diff --git a/.gitignore b/.gitignore
index 47f36f6..b187d36 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
.DS_Store
-vendor
\ No newline at end of file
+vendor
+.idea
diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore
new file mode 100644
index 0000000..79b2e0d
--- /dev/null
+++ b/.openapi-generator-ignore
@@ -0,0 +1,25 @@
+# OpenAPI Generator Ignore
+# Generated by openapi-generator https://github.com/openapitools/openapi-generator
+
+# Use this file to prevent files from being overwritten by the generator.
+# The patterns follow closely to .gitignore or .dockerignore.
+
+# As an example, the C# client generator defines ApiClient.cs.
+# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
+#ApiClient.cs
+
+# You can match any string of characters against a directory, file or extension with a single asterisk (*):
+#foo/*/qux
+# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
+
+# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
+#foo/**/qux
+# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
+
+# You can also negate patterns with an exclamation (!).
+# For example, you can ignore all files in a docs folder with the file extension .md:
+#docs/*.md
+# Then explicitly reverse the ignore rule for a single file:
+#!docs/README.md
+
+.gitignore
diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES
new file mode 100644
index 0000000..5ae8dab
--- /dev/null
+++ b/.openapi-generator/FILES
@@ -0,0 +1,960 @@
+.php-cs-fixer.dist.php
+.phplint.yml
+.travis.yml
+README.md
+composer.json
+docs/Api/AccountApi.md
+docs/Api/BalanceApi.md
+docs/Api/CompaniesApi.md
+docs/Api/ContactsApi.md
+docs/Api/ConversationsApi.md
+docs/Api/CouponsApi.md
+docs/Api/DealsApi.md
+docs/Api/DomainsApi.md
+docs/Api/EcommerceApi.md
+docs/Api/EmailCampaignsApi.md
+docs/Api/EventApi.md
+docs/Api/ExternalFeedsApi.md
+docs/Api/FilesApi.md
+docs/Api/InboundParsingApi.md
+docs/Api/MasterAccountApi.md
+docs/Api/NotesApi.md
+docs/Api/PaymentsApi.md
+docs/Api/ProcessApi.md
+docs/Api/ProgramApi.md
+docs/Api/RewardsApi.md
+docs/Api/SMSCampaignsApi.md
+docs/Api/SendersApi.md
+docs/Api/TasksApi.md
+docs/Api/TierApi.md
+docs/Api/TransactionalEmailsApi.md
+docs/Api/TransactionalSMSApi.md
+docs/Api/TransactionalWhatsAppApi.md
+docs/Api/UserApi.md
+docs/Api/WebhooksApi.md
+docs/Api/WhatsAppCampaignsApi.md
+docs/Model/AbTestCampaignResult.md
+docs/Model/AbTestCampaignResultClickedLinks.md
+docs/Model/AbTestCampaignResultStatistics.md
+docs/Model/AbTestVersionClicksInner.md
+docs/Model/AbTestVersionStats.md
+docs/Model/AddContactToListByEmails.md
+docs/Model/AddContactToListByExtIDs.md
+docs/Model/AddContactToListByIDs.md
+docs/Model/AddContactToListRequest.md
+docs/Model/AttributeRewardPayload.md
+docs/Model/AttributedRewardFailedConditionErrorResponse.md
+docs/Model/AuthenticateDomainModel.md
+docs/Model/BadRequestPayload.md
+docs/Model/Balance.md
+docs/Model/BalanceBalancesInner.md
+docs/Model/BalanceDefinition.md
+docs/Model/BalanceDefinitionIdDoesNotExist.md
+docs/Model/BalanceDefinitionPage.md
+docs/Model/BalanceLimit.md
+docs/Model/BalanceLimitPayload.md
+docs/Model/BalancePage.md
+docs/Model/BlockDomain.md
+docs/Model/CancelledTransaction.md
+docs/Model/Cart.md
+docs/Model/CompaniesIdPatchRequest.md
+docs/Model/CompaniesImportPost200Response.md
+docs/Model/CompaniesImportPost400Response.md
+docs/Model/CompaniesLinkUnlinkIdPatchRequest.md
+docs/Model/CompaniesList.md
+docs/Model/CompaniesPost200Response.md
+docs/Model/CompaniesPostRequest.md
+docs/Model/Company.md
+docs/Model/CompanyAttributesInner.md
+docs/Model/CompleteTransactionPayload.md
+docs/Model/CompletedTransaction.md
+docs/Model/ComponentItems.md
+docs/Model/Configuration.md
+docs/Model/ContactBalances.md
+docs/Model/ContactBalancesBalancesInner.md
+docs/Model/ContactErrorModel.md
+docs/Model/ContactIdInvalidResponse.md
+docs/Model/ConversationsAgentOnlinePingPostRequest.md
+docs/Model/ConversationsMessage.md
+docs/Model/ConversationsMessageFile.md
+docs/Model/ConversationsMessageFileImageInfo.md
+docs/Model/ConversationsMessagesIdPutRequest.md
+docs/Model/ConversationsMessagesPostRequest.md
+docs/Model/ConversationsPushedMessagesPostRequest.md
+docs/Model/ConversionSourceMetrics.md
+docs/Model/ConversionSourceProduct.md
+docs/Model/CorporateGroupDetailsResponse.md
+docs/Model/CorporateGroupDetailsResponseGroup.md
+docs/Model/CorporateGroupDetailsResponseSubAccountsInner.md
+docs/Model/CorporateGroupDetailsResponseUsersInner.md
+docs/Model/CorporateGroupIdPutRequest.md
+docs/Model/CorporateGroupPost201Response.md
+docs/Model/CorporateGroupPostRequest.md
+docs/Model/CorporateGroupUnlinkGroupIdSubAccountsPutRequest.md
+docs/Model/CorporateIpGet200ResponseInner.md
+docs/Model/CorporateSsoTokenPostRequest.md
+docs/Model/CorporateSubAccountIpAssociatePostRequest.md
+docs/Model/CorporateSubAccountIpDissociatePutRequest.md
+docs/Model/CorporateSubAccountKeyPostRequest.md
+docs/Model/CorporateSubAccountSsoTokenPostRequest.md
+docs/Model/CorporateUserEmailPermissionsPutRequest.md
+docs/Model/CorporateUserEmailPermissionsPutRequestPrivilegesInner.md
+docs/Model/CorporateUserInvitationActionEmailPut200Response.md
+docs/Model/CreateApiKeyResponse.md
+docs/Model/CreateAttribute.md
+docs/Model/CreateAttributeEnumerationInner.md
+docs/Model/CreateBalanceDefinitionPayload.md
+docs/Model/CreateCategoryModel.md
+docs/Model/CreateContact.md
+docs/Model/CreateCouponCollection201Response.md
+docs/Model/CreateCouponCollectionRequest.md
+docs/Model/CreateCouponsRequest.md
+docs/Model/CreateDoiContact.md
+docs/Model/CreateDoiContactAttributesValue.md
+docs/Model/CreateDomain.md
+docs/Model/CreateDomainModel.md
+docs/Model/CreateDomainModelDnsRecords.md
+docs/Model/CreateDomainModelDnsRecordsDkimRecord.md
+docs/Model/CreateEmailCampaign.md
+docs/Model/CreateEmailCampaignEmailExpirationDate.md
+docs/Model/CreateEmailCampaignRecipients.md
+docs/Model/CreateEmailCampaignSender.md
+docs/Model/CreateExternalFeed.md
+docs/Model/CreateExternalFeed201Response.md
+docs/Model/CreateList.md
+docs/Model/CreateLoyaltyProgramPayload.md
+docs/Model/CreateModel.md
+docs/Model/CreateOrderPayload.md
+docs/Model/CreatePaymentRequest.md
+docs/Model/CreatePaymentResponse.md
+docs/Model/CreateProductModel.md
+docs/Model/CreateSender.md
+docs/Model/CreateSenderIpsInner.md
+docs/Model/CreateSenderModel.md
+docs/Model/CreateSmsCampaign.md
+docs/Model/CreateSmsCampaignRecipients.md
+docs/Model/CreateSmtpEmail.md
+docs/Model/CreateSmtpTemplate.md
+docs/Model/CreateSmtpTemplateSender.md
+docs/Model/CreateSubAccount.md
+docs/Model/CreateSubAccountResponse.md
+docs/Model/CreateSubscriptionMemberPayload.md
+docs/Model/CreateSubscriptionMemberResponse.md
+docs/Model/CreateSubscriptionPayload.md
+docs/Model/CreateSubscriptionResponse.md
+docs/Model/CreateTierGroupRequest.md
+docs/Model/CreateTransactionPayload.md
+docs/Model/CreateUpdateBatchCategory.md
+docs/Model/CreateUpdateBatchCategoryModel.md
+docs/Model/CreateUpdateBatchProducts.md
+docs/Model/CreateUpdateBatchProductsModel.md
+docs/Model/CreateUpdateCategories.md
+docs/Model/CreateUpdateCategory.md
+docs/Model/CreateUpdateContactModel.md
+docs/Model/CreateUpdateFolder.md
+docs/Model/CreateUpdateProduct.md
+docs/Model/CreateUpdateProducts.md
+docs/Model/CreateWebhook.md
+docs/Model/CreateWhatsAppCampaign.md
+docs/Model/CreateWhatsAppCampaignRecipients.md
+docs/Model/CreateWhatsAppTemplate.md
+docs/Model/CreatedBatchId.md
+docs/Model/CreatedProcessId.md
+docs/Model/CrmDealsIdPatchRequest.md
+docs/Model/CrmDealsLinkUnlinkIdPatchRequest.md
+docs/Model/CrmDealsPost201Response.md
+docs/Model/CrmDealsPostRequest.md
+docs/Model/CrmTasksIdPatchRequest.md
+docs/Model/CrmTasksPost201Response.md
+docs/Model/CrmTasksPostRequest.md
+docs/Model/Deal.md
+docs/Model/DealAttributesInner.md
+docs/Model/DealsList.md
+docs/Model/DeleteHardbounces.md
+docs/Model/DeleteSubscriptionMemberPayload.md
+docs/Model/EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response.md
+docs/Model/EcommerceAttributionMetricsGet200Response.md
+docs/Model/EcommerceAttributionMetricsGet200ResponseTotals.md
+docs/Model/EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response.md
+docs/Model/EcommerceConfigDisplayCurrencyGet200Response.md
+docs/Model/EmailExportRecipients.md
+docs/Model/ErrorModel.md
+docs/Model/ErrorResponse.md
+docs/Model/Event.md
+docs/Model/EventContactPropertiesValue.md
+docs/Model/EventEventPropertiesValue.md
+docs/Model/EventIdentifiers.md
+docs/Model/ExportWebhooksHistory.md
+docs/Model/ExportWebhooksHistoryRequest.md
+docs/Model/FileData.md
+docs/Model/FileDownloadableLink.md
+docs/Model/GetAccount.md
+docs/Model/GetAccountActivity.md
+docs/Model/GetAccountActivityLogsInner.md
+docs/Model/GetAccountAllOfMarketingAutomation.md
+docs/Model/GetAccountAllOfPlan.md
+docs/Model/GetAccountAllOfRelay.md
+docs/Model/GetAccountAllOfRelayData.md
+docs/Model/GetAggregatedReport.md
+docs/Model/GetAllExternalFeeds.md
+docs/Model/GetAllExternalFeedsFeedsInner.md
+docs/Model/GetAttributes.md
+docs/Model/GetAttributesAttributesInner.md
+docs/Model/GetAttributesAttributesInnerEnumerationInner.md
+docs/Model/GetBlockedDomains.md
+docs/Model/GetCampaignOverview.md
+docs/Model/GetCampaignRecipients.md
+docs/Model/GetCampaignStats.md
+docs/Model/GetCategories.md
+docs/Model/GetCategoryDetails.md
+docs/Model/GetClient.md
+docs/Model/GetContactCampaignStats.md
+docs/Model/GetContactCampaignStatsClickedInner.md
+docs/Model/GetContactCampaignStatsOpenedInner.md
+docs/Model/GetContactCampaignStatsTransacAttributesInner.md
+docs/Model/GetContactCampaignStatsUnsubscriptions.md
+docs/Model/GetContactDetails.md
+docs/Model/GetContactInfoIdentifierParameter.md
+docs/Model/GetContacts.md
+docs/Model/GetCorporateInvitedUsersList.md
+docs/Model/GetCorporateInvitedUsersListUsersInner.md
+docs/Model/GetCorporateInvitedUsersListUsersInnerFeatureAccess.md
+docs/Model/GetCorporateInvitedUsersListUsersInnerGroups.md
+docs/Model/GetCorporateUserPermission.md
+docs/Model/GetCorporateUserPermissionFeatureAccess.md
+docs/Model/GetCorporateUserPermissionGroupsInner.md
+docs/Model/GetCouponCollection.md
+docs/Model/GetDeviceBrowserStats.md
+docs/Model/GetDomainConfigurationModel.md
+docs/Model/GetDomainsList.md
+docs/Model/GetDomainsListDomainsInner.md
+docs/Model/GetEmailCampaign.md
+docs/Model/GetEmailCampaigns.md
+docs/Model/GetEmailCampaignsCampaignsInner.md
+docs/Model/GetEmailEventReport.md
+docs/Model/GetEmailEventReportEventsInner.md
+docs/Model/GetExtendedCampaignOverview.md
+docs/Model/GetExtendedCampaignOverviewAllOfSender.md
+docs/Model/GetExtendedCampaignStats.md
+docs/Model/GetExtendedClient.md
+docs/Model/GetExtendedClientAllOfAddress.md
+docs/Model/GetExtendedContactDetails.md
+docs/Model/GetExtendedContactDetailsAllOfStatistics.md
+docs/Model/GetExtendedContactDetailsAllOfStatisticsClicked.md
+docs/Model/GetExtendedContactDetailsAllOfStatisticsLinks.md
+docs/Model/GetExtendedContactDetailsAllOfStatisticsMessagesSent.md
+docs/Model/GetExtendedContactDetailsAllOfStatisticsOpened.md
+docs/Model/GetExtendedContactDetailsAllOfStatisticsUnsubscriptions.md
+docs/Model/GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription.md
+docs/Model/GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.md
+docs/Model/GetExtendedList.md
+docs/Model/GetExtendedListAllOfCampaignStats.md
+docs/Model/GetExternalFeedByUUID.md
+docs/Model/GetExternalFeedByUUIDHeadersInner.md
+docs/Model/GetFolder.md
+docs/Model/GetFolderLists.md
+docs/Model/GetFolders.md
+docs/Model/GetInboundEmailEvents.md
+docs/Model/GetInboundEmailEventsByUuid.md
+docs/Model/GetInboundEmailEventsByUuidAttachmentsInner.md
+docs/Model/GetInboundEmailEventsByUuidLogsInner.md
+docs/Model/GetInboundEmailEventsEventsInner.md
+docs/Model/GetInvitedUsersList.md
+docs/Model/GetInvitedUsersListUsersInner.md
+docs/Model/GetInvitedUsersListUsersInnerFeatureAccess.md
+docs/Model/GetIp.md
+docs/Model/GetIpFromSender.md
+docs/Model/GetIps.md
+docs/Model/GetIpsFromSender.md
+docs/Model/GetList.md
+docs/Model/GetLists.md
+docs/Model/GetListsListsInner.md
+docs/Model/GetPaymentRequest.md
+docs/Model/GetProcess.md
+docs/Model/GetProcesses.md
+docs/Model/GetProductDetails.md
+docs/Model/GetProducts.md
+docs/Model/GetReports.md
+docs/Model/GetReportsReportsInner.md
+docs/Model/GetScheduledEmailByBatchId.md
+docs/Model/GetScheduledEmailByBatchIdBatchesInner.md
+docs/Model/GetScheduledEmailById200Response.md
+docs/Model/GetScheduledEmailByMessageId.md
+docs/Model/GetSegments.md
+docs/Model/GetSendersList.md
+docs/Model/GetSendersListSendersInner.md
+docs/Model/GetSendersListSendersInnerIpsInner.md
+docs/Model/GetSharedTemplateUrl.md
+docs/Model/GetSmsCampaign.md
+docs/Model/GetSmsCampaignOverview.md
+docs/Model/GetSmsCampaignStats.md
+docs/Model/GetSmsCampaigns.md
+docs/Model/GetSmsCampaignsCampaignsInner.md
+docs/Model/GetSmsEventReport.md
+docs/Model/GetSmsEventReportEventsInner.md
+docs/Model/GetSmtpTemplateOverview.md
+docs/Model/GetSmtpTemplateOverviewSender.md
+docs/Model/GetSmtpTemplates.md
+docs/Model/GetSsoToken.md
+docs/Model/GetStatsByDevice.md
+docs/Model/GetSubAccountGroups200ResponseInner.md
+docs/Model/GetSubscriptionInfoResponse.md
+docs/Model/GetSubscriptionInfoResponseBalance.md
+docs/Model/GetSubscriptionInfoResponseBalanceBalancesInner.md
+docs/Model/GetSubscriptionInfoResponseMembersInner.md
+docs/Model/GetSubscriptionInfoResponseRewardInner.md
+docs/Model/GetSubscriptionInfoResponseTierInner.md
+docs/Model/GetSubscriptionMemberResponse.md
+docs/Model/GetSubscriptionMemberResponseMemberContactIdInner.md
+docs/Model/GetTransacAggregatedSmsReport.md
+docs/Model/GetTransacBlockedContacts.md
+docs/Model/GetTransacBlockedContactsContactsInner.md
+docs/Model/GetTransacBlockedContactsContactsInnerReason.md
+docs/Model/GetTransacEmailContent.md
+docs/Model/GetTransacEmailContentEventsInner.md
+docs/Model/GetTransacEmailsList.md
+docs/Model/GetTransacEmailsListTransactionalEmailsInner.md
+docs/Model/GetTransacSmsReport.md
+docs/Model/GetTransacSmsReportReportsInner.md
+docs/Model/GetUserPermission.md
+docs/Model/GetUserPermissionPrivilegesInner.md
+docs/Model/GetVersionInfoResponse.md
+docs/Model/GetWebhook.md
+docs/Model/GetWebhooks.md
+docs/Model/GetWhatsAppConfig.md
+docs/Model/GetWhatsappCampaignOverview.md
+docs/Model/GetWhatsappCampaigns.md
+docs/Model/GetWhatsappCampaignsCampaignsInner.md
+docs/Model/GetWhatsappEventReport.md
+docs/Model/GetWhatsappEventReportEventsInner.md
+docs/Model/GetWhatsappTemplates.md
+docs/Model/GetWhatsappTemplatesTemplatesInner.md
+docs/Model/InviteAdminUser.md
+docs/Model/InviteAdminUserPrivilegesInner.md
+docs/Model/Inviteuser.md
+docs/Model/InviteuserPrivilegesInner.md
+docs/Model/InviteuserResponse.md
+docs/Model/LoyaltyProgram.md
+docs/Model/LoyaltyProgramPage.md
+docs/Model/LoyaltyProgramValidationError.md
+docs/Model/LoyaltyTierPage.md
+docs/Model/MasterDetailsResponse.md
+docs/Model/MasterDetailsResponseBillingInfo.md
+docs/Model/MasterDetailsResponseBillingInfoAddress.md
+docs/Model/MasterDetailsResponseBillingInfoName.md
+docs/Model/MasterDetailsResponsePlanInfo.md
+docs/Model/MasterDetailsResponsePlanInfoFeaturesInner.md
+docs/Model/Note.md
+docs/Model/NoteData.md
+docs/Model/NoteId.md
+docs/Model/Notification.md
+docs/Model/Offer.md
+docs/Model/OfferList.md
+docs/Model/OffersListResponse.md
+docs/Model/Order.md
+docs/Model/OrderBatch.md
+docs/Model/OrderBilling.md
+docs/Model/OrderIdentifiers.md
+docs/Model/OrderProductsInner.md
+docs/Model/Otp.md
+docs/Model/PatchLoyaltyProgramPayload.md
+docs/Model/Pipeline.md
+docs/Model/PipelineStage.md
+docs/Model/PostContactInfo.md
+docs/Model/PostContactInfoContacts.md
+docs/Model/PostContactInfoContactsFailure.md
+docs/Model/PostContactInfoContactsSuccess.md
+docs/Model/PostSendFailed.md
+docs/Model/PostSendSmsTestFailed.md
+docs/Model/PutRevokeUserPermission.md
+docs/Model/PutRevokeUserPermissionResponse.md
+docs/Model/Putresendcancelinvitation.md
+docs/Model/PutresendcancelinvitationResponse.md
+docs/Model/RedeemRewardPayload.md
+docs/Model/RedeemedRewardFailedConditionErrorResponse.md
+docs/Model/RemoveContactFromListByAll.md
+docs/Model/RemoveContactFromListByEmails.md
+docs/Model/RemoveContactFromListByExtIDs.md
+docs/Model/RemoveContactFromListByIDs.md
+docs/Model/RemoveContactFromListRequest.md
+docs/Model/RequestContactExport.md
+docs/Model/RequestContactExportCustomContactFilter.md
+docs/Model/RequestContactImport.md
+docs/Model/RequestContactImportJsonBodyInner.md
+docs/Model/RequestContactImportNewList.md
+docs/Model/RequestSmsRecipientExport.md
+docs/Model/RewardAttributionResponse.md
+docs/Model/RewardRedeemResponse.md
+docs/Model/ScheduleSmtpEmail.md
+docs/Model/Segment.md
+docs/Model/SendReport.md
+docs/Model/SendReportEmail.md
+docs/Model/SendSms.md
+docs/Model/SendSmtpEmail.md
+docs/Model/SendSmtpEmailAttachmentInner.md
+docs/Model/SendSmtpEmailBccInner.md
+docs/Model/SendSmtpEmailCcInner.md
+docs/Model/SendSmtpEmailMessageVersionsInner.md
+docs/Model/SendSmtpEmailReplyTo.md
+docs/Model/SendSmtpEmailSender.md
+docs/Model/SendSmtpEmailToInner.md
+docs/Model/SendTestEmail.md
+docs/Model/SendTestSms.md
+docs/Model/SendTransacSms.md
+docs/Model/SendWhatsappMessage201Response.md
+docs/Model/SendWhatsappMessageRequest.md
+docs/Model/SendWhatsappMessageTemplate.md
+docs/Model/SendWhatsappMessageText.md
+docs/Model/SubAccountAppsToggleRequest.md
+docs/Model/SubAccountDetailsResponse.md
+docs/Model/SubAccountDetailsResponseGroupsInner.md
+docs/Model/SubAccountDetailsResponsePlanInfo.md
+docs/Model/SubAccountDetailsResponsePlanInfoCredits.md
+docs/Model/SubAccountDetailsResponsePlanInfoCreditsEmails.md
+docs/Model/SubAccountDetailsResponsePlanInfoCreditsExternalFeeds.md
+docs/Model/SubAccountDetailsResponsePlanInfoCreditsSms.md
+docs/Model/SubAccountDetailsResponsePlanInfoCreditsWhatsapp.md
+docs/Model/SubAccountDetailsResponsePlanInfoCreditsWpSubscribers.md
+docs/Model/SubAccountDetailsResponsePlanInfoFeatures.md
+docs/Model/SubAccountDetailsResponsePlanInfoFeaturesInbox.md
+docs/Model/SubAccountDetailsResponsePlanInfoFeaturesLandingPage.md
+docs/Model/SubAccountDetailsResponsePlanInfoFeaturesUsers.md
+docs/Model/SubAccountUpdatePlanRequest.md
+docs/Model/SubAccountUpdatePlanRequestCredits.md
+docs/Model/SubAccountUpdatePlanRequestFeatures.md
+docs/Model/SubAccountsResponse.md
+docs/Model/SubAccountsResponseSubAccountsInner.md
+docs/Model/SubAccountsResponseSubAccountsInnerGroupsInner.md
+docs/Model/SubscriptionNotFoundErrorResponse.md
+docs/Model/Task.md
+docs/Model/TaskList.md
+docs/Model/TaskReminder.md
+docs/Model/TaskTypes.md
+docs/Model/Tier.md
+docs/Model/TierAccessConditionsInner.md
+docs/Model/TierForContact.md
+docs/Model/TierGroup.md
+docs/Model/TierGroupPage.md
+docs/Model/TierRequest.md
+docs/Model/TierRequestAccessConditionsInner.md
+docs/Model/TierRequestTierRewardsInner.md
+docs/Model/TierTierRewardsInner.md
+docs/Model/Transaction.md
+docs/Model/UnauthorizedResponse.md
+docs/Model/UpdateAttribute.md
+docs/Model/UpdateAttributeEnumerationInner.md
+docs/Model/UpdateBalanceDefinitionPayload.md
+docs/Model/UpdateBatchContacts.md
+docs/Model/UpdateBatchContactsContactsInner.md
+docs/Model/UpdateBatchContactsModel.md
+docs/Model/UpdateCampaignStatus.md
+docs/Model/UpdateContact.md
+docs/Model/UpdateCouponCollection200Response.md
+docs/Model/UpdateCouponCollectionRequest.md
+docs/Model/UpdateEmailCampaign.md
+docs/Model/UpdateEmailCampaignEmailExpirationDate.md
+docs/Model/UpdateEmailCampaignRecipients.md
+docs/Model/UpdateEmailCampaignSender.md
+docs/Model/UpdateExternalFeed.md
+docs/Model/UpdateList.md
+docs/Model/UpdateLoyaltyProgramPayload.md
+docs/Model/UpdateSender.md
+docs/Model/UpdateSmsCampaign.md
+docs/Model/UpdateSmtpTemplate.md
+docs/Model/UpdateSmtpTemplateSender.md
+docs/Model/UpdateTierGroup404Response.md
+docs/Model/UpdateTierGroupRequest.md
+docs/Model/UpdateUserResponse.md
+docs/Model/UpdateWebhook.md
+docs/Model/UpdateWhatsAppCampaign.md
+docs/Model/UploadImageModel.md
+docs/Model/UploadImageToGallery.md
+docs/Model/ValidateRewardPayload.md
+docs/Model/ValidatedRewardResponse.md
+docs/Model/ValidationError.md
+docs/Model/VariablesItems.md
+docs/Model/VersionInfo.md
+docs/Model/WhatsappCampStats.md
+docs/Model/WhatsappCampTemplate.md
+git_push.sh
+lib/Api/AccountApi.php
+lib/Api/BalanceApi.php
+lib/Api/CompaniesApi.php
+lib/Api/ContactsApi.php
+lib/Api/ConversationsApi.php
+lib/Api/CouponsApi.php
+lib/Api/DealsApi.php
+lib/Api/DomainsApi.php
+lib/Api/EcommerceApi.php
+lib/Api/EmailCampaignsApi.php
+lib/Api/EventApi.php
+lib/Api/ExternalFeedsApi.php
+lib/Api/FilesApi.php
+lib/Api/InboundParsingApi.php
+lib/Api/MasterAccountApi.php
+lib/Api/NotesApi.php
+lib/Api/PaymentsApi.php
+lib/Api/ProcessApi.php
+lib/Api/ProgramApi.php
+lib/Api/RewardsApi.php
+lib/Api/SMSCampaignsApi.php
+lib/Api/SendersApi.php
+lib/Api/TasksApi.php
+lib/Api/TierApi.php
+lib/Api/TransactionalEmailsApi.php
+lib/Api/TransactionalSMSApi.php
+lib/Api/TransactionalWhatsAppApi.php
+lib/Api/UserApi.php
+lib/Api/WebhooksApi.php
+lib/Api/WhatsAppCampaignsApi.php
+lib/ApiException.php
+lib/Configuration.php
+lib/HeaderSelector.php
+lib/Models/AbTestCampaignResult.php
+lib/Models/AbTestCampaignResultClickedLinks.php
+lib/Models/AbTestCampaignResultStatistics.php
+lib/Models/AbTestVersionClicksInner.php
+lib/Models/AbTestVersionStats.php
+lib/Models/AbstractModel.php
+lib/Models/AddContactToListByEmails.php
+lib/Models/AddContactToListByExtIDs.php
+lib/Models/AddContactToListByIDs.php
+lib/Models/AddContactToListRequest.php
+lib/Models/AttributeRewardPayload.php
+lib/Models/AttributedRewardFailedConditionErrorResponse.php
+lib/Models/AuthenticateDomainModel.php
+lib/Models/BadRequestPayload.php
+lib/Models/Balance.php
+lib/Models/BalanceBalancesInner.php
+lib/Models/BalanceDefinition.php
+lib/Models/BalanceDefinitionIdDoesNotExist.php
+lib/Models/BalanceDefinitionPage.php
+lib/Models/BalanceLimit.php
+lib/Models/BalanceLimitPayload.php
+lib/Models/BalancePage.php
+lib/Models/BlockDomain.php
+lib/Models/CancelledTransaction.php
+lib/Models/Cart.php
+lib/Models/CompaniesIdPatchRequest.php
+lib/Models/CompaniesImportPost200Response.php
+lib/Models/CompaniesImportPost400Response.php
+lib/Models/CompaniesLinkUnlinkIdPatchRequest.php
+lib/Models/CompaniesList.php
+lib/Models/CompaniesPost200Response.php
+lib/Models/CompaniesPostRequest.php
+lib/Models/Company.php
+lib/Models/CompanyAttributesInner.php
+lib/Models/CompleteTransactionPayload.php
+lib/Models/CompletedTransaction.php
+lib/Models/ComponentItems.php
+lib/Models/Configuration.php
+lib/Models/ContactBalances.php
+lib/Models/ContactBalancesBalancesInner.php
+lib/Models/ContactErrorModel.php
+lib/Models/ContactIdInvalidResponse.php
+lib/Models/ConversationsAgentOnlinePingPostRequest.php
+lib/Models/ConversationsMessage.php
+lib/Models/ConversationsMessageFile.php
+lib/Models/ConversationsMessageFileImageInfo.php
+lib/Models/ConversationsMessagesIdPutRequest.php
+lib/Models/ConversationsMessagesPostRequest.php
+lib/Models/ConversationsPushedMessagesPostRequest.php
+lib/Models/ConversionSourceMetrics.php
+lib/Models/ConversionSourceProduct.php
+lib/Models/CorporateGroupDetailsResponse.php
+lib/Models/CorporateGroupDetailsResponseGroup.php
+lib/Models/CorporateGroupDetailsResponseSubAccountsInner.php
+lib/Models/CorporateGroupDetailsResponseUsersInner.php
+lib/Models/CorporateGroupIdPutRequest.php
+lib/Models/CorporateGroupPost201Response.php
+lib/Models/CorporateGroupPostRequest.php
+lib/Models/CorporateGroupUnlinkGroupIdSubAccountsPutRequest.php
+lib/Models/CorporateIpGet200ResponseInner.php
+lib/Models/CorporateSsoTokenPostRequest.php
+lib/Models/CorporateSubAccountIpAssociatePostRequest.php
+lib/Models/CorporateSubAccountIpDissociatePutRequest.php
+lib/Models/CorporateSubAccountKeyPostRequest.php
+lib/Models/CorporateSubAccountSsoTokenPostRequest.php
+lib/Models/CorporateUserEmailPermissionsPutRequest.php
+lib/Models/CorporateUserEmailPermissionsPutRequestPrivilegesInner.php
+lib/Models/CorporateUserInvitationActionEmailPut200Response.php
+lib/Models/CreateApiKeyResponse.php
+lib/Models/CreateAttribute.php
+lib/Models/CreateAttributeEnumerationInner.php
+lib/Models/CreateBalanceDefinitionPayload.php
+lib/Models/CreateCategoryModel.php
+lib/Models/CreateContact.php
+lib/Models/CreateCouponCollection201Response.php
+lib/Models/CreateCouponCollectionRequest.php
+lib/Models/CreateCouponsRequest.php
+lib/Models/CreateDoiContact.php
+lib/Models/CreateDoiContactAttributesValue.php
+lib/Models/CreateDomain.php
+lib/Models/CreateDomainModel.php
+lib/Models/CreateDomainModelDnsRecords.php
+lib/Models/CreateDomainModelDnsRecordsDkimRecord.php
+lib/Models/CreateEmailCampaign.php
+lib/Models/CreateEmailCampaignEmailExpirationDate.php
+lib/Models/CreateEmailCampaignRecipients.php
+lib/Models/CreateEmailCampaignSender.php
+lib/Models/CreateExternalFeed.php
+lib/Models/CreateExternalFeed201Response.php
+lib/Models/CreateList.php
+lib/Models/CreateLoyaltyProgramPayload.php
+lib/Models/CreateModel.php
+lib/Models/CreateOrderPayload.php
+lib/Models/CreatePaymentRequest.php
+lib/Models/CreatePaymentResponse.php
+lib/Models/CreateProductModel.php
+lib/Models/CreateSender.php
+lib/Models/CreateSenderIpsInner.php
+lib/Models/CreateSenderModel.php
+lib/Models/CreateSmsCampaign.php
+lib/Models/CreateSmsCampaignRecipients.php
+lib/Models/CreateSmtpEmail.php
+lib/Models/CreateSmtpTemplate.php
+lib/Models/CreateSmtpTemplateSender.php
+lib/Models/CreateSubAccount.php
+lib/Models/CreateSubAccountResponse.php
+lib/Models/CreateSubscriptionMemberPayload.php
+lib/Models/CreateSubscriptionMemberResponse.php
+lib/Models/CreateSubscriptionPayload.php
+lib/Models/CreateSubscriptionResponse.php
+lib/Models/CreateTierGroupRequest.php
+lib/Models/CreateTransactionPayload.php
+lib/Models/CreateUpdateBatchCategory.php
+lib/Models/CreateUpdateBatchCategoryModel.php
+lib/Models/CreateUpdateBatchProducts.php
+lib/Models/CreateUpdateBatchProductsModel.php
+lib/Models/CreateUpdateCategories.php
+lib/Models/CreateUpdateCategory.php
+lib/Models/CreateUpdateContactModel.php
+lib/Models/CreateUpdateFolder.php
+lib/Models/CreateUpdateProduct.php
+lib/Models/CreateUpdateProducts.php
+lib/Models/CreateWebhook.php
+lib/Models/CreateWhatsAppCampaign.php
+lib/Models/CreateWhatsAppCampaignRecipients.php
+lib/Models/CreateWhatsAppTemplate.php
+lib/Models/CreatedBatchId.php
+lib/Models/CreatedProcessId.php
+lib/Models/CrmDealsIdPatchRequest.php
+lib/Models/CrmDealsLinkUnlinkIdPatchRequest.php
+lib/Models/CrmDealsPost201Response.php
+lib/Models/CrmDealsPostRequest.php
+lib/Models/CrmTasksIdPatchRequest.php
+lib/Models/CrmTasksPost201Response.php
+lib/Models/CrmTasksPostRequest.php
+lib/Models/Deal.php
+lib/Models/DealAttributesInner.php
+lib/Models/DealsList.php
+lib/Models/DeleteHardbounces.php
+lib/Models/DeleteSubscriptionMemberPayload.php
+lib/Models/EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response.php
+lib/Models/EcommerceAttributionMetricsGet200Response.php
+lib/Models/EcommerceAttributionMetricsGet200ResponseTotals.php
+lib/Models/EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response.php
+lib/Models/EcommerceConfigDisplayCurrencyGet200Response.php
+lib/Models/EmailExportRecipients.php
+lib/Models/ErrorModel.php
+lib/Models/ErrorResponse.php
+lib/Models/Event.php
+lib/Models/EventContactPropertiesValue.php
+lib/Models/EventEventPropertiesValue.php
+lib/Models/EventIdentifiers.php
+lib/Models/ExportWebhooksHistory.php
+lib/Models/ExportWebhooksHistoryRequest.php
+lib/Models/FileData.php
+lib/Models/FileDownloadableLink.php
+lib/Models/GetAccount.php
+lib/Models/GetAccountActivity.php
+lib/Models/GetAccountActivityLogsInner.php
+lib/Models/GetAccountAllOfMarketingAutomation.php
+lib/Models/GetAccountAllOfPlan.php
+lib/Models/GetAccountAllOfRelay.php
+lib/Models/GetAccountAllOfRelayData.php
+lib/Models/GetAggregatedReport.php
+lib/Models/GetAllExternalFeeds.php
+lib/Models/GetAllExternalFeedsFeedsInner.php
+lib/Models/GetAttributes.php
+lib/Models/GetAttributesAttributesInner.php
+lib/Models/GetAttributesAttributesInnerEnumerationInner.php
+lib/Models/GetBlockedDomains.php
+lib/Models/GetCampaignOverview.php
+lib/Models/GetCampaignRecipients.php
+lib/Models/GetCampaignStats.php
+lib/Models/GetCategories.php
+lib/Models/GetCategoryDetails.php
+lib/Models/GetClient.php
+lib/Models/GetContactCampaignStats.php
+lib/Models/GetContactCampaignStatsClickedInner.php
+lib/Models/GetContactCampaignStatsOpenedInner.php
+lib/Models/GetContactCampaignStatsTransacAttributesInner.php
+lib/Models/GetContactCampaignStatsUnsubscriptions.php
+lib/Models/GetContactDetails.php
+lib/Models/GetContactInfoIdentifierParameter.php
+lib/Models/GetContacts.php
+lib/Models/GetCorporateInvitedUsersList.php
+lib/Models/GetCorporateInvitedUsersListUsersInner.php
+lib/Models/GetCorporateInvitedUsersListUsersInnerFeatureAccess.php
+lib/Models/GetCorporateInvitedUsersListUsersInnerGroups.php
+lib/Models/GetCorporateUserPermission.php
+lib/Models/GetCorporateUserPermissionFeatureAccess.php
+lib/Models/GetCorporateUserPermissionGroupsInner.php
+lib/Models/GetCouponCollection.php
+lib/Models/GetDeviceBrowserStats.php
+lib/Models/GetDomainConfigurationModel.php
+lib/Models/GetDomainsList.php
+lib/Models/GetDomainsListDomainsInner.php
+lib/Models/GetEmailCampaign.php
+lib/Models/GetEmailCampaigns.php
+lib/Models/GetEmailCampaignsCampaignsInner.php
+lib/Models/GetEmailEventReport.php
+lib/Models/GetEmailEventReportEventsInner.php
+lib/Models/GetExtendedCampaignOverview.php
+lib/Models/GetExtendedCampaignOverviewAllOfSender.php
+lib/Models/GetExtendedCampaignStats.php
+lib/Models/GetExtendedClient.php
+lib/Models/GetExtendedClientAllOfAddress.php
+lib/Models/GetExtendedContactDetails.php
+lib/Models/GetExtendedContactDetailsAllOfStatistics.php
+lib/Models/GetExtendedContactDetailsAllOfStatisticsClicked.php
+lib/Models/GetExtendedContactDetailsAllOfStatisticsLinks.php
+lib/Models/GetExtendedContactDetailsAllOfStatisticsMessagesSent.php
+lib/Models/GetExtendedContactDetailsAllOfStatisticsOpened.php
+lib/Models/GetExtendedContactDetailsAllOfStatisticsUnsubscriptions.php
+lib/Models/GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription.php
+lib/Models/GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.php
+lib/Models/GetExtendedList.php
+lib/Models/GetExtendedListAllOfCampaignStats.php
+lib/Models/GetExternalFeedByUUID.php
+lib/Models/GetExternalFeedByUUIDHeadersInner.php
+lib/Models/GetFolder.php
+lib/Models/GetFolderLists.php
+lib/Models/GetFolders.php
+lib/Models/GetInboundEmailEvents.php
+lib/Models/GetInboundEmailEventsByUuid.php
+lib/Models/GetInboundEmailEventsByUuidAttachmentsInner.php
+lib/Models/GetInboundEmailEventsByUuidLogsInner.php
+lib/Models/GetInboundEmailEventsEventsInner.php
+lib/Models/GetInvitedUsersList.php
+lib/Models/GetInvitedUsersListUsersInner.php
+lib/Models/GetInvitedUsersListUsersInnerFeatureAccess.php
+lib/Models/GetIp.php
+lib/Models/GetIpFromSender.php
+lib/Models/GetIps.php
+lib/Models/GetIpsFromSender.php
+lib/Models/GetList.php
+lib/Models/GetLists.php
+lib/Models/GetListsListsInner.php
+lib/Models/GetPaymentRequest.php
+lib/Models/GetProcess.php
+lib/Models/GetProcesses.php
+lib/Models/GetProductDetails.php
+lib/Models/GetProducts.php
+lib/Models/GetReports.php
+lib/Models/GetReportsReportsInner.php
+lib/Models/GetScheduledEmailByBatchId.php
+lib/Models/GetScheduledEmailByBatchIdBatchesInner.php
+lib/Models/GetScheduledEmailById200Response.php
+lib/Models/GetScheduledEmailByMessageId.php
+lib/Models/GetSegments.php
+lib/Models/GetSendersList.php
+lib/Models/GetSendersListSendersInner.php
+lib/Models/GetSendersListSendersInnerIpsInner.php
+lib/Models/GetSharedTemplateUrl.php
+lib/Models/GetSmsCampaign.php
+lib/Models/GetSmsCampaignOverview.php
+lib/Models/GetSmsCampaignStats.php
+lib/Models/GetSmsCampaigns.php
+lib/Models/GetSmsCampaignsCampaignsInner.php
+lib/Models/GetSmsEventReport.php
+lib/Models/GetSmsEventReportEventsInner.php
+lib/Models/GetSmtpTemplateOverview.php
+lib/Models/GetSmtpTemplateOverviewSender.php
+lib/Models/GetSmtpTemplates.php
+lib/Models/GetSsoToken.php
+lib/Models/GetStatsByDevice.php
+lib/Models/GetSubAccountGroups200ResponseInner.php
+lib/Models/GetSubscriptionInfoResponse.php
+lib/Models/GetSubscriptionInfoResponseBalance.php
+lib/Models/GetSubscriptionInfoResponseBalanceBalancesInner.php
+lib/Models/GetSubscriptionInfoResponseMembersInner.php
+lib/Models/GetSubscriptionInfoResponseRewardInner.php
+lib/Models/GetSubscriptionInfoResponseTierInner.php
+lib/Models/GetSubscriptionMemberResponse.php
+lib/Models/GetSubscriptionMemberResponseMemberContactIdInner.php
+lib/Models/GetTransacAggregatedSmsReport.php
+lib/Models/GetTransacBlockedContacts.php
+lib/Models/GetTransacBlockedContactsContactsInner.php
+lib/Models/GetTransacBlockedContactsContactsInnerReason.php
+lib/Models/GetTransacEmailContent.php
+lib/Models/GetTransacEmailContentEventsInner.php
+lib/Models/GetTransacEmailsList.php
+lib/Models/GetTransacEmailsListTransactionalEmailsInner.php
+lib/Models/GetTransacSmsReport.php
+lib/Models/GetTransacSmsReportReportsInner.php
+lib/Models/GetUserPermission.php
+lib/Models/GetUserPermissionPrivilegesInner.php
+lib/Models/GetVersionInfoResponse.php
+lib/Models/GetWebhook.php
+lib/Models/GetWebhooks.php
+lib/Models/GetWhatsAppConfig.php
+lib/Models/GetWhatsappCampaignOverview.php
+lib/Models/GetWhatsappCampaigns.php
+lib/Models/GetWhatsappCampaignsCampaignsInner.php
+lib/Models/GetWhatsappEventReport.php
+lib/Models/GetWhatsappEventReportEventsInner.php
+lib/Models/GetWhatsappTemplates.php
+lib/Models/GetWhatsappTemplatesTemplatesInner.php
+lib/Models/InviteAdminUser.php
+lib/Models/InviteAdminUserPrivilegesInner.php
+lib/Models/Inviteuser.php
+lib/Models/InviteuserPrivilegesInner.php
+lib/Models/InviteuserResponse.php
+lib/Models/LoyaltyProgram.php
+lib/Models/LoyaltyProgramPage.php
+lib/Models/LoyaltyProgramValidationError.php
+lib/Models/LoyaltyTierPage.php
+lib/Models/MasterDetailsResponse.php
+lib/Models/MasterDetailsResponseBillingInfo.php
+lib/Models/MasterDetailsResponseBillingInfoAddress.php
+lib/Models/MasterDetailsResponseBillingInfoName.php
+lib/Models/MasterDetailsResponsePlanInfo.php
+lib/Models/MasterDetailsResponsePlanInfoFeaturesInner.php
+lib/Models/ModelInterface.php
+lib/Models/Note.php
+lib/Models/NoteData.php
+lib/Models/NoteId.php
+lib/Models/Notification.php
+lib/Models/Offer.php
+lib/Models/OfferList.php
+lib/Models/OffersListResponse.php
+lib/Models/Order.php
+lib/Models/OrderBatch.php
+lib/Models/OrderBilling.php
+lib/Models/OrderIdentifiers.php
+lib/Models/OrderProductsInner.php
+lib/Models/Otp.php
+lib/Models/PatchLoyaltyProgramPayload.php
+lib/Models/Pipeline.php
+lib/Models/PipelineStage.php
+lib/Models/PostContactInfo.php
+lib/Models/PostContactInfoContacts.php
+lib/Models/PostContactInfoContactsFailure.php
+lib/Models/PostContactInfoContactsSuccess.php
+lib/Models/PostSendFailed.php
+lib/Models/PostSendSmsTestFailed.php
+lib/Models/PutRevokeUserPermission.php
+lib/Models/PutRevokeUserPermissionResponse.php
+lib/Models/Putresendcancelinvitation.php
+lib/Models/PutresendcancelinvitationResponse.php
+lib/Models/RedeemRewardPayload.php
+lib/Models/RedeemedRewardFailedConditionErrorResponse.php
+lib/Models/RemoveContactFromListByAll.php
+lib/Models/RemoveContactFromListByEmails.php
+lib/Models/RemoveContactFromListByExtIDs.php
+lib/Models/RemoveContactFromListByIDs.php
+lib/Models/RemoveContactFromListRequest.php
+lib/Models/RequestContactExport.php
+lib/Models/RequestContactExportCustomContactFilter.php
+lib/Models/RequestContactImport.php
+lib/Models/RequestContactImportJsonBodyInner.php
+lib/Models/RequestContactImportNewList.php
+lib/Models/RequestSmsRecipientExport.php
+lib/Models/RewardAttributionResponse.php
+lib/Models/RewardRedeemResponse.php
+lib/Models/ScheduleSmtpEmail.php
+lib/Models/Segment.php
+lib/Models/SendReport.php
+lib/Models/SendReportEmail.php
+lib/Models/SendSms.php
+lib/Models/SendSmtpEmail.php
+lib/Models/SendSmtpEmailAttachmentInner.php
+lib/Models/SendSmtpEmailBccInner.php
+lib/Models/SendSmtpEmailCcInner.php
+lib/Models/SendSmtpEmailMessageVersionsInner.php
+lib/Models/SendSmtpEmailReplyTo.php
+lib/Models/SendSmtpEmailSender.php
+lib/Models/SendSmtpEmailToInner.php
+lib/Models/SendTestEmail.php
+lib/Models/SendTestSms.php
+lib/Models/SendTransacSms.php
+lib/Models/SendWhatsappMessage201Response.php
+lib/Models/SendWhatsappMessageRequest.php
+lib/Models/SendWhatsappMessageTemplate.php
+lib/Models/SendWhatsappMessageText.php
+lib/Models/SubAccountAppsToggleRequest.php
+lib/Models/SubAccountDetailsResponse.php
+lib/Models/SubAccountDetailsResponseGroupsInner.php
+lib/Models/SubAccountDetailsResponsePlanInfo.php
+lib/Models/SubAccountDetailsResponsePlanInfoCredits.php
+lib/Models/SubAccountDetailsResponsePlanInfoCreditsEmails.php
+lib/Models/SubAccountDetailsResponsePlanInfoCreditsExternalFeeds.php
+lib/Models/SubAccountDetailsResponsePlanInfoCreditsSms.php
+lib/Models/SubAccountDetailsResponsePlanInfoCreditsWhatsapp.php
+lib/Models/SubAccountDetailsResponsePlanInfoCreditsWpSubscribers.php
+lib/Models/SubAccountDetailsResponsePlanInfoFeatures.php
+lib/Models/SubAccountDetailsResponsePlanInfoFeaturesInbox.php
+lib/Models/SubAccountDetailsResponsePlanInfoFeaturesLandingPage.php
+lib/Models/SubAccountDetailsResponsePlanInfoFeaturesUsers.php
+lib/Models/SubAccountUpdatePlanRequest.php
+lib/Models/SubAccountUpdatePlanRequestCredits.php
+lib/Models/SubAccountUpdatePlanRequestFeatures.php
+lib/Models/SubAccountsResponse.php
+lib/Models/SubAccountsResponseSubAccountsInner.php
+lib/Models/SubAccountsResponseSubAccountsInnerGroupsInner.php
+lib/Models/SubscriptionNotFoundErrorResponse.php
+lib/Models/Task.php
+lib/Models/TaskList.php
+lib/Models/TaskReminder.php
+lib/Models/TaskTypes.php
+lib/Models/Tier.php
+lib/Models/TierAccessConditionsInner.php
+lib/Models/TierForContact.php
+lib/Models/TierGroup.php
+lib/Models/TierGroupPage.php
+lib/Models/TierRequest.php
+lib/Models/TierRequestAccessConditionsInner.php
+lib/Models/TierRequestTierRewardsInner.php
+lib/Models/TierTierRewardsInner.php
+lib/Models/Transaction.php
+lib/Models/UnauthorizedResponse.php
+lib/Models/UpdateAttribute.php
+lib/Models/UpdateAttributeEnumerationInner.php
+lib/Models/UpdateBalanceDefinitionPayload.php
+lib/Models/UpdateBatchContacts.php
+lib/Models/UpdateBatchContactsContactsInner.php
+lib/Models/UpdateBatchContactsModel.php
+lib/Models/UpdateCampaignStatus.php
+lib/Models/UpdateContact.php
+lib/Models/UpdateCouponCollection200Response.php
+lib/Models/UpdateCouponCollectionRequest.php
+lib/Models/UpdateEmailCampaign.php
+lib/Models/UpdateEmailCampaignEmailExpirationDate.php
+lib/Models/UpdateEmailCampaignRecipients.php
+lib/Models/UpdateEmailCampaignSender.php
+lib/Models/UpdateExternalFeed.php
+lib/Models/UpdateList.php
+lib/Models/UpdateLoyaltyProgramPayload.php
+lib/Models/UpdateSender.php
+lib/Models/UpdateSmsCampaign.php
+lib/Models/UpdateSmtpTemplate.php
+lib/Models/UpdateSmtpTemplateSender.php
+lib/Models/UpdateTierGroup404Response.php
+lib/Models/UpdateTierGroupRequest.php
+lib/Models/UpdateUserResponse.php
+lib/Models/UpdateWebhook.php
+lib/Models/UpdateWhatsAppCampaign.php
+lib/Models/UploadImageModel.php
+lib/Models/UploadImageToGallery.php
+lib/Models/ValidateRewardPayload.php
+lib/Models/ValidatedRewardResponse.php
+lib/Models/ValidationError.php
+lib/Models/VariablesItems.php
+lib/Models/VersionInfo.php
+lib/Models/WhatsappCampStats.php
+lib/Models/WhatsappCampTemplate.php
+lib/ObjectSerializer.php
+phpunit.xml.dist
+tests/Model/SegmentTest.php
diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION
new file mode 100644
index 0000000..4bc5d61
--- /dev/null
+++ b/.openapi-generator/VERSION
@@ -0,0 +1 @@
+7.9.0
diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php
new file mode 100644
index 0000000..af9cf39
--- /dev/null
+++ b/.php-cs-fixer.dist.php
@@ -0,0 +1,29 @@
+in(__DIR__)
+ ->exclude('vendor')
+ ->exclude('test')
+ ->exclude('tests')
+;
+
+$config = new PhpCsFixer\Config();
+return $config->setRules([
+ '@PSR12' => true,
+ 'phpdoc_order' => true,
+ 'array_syntax' => [ 'syntax' => 'short' ],
+ 'strict_comparison' => true,
+ 'strict_param' => true,
+ 'no_trailing_whitespace' => false,
+ 'no_trailing_whitespace_in_comment' => false,
+ 'braces' => false,
+ 'single_blank_line_at_eof' => false,
+ 'blank_line_after_namespace' => false,
+ 'no_leading_import_slash' => false,
+ ])
+ ->setFinder($finder)
+;
diff --git a/.phplint.yml b/.phplint.yml
new file mode 100644
index 0000000..7cd1307
--- /dev/null
+++ b/.phplint.yml
@@ -0,0 +1,11 @@
+path:
+ - ./lib
+ - ./tests
+jobs: 10
+extensions:
+ - php
+exclude:
+ - vendor
+warning: true
+memory-limit: -1
+no-cache: true
diff --git a/.travis.yml b/.travis.yml
index e93086b..707be2a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,7 +1,12 @@
language: php
-sudo: false
+# Jammy Jellyfish environment has preinstalled PHP 8.1
+# Focal Fossa doesn't fit since it contains preinstalled PHP 7.4 only
+# https://docs.travis-ci.com/user/reference/jammy/#php-support
+dist: jammy
+os:
+ - linux
php:
- - 5.6
- - 7.0
+ - 8.1
+ - 8.2
before_install: "composer install"
-script: "vendor/bin/phpunit"
\ No newline at end of file
+script: "vendor/bin/phpunit"
diff --git a/README.md b/README.md
index 5dc8b62..528485c 100644
--- a/README.md
+++ b/README.md
@@ -1,53 +1,62 @@
-# Brevo's API v3 Php Library
-
-Brevo's API exposes the entire Brevo features via a standardized programmatic interface. Please refer to the full [documentation](https://developers.brevo.com) to learn more.
-
-This is the wrapper for the API. It implements all the features of the API v3.
+# Brevo's API v3 Php Library
+
+Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to :
+ - Manage your campaigns and get the statistics
+ - Manage your contacts
+ - Send transactional Emails and SMS
+ - and much more...
+
+You can download our wrappers at https://github.com/orgs/brevo
+
+**Possible responses**
+ | Code | Message |
+ | :-------------: | ------------- |
+ | 200 | OK. Successful Request |
+ | 201 | OK. Successful Creation |
+ | 202 | OK. Request accepted |
+ | 204 | OK. Successful Update/Deletion |
+ | 400 | Error. Bad Request |
+ | 401 | Error. Authentication Needed |
+ | 402 | Error. Not enough credit, plan upgrade needed |
+ | 403 | Error. Permission denied |
+ | 404 | Error. Object does not exist |
+ | 405 | Error. Method not allowed |
+ | 406 | Error. Not Acceptable |
+ | 422 | Error. Unprocessable Entity |
+
+
+For more information, please visit [https://account.brevo.com/support](https://account.brevo.com/support).
Brevo's API matches the [OpenAPI v2 definition](https://www.openapis.org/). The specification can be downloaded [here](https://api.brevo.com/v3/swagger_definition.yml).
-This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project and is reviewed and maintained by Brevo:
-- API version: 3.0.0
-- Build package: io.swagger.codegen.languages.PhpClientCodegen
-For more information, please visit [https://account.brevo.com/support](https://account.brevo.com/support)
+## Installation & Usage
-## Requirements
+### Requirements
-PHP 5.6 and later
+PHP 8.1 and later.
-## Installation & Usage
### Composer
-To install the bindings via [Composer](http://getcomposer.org/):
-
-Create a ```composer.json``` file in any directory & add below code in composer.json file.
+To install the bindings via [Composer](https://getcomposer.org/), add the following to `composer.json`:
-```
+```json
{
-"require": {
-"getbrevo/brevo-php": "1.x.x"
-}
+ "require": {
+ "getbrevo/brevo-php": "*"
+ }
}
```
-Then run below commands in the same directory
-```
-composer require getbrevo/brevo-php "1.x.x"
-```
+Then run `composer install`
-Further do:
-* run ``composer install`` to get these dependencies added to your vendor directory
-* add the autoloader to your application with this line: ``require("vendor/autoload.php")``
+### Manual Installation
+Download the files and include `autoload.php`:
-## Tests
-
-To run the unit tests:
-
-```
-composer install
-./vendor/bin/phpunit
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\AccountApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
@@ -81,10 +94,9 @@ try {
echo 'Exception when calling AccountApi->getAccount: ', $e->getMessage(), PHP_EOL;
}
-?>
```
-## Documentation for API Endpoints
+## API Endpoints
All URIs are relative to *https://api.brevo.com/v3*
@@ -92,28 +104,29 @@ Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AccountApi* | [**getAccount**](docs/Api/AccountApi.md#getaccount) | **GET** /account | Get your account information, plan and credits details
*AccountApi* | [**getAccountActivity**](docs/Api/AccountApi.md#getaccountactivity) | **GET** /organization/activities | Get user activity logs
+*BalanceApi* | [**beginTransaction**](docs/Api/BalanceApi.md#begintransaction) | **POST** /loyalty/balance/programs/{loyaltyProgramId}/transactions | Create new transaction
+*BalanceApi* | [**cancelTransaction**](docs/Api/BalanceApi.md#canceltransaction) | **POST** /loyalty/balance/programs/{loyaltyProgramId}/transactions/{transactionId}/cancel | Cancel transaction
+*BalanceApi* | [**completeTransaction**](docs/Api/BalanceApi.md#completetransaction) | **POST** /loyalty/balance/programs/{loyaltyProgramId}/transactions/{transactionId}/complete | Complete transaction
+*BalanceApi* | [**createBalanceOrder**](docs/Api/BalanceApi.md#createbalanceorder) | **POST** /loyalty/balance/programs/{loyaltyProgramId}/create-order | Create balance order
+*BalanceApi* | [**getBalanceDefinitionList**](docs/Api/BalanceApi.md#getbalancedefinitionlist) | **GET** /loyalty/balance/programs/{loyaltyProgramId}/balance-definitions | Get balance definition list
+*BalanceApi* | [**getContactBalances**](docs/Api/BalanceApi.md#getcontactbalances) | **GET** /loyalty/balance/programs/{loyaltyProgramId}/contact-balances | Get balance list
+*BalanceApi* | [**getSubscriptionBalances**](docs/Api/BalanceApi.md#getsubscriptionbalances) | **GET** /loyalty/balance/programs/{loyaltyProgramId}/subscriptions/{contactId}/balances | Get subscription balances
+*BalanceApi* | [**loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDelete**](docs/Api/BalanceApi.md#loyaltybalanceprogramsloyaltyprogramidbalancedefinitionsbalancedefinitioniddelete) | **DELETE** /loyalty/balance/programs/{loyaltyProgramId}/balance-definitions/{balanceDefinitionId} | Delete balance definition
+*BalanceApi* | [**loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGet**](docs/Api/BalanceApi.md#loyaltybalanceprogramsloyaltyprogramidbalancedefinitionsbalancedefinitionidget) | **GET** /loyalty/balance/programs/{loyaltyProgramId}/balance-definitions/{balanceDefinitionId} | Get balance definition
+*BalanceApi* | [**loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDelete**](docs/Api/BalanceApi.md#loyaltybalanceprogramsloyaltyprogramidbalancedefinitionsbalancedefinitionidlimitsbalancelimitiddelete) | **DELETE** /loyalty/balance/programs/{loyaltyProgramId}/balance-definitions/{balanceDefinitionId}/limits/{balanceLimitId} | Delete balance limit
+*BalanceApi* | [**loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGet**](docs/Api/BalanceApi.md#loyaltybalanceprogramsloyaltyprogramidbalancedefinitionsbalancedefinitionidlimitsbalancelimitidget) | **GET** /loyalty/balance/programs/{loyaltyProgramId}/balance-definitions/{balanceDefinitionId}/limits/{balanceLimitId} | Get balance limits
+*BalanceApi* | [**loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPut**](docs/Api/BalanceApi.md#loyaltybalanceprogramsloyaltyprogramidbalancedefinitionsbalancedefinitionidlimitsbalancelimitidput) | **PUT** /loyalty/balance/programs/{loyaltyProgramId}/balance-definitions/{balanceDefinitionId}/limits/{balanceLimitId} | Updates balance limit
+*BalanceApi* | [**loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPost**](docs/Api/BalanceApi.md#loyaltybalanceprogramsloyaltyprogramidbalancedefinitionsbalancedefinitionidlimitspost) | **POST** /loyalty/balance/programs/{loyaltyProgramId}/balance-definitions/{balanceDefinitionId}/limits | Create balance limits
+*BalanceApi* | [**loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPut**](docs/Api/BalanceApi.md#loyaltybalanceprogramsloyaltyprogramidbalancedefinitionsbalancedefinitionidput) | **PUT** /loyalty/balance/programs/{loyaltyProgramId}/balance-definitions/{balanceDefinitionId} | Update balance definition
+*BalanceApi* | [**loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPost**](docs/Api/BalanceApi.md#loyaltybalanceprogramsloyaltyprogramidbalancedefinitionspost) | **POST** /loyalty/balance/programs/{loyaltyProgramId}/balance-definitions | Create balance definition
*CompaniesApi* | [**companiesAttributesGet**](docs/Api/CompaniesApi.md#companiesattributesget) | **GET** /companies/attributes | Get company attributes
-*CompaniesApi* | [**companiesGet**](docs/Api/CompaniesApi.md#companiesget) | **GET** /companies | Get all companies
+*CompaniesApi* | [**companiesGet**](docs/Api/CompaniesApi.md#companiesget) | **GET** /companies | Get all Companies
*CompaniesApi* | [**companiesIdDelete**](docs/Api/CompaniesApi.md#companiesiddelete) | **DELETE** /companies/{id} | Delete a company
*CompaniesApi* | [**companiesIdGet**](docs/Api/CompaniesApi.md#companiesidget) | **GET** /companies/{id} | Get a company
*CompaniesApi* | [**companiesIdPatch**](docs/Api/CompaniesApi.md#companiesidpatch) | **PATCH** /companies/{id} | Update a company
-*CompaniesApi* | [**companiesLinkUnlinkIdPatch**](docs/Api/CompaniesApi.md#companieslinkunlinkidpatch) | **PATCH** /companies/link-unlink/{id} | Link and Unlink company with contacts and deals
+*CompaniesApi* | [**companiesImportPost**](docs/Api/CompaniesApi.md#companiesimportpost) | **POST** /companies/import | Import companies(creation and updation)
+*CompaniesApi* | [**companiesLinkUnlinkIdPatch**](docs/Api/CompaniesApi.md#companieslinkunlinkidpatch) | **PATCH** /companies/link-unlink/{id} | Link and Unlink company with contact and deal
*CompaniesApi* | [**companiesPost**](docs/Api/CompaniesApi.md#companiespost) | **POST** /companies | Create a company
-*AttributesApi* | [**createAttribute**](docs/Api/AttributesApi.md#createattribute) | **POST** /contacts/attributes/{attributeCategory}/{attributeName} | Create contact attribute
-*AttributesApi* | [**deleteAttribute**](docs/Api/AttributesApi.md#deleteattribute) | **DELETE** /contacts/attributes/{attributeCategory}/{attributeName} | Delete an attribute
-*AttributesApi* | [**getAttributes**](docs/Api/AttributesApi.md#getattributes) | **GET** /contacts/attributes | List all attributes
-*AttributesApi* | [**updateAttribute**](docs/Api/AttributesApi.md#updateattribute) | **PUT** /contacts/attributes/{attributeCategory}/{attributeName} | Update contact attribute
-*CRMApi* | [**crmNotesGet**](docs/Api/CRMApi.md#crmnotesget) | **GET** /crm/notes | Get all notes
-*CRMApi* | [**crmNotesIdDelete**](docs/Api/CRMApi.md#crmnotesiddelete) | **DELETE** /crm/notes/{id} | Delete a note
-*CRMApi* | [**crmNotesIdGet**](docs/Api/CRMApi.md#crmnotesidget) | **GET** /crm/notes/{id} | Get a note
-*CRMApi* | [**crmNotesIdPatch**](docs/Api/CRMApi.md#crmnotesidpatch) | **PATCH** /crm/notes/{id} | Update a note
-*CRMApi* | [**crmNotesPost**](docs/Api/CRMApi.md#crmnotespost) | **POST** /crm/notes | Create a note
-*CRMApi* | [**crmTasksGet**](docs/Api/CRMApi.md#crmtasksget) | **GET** /crm/tasks | Get all tasks
-*CRMApi* | [**crmTasksIdDelete**](docs/Api/CRMApi.md#crmtasksiddelete) | **DELETE** /crm/tasks/{id} | Delete a task
-*CRMApi* | [**crmTasksIdGet**](docs/Api/CRMApi.md#crmtasksidget) | **GET** /crm/tasks/{id} | Get a task
-*CRMApi* | [**crmTasksIdPatch**](docs/Api/CRMApi.md#crmtasksidpatch) | **PATCH** /crm/tasks/{id} | Update a task
-*CRMApi* | [**crmTasksPost**](docs/Api/CRMApi.md#crmtaskspost) | **POST** /crm/tasks | Create a task
-*CRMApi* | [**crmTasktypesGet**](docs/Api/CRMApi.md#crmtasktypesget) | **GET** /crm/tasktypes | Get all task types
*ContactsApi* | [**addContactToList**](docs/Api/ContactsApi.md#addcontacttolist) | **POST** /contacts/lists/{listId}/contacts/add | Add existing contacts to a list
*ContactsApi* | [**createAttribute**](docs/Api/ContactsApi.md#createattribute) | **POST** /contacts/attributes/{attributeCategory}/{attributeName} | Create contact attribute
*ContactsApi* | [**createContact**](docs/Api/ContactsApi.md#createcontact) | **POST** /contacts | Create a contact
@@ -135,7 +148,7 @@ Class | Method | HTTP request | Description
*ContactsApi* | [**getFolders**](docs/Api/ContactsApi.md#getfolders) | **GET** /contacts/folders | Get all folders
*ContactsApi* | [**getList**](docs/Api/ContactsApi.md#getlist) | **GET** /contacts/lists/{listId} | Get a list's details
*ContactsApi* | [**getLists**](docs/Api/ContactsApi.md#getlists) | **GET** /contacts/lists | Get all the lists
-*ContactsApi* | [**getSegments**](docs/Api/ContactsApi.md#getsegments) | **GET** /contacts/segments | Get all the Segments
+*ContactsApi* | [**getSegments**](docs/Api/ContactsApi.md#getsegments) | **GET** /contacts/segments | Get all the segments
*ContactsApi* | [**importContacts**](docs/Api/ContactsApi.md#importcontacts) | **POST** /contacts/import | Import contacts
*ContactsApi* | [**removeContactFromList**](docs/Api/ContactsApi.md#removecontactfromlist) | **POST** /contacts/lists/{listId}/contacts/remove | Delete a contact from a list
*ContactsApi* | [**requestContactExport**](docs/Api/ContactsApi.md#requestcontactexport) | **POST** /contacts/export | Export contacts
@@ -163,6 +176,7 @@ Class | Method | HTTP request | Description
*DealsApi* | [**crmDealsIdDelete**](docs/Api/DealsApi.md#crmdealsiddelete) | **DELETE** /crm/deals/{id} | Delete a deal
*DealsApi* | [**crmDealsIdGet**](docs/Api/DealsApi.md#crmdealsidget) | **GET** /crm/deals/{id} | Get a deal
*DealsApi* | [**crmDealsIdPatch**](docs/Api/DealsApi.md#crmdealsidpatch) | **PATCH** /crm/deals/{id} | Update a deal
+*DealsApi* | [**crmDealsImportPost**](docs/Api/DealsApi.md#crmdealsimportpost) | **POST** /crm/deals/import | Import deals(creation and updation)
*DealsApi* | [**crmDealsLinkUnlinkIdPatch**](docs/Api/DealsApi.md#crmdealslinkunlinkidpatch) | **PATCH** /crm/deals/link-unlink/{id} | Link and Unlink a deal with contacts and companies
*DealsApi* | [**crmDealsPost**](docs/Api/DealsApi.md#crmdealspost) | **POST** /crm/deals | Create a deal
*DealsApi* | [**crmPipelineDetailsAllGet**](docs/Api/DealsApi.md#crmpipelinedetailsallget) | **GET** /crm/pipeline/details/all | Get all pipelines
@@ -180,11 +194,16 @@ Class | Method | HTTP request | Description
*EcommerceApi* | [**createUpdateCategory**](docs/Api/EcommerceApi.md#createupdatecategory) | **POST** /categories | Create/Update a category
*EcommerceApi* | [**createUpdateProduct**](docs/Api/EcommerceApi.md#createupdateproduct) | **POST** /products | Create/Update a product
*EcommerceApi* | [**ecommerceActivatePost**](docs/Api/EcommerceApi.md#ecommerceactivatepost) | **POST** /ecommerce/activate | Activate the eCommerce app
+*EcommerceApi* | [**ecommerceAttributionMetricsConversionSourceConversionSourceIdGet**](docs/Api/EcommerceApi.md#ecommerceattributionmetricsconversionsourceconversionsourceidget) | **GET** /ecommerce/attribution/metrics/{conversionSource}/{conversionSourceId} | Get detailed attribution metrics for a single Brevo campaign
+*EcommerceApi* | [**ecommerceAttributionMetricsGet**](docs/Api/EcommerceApi.md#ecommerceattributionmetricsget) | **GET** /ecommerce/attribution/metrics | Get attribution metrics for one or more Brevo campaigns
+*EcommerceApi* | [**ecommerceAttributionProductsConversionSourceConversionSourceIdGet**](docs/Api/EcommerceApi.md#ecommerceattributionproductsconversionsourceconversionsourceidget) | **GET** /ecommerce/attribution/products/{conversionSource}/{conversionSourceId} | Get attributed product sales for a single Brevo campaign
+*EcommerceApi* | [**ecommerceConfigDisplayCurrencyGet**](docs/Api/EcommerceApi.md#ecommerceconfigdisplaycurrencyget) | **GET** /ecommerce/config/displayCurrency | Get the ISO 4217 compliant display currency code for your Brevo account
*EcommerceApi* | [**getCategories**](docs/Api/EcommerceApi.md#getcategories) | **GET** /categories | Return all your categories
*EcommerceApi* | [**getCategoryInfo**](docs/Api/EcommerceApi.md#getcategoryinfo) | **GET** /categories/{id} | Get a category details
*EcommerceApi* | [**getOrders**](docs/Api/EcommerceApi.md#getorders) | **GET** /orders | Get order details
*EcommerceApi* | [**getProductInfo**](docs/Api/EcommerceApi.md#getproductinfo) | **GET** /products/{id} | Get a product's details
*EcommerceApi* | [**getProducts**](docs/Api/EcommerceApi.md#getproducts) | **GET** /products | Return all your products
+*EcommerceApi* | [**setConfigDisplayCurrency**](docs/Api/EcommerceApi.md#setconfigdisplaycurrency) | **POST** /ecommerce/config/displayCurrency | Set the ISO 4217 compliant display currency code for your Brevo account
*EmailCampaignsApi* | [**createEmailCampaign**](docs/Api/EmailCampaignsApi.md#createemailcampaign) | **POST** /emailCampaigns | Create an email campaign
*EmailCampaignsApi* | [**deleteEmailCampaign**](docs/Api/EmailCampaignsApi.md#deleteemailcampaign) | **DELETE** /emailCampaigns/{campaignId} | Delete an email campaign
*EmailCampaignsApi* | [**emailExportRecipients**](docs/Api/EmailCampaignsApi.md#emailexportrecipients) | **POST** /emailCampaigns/{campaignId}/exportRecipients | Export the recipients of an email campaign
@@ -198,13 +217,7 @@ Class | Method | HTTP request | Description
*EmailCampaignsApi* | [**updateCampaignStatus**](docs/Api/EmailCampaignsApi.md#updatecampaignstatus) | **PUT** /emailCampaigns/{campaignId}/status | Update an email campaign status
*EmailCampaignsApi* | [**updateEmailCampaign**](docs/Api/EmailCampaignsApi.md#updateemailcampaign) | **PUT** /emailCampaigns/{campaignId} | Update an email campaign
*EmailCampaignsApi* | [**uploadImageToGallery**](docs/Api/EmailCampaignsApi.md#uploadimagetogallery) | **POST** /emailCampaigns/images | Upload an image to your account's image gallery
-*EventsApi* | [**createEvent**](docs/Api/EventsApi.md#createEvent) | **POST** /events | Create an event
-*FoldersApi* | [**createFolder**](docs/Api/FoldersApi.md#createfolder) | **POST** /contacts/folders | Create a folder
-*FoldersApi* | [**deleteFolder**](docs/Api/FoldersApi.md#deletefolder) | **DELETE** /contacts/folders/{folderId} | Delete a folder (and all its lists)
-*FoldersApi* | [**getFolder**](docs/Api/FoldersApi.md#getfolder) | **GET** /contacts/folders/{folderId} | Returns a folder's details
-*FoldersApi* | [**getFolderLists**](docs/Api/FoldersApi.md#getfolderlists) | **GET** /contacts/folders/{folderId}/lists | Get lists in a folder
-*FoldersApi* | [**getFolders**](docs/Api/FoldersApi.md#getfolders) | **GET** /contacts/folders | Get all folders
-*FoldersApi* | [**updateFolder**](docs/Api/FoldersApi.md#updatefolder) | **PUT** /contacts/folders/{folderId} | Update a folder
+*EventApi* | [**createEvent**](docs/Api/EventApi.md#createevent) | **POST** /events | Create an event
*ExternalFeedsApi* | [**createExternalFeed**](docs/Api/ExternalFeedsApi.md#createexternalfeed) | **POST** /feeds | Create an external feed
*ExternalFeedsApi* | [**deleteExternalFeed**](docs/Api/ExternalFeedsApi.md#deleteexternalfeed) | **DELETE** /feeds/{uuid} | Delete an external feed
*ExternalFeedsApi* | [**getAllExternalFeeds**](docs/Api/ExternalFeedsApi.md#getallexternalfeeds) | **GET** /feeds | Fetch all external feeds
@@ -218,29 +231,30 @@ Class | Method | HTTP request | Description
*InboundParsingApi* | [**getInboundEmailAttachment**](docs/Api/InboundParsingApi.md#getinboundemailattachment) | **GET** /inbound/attachments/{downloadToken} | Retrieve inbound attachment with download token.
*InboundParsingApi* | [**getInboundEmailEvents**](docs/Api/InboundParsingApi.md#getinboundemailevents) | **GET** /inbound/events | Get the list of all the events for the received emails.
*InboundParsingApi* | [**getInboundEmailEventsByUuid**](docs/Api/InboundParsingApi.md#getinboundemaileventsbyuuid) | **GET** /inbound/events/{uuid} | Fetch all events history for one particular received email.
-*ListsApi* | [**addContactToList**](docs/Api/ListsApi.md#addcontacttolist) | **POST** /contacts/lists/{listId}/contacts/add | Add existing contacts to a list
-*ListsApi* | [**createList**](docs/Api/ListsApi.md#createlist) | **POST** /contacts/lists | Create a list
-*ListsApi* | [**deleteList**](docs/Api/ListsApi.md#deletelist) | **DELETE** /contacts/lists/{listId} | Delete a list
-*ListsApi* | [**getContactsFromList**](docs/Api/ListsApi.md#getcontactsfromlist) | **GET** /contacts/lists/{listId}/contacts | Get contacts in a list
-*ListsApi* | [**getFolderLists**](docs/Api/ListsApi.md#getfolderlists) | **GET** /contacts/folders/{folderId}/lists | Get lists in a folder
-*ListsApi* | [**getList**](docs/Api/ListsApi.md#getlist) | **GET** /contacts/lists/{listId} | Get a list's details
-*ListsApi* | [**getLists**](docs/Api/ListsApi.md#getlists) | **GET** /contacts/lists | Get all the lists
-*ListsApi* | [**removeContactFromList**](docs/Api/ListsApi.md#removecontactfromlist) | **POST** /contacts/lists/{listId}/contacts/remove | Delete a contact from a list
-*ListsApi* | [**updateList**](docs/Api/ListsApi.md#updatelist) | **PUT** /contacts/lists/{listId} | Update a list
+*MasterAccountApi* | [**corporateGroupIdDelete**](docs/Api/MasterAccountApi.md#corporategroupiddelete) | **DELETE** /corporate/group/{id} | Delete a group
+*MasterAccountApi* | [**corporateGroupIdGet**](docs/Api/MasterAccountApi.md#corporategroupidget) | **GET** /corporate/group/{id} | GET a group details
*MasterAccountApi* | [**corporateGroupIdPut**](docs/Api/MasterAccountApi.md#corporategroupidput) | **PUT** /corporate/group/{id} | Update a group of sub-accounts
-*MasterAccountApi* | [**corporateGroupPost**](docs/Api/MasterAccountApi.md#corporategrouppost) | **POST** /corporate/group | Create a new group of sub-accounts
+*MasterAccountApi* | [**corporateGroupPost**](docs/Api/MasterAccountApi.md#corporategrouppost) | **POST** /corporate/group | Create a group of sub-accounts
+*MasterAccountApi* | [**corporateGroupUnlinkGroupIdSubAccountsPut**](docs/Api/MasterAccountApi.md#corporategroupunlinkgroupidsubaccountsput) | **PUT** /corporate/group/unlink/{groupId}/subAccounts | Delete sub-account from group
+*MasterAccountApi* | [**corporateIpGet**](docs/Api/MasterAccountApi.md#corporateipget) | **GET** /corporate/ip | List of all IPs
*MasterAccountApi* | [**corporateMasterAccountGet**](docs/Api/MasterAccountApi.md#corporatemasteraccountget) | **GET** /corporate/masterAccount | Get the details of requested master account
+*MasterAccountApi* | [**corporateSsoTokenPost**](docs/Api/MasterAccountApi.md#corporatessotokenpost) | **POST** /corporate/ssoToken | Generate SSO token to access admin account
*MasterAccountApi* | [**corporateSubAccountGet**](docs/Api/MasterAccountApi.md#corporatesubaccountget) | **GET** /corporate/subAccount | Get the list of all the sub-accounts of the master account.
*MasterAccountApi* | [**corporateSubAccountIdApplicationsTogglePut**](docs/Api/MasterAccountApi.md#corporatesubaccountidapplicationstoggleput) | **PUT** /corporate/subAccount/{id}/applications/toggle | Enable/disable sub-account application(s)
*MasterAccountApi* | [**corporateSubAccountIdDelete**](docs/Api/MasterAccountApi.md#corporatesubaccountiddelete) | **DELETE** /corporate/subAccount/{id} | Delete a sub-account
*MasterAccountApi* | [**corporateSubAccountIdGet**](docs/Api/MasterAccountApi.md#corporatesubaccountidget) | **GET** /corporate/subAccount/{id} | Get sub-account details
*MasterAccountApi* | [**corporateSubAccountIdPlanPut**](docs/Api/MasterAccountApi.md#corporatesubaccountidplanput) | **PUT** /corporate/subAccount/{id}/plan | Update sub-account plan
+*MasterAccountApi* | [**corporateSubAccountIpAssociatePost**](docs/Api/MasterAccountApi.md#corporatesubaccountipassociatepost) | **POST** /corporate/subAccount/ip/associate | Associate an IP to sub-accounts
+*MasterAccountApi* | [**corporateSubAccountIpDissociatePut**](docs/Api/MasterAccountApi.md#corporatesubaccountipdissociateput) | **PUT** /corporate/subAccount/ip/dissociate | Dissociate an IP to sub-accounts
*MasterAccountApi* | [**corporateSubAccountKeyPost**](docs/Api/MasterAccountApi.md#corporatesubaccountkeypost) | **POST** /corporate/subAccount/key | Create an API key for a sub-account
*MasterAccountApi* | [**corporateSubAccountPost**](docs/Api/MasterAccountApi.md#corporatesubaccountpost) | **POST** /corporate/subAccount | Create a new sub-account under a master account.
-*MasterAccountApi* | [**corporateSubAccountSsoTokenPost**](docs/Api/MasterAccountApi.md#corporatesubaccountssotokenpost) | **POST** /corporate/subAccount/ssoToken | Generate SSO token to access Brevo
+*MasterAccountApi* | [**corporateSubAccountSsoTokenPost**](docs/Api/MasterAccountApi.md#corporatesubaccountssotokenpost) | **POST** /corporate/subAccount/ssoToken | Generate SSO token to access sub-account
+*MasterAccountApi* | [**corporateUserEmailPermissionsPut**](docs/Api/MasterAccountApi.md#corporateuseremailpermissionsput) | **PUT** /corporate/user/{email}/permissions | Change admin user permissions
+*MasterAccountApi* | [**corporateUserInvitationActionEmailPut**](docs/Api/MasterAccountApi.md#corporateuserinvitationactionemailput) | **PUT** /corporate/user/invitation/{action}/{email} | Resend / cancel admin user invitation
*MasterAccountApi* | [**corporateUserRevokeEmailDelete**](docs/Api/MasterAccountApi.md#corporateuserrevokeemaildelete) | **DELETE** /corporate/user/revoke/{email} | Revoke an admin user
-*MasterAccountApi* | [**getAccountActivity**](docs/Api/MasterAccountApi.md#getaccountactivity) | **GET** /organization/activities | Get user activity logs
+*MasterAccountApi* | [**getAccountActivity_0**](docs/Api/MasterAccountApi.md#getaccountactivity_0) | **GET** /organization/activities | Get user activity logs
*MasterAccountApi* | [**getCorporateInvitedUsersList**](docs/Api/MasterAccountApi.md#getcorporateinviteduserslist) | **GET** /corporate/invited/users | Get the list of all admin users
+*MasterAccountApi* | [**getCorporateUserPermission**](docs/Api/MasterAccountApi.md#getcorporateuserpermission) | **GET** /corporate/user/{email}/permissions | Check admin user permissions
*MasterAccountApi* | [**getSubAccountGroups**](docs/Api/MasterAccountApi.md#getsubaccountgroups) | **GET** /corporate/groups | Get the list of groups
*MasterAccountApi* | [**inviteAdminUser**](docs/Api/MasterAccountApi.md#inviteadminuser) | **POST** /corporate/user/invitation/send | Send invitation to an admin user
*NotesApi* | [**crmNotesGet**](docs/Api/NotesApi.md#crmnotesget) | **GET** /crm/notes | Get all notes
@@ -248,24 +262,29 @@ Class | Method | HTTP request | Description
*NotesApi* | [**crmNotesIdGet**](docs/Api/NotesApi.md#crmnotesidget) | **GET** /crm/notes/{id} | Get a note
*NotesApi* | [**crmNotesIdPatch**](docs/Api/NotesApi.md#crmnotesidpatch) | **PATCH** /crm/notes/{id} | Update a note
*NotesApi* | [**crmNotesPost**](docs/Api/NotesApi.md#crmnotespost) | **POST** /crm/notes | Create a note
+*PaymentsApi* | [**createPaymentRequest**](docs/Api/PaymentsApi.md#createpaymentrequest) | **POST** /payments/requests | Create a payment request
+*PaymentsApi* | [**deletePaymentRequest**](docs/Api/PaymentsApi.md#deletepaymentrequest) | **DELETE** /payments/requests/{id} | Delete a payment request.
+*PaymentsApi* | [**getPaymentRequest**](docs/Api/PaymentsApi.md#getpaymentrequest) | **GET** /payments/requests/{id} | Get payment request details
*ProcessApi* | [**getProcess**](docs/Api/ProcessApi.md#getprocess) | **GET** /processes/{processId} | Return the informations for a process
*ProcessApi* | [**getProcesses**](docs/Api/ProcessApi.md#getprocesses) | **GET** /processes | Return all the processes for your account
-*ResellerApi* | [**addCredits**](docs/Api/ResellerApi.md#addcredits) | **POST** /reseller/children/{childIdentifier}/credits/add | Add Email and/or SMS credits to a specific child account
-*ResellerApi* | [**associateIpToChild**](docs/Api/ResellerApi.md#associateiptochild) | **POST** /reseller/children/{childIdentifier}/ips/associate | Associate a dedicated IP to the child
-*ResellerApi* | [**createChildDomain**](docs/Api/ResellerApi.md#createchilddomain) | **POST** /reseller/children/{childIdentifier}/domains | Create a domain for a child account
-*ResellerApi* | [**createResellerChild**](docs/Api/ResellerApi.md#createresellerchild) | **POST** /reseller/children | Creates a reseller child
-*ResellerApi* | [**deleteChildDomain**](docs/Api/ResellerApi.md#deletechilddomain) | **DELETE** /reseller/children/{childIdentifier}/domains/{domainName} | Delete the sender domain of the reseller child based on the childIdentifier and domainName passed
-*ResellerApi* | [**deleteResellerChild**](docs/Api/ResellerApi.md#deleteresellerchild) | **DELETE** /reseller/children/{childIdentifier} | Delete a single reseller child based on the child identifier supplied
-*ResellerApi* | [**dissociateIpFromChild**](docs/Api/ResellerApi.md#dissociateipfromchild) | **POST** /reseller/children/{childIdentifier}/ips/dissociate | Dissociate a dedicated IP to the child
-*ResellerApi* | [**getChildAccountCreationStatus**](docs/Api/ResellerApi.md#getchildaccountcreationstatus) | **GET** /reseller/children/{childIdentifier}/accountCreationStatus | Get the status of a reseller's child account creation, whether it is successfully created (exists) or not based on the identifier supplied
-*ResellerApi* | [**getChildDomains**](docs/Api/ResellerApi.md#getchilddomains) | **GET** /reseller/children/{childIdentifier}/domains | Get all sender domains for a specific child account
-*ResellerApi* | [**getChildInfo**](docs/Api/ResellerApi.md#getchildinfo) | **GET** /reseller/children/{childIdentifier} | Get a child account's details
-*ResellerApi* | [**getResellerChilds**](docs/Api/ResellerApi.md#getresellerchilds) | **GET** /reseller/children | Get the list of all children accounts
-*ResellerApi* | [**getSsoToken**](docs/Api/ResellerApi.md#getssotoken) | **GET** /reseller/children/{childIdentifier}/auth | Get session token to access Brevo (SSO)
-*ResellerApi* | [**removeCredits**](docs/Api/ResellerApi.md#removecredits) | **POST** /reseller/children/{childIdentifier}/credits/remove | Remove Email and/or SMS credits from a specific child account
-*ResellerApi* | [**updateChildAccountStatus**](docs/Api/ResellerApi.md#updatechildaccountstatus) | **PUT** /reseller/children/{childIdentifier}/accountStatus | Update info of reseller's child account status based on the childIdentifier supplied
-*ResellerApi* | [**updateChildDomain**](docs/Api/ResellerApi.md#updatechilddomain) | **PUT** /reseller/children/{childIdentifier}/domains/{domainName} | Update the sender domain of reseller's child based on the childIdentifier and domainName passed
-*ResellerApi* | [**updateResellerChild**](docs/Api/ResellerApi.md#updateresellerchild) | **PUT** /reseller/children/{childIdentifier} | Update info of reseller's child based on the child identifier supplied
+*ProgramApi* | [**createNewLP**](docs/Api/ProgramApi.md#createnewlp) | **POST** /loyalty/config/programs | Create loyalty program
+*ProgramApi* | [**deleteContactMembers**](docs/Api/ProgramApi.md#deletecontactmembers) | **DELETE** /loyalty/config/programs/{loyaltyProgramId}/subscriptions-members | Delete subscription member
+*ProgramApi* | [**deleteLoyaltyProgram**](docs/Api/ProgramApi.md#deleteloyaltyprogram) | **DELETE** /loyalty/config/programs/{loyaltyProgramId} | Delete Loyalty Program
+*ProgramApi* | [**deleteSubscriptionMember**](docs/Api/ProgramApi.md#deletesubscriptionmember) | **DELETE** /loyalty/config/programs/{loyaltyProgramId}/contact/{contactId} | Delete subscription
+*ProgramApi* | [**getLPList**](docs/Api/ProgramApi.md#getlplist) | **GET** /loyalty/config/programs | Get loyalty program list
+*ProgramApi* | [**getLoyaltyProgramInfo**](docs/Api/ProgramApi.md#getloyaltyprograminfo) | **GET** /loyalty/config/programs/{loyaltyProgramId} | Get loyalty program Info
+*ProgramApi* | [**getParameterSubscriptionInfo**](docs/Api/ProgramApi.md#getparametersubscriptioninfo) | **GET** /loyalty/config/programs/{loyaltyProgramId}/account-info | Get Subscription Data
+*ProgramApi* | [**getSubscriptionMember**](docs/Api/ProgramApi.md#getsubscriptionmember) | **GET** /loyalty/config/programs/{loyaltyProgramId}/contact/{contactId} | Get subscription info
+*ProgramApi* | [**partiallyUpdateLoyaltyProgram**](docs/Api/ProgramApi.md#partiallyupdateloyaltyprogram) | **PATCH** /loyalty/config/programs/{loyaltyProgramId} | Partially update loyalty program
+*ProgramApi* | [**publishLoyaltyProgram**](docs/Api/ProgramApi.md#publishloyaltyprogram) | **POST** /loyalty/config/programs/{loyaltyProgramId}/publish | Publish loyalty program
+*ProgramApi* | [**subscribeMemberToASubscription**](docs/Api/ProgramApi.md#subscribemembertoasubscription) | **POST** /loyalty/config/programs/{loyaltyProgramId}/subscriptions-members | Create subscription member
+*ProgramApi* | [**subscribeToLoyaltyProgram**](docs/Api/ProgramApi.md#subscribetoloyaltyprogram) | **POST** /loyalty/config/programs/{loyaltyProgramId}/subscriptions | Create subscription
+*ProgramApi* | [**updateLoyaltyProgram**](docs/Api/ProgramApi.md#updateloyaltyprogram) | **PUT** /loyalty/config/programs/{loyaltyProgramId} | Update loyalty program
+*RewardsApi* | [**attributeReward**](docs/Api/RewardsApi.md#attributereward) | **POST** /loyalty/offer/programs/{loyaltyProgramId}/rewards/attribute | Attribute reward to a contact
+*RewardsApi* | [**getOffersList**](docs/Api/RewardsApi.md#getofferslist) | **GET** /loyalty/offer/programs/{loyaltyProgramId}/offers | Get Reward list
+*RewardsApi* | [**redeemReward**](docs/Api/RewardsApi.md#redeemreward) | **POST** /loyalty/offer/programs/{loyaltyProgramId}/rewards/redeem | Redeem reward
+*RewardsApi* | [**revokeReward**](docs/Api/RewardsApi.md#revokereward) | **DELETE** /loyalty/offer/programs/{loyaltyProgramId}/rewards/revoke | Revoke reward
+*RewardsApi* | [**validateReward**](docs/Api/RewardsApi.md#validatereward) | **POST** /loyalty/offer/programs/{loyaltyProgramId}/rewards/validate | Validates a voucher
*SMSCampaignsApi* | [**createSmsCampaign**](docs/Api/SMSCampaignsApi.md#createsmscampaign) | **POST** /smsCampaigns | Creates an SMS campaign
*SMSCampaignsApi* | [**deleteSmsCampaign**](docs/Api/SMSCampaignsApi.md#deletesmscampaign) | **DELETE** /smsCampaigns/{campaignId} | Delete an SMS campaign
*SMSCampaignsApi* | [**getSmsCampaign**](docs/Api/SMSCampaignsApi.md#getsmscampaign) | **GET** /smsCampaigns/{campaignId} | Get an SMS campaign
@@ -282,13 +301,23 @@ Class | Method | HTTP request | Description
*SendersApi* | [**getIpsFromSender**](docs/Api/SendersApi.md#getipsfromsender) | **GET** /senders/{senderId}/ips | Get all the dedicated IPs for a sender
*SendersApi* | [**getSenders**](docs/Api/SendersApi.md#getsenders) | **GET** /senders | Get the list of all your senders
*SendersApi* | [**updateSender**](docs/Api/SendersApi.md#updatesender) | **PUT** /senders/{senderId} | Update a sender
-*SendersApi* | [**validateSenderByOTP**](docs/Api/SendersApi.md#validatesenderbyotp) | **PUT** /senders/{senderId}/validate | Update a sender
+*SendersApi* | [**validateSenderByOTP**](docs/Api/SendersApi.md#validatesenderbyotp) | **PUT** /senders/{senderId}/validate | Validate Sender using OTP
*TasksApi* | [**crmTasksGet**](docs/Api/TasksApi.md#crmtasksget) | **GET** /crm/tasks | Get all tasks
*TasksApi* | [**crmTasksIdDelete**](docs/Api/TasksApi.md#crmtasksiddelete) | **DELETE** /crm/tasks/{id} | Delete a task
*TasksApi* | [**crmTasksIdGet**](docs/Api/TasksApi.md#crmtasksidget) | **GET** /crm/tasks/{id} | Get a task
*TasksApi* | [**crmTasksIdPatch**](docs/Api/TasksApi.md#crmtasksidpatch) | **PATCH** /crm/tasks/{id} | Update a task
*TasksApi* | [**crmTasksPost**](docs/Api/TasksApi.md#crmtaskspost) | **POST** /crm/tasks | Create a task
*TasksApi* | [**crmTasktypesGet**](docs/Api/TasksApi.md#crmtasktypesget) | **GET** /crm/tasktypes | Get all task types
+*TierApi* | [**createTierForTierGroup**](docs/Api/TierApi.md#createtierfortiergroup) | **POST** /loyalty/tier/programs/{loyaltyProgramId}/tier-groups/{tierGroupId}/tiers | Create new tier
+*TierApi* | [**createTierGroup**](docs/Api/TierApi.md#createtiergroup) | **POST** /loyalty/tier/programs/{loyaltyProgramId}/tier-groups | Create tier group
+*TierApi* | [**deleteTierGroup**](docs/Api/TierApi.md#deletetiergroup) | **DELETE** /loyalty/tier/programs/{loyaltyProgramId}/tier-groups/{tierGroupId} | Delete tier group
+*TierApi* | [**getListOfTierGroups**](docs/Api/TierApi.md#getlistoftiergroups) | **GET** /loyalty/tier/programs/{loyaltyProgramId}/tier-groups | Get tier group page
+*TierApi* | [**getLoyaltyProgramTier**](docs/Api/TierApi.md#getloyaltyprogramtier) | **GET** /loyalty/tier/programs/{loyaltyProgramId}/tiers | Get tier page
+*TierApi* | [**getTierGroup**](docs/Api/TierApi.md#gettiergroup) | **GET** /loyalty/tier/programs/{loyaltyProgramId}/tier-groups/{tierGroupId} | Get tier group by Id
+*TierApi* | [**loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPost**](docs/Api/TierApi.md#loyaltytierprogramsloyaltyprogramidcontactscontactidtierstieridpost) | **POST** /loyalty/tier/programs/{loyaltyProgramId}/contacts/{contactId}/tiers/{tierId} | Add subscription to a tier
+*TierApi* | [**loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDelete**](docs/Api/TierApi.md#loyaltytierprogramsloyaltyprogramidtierstieriddelete) | **DELETE** /loyalty/tier/programs/{loyaltyProgramId}/tiers/{tierId} | Delete tier
+*TierApi* | [**loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPut**](docs/Api/TierApi.md#loyaltytierprogramsloyaltyprogramidtierstieridput) | **PUT** /loyalty/tier/programs/{loyaltyProgramId}/tiers/{tierId} | Update tier
+*TierApi* | [**updateTierGroup**](docs/Api/TierApi.md#updatetiergroup) | **PUT** /loyalty/tier/programs/{loyaltyProgramId}/tier-groups/{tierGroupId} | Update tier group
*TransactionalEmailsApi* | [**blockNewDomain**](docs/Api/TransactionalEmailsApi.md#blocknewdomain) | **POST** /smtp/blockedDomains | Add a new domain to the list of blocked domains
*TransactionalEmailsApi* | [**createSmtpTemplate**](docs/Api/TransactionalEmailsApi.md#createsmtptemplate) | **POST** /smtp/templates | Create an email template
*TransactionalEmailsApi* | [**deleteBlockedDomain**](docs/Api/TransactionalEmailsApi.md#deleteblockeddomain) | **DELETE** /smtp/blockedDomains/{domain} | Unblock an existing domain from the list of blocked domains
@@ -298,8 +327,7 @@ Class | Method | HTTP request | Description
*TransactionalEmailsApi* | [**getAggregatedSmtpReport**](docs/Api/TransactionalEmailsApi.md#getaggregatedsmtpreport) | **GET** /smtp/statistics/aggregatedReport | Get your transactional email activity aggregated over a period of time
*TransactionalEmailsApi* | [**getBlockedDomains**](docs/Api/TransactionalEmailsApi.md#getblockeddomains) | **GET** /smtp/blockedDomains | Get the list of blocked domains
*TransactionalEmailsApi* | [**getEmailEventReport**](docs/Api/TransactionalEmailsApi.md#getemaileventreport) | **GET** /smtp/statistics/events | Get all your transactional email activity (unaggregated events)
-*TransactionalEmailsApi* | [**getScheduledEmailByBatchId**](docs/Api/TransactionalEmailsApi.md#getscheduledemailbybatchid) | **GET** /smtp/emailStatus/{batchId} | Fetch scheduled emails by batchId
-*TransactionalEmailsApi* | [**getScheduledEmailByMessageId**](docs/Api/TransactionalEmailsApi.md#getscheduledemailbymessageid) | **GET** /smtp/emailStatus/{messageId} | Fetch scheduled email by messageId
+*TransactionalEmailsApi* | [**getScheduledEmailById**](docs/Api/TransactionalEmailsApi.md#getscheduledemailbyid) | **GET** /smtp/emailStatus/{identifier} | Fetch scheduled emails by batchId or messageId
*TransactionalEmailsApi* | [**getSmtpReport**](docs/Api/TransactionalEmailsApi.md#getsmtpreport) | **GET** /smtp/statistics/reports | Get your transactional email activity aggregated per day
*TransactionalEmailsApi* | [**getSmtpTemplate**](docs/Api/TransactionalEmailsApi.md#getsmtptemplate) | **GET** /smtp/templates/{templateId} | Returns the template information
*TransactionalEmailsApi* | [**getSmtpTemplates**](docs/Api/TransactionalEmailsApi.md#getsmtptemplates) | **GET** /smtp/templates | Get the list of email templates
@@ -330,7 +358,7 @@ Class | Method | HTTP request | Description
*WebhooksApi* | [**getWebhooks**](docs/Api/WebhooksApi.md#getwebhooks) | **GET** /webhooks | Get all webhooks
*WebhooksApi* | [**updateWebhook**](docs/Api/WebhooksApi.md#updatewebhook) | **PUT** /webhooks/{webhookId} | Update a webhook
*WhatsAppCampaignsApi* | [**createWhatsAppCampaign**](docs/Api/WhatsAppCampaignsApi.md#createwhatsappcampaign) | **POST** /whatsappCampaigns | Create and Send a WhatsApp campaign
-*WhatsAppCampaignsApi* | [**createWhatsAppTemplate**](docs/Api/WhatsAppCampaignsApi.md#createwhatsapptemplate) | **POST** /whatsppCampaigns/template | Create a WhatsApp template
+*WhatsAppCampaignsApi* | [**createWhatsAppTemplate**](docs/Api/WhatsAppCampaignsApi.md#createwhatsapptemplate) | **POST** /whatsappCampaigns/template | Create a WhatsApp template
*WhatsAppCampaignsApi* | [**deleteWhatsAppCampaign**](docs/Api/WhatsAppCampaignsApi.md#deletewhatsappcampaign) | **DELETE** /whatsappCampaigns/{campaignId} | Delete a WhatsApp campaign
*WhatsAppCampaignsApi* | [**getWhatsAppCampaign**](docs/Api/WhatsAppCampaignsApi.md#getwhatsappcampaign) | **GET** /whatsappCampaigns/{campaignId} | Get a WhatsApp campaign
*WhatsAppCampaignsApi* | [**getWhatsAppCampaigns**](docs/Api/WhatsAppCampaignsApi.md#getwhatsappcampaigns) | **GET** /whatsappCampaigns | Return all your created WhatsApp campaigns
@@ -339,379 +367,484 @@ Class | Method | HTTP request | Description
*WhatsAppCampaignsApi* | [**sendWhatsAppTemplateApproval**](docs/Api/WhatsAppCampaignsApi.md#sendwhatsapptemplateapproval) | **POST** /whatsappCampaigns/template/approval/{templateId} | Send your WhatsApp template for approval
*WhatsAppCampaignsApi* | [**updateWhatsAppCampaign**](docs/Api/WhatsAppCampaignsApi.md#updatewhatsappcampaign) | **PUT** /whatsappCampaigns/{campaignId} | Update a WhatsApp campaign
-
-## Documentation For Models
-
- - [AbTestCampaignResult](docs/Model/AbTestCampaignResult.md)
- - [AbTestCampaignResultClickedLinks](docs/Model/AbTestCampaignResultClickedLinks.md)
- - [AbTestCampaignResultStatistics](docs/Model/AbTestCampaignResultStatistics.md)
- - [AbTestVersionClicks](docs/Model/AbTestVersionClicks.md)
- - [AbTestVersionClicksInner](docs/Model/AbTestVersionClicksInner.md)
- - [AbTestVersionStats](docs/Model/AbTestVersionStats.md)
- - [AddChildDomain](docs/Model/AddChildDomain.md)
- - [AddContactToList](docs/Model/AddContactToList.md)
- - [AddCredits](docs/Model/AddCredits.md)
- - [AuthenticateDomainModel](docs/Model/AuthenticateDomainModel.md)
- - [BlockDomain](docs/Model/BlockDomain.md)
- - [Body](docs/Model/Body.md)
- - [Body1](docs/Model/Body1.md)
- - [Body10](docs/Model/Body10.md)
- - [Body11](docs/Model/Body11.md)
- - [Body12](docs/Model/Body12.md)
- - [Body13](docs/Model/Body13.md)
- - [Body14](docs/Model/Body14.md)
- - [Body2](docs/Model/Body2.md)
- - [Body3](docs/Model/Body3.md)
- - [Body4](docs/Model/Body4.md)
- - [Body5](docs/Model/Body5.md)
- - [Body6](docs/Model/Body6.md)
- - [Body7](docs/Model/Body7.md)
- - [Body8](docs/Model/Body8.md)
- - [Body9](docs/Model/Body9.md)
- - [BodyVariablesItems](docs/Model/BodyVariablesItems.md)
- - [CompaniesList](docs/Model/CompaniesList.md)
- - [Company](docs/Model/Company.md)
- - [CompanyAttributes](docs/Model/CompanyAttributes.md)
- - [CompanyAttributesInner](docs/Model/CompanyAttributesInner.md)
- - [ComponentItems](docs/Model/ComponentItems.md)
- - [ConversationsMessage](docs/Model/ConversationsMessage.md)
- - [ConversationsMessageFile](docs/Model/ConversationsMessageFile.md)
- - [ConversationsMessageFileImageInfo](docs/Model/ConversationsMessageFileImageInfo.md)
- - [CreateApiKeyRequest](docs/Model/CreateApiKeyRequest.md)
- - [CreateApiKeyResponse](docs/Model/CreateApiKeyResponse.md)
- - [CreateAttribute](docs/Model/CreateAttribute.md)
- - [CreateAttributeEnumeration](docs/Model/CreateAttributeEnumeration.md)
- - [CreateCategoryModel](docs/Model/CreateCategoryModel.md)
- - [CreateChild](docs/Model/CreateChild.md)
- - [CreateContact](docs/Model/CreateContact.md)
- - [CreateCouponCollection](docs/Model/CreateCouponCollection.md)
- - [CreateCoupons](docs/Model/CreateCoupons.md)
- - [CreateDoiContact](docs/Model/CreateDoiContact.md)
- - [CreateDomain](docs/Model/CreateDomain.md)
- - [CreateDomainModel](docs/Model/CreateDomainModel.md)
- - [CreateDomainModelDnsRecords](docs/Model/CreateDomainModelDnsRecords.md)
- - [CreateDomainModelDnsRecordsDkimRecord](docs/Model/CreateDomainModelDnsRecordsDkimRecord.md)
- - [CreateEmailCampaign](docs/Model/CreateEmailCampaign.md)
- - [CreateEmailCampaignRecipients](docs/Model/CreateEmailCampaignRecipients.md)
- - [CreateEmailCampaignSender](docs/Model/CreateEmailCampaignSender.md)
- - [CreateExternalFeed](docs/Model/CreateExternalFeed.md)
- - [CreateList](docs/Model/CreateList.md)
- - [CreateModel](docs/Model/CreateModel.md)
- - [CreateProductModel](docs/Model/CreateProductModel.md)
- - [CreateReseller](docs/Model/CreateReseller.md)
- - [CreateSender](docs/Model/CreateSender.md)
- - [CreateSenderIps](docs/Model/CreateSenderIps.md)
- - [CreateSenderModel](docs/Model/CreateSenderModel.md)
- - [CreateSmsCampaign](docs/Model/CreateSmsCampaign.md)
- - [CreateSmsCampaignRecipients](docs/Model/CreateSmsCampaignRecipients.md)
- - [CreateSmtpEmail](docs/Model/CreateSmtpEmail.md)
- - [CreateSmtpTemplate](docs/Model/CreateSmtpTemplate.md)
- - [CreateSmtpTemplateSender](docs/Model/CreateSmtpTemplateSender.md)
- - [CreateSubAccount](docs/Model/CreateSubAccount.md)
- - [CreateSubAccountResponse](docs/Model/CreateSubAccountResponse.md)
- - [CreateUpdateBatchCategory](docs/Model/CreateUpdateBatchCategory.md)
- - [CreateUpdateBatchCategoryModel](docs/Model/CreateUpdateBatchCategoryModel.md)
- - [CreateUpdateBatchProducts](docs/Model/CreateUpdateBatchProducts.md)
- - [CreateUpdateBatchProductsModel](docs/Model/CreateUpdateBatchProductsModel.md)
- - [CreateUpdateCategories](docs/Model/CreateUpdateCategories.md)
- - [CreateUpdateCategory](docs/Model/CreateUpdateCategory.md)
- - [CreateUpdateContactModel](docs/Model/CreateUpdateContactModel.md)
- - [CreateUpdateFolder](docs/Model/CreateUpdateFolder.md)
- - [CreateUpdateProduct](docs/Model/CreateUpdateProduct.md)
- - [CreateUpdateProducts](docs/Model/CreateUpdateProducts.md)
- - [CreateWebhook](docs/Model/CreateWebhook.md)
- - [CreateWhatsAppCampaign](docs/Model/CreateWhatsAppCampaign.md)
- - [CreateWhatsAppCampaignRecipients](docs/Model/CreateWhatsAppCampaignRecipients.md)
- - [CreateWhatsAppTemplate](docs/Model/CreateWhatsAppTemplate.md)
- - [CreatedBatchId](docs/Model/CreatedBatchId.md)
- - [CreatedProcessId](docs/Model/CreatedProcessId.md)
- - [Deal](docs/Model/Deal.md)
- - [DealAttributes](docs/Model/DealAttributes.md)
- - [DealAttributesInner](docs/Model/DealAttributesInner.md)
- - [DealsList](docs/Model/DealsList.md)
- - [DeleteHardbounces](docs/Model/DeleteHardbounces.md)
- - [EmailExportRecipients](docs/Model/EmailExportRecipients.md)
- - [ErrorModel](docs/Model/ErrorModel.md)
- - [Event](docs/Model/Event.md)
- - [ExportWebhooksHistory](docs/Model/ExportWebhooksHistory.md)
- - [FileData](docs/Model/FileData.md)
- - [FileDownloadableLink](docs/Model/FileDownloadableLink.md)
- - [FileList](docs/Model/FileList.md)
- - [GetAccount](docs/Model/GetAccount.md)
- - [GetAccountActivity](docs/Model/GetAccountActivity.md)
- - [GetAccountActivityLogs](docs/Model/GetAccountActivityLogs.md)
- - [GetAccountMarketingAutomation](docs/Model/GetAccountMarketingAutomation.md)
- - [GetAccountPlan](docs/Model/GetAccountPlan.md)
- - [GetAccountRelay](docs/Model/GetAccountRelay.md)
- - [GetAccountRelayData](docs/Model/GetAccountRelayData.md)
- - [GetAggregatedReport](docs/Model/GetAggregatedReport.md)
- - [GetAllExternalFeeds](docs/Model/GetAllExternalFeeds.md)
- - [GetAllExternalFeedsFeeds](docs/Model/GetAllExternalFeedsFeeds.md)
- - [GetAttributes](docs/Model/GetAttributes.md)
- - [GetAttributesAttributes](docs/Model/GetAttributesAttributes.md)
- - [GetAttributesEnumeration](docs/Model/GetAttributesEnumeration.md)
- - [GetBlockedDomains](docs/Model/GetBlockedDomains.md)
- - [GetCampaignOverview](docs/Model/GetCampaignOverview.md)
- - [GetCampaignRecipients](docs/Model/GetCampaignRecipients.md)
- - [GetCampaignStats](docs/Model/GetCampaignStats.md)
- - [GetCategories](docs/Model/GetCategories.md)
- - [GetCategoryDetails](docs/Model/GetCategoryDetails.md)
- - [GetChildAccountCreationStatus](docs/Model/GetChildAccountCreationStatus.md)
- - [GetChildDomain](docs/Model/GetChildDomain.md)
- - [GetChildDomains](docs/Model/GetChildDomains.md)
- - [GetChildInfo](docs/Model/GetChildInfo.md)
- - [GetChildInfoApiKeys](docs/Model/GetChildInfoApiKeys.md)
- - [GetChildInfoApiKeysV2](docs/Model/GetChildInfoApiKeysV2.md)
- - [GetChildInfoApiKeysV3](docs/Model/GetChildInfoApiKeysV3.md)
- - [GetChildInfoCredits](docs/Model/GetChildInfoCredits.md)
- - [GetChildInfoStatistics](docs/Model/GetChildInfoStatistics.md)
- - [GetChildrenList](docs/Model/GetChildrenList.md)
- - [GetClient](docs/Model/GetClient.md)
- - [GetContactCampaignStats](docs/Model/GetContactCampaignStats.md)
- - [GetContactCampaignStatsClicked](docs/Model/GetContactCampaignStatsClicked.md)
- - [GetContactCampaignStatsOpened](docs/Model/GetContactCampaignStatsOpened.md)
- - [GetContactCampaignStatsTransacAttributes](docs/Model/GetContactCampaignStatsTransacAttributes.md)
- - [GetContactCampaignStatsUnsubscriptions](docs/Model/GetContactCampaignStatsUnsubscriptions.md)
- - [GetContactDetails](docs/Model/GetContactDetails.md)
- - [GetContacts](docs/Model/GetContacts.md)
- - [GetCorporateInvitedUsersList](docs/Model/GetCorporateInvitedUsersList.md)
- - [GetCorporateInvitedUsersListFeatureAccess](docs/Model/GetCorporateInvitedUsersListFeatureAccess.md)
- - [GetCorporateInvitedUsersListGroups](docs/Model/GetCorporateInvitedUsersListGroups.md)
- - [GetCorporateInvitedUsersListUsers](docs/Model/GetCorporateInvitedUsersListUsers.md)
- - [GetCouponCollection](docs/Model/GetCouponCollection.md)
- - [GetDeviceBrowserStats](docs/Model/GetDeviceBrowserStats.md)
- - [GetDomainConfigurationModel](docs/Model/GetDomainConfigurationModel.md)
- - [GetDomainsList](docs/Model/GetDomainsList.md)
- - [GetDomainsListDomains](docs/Model/GetDomainsListDomains.md)
- - [GetEmailCampaign](docs/Model/GetEmailCampaign.md)
- - [GetEmailCampaigns](docs/Model/GetEmailCampaigns.md)
- - [GetEmailEventReport](docs/Model/GetEmailEventReport.md)
- - [GetEmailEventReportEvents](docs/Model/GetEmailEventReportEvents.md)
- - [GetExtendedCampaignOverview](docs/Model/GetExtendedCampaignOverview.md)
- - [GetExtendedCampaignOverviewSender](docs/Model/GetExtendedCampaignOverviewSender.md)
- - [GetExtendedCampaignStats](docs/Model/GetExtendedCampaignStats.md)
- - [GetExtendedCampaignStatsGlobalStats](docs/Model/GetExtendedCampaignStatsGlobalStats.md)
- - [GetExtendedClient](docs/Model/GetExtendedClient.md)
- - [GetExtendedClientAddress](docs/Model/GetExtendedClientAddress.md)
- - [GetExtendedContactDetails](docs/Model/GetExtendedContactDetails.md)
- - [GetExtendedContactDetailsStatistics](docs/Model/GetExtendedContactDetailsStatistics.md)
- - [GetExtendedContactDetailsStatisticsClicked](docs/Model/GetExtendedContactDetailsStatisticsClicked.md)
- - [GetExtendedContactDetailsStatisticsDelivered](docs/Model/GetExtendedContactDetailsStatisticsDelivered.md)
- - [GetExtendedContactDetailsStatisticsLinks](docs/Model/GetExtendedContactDetailsStatisticsLinks.md)
- - [GetExtendedContactDetailsStatisticsMessagesSent](docs/Model/GetExtendedContactDetailsStatisticsMessagesSent.md)
- - [GetExtendedContactDetailsStatisticsOpened](docs/Model/GetExtendedContactDetailsStatisticsOpened.md)
- - [GetExtendedContactDetailsStatisticsUnsubscriptions](docs/Model/GetExtendedContactDetailsStatisticsUnsubscriptions.md)
- - [GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription](docs/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription.md)
- - [GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription](docs/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription.md)
- - [GetExtendedList](docs/Model/GetExtendedList.md)
- - [GetExtendedListCampaignStats](docs/Model/GetExtendedListCampaignStats.md)
- - [GetExternalFeedByUUID](docs/Model/GetExternalFeedByUUID.md)
- - [GetExternalFeedByUUIDHeaders](docs/Model/GetExternalFeedByUUIDHeaders.md)
- - [GetFolder](docs/Model/GetFolder.md)
- - [GetFolderLists](docs/Model/GetFolderLists.md)
- - [GetFolders](docs/Model/GetFolders.md)
- - [GetInboundEmailEvents](docs/Model/GetInboundEmailEvents.md)
- - [GetInboundEmailEventsByUuid](docs/Model/GetInboundEmailEventsByUuid.md)
- - [GetInboundEmailEventsByUuidAttachments](docs/Model/GetInboundEmailEventsByUuidAttachments.md)
- - [GetInboundEmailEventsByUuidLogs](docs/Model/GetInboundEmailEventsByUuidLogs.md)
- - [GetInboundEmailEventsEvents](docs/Model/GetInboundEmailEventsEvents.md)
- - [GetInvitedUsersList](docs/Model/GetInvitedUsersList.md)
- - [GetInvitedUsersListFeatureAccess](docs/Model/GetInvitedUsersListFeatureAccess.md)
- - [GetInvitedUsersListUsers](docs/Model/GetInvitedUsersListUsers.md)
- - [GetIp](docs/Model/GetIp.md)
- - [GetIpFromSender](docs/Model/GetIpFromSender.md)
- - [GetIps](docs/Model/GetIps.md)
- - [GetIpsFromSender](docs/Model/GetIpsFromSender.md)
- - [GetList](docs/Model/GetList.md)
- - [GetLists](docs/Model/GetLists.md)
- - [GetOrders](docs/Model/GetOrders.md)
- - [GetProcess](docs/Model/GetProcess.md)
- - [GetProcesses](docs/Model/GetProcesses.md)
- - [GetProductDetails](docs/Model/GetProductDetails.md)
- - [GetProducts](docs/Model/GetProducts.md)
- - [GetReports](docs/Model/GetReports.md)
- - [GetReportsReports](docs/Model/GetReportsReports.md)
- - [GetScheduledEmailByBatchId](docs/Model/GetScheduledEmailByBatchId.md)
- - [GetScheduledEmailByBatchIdBatches](docs/Model/GetScheduledEmailByBatchIdBatches.md)
- - [GetScheduledEmailByMessageId](docs/Model/GetScheduledEmailByMessageId.md)
- - [GetSegments](docs/Model/GetSegments.md)
- - [GetSegmentsSegments](docs/Model/GetSegmentsSegments.md)
- - [GetSendersList](docs/Model/GetSendersList.md)
- - [GetSendersListIps](docs/Model/GetSendersListIps.md)
- - [GetSendersListSenders](docs/Model/GetSendersListSenders.md)
- - [GetSharedTemplateUrl](docs/Model/GetSharedTemplateUrl.md)
- - [GetSmsCampaign](docs/Model/GetSmsCampaign.md)
- - [GetSmsCampaignOverview](docs/Model/GetSmsCampaignOverview.md)
- - [GetSmsCampaignRecipients](docs/Model/GetSmsCampaignRecipients.md)
- - [GetSmsCampaignStats](docs/Model/GetSmsCampaignStats.md)
- - [GetSmsCampaigns](docs/Model/GetSmsCampaigns.md)
- - [GetSmsEventReport](docs/Model/GetSmsEventReport.md)
- - [GetSmsEventReportEvents](docs/Model/GetSmsEventReportEvents.md)
- - [GetSmtpTemplateOverview](docs/Model/GetSmtpTemplateOverview.md)
- - [GetSmtpTemplateOverviewSender](docs/Model/GetSmtpTemplateOverviewSender.md)
- - [GetSmtpTemplates](docs/Model/GetSmtpTemplates.md)
- - [GetSsoToken](docs/Model/GetSsoToken.md)
- - [GetStatsByBrowser](docs/Model/GetStatsByBrowser.md)
- - [GetStatsByDevice](docs/Model/GetStatsByDevice.md)
- - [GetStatsByDomain](docs/Model/GetStatsByDomain.md)
- - [GetTransacAggregatedSmsReport](docs/Model/GetTransacAggregatedSmsReport.md)
- - [GetTransacBlockedContacts](docs/Model/GetTransacBlockedContacts.md)
- - [GetTransacBlockedContactsContacts](docs/Model/GetTransacBlockedContactsContacts.md)
- - [GetTransacBlockedContactsReason](docs/Model/GetTransacBlockedContactsReason.md)
- - [GetTransacEmailContent](docs/Model/GetTransacEmailContent.md)
- - [GetTransacEmailContentEvents](docs/Model/GetTransacEmailContentEvents.md)
- - [GetTransacEmailsList](docs/Model/GetTransacEmailsList.md)
- - [GetTransacEmailsListTransactionalEmails](docs/Model/GetTransacEmailsListTransactionalEmails.md)
- - [GetTransacSmsReport](docs/Model/GetTransacSmsReport.md)
- - [GetTransacSmsReportReports](docs/Model/GetTransacSmsReportReports.md)
- - [GetUserPermission](docs/Model/GetUserPermission.md)
- - [GetUserPermissionPrivileges](docs/Model/GetUserPermissionPrivileges.md)
- - [GetWATemplates](docs/Model/GetWATemplates.md)
- - [GetWATemplatesTemplates](docs/Model/GetWATemplatesTemplates.md)
- - [GetWebhook](docs/Model/GetWebhook.md)
- - [GetWebhookAuth](docs/Model/GetWebhookAuth.md)
- - [GetWebhookHeaders](docs/Model/GetWebhookHeaders.md)
- - [GetWebhooks](docs/Model/GetWebhooks.md)
- - [GetWhatsAppConfig](docs/Model/GetWhatsAppConfig.md)
- - [GetWhatsappCampaignOverview](docs/Model/GetWhatsappCampaignOverview.md)
- - [GetWhatsappCampaigns](docs/Model/GetWhatsappCampaigns.md)
- - [GetWhatsappCampaignsCampaigns](docs/Model/GetWhatsappCampaignsCampaigns.md)
- - [GetWhatsappEventReport](docs/Model/GetWhatsappEventReport.md)
- - [GetWhatsappEventReportEvents](docs/Model/GetWhatsappEventReportEvents.md)
- - [InlineResponse200](docs/Model/InlineResponse200.md)
- - [InlineResponse2001](docs/Model/InlineResponse2001.md)
- - [InlineResponse2002](docs/Model/InlineResponse2002.md)
- - [InlineResponse201](docs/Model/InlineResponse201.md)
- - [InlineResponse2011](docs/Model/InlineResponse2011.md)
- - [InlineResponse2012](docs/Model/InlineResponse2012.md)
- - [InlineResponse2013](docs/Model/InlineResponse2013.md)
- - [InlineResponse2014](docs/Model/InlineResponse2014.md)
- - [InlineResponse2015](docs/Model/InlineResponse2015.md)
- - [InviteAdminUser](docs/Model/InviteAdminUser.md)
- - [InviteAdminUserPrivileges](docs/Model/InviteAdminUserPrivileges.md)
- - [Inviteuser](docs/Model/Inviteuser.md)
- - [InviteuserPrivileges](docs/Model/InviteuserPrivileges.md)
- - [ManageIp](docs/Model/ManageIp.md)
- - [MasterDetailsResponse](docs/Model/MasterDetailsResponse.md)
- - [MasterDetailsResponseBillingInfo](docs/Model/MasterDetailsResponseBillingInfo.md)
- - [MasterDetailsResponseBillingInfoAddress](docs/Model/MasterDetailsResponseBillingInfoAddress.md)
- - [MasterDetailsResponseBillingInfoName](docs/Model/MasterDetailsResponseBillingInfoName.md)
- - [MasterDetailsResponsePlanInfo](docs/Model/MasterDetailsResponsePlanInfo.md)
- - [MasterDetailsResponsePlanInfoFeatures](docs/Model/MasterDetailsResponsePlanInfoFeatures.md)
- - [Note](docs/Model/Note.md)
- - [NoteData](docs/Model/NoteData.md)
- - [NoteId](docs/Model/NoteId.md)
- - [NoteList](docs/Model/NoteList.md)
- - [Order](docs/Model/Order.md)
- - [OrderBatch](docs/Model/OrderBatch.md)
- - [OrderBilling](docs/Model/OrderBilling.md)
- - [OrderProducts](docs/Model/OrderProducts.md)
- - [Otp](docs/Model/Otp.md)
- - [Pipeline](docs/Model/Pipeline.md)
- - [PipelineStage](docs/Model/PipelineStage.md)
- - [Pipelines](docs/Model/Pipelines.md)
- - [PostContactInfo](docs/Model/PostContactInfo.md)
- - [PostContactInfoContacts](docs/Model/PostContactInfoContacts.md)
- - [PostSendFailed](docs/Model/PostSendFailed.md)
- - [PostSendSmsTestFailed](docs/Model/PostSendSmsTestFailed.md)
- - [PutRevokeUserPermission](docs/Model/PutRevokeUserPermission.md)
- - [Putresendcancelinvitation](docs/Model/Putresendcancelinvitation.md)
- - [RemainingCreditModel](docs/Model/RemainingCreditModel.md)
- - [RemainingCreditModelChild](docs/Model/RemainingCreditModelChild.md)
- - [RemainingCreditModelReseller](docs/Model/RemainingCreditModelReseller.md)
- - [RemoveContactFromList](docs/Model/RemoveContactFromList.md)
- - [RemoveCredits](docs/Model/RemoveCredits.md)
- - [RequestContactExport](docs/Model/RequestContactExport.md)
- - [RequestContactExportCustomContactFilter](docs/Model/RequestContactExportCustomContactFilter.md)
- - [RequestContactImport](docs/Model/RequestContactImport.md)
- - [RequestContactImportJsonBody](docs/Model/RequestContactImportJsonBody.md)
- - [RequestContactImportNewList](docs/Model/RequestContactImportNewList.md)
- - [RequestSmsRecipientExport](docs/Model/RequestSmsRecipientExport.md)
- - [ScheduleSmtpEmail](docs/Model/ScheduleSmtpEmail.md)
- - [SendReport](docs/Model/SendReport.md)
- - [SendReportEmail](docs/Model/SendReportEmail.md)
- - [SendSms](docs/Model/SendSms.md)
- - [SendSmtpEmail](docs/Model/SendSmtpEmail.md)
- - [SendSmtpEmailAttachment](docs/Model/SendSmtpEmailAttachment.md)
- - [SendSmtpEmailBcc](docs/Model/SendSmtpEmailBcc.md)
- - [SendSmtpEmailCc](docs/Model/SendSmtpEmailCc.md)
- - [SendSmtpEmailMessageVersions](docs/Model/SendSmtpEmailMessageVersions.md)
- - [SendSmtpEmailReplyTo](docs/Model/SendSmtpEmailReplyTo.md)
- - [SendSmtpEmailReplyTo1](docs/Model/SendSmtpEmailReplyTo1.md)
- - [SendSmtpEmailSender](docs/Model/SendSmtpEmailSender.md)
- - [SendSmtpEmailTo](docs/Model/SendSmtpEmailTo.md)
- - [SendSmtpEmailTo1](docs/Model/SendSmtpEmailTo1.md)
- - [SendTestEmail](docs/Model/SendTestEmail.md)
- - [SendTestSms](docs/Model/SendTestSms.md)
- - [SendTransacSms](docs/Model/SendTransacSms.md)
- - [SendWhatsappMessage](docs/Model/SendWhatsappMessage.md)
- - [SsoTokenRequest](docs/Model/SsoTokenRequest.md)
- - [SubAccountAppsToggleRequest](docs/Model/SubAccountAppsToggleRequest.md)
- - [SubAccountDetailsResponse](docs/Model/SubAccountDetailsResponse.md)
- - [SubAccountDetailsResponsePlanInfo](docs/Model/SubAccountDetailsResponsePlanInfo.md)
- - [SubAccountDetailsResponsePlanInfoCredits](docs/Model/SubAccountDetailsResponsePlanInfoCredits.md)
- - [SubAccountDetailsResponsePlanInfoCreditsEmails](docs/Model/SubAccountDetailsResponsePlanInfoCreditsEmails.md)
- - [SubAccountDetailsResponsePlanInfoFeatures](docs/Model/SubAccountDetailsResponsePlanInfoFeatures.md)
- - [SubAccountDetailsResponsePlanInfoFeaturesInbox](docs/Model/SubAccountDetailsResponsePlanInfoFeaturesInbox.md)
- - [SubAccountDetailsResponsePlanInfoFeaturesLandingPage](docs/Model/SubAccountDetailsResponsePlanInfoFeaturesLandingPage.md)
- - [SubAccountDetailsResponsePlanInfoFeaturesUsers](docs/Model/SubAccountDetailsResponsePlanInfoFeaturesUsers.md)
- - [SubAccountUpdatePlanRequest](docs/Model/SubAccountUpdatePlanRequest.md)
- - [SubAccountUpdatePlanRequestCredits](docs/Model/SubAccountUpdatePlanRequestCredits.md)
- - [SubAccountUpdatePlanRequestFeatures](docs/Model/SubAccountUpdatePlanRequestFeatures.md)
- - [SubAccountsResponse](docs/Model/SubAccountsResponse.md)
- - [SubAccountsResponseSubAccounts](docs/Model/SubAccountsResponseSubAccounts.md)
- - [Task](docs/Model/Task.md)
- - [TaskList](docs/Model/TaskList.md)
- - [TaskReminder](docs/Model/TaskReminder.md)
- - [TaskTypes](docs/Model/TaskTypes.md)
- - [UpdateAttribute](docs/Model/UpdateAttribute.md)
- - [UpdateAttributeEnumeration](docs/Model/UpdateAttributeEnumeration.md)
- - [UpdateBatchContacts](docs/Model/UpdateBatchContacts.md)
- - [UpdateBatchContactsContacts](docs/Model/UpdateBatchContactsContacts.md)
- - [UpdateBatchContactsModel](docs/Model/UpdateBatchContactsModel.md)
- - [UpdateCampaignStatus](docs/Model/UpdateCampaignStatus.md)
- - [UpdateChild](docs/Model/UpdateChild.md)
- - [UpdateChildAccountStatus](docs/Model/UpdateChildAccountStatus.md)
- - [UpdateChildDomain](docs/Model/UpdateChildDomain.md)
- - [UpdateContact](docs/Model/UpdateContact.md)
- - [UpdateCouponCollection](docs/Model/UpdateCouponCollection.md)
- - [UpdateEmailCampaign](docs/Model/UpdateEmailCampaign.md)
- - [UpdateEmailCampaignRecipients](docs/Model/UpdateEmailCampaignRecipients.md)
- - [UpdateEmailCampaignSender](docs/Model/UpdateEmailCampaignSender.md)
- - [UpdateExternalFeed](docs/Model/UpdateExternalFeed.md)
- - [UpdateList](docs/Model/UpdateList.md)
- - [UpdateSender](docs/Model/UpdateSender.md)
- - [UpdateSmsCampaign](docs/Model/UpdateSmsCampaign.md)
- - [UpdateSmtpTemplate](docs/Model/UpdateSmtpTemplate.md)
- - [UpdateSmtpTemplateSender](docs/Model/UpdateSmtpTemplateSender.md)
- - [UpdateWebhook](docs/Model/UpdateWebhook.md)
- - [UpdateWhatsAppCampaign](docs/Model/UpdateWhatsAppCampaign.md)
- - [UploadImageModel](docs/Model/UploadImageModel.md)
- - [UploadImageToGallery](docs/Model/UploadImageToGallery.md)
- - [GetChildInfo](docs/Model/GetChildInfo.md)
- - [GetExtendedCampaignOverview](docs/Model/GetExtendedCampaignOverview.md)
- - [GetExtendedClient](docs/Model/GetExtendedClient.md)
- - [GetExtendedContactDetails](docs/Model/GetExtendedContactDetails.md)
- - [GetExtendedList](docs/Model/GetExtendedList.md)
- - [GetSmsCampaign](docs/Model/GetSmsCampaign.md)
- - [GetAccount](docs/Model/GetAccount.md)
- - [GetEmailCampaign](docs/Model/GetEmailCampaign.md)
- - [VariablesItems](docs/Model/VariablesItems.md)
- - [WhatsappCampStats](docs/Model/WhatsappCampStats.md)
- - [WhatsappCampTemplate](docs/Model/WhatsappCampTemplate.md)
-
-
-## Documentation For Authorization
-
-
-## api-key
-
-The API key should be passed in the request headers as `api-key` for authentication.
+## Models
+
+- [AbTestCampaignResult](docs/Model/AbTestCampaignResult.md)
+- [AbTestCampaignResultClickedLinks](docs/Model/AbTestCampaignResultClickedLinks.md)
+- [AbTestCampaignResultStatistics](docs/Model/AbTestCampaignResultStatistics.md)
+- [AbTestVersionClicksInner](docs/Model/AbTestVersionClicksInner.md)
+- [AbTestVersionStats](docs/Model/AbTestVersionStats.md)
+- [AddContactToListByEmails](docs/Model/AddContactToListByEmails.md)
+- [AddContactToListByExtIDs](docs/Model/AddContactToListByExtIDs.md)
+- [AddContactToListByIDs](docs/Model/AddContactToListByIDs.md)
+- [AddContactToListRequest](docs/Model/AddContactToListRequest.md)
+- [AttributeRewardPayload](docs/Model/AttributeRewardPayload.md)
+- [AttributedRewardFailedConditionErrorResponse](docs/Model/AttributedRewardFailedConditionErrorResponse.md)
+- [AuthenticateDomainModel](docs/Model/AuthenticateDomainModel.md)
+- [BadRequestPayload](docs/Model/BadRequestPayload.md)
+- [Balance](docs/Model/Balance.md)
+- [BalanceBalancesInner](docs/Model/BalanceBalancesInner.md)
+- [BalanceDefinition](docs/Model/BalanceDefinition.md)
+- [BalanceDefinitionIdDoesNotExist](docs/Model/BalanceDefinitionIdDoesNotExist.md)
+- [BalanceDefinitionPage](docs/Model/BalanceDefinitionPage.md)
+- [BalanceLimit](docs/Model/BalanceLimit.md)
+- [BalanceLimitPayload](docs/Model/BalanceLimitPayload.md)
+- [BalancePage](docs/Model/BalancePage.md)
+- [BlockDomain](docs/Model/BlockDomain.md)
+- [CancelledTransaction](docs/Model/CancelledTransaction.md)
+- [Cart](docs/Model/Cart.md)
+- [CompaniesIdPatchRequest](docs/Model/CompaniesIdPatchRequest.md)
+- [CompaniesImportPost200Response](docs/Model/CompaniesImportPost200Response.md)
+- [CompaniesImportPost400Response](docs/Model/CompaniesImportPost400Response.md)
+- [CompaniesLinkUnlinkIdPatchRequest](docs/Model/CompaniesLinkUnlinkIdPatchRequest.md)
+- [CompaniesList](docs/Model/CompaniesList.md)
+- [CompaniesPost200Response](docs/Model/CompaniesPost200Response.md)
+- [CompaniesPostRequest](docs/Model/CompaniesPostRequest.md)
+- [Company](docs/Model/Company.md)
+- [CompanyAttributesInner](docs/Model/CompanyAttributesInner.md)
+- [CompleteTransactionPayload](docs/Model/CompleteTransactionPayload.md)
+- [CompletedTransaction](docs/Model/CompletedTransaction.md)
+- [ComponentItems](docs/Model/ComponentItems.md)
+- [Configuration](docs/Model/Configuration.md)
+- [ContactBalances](docs/Model/ContactBalances.md)
+- [ContactBalancesBalancesInner](docs/Model/ContactBalancesBalancesInner.md)
+- [ContactErrorModel](docs/Model/ContactErrorModel.md)
+- [ContactIdInvalidResponse](docs/Model/ContactIdInvalidResponse.md)
+- [ConversationsAgentOnlinePingPostRequest](docs/Model/ConversationsAgentOnlinePingPostRequest.md)
+- [ConversationsMessage](docs/Model/ConversationsMessage.md)
+- [ConversationsMessageFile](docs/Model/ConversationsMessageFile.md)
+- [ConversationsMessageFileImageInfo](docs/Model/ConversationsMessageFileImageInfo.md)
+- [ConversationsMessagesIdPutRequest](docs/Model/ConversationsMessagesIdPutRequest.md)
+- [ConversationsMessagesPostRequest](docs/Model/ConversationsMessagesPostRequest.md)
+- [ConversationsPushedMessagesPostRequest](docs/Model/ConversationsPushedMessagesPostRequest.md)
+- [ConversionSourceMetrics](docs/Model/ConversionSourceMetrics.md)
+- [ConversionSourceProduct](docs/Model/ConversionSourceProduct.md)
+- [CorporateGroupDetailsResponse](docs/Model/CorporateGroupDetailsResponse.md)
+- [CorporateGroupDetailsResponseGroup](docs/Model/CorporateGroupDetailsResponseGroup.md)
+- [CorporateGroupDetailsResponseSubAccountsInner](docs/Model/CorporateGroupDetailsResponseSubAccountsInner.md)
+- [CorporateGroupDetailsResponseUsersInner](docs/Model/CorporateGroupDetailsResponseUsersInner.md)
+- [CorporateGroupIdPutRequest](docs/Model/CorporateGroupIdPutRequest.md)
+- [CorporateGroupPost201Response](docs/Model/CorporateGroupPost201Response.md)
+- [CorporateGroupPostRequest](docs/Model/CorporateGroupPostRequest.md)
+- [CorporateGroupUnlinkGroupIdSubAccountsPutRequest](docs/Model/CorporateGroupUnlinkGroupIdSubAccountsPutRequest.md)
+- [CorporateIpGet200ResponseInner](docs/Model/CorporateIpGet200ResponseInner.md)
+- [CorporateSsoTokenPostRequest](docs/Model/CorporateSsoTokenPostRequest.md)
+- [CorporateSubAccountIpAssociatePostRequest](docs/Model/CorporateSubAccountIpAssociatePostRequest.md)
+- [CorporateSubAccountIpDissociatePutRequest](docs/Model/CorporateSubAccountIpDissociatePutRequest.md)
+- [CorporateSubAccountKeyPostRequest](docs/Model/CorporateSubAccountKeyPostRequest.md)
+- [CorporateSubAccountSsoTokenPostRequest](docs/Model/CorporateSubAccountSsoTokenPostRequest.md)
+- [CorporateUserEmailPermissionsPutRequest](docs/Model/CorporateUserEmailPermissionsPutRequest.md)
+- [CorporateUserEmailPermissionsPutRequestPrivilegesInner](docs/Model/CorporateUserEmailPermissionsPutRequestPrivilegesInner.md)
+- [CorporateUserInvitationActionEmailPut200Response](docs/Model/CorporateUserInvitationActionEmailPut200Response.md)
+- [CreateApiKeyResponse](docs/Model/CreateApiKeyResponse.md)
+- [CreateAttribute](docs/Model/CreateAttribute.md)
+- [CreateAttributeEnumerationInner](docs/Model/CreateAttributeEnumerationInner.md)
+- [CreateBalanceDefinitionPayload](docs/Model/CreateBalanceDefinitionPayload.md)
+- [CreateCategoryModel](docs/Model/CreateCategoryModel.md)
+- [CreateContact](docs/Model/CreateContact.md)
+- [CreateCouponCollection201Response](docs/Model/CreateCouponCollection201Response.md)
+- [CreateCouponCollectionRequest](docs/Model/CreateCouponCollectionRequest.md)
+- [CreateCouponsRequest](docs/Model/CreateCouponsRequest.md)
+- [CreateDoiContact](docs/Model/CreateDoiContact.md)
+- [CreateDoiContactAttributesValue](docs/Model/CreateDoiContactAttributesValue.md)
+- [CreateDomain](docs/Model/CreateDomain.md)
+- [CreateDomainModel](docs/Model/CreateDomainModel.md)
+- [CreateDomainModelDnsRecords](docs/Model/CreateDomainModelDnsRecords.md)
+- [CreateDomainModelDnsRecordsDkimRecord](docs/Model/CreateDomainModelDnsRecordsDkimRecord.md)
+- [CreateEmailCampaign](docs/Model/CreateEmailCampaign.md)
+- [CreateEmailCampaignEmailExpirationDate](docs/Model/CreateEmailCampaignEmailExpirationDate.md)
+- [CreateEmailCampaignRecipients](docs/Model/CreateEmailCampaignRecipients.md)
+- [CreateEmailCampaignSender](docs/Model/CreateEmailCampaignSender.md)
+- [CreateExternalFeed](docs/Model/CreateExternalFeed.md)
+- [CreateExternalFeed201Response](docs/Model/CreateExternalFeed201Response.md)
+- [CreateList](docs/Model/CreateList.md)
+- [CreateLoyaltyProgramPayload](docs/Model/CreateLoyaltyProgramPayload.md)
+- [CreateModel](docs/Model/CreateModel.md)
+- [CreateOrderPayload](docs/Model/CreateOrderPayload.md)
+- [CreatePaymentRequest](docs/Model/CreatePaymentRequest.md)
+- [CreatePaymentResponse](docs/Model/CreatePaymentResponse.md)
+- [CreateProductModel](docs/Model/CreateProductModel.md)
+- [CreateSender](docs/Model/CreateSender.md)
+- [CreateSenderIpsInner](docs/Model/CreateSenderIpsInner.md)
+- [CreateSenderModel](docs/Model/CreateSenderModel.md)
+- [CreateSmsCampaign](docs/Model/CreateSmsCampaign.md)
+- [CreateSmsCampaignRecipients](docs/Model/CreateSmsCampaignRecipients.md)
+- [CreateSmtpEmail](docs/Model/CreateSmtpEmail.md)
+- [CreateSmtpTemplate](docs/Model/CreateSmtpTemplate.md)
+- [CreateSmtpTemplateSender](docs/Model/CreateSmtpTemplateSender.md)
+- [CreateSubAccount](docs/Model/CreateSubAccount.md)
+- [CreateSubAccountResponse](docs/Model/CreateSubAccountResponse.md)
+- [CreateSubscriptionMemberPayload](docs/Model/CreateSubscriptionMemberPayload.md)
+- [CreateSubscriptionMemberResponse](docs/Model/CreateSubscriptionMemberResponse.md)
+- [CreateSubscriptionPayload](docs/Model/CreateSubscriptionPayload.md)
+- [CreateSubscriptionResponse](docs/Model/CreateSubscriptionResponse.md)
+- [CreateTierGroupRequest](docs/Model/CreateTierGroupRequest.md)
+- [CreateTransactionPayload](docs/Model/CreateTransactionPayload.md)
+- [CreateUpdateBatchCategory](docs/Model/CreateUpdateBatchCategory.md)
+- [CreateUpdateBatchCategoryModel](docs/Model/CreateUpdateBatchCategoryModel.md)
+- [CreateUpdateBatchProducts](docs/Model/CreateUpdateBatchProducts.md)
+- [CreateUpdateBatchProductsModel](docs/Model/CreateUpdateBatchProductsModel.md)
+- [CreateUpdateCategories](docs/Model/CreateUpdateCategories.md)
+- [CreateUpdateCategory](docs/Model/CreateUpdateCategory.md)
+- [CreateUpdateContactModel](docs/Model/CreateUpdateContactModel.md)
+- [CreateUpdateFolder](docs/Model/CreateUpdateFolder.md)
+- [CreateUpdateProduct](docs/Model/CreateUpdateProduct.md)
+- [CreateUpdateProducts](docs/Model/CreateUpdateProducts.md)
+- [CreateWebhook](docs/Model/CreateWebhook.md)
+- [CreateWhatsAppCampaign](docs/Model/CreateWhatsAppCampaign.md)
+- [CreateWhatsAppCampaignRecipients](docs/Model/CreateWhatsAppCampaignRecipients.md)
+- [CreateWhatsAppTemplate](docs/Model/CreateWhatsAppTemplate.md)
+- [CreatedBatchId](docs/Model/CreatedBatchId.md)
+- [CreatedProcessId](docs/Model/CreatedProcessId.md)
+- [CrmDealsIdPatchRequest](docs/Model/CrmDealsIdPatchRequest.md)
+- [CrmDealsLinkUnlinkIdPatchRequest](docs/Model/CrmDealsLinkUnlinkIdPatchRequest.md)
+- [CrmDealsPost201Response](docs/Model/CrmDealsPost201Response.md)
+- [CrmDealsPostRequest](docs/Model/CrmDealsPostRequest.md)
+- [CrmTasksIdPatchRequest](docs/Model/CrmTasksIdPatchRequest.md)
+- [CrmTasksPost201Response](docs/Model/CrmTasksPost201Response.md)
+- [CrmTasksPostRequest](docs/Model/CrmTasksPostRequest.md)
+- [Deal](docs/Model/Deal.md)
+- [DealAttributesInner](docs/Model/DealAttributesInner.md)
+- [DealsList](docs/Model/DealsList.md)
+- [DeleteHardbounces](docs/Model/DeleteHardbounces.md)
+- [DeleteSubscriptionMemberPayload](docs/Model/DeleteSubscriptionMemberPayload.md)
+- [EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response](docs/Model/EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response.md)
+- [EcommerceAttributionMetricsGet200Response](docs/Model/EcommerceAttributionMetricsGet200Response.md)
+- [EcommerceAttributionMetricsGet200ResponseTotals](docs/Model/EcommerceAttributionMetricsGet200ResponseTotals.md)
+- [EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response](docs/Model/EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response.md)
+- [EcommerceConfigDisplayCurrencyGet200Response](docs/Model/EcommerceConfigDisplayCurrencyGet200Response.md)
+- [EmailExportRecipients](docs/Model/EmailExportRecipients.md)
+- [ErrorModel](docs/Model/ErrorModel.md)
+- [ErrorResponse](docs/Model/ErrorResponse.md)
+- [Event](docs/Model/Event.md)
+- [EventContactPropertiesValue](docs/Model/EventContactPropertiesValue.md)
+- [EventEventPropertiesValue](docs/Model/EventEventPropertiesValue.md)
+- [EventIdentifiers](docs/Model/EventIdentifiers.md)
+- [ExportWebhooksHistory](docs/Model/ExportWebhooksHistory.md)
+- [ExportWebhooksHistoryRequest](docs/Model/ExportWebhooksHistoryRequest.md)
+- [FileData](docs/Model/FileData.md)
+- [FileDownloadableLink](docs/Model/FileDownloadableLink.md)
+- [GetAccount](docs/Model/GetAccount.md)
+- [GetAccountActivity](docs/Model/GetAccountActivity.md)
+- [GetAccountActivityLogsInner](docs/Model/GetAccountActivityLogsInner.md)
+- [GetAccountAllOfMarketingAutomation](docs/Model/GetAccountAllOfMarketingAutomation.md)
+- [GetAccountAllOfPlan](docs/Model/GetAccountAllOfPlan.md)
+- [GetAccountAllOfRelay](docs/Model/GetAccountAllOfRelay.md)
+- [GetAccountAllOfRelayData](docs/Model/GetAccountAllOfRelayData.md)
+- [GetAggregatedReport](docs/Model/GetAggregatedReport.md)
+- [GetAllExternalFeeds](docs/Model/GetAllExternalFeeds.md)
+- [GetAllExternalFeedsFeedsInner](docs/Model/GetAllExternalFeedsFeedsInner.md)
+- [GetAttributes](docs/Model/GetAttributes.md)
+- [GetAttributesAttributesInner](docs/Model/GetAttributesAttributesInner.md)
+- [GetAttributesAttributesInnerEnumerationInner](docs/Model/GetAttributesAttributesInnerEnumerationInner.md)
+- [GetBlockedDomains](docs/Model/GetBlockedDomains.md)
+- [GetCampaignOverview](docs/Model/GetCampaignOverview.md)
+- [GetCampaignRecipients](docs/Model/GetCampaignRecipients.md)
+- [GetCampaignStats](docs/Model/GetCampaignStats.md)
+- [GetCategories](docs/Model/GetCategories.md)
+- [GetCategoryDetails](docs/Model/GetCategoryDetails.md)
+- [GetClient](docs/Model/GetClient.md)
+- [GetContactCampaignStats](docs/Model/GetContactCampaignStats.md)
+- [GetContactCampaignStatsClickedInner](docs/Model/GetContactCampaignStatsClickedInner.md)
+- [GetContactCampaignStatsOpenedInner](docs/Model/GetContactCampaignStatsOpenedInner.md)
+- [GetContactCampaignStatsTransacAttributesInner](docs/Model/GetContactCampaignStatsTransacAttributesInner.md)
+- [GetContactCampaignStatsUnsubscriptions](docs/Model/GetContactCampaignStatsUnsubscriptions.md)
+- [GetContactDetails](docs/Model/GetContactDetails.md)
+- [GetContactInfoIdentifierParameter](docs/Model/GetContactInfoIdentifierParameter.md)
+- [GetContacts](docs/Model/GetContacts.md)
+- [GetCorporateInvitedUsersList](docs/Model/GetCorporateInvitedUsersList.md)
+- [GetCorporateInvitedUsersListUsersInner](docs/Model/GetCorporateInvitedUsersListUsersInner.md)
+- [GetCorporateInvitedUsersListUsersInnerFeatureAccess](docs/Model/GetCorporateInvitedUsersListUsersInnerFeatureAccess.md)
+- [GetCorporateInvitedUsersListUsersInnerGroups](docs/Model/GetCorporateInvitedUsersListUsersInnerGroups.md)
+- [GetCorporateUserPermission](docs/Model/GetCorporateUserPermission.md)
+- [GetCorporateUserPermissionFeatureAccess](docs/Model/GetCorporateUserPermissionFeatureAccess.md)
+- [GetCorporateUserPermissionGroupsInner](docs/Model/GetCorporateUserPermissionGroupsInner.md)
+- [GetCouponCollection](docs/Model/GetCouponCollection.md)
+- [GetDeviceBrowserStats](docs/Model/GetDeviceBrowserStats.md)
+- [GetDomainConfigurationModel](docs/Model/GetDomainConfigurationModel.md)
+- [GetDomainsList](docs/Model/GetDomainsList.md)
+- [GetDomainsListDomainsInner](docs/Model/GetDomainsListDomainsInner.md)
+- [GetEmailCampaign](docs/Model/GetEmailCampaign.md)
+- [GetEmailCampaigns](docs/Model/GetEmailCampaigns.md)
+- [GetEmailCampaignsCampaignsInner](docs/Model/GetEmailCampaignsCampaignsInner.md)
+- [GetEmailEventReport](docs/Model/GetEmailEventReport.md)
+- [GetEmailEventReportEventsInner](docs/Model/GetEmailEventReportEventsInner.md)
+- [GetExtendedCampaignOverview](docs/Model/GetExtendedCampaignOverview.md)
+- [GetExtendedCampaignOverviewAllOfSender](docs/Model/GetExtendedCampaignOverviewAllOfSender.md)
+- [GetExtendedCampaignStats](docs/Model/GetExtendedCampaignStats.md)
+- [GetExtendedClient](docs/Model/GetExtendedClient.md)
+- [GetExtendedClientAllOfAddress](docs/Model/GetExtendedClientAllOfAddress.md)
+- [GetExtendedContactDetails](docs/Model/GetExtendedContactDetails.md)
+- [GetExtendedContactDetailsAllOfStatistics](docs/Model/GetExtendedContactDetailsAllOfStatistics.md)
+- [GetExtendedContactDetailsAllOfStatisticsClicked](docs/Model/GetExtendedContactDetailsAllOfStatisticsClicked.md)
+- [GetExtendedContactDetailsAllOfStatisticsLinks](docs/Model/GetExtendedContactDetailsAllOfStatisticsLinks.md)
+- [GetExtendedContactDetailsAllOfStatisticsMessagesSent](docs/Model/GetExtendedContactDetailsAllOfStatisticsMessagesSent.md)
+- [GetExtendedContactDetailsAllOfStatisticsOpened](docs/Model/GetExtendedContactDetailsAllOfStatisticsOpened.md)
+- [GetExtendedContactDetailsAllOfStatisticsUnsubscriptions](docs/Model/GetExtendedContactDetailsAllOfStatisticsUnsubscriptions.md)
+- [GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription](docs/Model/GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription.md)
+- [GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription](docs/Model/GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.md)
+- [GetExtendedList](docs/Model/GetExtendedList.md)
+- [GetExtendedListAllOfCampaignStats](docs/Model/GetExtendedListAllOfCampaignStats.md)
+- [GetExternalFeedByUUID](docs/Model/GetExternalFeedByUUID.md)
+- [GetExternalFeedByUUIDHeadersInner](docs/Model/GetExternalFeedByUUIDHeadersInner.md)
+- [GetFolder](docs/Model/GetFolder.md)
+- [GetFolderLists](docs/Model/GetFolderLists.md)
+- [GetFolders](docs/Model/GetFolders.md)
+- [GetInboundEmailEvents](docs/Model/GetInboundEmailEvents.md)
+- [GetInboundEmailEventsByUuid](docs/Model/GetInboundEmailEventsByUuid.md)
+- [GetInboundEmailEventsByUuidAttachmentsInner](docs/Model/GetInboundEmailEventsByUuidAttachmentsInner.md)
+- [GetInboundEmailEventsByUuidLogsInner](docs/Model/GetInboundEmailEventsByUuidLogsInner.md)
+- [GetInboundEmailEventsEventsInner](docs/Model/GetInboundEmailEventsEventsInner.md)
+- [GetInvitedUsersList](docs/Model/GetInvitedUsersList.md)
+- [GetInvitedUsersListUsersInner](docs/Model/GetInvitedUsersListUsersInner.md)
+- [GetInvitedUsersListUsersInnerFeatureAccess](docs/Model/GetInvitedUsersListUsersInnerFeatureAccess.md)
+- [GetIp](docs/Model/GetIp.md)
+- [GetIpFromSender](docs/Model/GetIpFromSender.md)
+- [GetIps](docs/Model/GetIps.md)
+- [GetIpsFromSender](docs/Model/GetIpsFromSender.md)
+- [GetList](docs/Model/GetList.md)
+- [GetLists](docs/Model/GetLists.md)
+- [GetListsListsInner](docs/Model/GetListsListsInner.md)
+- [GetPaymentRequest](docs/Model/GetPaymentRequest.md)
+- [GetProcess](docs/Model/GetProcess.md)
+- [GetProcesses](docs/Model/GetProcesses.md)
+- [GetProductDetails](docs/Model/GetProductDetails.md)
+- [GetProducts](docs/Model/GetProducts.md)
+- [GetReports](docs/Model/GetReports.md)
+- [GetReportsReportsInner](docs/Model/GetReportsReportsInner.md)
+- [GetScheduledEmailByBatchId](docs/Model/GetScheduledEmailByBatchId.md)
+- [GetScheduledEmailByBatchIdBatchesInner](docs/Model/GetScheduledEmailByBatchIdBatchesInner.md)
+- [GetScheduledEmailById200Response](docs/Model/GetScheduledEmailById200Response.md)
+- [GetScheduledEmailByMessageId](docs/Model/GetScheduledEmailByMessageId.md)
+- [GetSegments](docs/Model/GetSegments.md)
+- [GetSendersList](docs/Model/GetSendersList.md)
+- [GetSendersListSendersInner](docs/Model/GetSendersListSendersInner.md)
+- [GetSendersListSendersInnerIpsInner](docs/Model/GetSendersListSendersInnerIpsInner.md)
+- [GetSharedTemplateUrl](docs/Model/GetSharedTemplateUrl.md)
+- [GetSmsCampaign](docs/Model/GetSmsCampaign.md)
+- [GetSmsCampaignOverview](docs/Model/GetSmsCampaignOverview.md)
+- [GetSmsCampaignStats](docs/Model/GetSmsCampaignStats.md)
+- [GetSmsCampaigns](docs/Model/GetSmsCampaigns.md)
+- [GetSmsCampaignsCampaignsInner](docs/Model/GetSmsCampaignsCampaignsInner.md)
+- [GetSmsEventReport](docs/Model/GetSmsEventReport.md)
+- [GetSmsEventReportEventsInner](docs/Model/GetSmsEventReportEventsInner.md)
+- [GetSmtpTemplateOverview](docs/Model/GetSmtpTemplateOverview.md)
+- [GetSmtpTemplateOverviewSender](docs/Model/GetSmtpTemplateOverviewSender.md)
+- [GetSmtpTemplates](docs/Model/GetSmtpTemplates.md)
+- [GetSsoToken](docs/Model/GetSsoToken.md)
+- [GetStatsByDevice](docs/Model/GetStatsByDevice.md)
+- [GetSubAccountGroups200ResponseInner](docs/Model/GetSubAccountGroups200ResponseInner.md)
+- [GetSubscriptionInfoResponse](docs/Model/GetSubscriptionInfoResponse.md)
+- [GetSubscriptionInfoResponseBalance](docs/Model/GetSubscriptionInfoResponseBalance.md)
+- [GetSubscriptionInfoResponseBalanceBalancesInner](docs/Model/GetSubscriptionInfoResponseBalanceBalancesInner.md)
+- [GetSubscriptionInfoResponseMembersInner](docs/Model/GetSubscriptionInfoResponseMembersInner.md)
+- [GetSubscriptionInfoResponseRewardInner](docs/Model/GetSubscriptionInfoResponseRewardInner.md)
+- [GetSubscriptionInfoResponseTierInner](docs/Model/GetSubscriptionInfoResponseTierInner.md)
+- [GetSubscriptionMemberResponse](docs/Model/GetSubscriptionMemberResponse.md)
+- [GetSubscriptionMemberResponseMemberContactIdInner](docs/Model/GetSubscriptionMemberResponseMemberContactIdInner.md)
+- [GetTransacAggregatedSmsReport](docs/Model/GetTransacAggregatedSmsReport.md)
+- [GetTransacBlockedContacts](docs/Model/GetTransacBlockedContacts.md)
+- [GetTransacBlockedContactsContactsInner](docs/Model/GetTransacBlockedContactsContactsInner.md)
+- [GetTransacBlockedContactsContactsInnerReason](docs/Model/GetTransacBlockedContactsContactsInnerReason.md)
+- [GetTransacEmailContent](docs/Model/GetTransacEmailContent.md)
+- [GetTransacEmailContentEventsInner](docs/Model/GetTransacEmailContentEventsInner.md)
+- [GetTransacEmailsList](docs/Model/GetTransacEmailsList.md)
+- [GetTransacEmailsListTransactionalEmailsInner](docs/Model/GetTransacEmailsListTransactionalEmailsInner.md)
+- [GetTransacSmsReport](docs/Model/GetTransacSmsReport.md)
+- [GetTransacSmsReportReportsInner](docs/Model/GetTransacSmsReportReportsInner.md)
+- [GetUserPermission](docs/Model/GetUserPermission.md)
+- [GetUserPermissionPrivilegesInner](docs/Model/GetUserPermissionPrivilegesInner.md)
+- [GetVersionInfoResponse](docs/Model/GetVersionInfoResponse.md)
+- [GetWebhook](docs/Model/GetWebhook.md)
+- [GetWebhooks](docs/Model/GetWebhooks.md)
+- [GetWhatsAppConfig](docs/Model/GetWhatsAppConfig.md)
+- [GetWhatsappCampaignOverview](docs/Model/GetWhatsappCampaignOverview.md)
+- [GetWhatsappCampaigns](docs/Model/GetWhatsappCampaigns.md)
+- [GetWhatsappCampaignsCampaignsInner](docs/Model/GetWhatsappCampaignsCampaignsInner.md)
+- [GetWhatsappEventReport](docs/Model/GetWhatsappEventReport.md)
+- [GetWhatsappEventReportEventsInner](docs/Model/GetWhatsappEventReportEventsInner.md)
+- [GetWhatsappTemplates](docs/Model/GetWhatsappTemplates.md)
+- [GetWhatsappTemplatesTemplatesInner](docs/Model/GetWhatsappTemplatesTemplatesInner.md)
+- [InviteAdminUser](docs/Model/InviteAdminUser.md)
+- [InviteAdminUserPrivilegesInner](docs/Model/InviteAdminUserPrivilegesInner.md)
+- [Inviteuser](docs/Model/Inviteuser.md)
+- [InviteuserPrivilegesInner](docs/Model/InviteuserPrivilegesInner.md)
+- [InviteuserResponse](docs/Model/InviteuserResponse.md)
+- [LoyaltyProgram](docs/Model/LoyaltyProgram.md)
+- [LoyaltyProgramPage](docs/Model/LoyaltyProgramPage.md)
+- [LoyaltyProgramValidationError](docs/Model/LoyaltyProgramValidationError.md)
+- [LoyaltyTierPage](docs/Model/LoyaltyTierPage.md)
+- [MasterDetailsResponse](docs/Model/MasterDetailsResponse.md)
+- [MasterDetailsResponseBillingInfo](docs/Model/MasterDetailsResponseBillingInfo.md)
+- [MasterDetailsResponseBillingInfoAddress](docs/Model/MasterDetailsResponseBillingInfoAddress.md)
+- [MasterDetailsResponseBillingInfoName](docs/Model/MasterDetailsResponseBillingInfoName.md)
+- [MasterDetailsResponsePlanInfo](docs/Model/MasterDetailsResponsePlanInfo.md)
+- [MasterDetailsResponsePlanInfoFeaturesInner](docs/Model/MasterDetailsResponsePlanInfoFeaturesInner.md)
+- [Note](docs/Model/Note.md)
+- [NoteData](docs/Model/NoteData.md)
+- [NoteId](docs/Model/NoteId.md)
+- [Notification](docs/Model/Notification.md)
+- [Offer](docs/Model/Offer.md)
+- [OfferList](docs/Model/OfferList.md)
+- [OffersListResponse](docs/Model/OffersListResponse.md)
+- [Order](docs/Model/Order.md)
+- [OrderBatch](docs/Model/OrderBatch.md)
+- [OrderBilling](docs/Model/OrderBilling.md)
+- [OrderIdentifiers](docs/Model/OrderIdentifiers.md)
+- [OrderProductsInner](docs/Model/OrderProductsInner.md)
+- [Otp](docs/Model/Otp.md)
+- [PatchLoyaltyProgramPayload](docs/Model/PatchLoyaltyProgramPayload.md)
+- [Pipeline](docs/Model/Pipeline.md)
+- [PipelineStage](docs/Model/PipelineStage.md)
+- [PostContactInfo](docs/Model/PostContactInfo.md)
+- [PostContactInfoContacts](docs/Model/PostContactInfoContacts.md)
+- [PostContactInfoContactsFailure](docs/Model/PostContactInfoContactsFailure.md)
+- [PostContactInfoContactsSuccess](docs/Model/PostContactInfoContactsSuccess.md)
+- [PostSendFailed](docs/Model/PostSendFailed.md)
+- [PostSendSmsTestFailed](docs/Model/PostSendSmsTestFailed.md)
+- [PutRevokeUserPermission](docs/Model/PutRevokeUserPermission.md)
+- [PutRevokeUserPermissionResponse](docs/Model/PutRevokeUserPermissionResponse.md)
+- [Putresendcancelinvitation](docs/Model/Putresendcancelinvitation.md)
+- [PutresendcancelinvitationResponse](docs/Model/PutresendcancelinvitationResponse.md)
+- [RedeemRewardPayload](docs/Model/RedeemRewardPayload.md)
+- [RedeemedRewardFailedConditionErrorResponse](docs/Model/RedeemedRewardFailedConditionErrorResponse.md)
+- [RemoveContactFromListByAll](docs/Model/RemoveContactFromListByAll.md)
+- [RemoveContactFromListByEmails](docs/Model/RemoveContactFromListByEmails.md)
+- [RemoveContactFromListByExtIDs](docs/Model/RemoveContactFromListByExtIDs.md)
+- [RemoveContactFromListByIDs](docs/Model/RemoveContactFromListByIDs.md)
+- [RemoveContactFromListRequest](docs/Model/RemoveContactFromListRequest.md)
+- [RequestContactExport](docs/Model/RequestContactExport.md)
+- [RequestContactExportCustomContactFilter](docs/Model/RequestContactExportCustomContactFilter.md)
+- [RequestContactImport](docs/Model/RequestContactImport.md)
+- [RequestContactImportJsonBodyInner](docs/Model/RequestContactImportJsonBodyInner.md)
+- [RequestContactImportNewList](docs/Model/RequestContactImportNewList.md)
+- [RequestSmsRecipientExport](docs/Model/RequestSmsRecipientExport.md)
+- [RewardAttributionResponse](docs/Model/RewardAttributionResponse.md)
+- [RewardRedeemResponse](docs/Model/RewardRedeemResponse.md)
+- [ScheduleSmtpEmail](docs/Model/ScheduleSmtpEmail.md)
+- [Segment](docs/Model/Segment.md)
+- [SendReport](docs/Model/SendReport.md)
+- [SendReportEmail](docs/Model/SendReportEmail.md)
+- [SendSms](docs/Model/SendSms.md)
+- [SendSmtpEmail](docs/Model/SendSmtpEmail.md)
+- [SendSmtpEmailAttachmentInner](docs/Model/SendSmtpEmailAttachmentInner.md)
+- [SendSmtpEmailBccInner](docs/Model/SendSmtpEmailBccInner.md)
+- [SendSmtpEmailCcInner](docs/Model/SendSmtpEmailCcInner.md)
+- [SendSmtpEmailMessageVersionsInner](docs/Model/SendSmtpEmailMessageVersionsInner.md)
+- [SendSmtpEmailReplyTo](docs/Model/SendSmtpEmailReplyTo.md)
+- [SendSmtpEmailSender](docs/Model/SendSmtpEmailSender.md)
+- [SendSmtpEmailToInner](docs/Model/SendSmtpEmailToInner.md)
+- [SendTestEmail](docs/Model/SendTestEmail.md)
+- [SendTestSms](docs/Model/SendTestSms.md)
+- [SendTransacSms](docs/Model/SendTransacSms.md)
+- [SendWhatsappMessage201Response](docs/Model/SendWhatsappMessage201Response.md)
+- [SendWhatsappMessageRequest](docs/Model/SendWhatsappMessageRequest.md)
+- [SendWhatsappMessageTemplate](docs/Model/SendWhatsappMessageTemplate.md)
+- [SendWhatsappMessageText](docs/Model/SendWhatsappMessageText.md)
+- [SubAccountAppsToggleRequest](docs/Model/SubAccountAppsToggleRequest.md)
+- [SubAccountDetailsResponse](docs/Model/SubAccountDetailsResponse.md)
+- [SubAccountDetailsResponseGroupsInner](docs/Model/SubAccountDetailsResponseGroupsInner.md)
+- [SubAccountDetailsResponsePlanInfo](docs/Model/SubAccountDetailsResponsePlanInfo.md)
+- [SubAccountDetailsResponsePlanInfoCredits](docs/Model/SubAccountDetailsResponsePlanInfoCredits.md)
+- [SubAccountDetailsResponsePlanInfoCreditsEmails](docs/Model/SubAccountDetailsResponsePlanInfoCreditsEmails.md)
+- [SubAccountDetailsResponsePlanInfoCreditsExternalFeeds](docs/Model/SubAccountDetailsResponsePlanInfoCreditsExternalFeeds.md)
+- [SubAccountDetailsResponsePlanInfoCreditsSms](docs/Model/SubAccountDetailsResponsePlanInfoCreditsSms.md)
+- [SubAccountDetailsResponsePlanInfoCreditsWhatsapp](docs/Model/SubAccountDetailsResponsePlanInfoCreditsWhatsapp.md)
+- [SubAccountDetailsResponsePlanInfoCreditsWpSubscribers](docs/Model/SubAccountDetailsResponsePlanInfoCreditsWpSubscribers.md)
+- [SubAccountDetailsResponsePlanInfoFeatures](docs/Model/SubAccountDetailsResponsePlanInfoFeatures.md)
+- [SubAccountDetailsResponsePlanInfoFeaturesInbox](docs/Model/SubAccountDetailsResponsePlanInfoFeaturesInbox.md)
+- [SubAccountDetailsResponsePlanInfoFeaturesLandingPage](docs/Model/SubAccountDetailsResponsePlanInfoFeaturesLandingPage.md)
+- [SubAccountDetailsResponsePlanInfoFeaturesUsers](docs/Model/SubAccountDetailsResponsePlanInfoFeaturesUsers.md)
+- [SubAccountUpdatePlanRequest](docs/Model/SubAccountUpdatePlanRequest.md)
+- [SubAccountUpdatePlanRequestCredits](docs/Model/SubAccountUpdatePlanRequestCredits.md)
+- [SubAccountUpdatePlanRequestFeatures](docs/Model/SubAccountUpdatePlanRequestFeatures.md)
+- [SubAccountsResponse](docs/Model/SubAccountsResponse.md)
+- [SubAccountsResponseSubAccountsInner](docs/Model/SubAccountsResponseSubAccountsInner.md)
+- [SubAccountsResponseSubAccountsInnerGroupsInner](docs/Model/SubAccountsResponseSubAccountsInnerGroupsInner.md)
+- [SubscriptionNotFoundErrorResponse](docs/Model/SubscriptionNotFoundErrorResponse.md)
+- [Task](docs/Model/Task.md)
+- [TaskList](docs/Model/TaskList.md)
+- [TaskReminder](docs/Model/TaskReminder.md)
+- [TaskTypes](docs/Model/TaskTypes.md)
+- [Tier](docs/Model/Tier.md)
+- [TierAccessConditionsInner](docs/Model/TierAccessConditionsInner.md)
+- [TierForContact](docs/Model/TierForContact.md)
+- [TierGroup](docs/Model/TierGroup.md)
+- [TierGroupPage](docs/Model/TierGroupPage.md)
+- [TierRequest](docs/Model/TierRequest.md)
+- [TierRequestAccessConditionsInner](docs/Model/TierRequestAccessConditionsInner.md)
+- [TierRequestTierRewardsInner](docs/Model/TierRequestTierRewardsInner.md)
+- [TierTierRewardsInner](docs/Model/TierTierRewardsInner.md)
+- [Transaction](docs/Model/Transaction.md)
+- [UnauthorizedResponse](docs/Model/UnauthorizedResponse.md)
+- [UpdateAttribute](docs/Model/UpdateAttribute.md)
+- [UpdateAttributeEnumerationInner](docs/Model/UpdateAttributeEnumerationInner.md)
+- [UpdateBalanceDefinitionPayload](docs/Model/UpdateBalanceDefinitionPayload.md)
+- [UpdateBatchContacts](docs/Model/UpdateBatchContacts.md)
+- [UpdateBatchContactsContactsInner](docs/Model/UpdateBatchContactsContactsInner.md)
+- [UpdateBatchContactsModel](docs/Model/UpdateBatchContactsModel.md)
+- [UpdateCampaignStatus](docs/Model/UpdateCampaignStatus.md)
+- [UpdateContact](docs/Model/UpdateContact.md)
+- [UpdateCouponCollection200Response](docs/Model/UpdateCouponCollection200Response.md)
+- [UpdateCouponCollectionRequest](docs/Model/UpdateCouponCollectionRequest.md)
+- [UpdateEmailCampaign](docs/Model/UpdateEmailCampaign.md)
+- [UpdateEmailCampaignEmailExpirationDate](docs/Model/UpdateEmailCampaignEmailExpirationDate.md)
+- [UpdateEmailCampaignRecipients](docs/Model/UpdateEmailCampaignRecipients.md)
+- [UpdateEmailCampaignSender](docs/Model/UpdateEmailCampaignSender.md)
+- [UpdateExternalFeed](docs/Model/UpdateExternalFeed.md)
+- [UpdateList](docs/Model/UpdateList.md)
+- [UpdateLoyaltyProgramPayload](docs/Model/UpdateLoyaltyProgramPayload.md)
+- [UpdateSender](docs/Model/UpdateSender.md)
+- [UpdateSmsCampaign](docs/Model/UpdateSmsCampaign.md)
+- [UpdateSmtpTemplate](docs/Model/UpdateSmtpTemplate.md)
+- [UpdateSmtpTemplateSender](docs/Model/UpdateSmtpTemplateSender.md)
+- [UpdateTierGroup404Response](docs/Model/UpdateTierGroup404Response.md)
+- [UpdateTierGroupRequest](docs/Model/UpdateTierGroupRequest.md)
+- [UpdateUserResponse](docs/Model/UpdateUserResponse.md)
+- [UpdateWebhook](docs/Model/UpdateWebhook.md)
+- [UpdateWhatsAppCampaign](docs/Model/UpdateWhatsAppCampaign.md)
+- [UploadImageModel](docs/Model/UploadImageModel.md)
+- [UploadImageToGallery](docs/Model/UploadImageToGallery.md)
+- [ValidateRewardPayload](docs/Model/ValidateRewardPayload.md)
+- [ValidatedRewardResponse](docs/Model/ValidatedRewardResponse.md)
+- [ValidationError](docs/Model/ValidationError.md)
+- [VariablesItems](docs/Model/VariablesItems.md)
+- [VersionInfo](docs/Model/VersionInfo.md)
+- [WhatsappCampStats](docs/Model/WhatsappCampStats.md)
+- [WhatsappCampTemplate](docs/Model/WhatsappCampTemplate.md)
+
+## Authorization
+
+### api-key
- **Type**: API key
- **API key parameter name**: api-key
- **Location**: HTTP header
+
+
+### partner-key
+
+- **Type**: API key
+- **API key parameter name**: partner-key
+- **Location**: HTTP header
+
+
+## Tests
+
+To run the tests, use:
+
+```bash
+composer install
+vendor/bin/phpunit
+```
+
+## Author
+
+contact@brevo.com
+
+## About this package
+
## partner-key
The partner key should be passed in the request headers as `partner-key` along with `api-key` pair for successful authentication of partner (Optional).
@@ -724,3 +857,13 @@ The partner key should be passed in the request headers as `partner-key` along w
If you find a bug, please post the issue on [Github](https://github.com/getbrevo/brevo-php/issues).
As always, if you need additional assistance, drop us a note [here](https://account.brevo.com/support).
+
+You can generate the PHP code with the CLI command: openapi-generator generate --skip-validate-spec -c config-openapi-generator.yml
+
+This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
+
+- API version: `3.0.0`
+ - Package version: `3.0.0`
+ - Generator version: `7.9.0`
+- Build package: `org.openapitools.codegen.languages.PhpNextgenClientCodegen`
+
diff --git a/composer.json b/composer.json
index 176f1d7..e57cf8b 100755
--- a/composer.json
+++ b/composer.json
@@ -2,42 +2,44 @@
"name": "getbrevo/brevo-php",
"description": "Official Brevo provided RESTFul API V3 php library",
"keywords": [
- "brevo",
- "swagger",
- "php",
- "sdk",
- "api"
+ "brevo",
+ "swagger",
+ "php",
+ "sdk",
+ "api"
],
"homepage": "https://github.com/getbrevo/brevo-php",
"license": "MIT",
"authors": [
- {
- "name": "Brevo Developers",
- "email": "contact@brevo.com",
- "homepage": "https://www.brevo.com/"
- }
+ {
+ "name": "Brevo Developers",
+ "email": "contact@brevo.com",
+ "homepage": "https://www.brevo.com/"
+ }
],
"require": {
- "php": ">=5.6",
+ "php": "^8.1",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",
- "guzzlehttp/guzzle": "^7.4.0"
+ "guzzlehttp/guzzle": "^7.4.5",
+ "guzzlehttp/psr7": "^2.0"
},
"require-dev": {
- "phpunit/phpunit": "^4.8",
- "squizlabs/php_codesniffer": "~2.6",
- "friendsofphp/php-cs-fixer": "~1.12"
+ "friendsofphp/php-cs-fixer": "^3.5",
+ "overtrue/phplint": "^9.0",
+ "phpunit/phpunit": "^9.0"
},
"autoload": {
"psr-4": { "Brevo\\Client\\" : "lib/" }
},
"autoload-dev": {
- "psr-4": { "Brevo\\Client\\" : "test/" }
+ "psr-4": { "Brevo\\Client\\Test\\" : "tests/" }
},
- "extra": {
- "branch-alias": {
- "dev-master": "1.x.x-dev"
- }
+ "scripts": {
+ "test": [
+ "@phplint"
+ ],
+ "phplint": "phplint"
}
-}
\ No newline at end of file
+}
diff --git a/composer.lock b/composer.lock
index fb002d7..5a85735 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,39 +4,51 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "fc3a3187a6ed0508923186df909358ff",
+ "content-hash": "41b10897330045330672bb5d3ce0a568",
"packages": [
{
"name": "guzzlehttp/guzzle",
- "version": "6.3.3",
+ "version": "7.9.2",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
- "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba"
+ "reference": "d281ed313b989f213357e3be1a179f02196ac99b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba",
- "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba",
+ "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d281ed313b989f213357e3be1a179f02196ac99b",
+ "reference": "d281ed313b989f213357e3be1a179f02196ac99b",
"shasum": ""
},
"require": {
- "guzzlehttp/promises": "^1.0",
- "guzzlehttp/psr7": "^1.4",
- "php": ">=5.5"
+ "ext-json": "*",
+ "guzzlehttp/promises": "^1.5.3 || ^2.0.3",
+ "guzzlehttp/psr7": "^2.7.0",
+ "php": "^7.2.5 || ^8.0",
+ "psr/http-client": "^1.0",
+ "symfony/deprecation-contracts": "^2.2 || ^3.0"
+ },
+ "provide": {
+ "psr/http-client-implementation": "1.0"
},
"require-dev": {
+ "bamarni/composer-bin-plugin": "^1.8.2",
"ext-curl": "*",
- "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
- "psr/log": "^1.0"
+ "guzzle/client-integration-tests": "3.0.2",
+ "php-http/message-factory": "^1.1",
+ "phpunit/phpunit": "^8.5.39 || ^9.6.20",
+ "psr/log": "^1.1 || ^2.0 || ^3.0"
},
"suggest": {
+ "ext-curl": "Required for CURL handler support",
+ "ext-intl": "Required for Internationalized Domain Name (IDN) support",
"psr/log": "Required for using the Log middleware"
},
"type": "library",
"extra": {
- "branch-alias": {
- "dev-master": "6.3-dev"
+ "bamarni-bin": {
+ "bin-links": true,
+ "forward-command": false
}
},
"autoload": {
@@ -52,128 +64,240 @@
"MIT"
],
"authors": [
+ {
+ "name": "Graham Campbell",
+ "email": "hello@gjcampbell.co.uk",
+ "homepage": "https://github.com/GrahamCampbell"
+ },
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
+ },
+ {
+ "name": "Jeremy Lindblom",
+ "email": "jeremeamia@gmail.com",
+ "homepage": "https://github.com/jeremeamia"
+ },
+ {
+ "name": "George Mponos",
+ "email": "gmponos@gmail.com",
+ "homepage": "https://github.com/gmponos"
+ },
+ {
+ "name": "Tobias Nyholm",
+ "email": "tobias.nyholm@gmail.com",
+ "homepage": "https://github.com/Nyholm"
+ },
+ {
+ "name": "Márk Sági-Kazár",
+ "email": "mark.sagikazar@gmail.com",
+ "homepage": "https://github.com/sagikazarmark"
+ },
+ {
+ "name": "Tobias Schultze",
+ "email": "webmaster@tubo-world.de",
+ "homepage": "https://github.com/Tobion"
}
],
"description": "Guzzle is a PHP HTTP client library",
- "homepage": "http://guzzlephp.org/",
"keywords": [
"client",
"curl",
"framework",
"http",
"http client",
+ "psr-18",
+ "psr-7",
"rest",
"web service"
],
- "time": "2018-04-22T15:46:56+00:00"
+ "support": {
+ "issues": "https://github.com/guzzle/guzzle/issues",
+ "source": "https://github.com/guzzle/guzzle/tree/7.9.2"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/GrahamCampbell",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/Nyholm",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-07-24T11:22:20+00:00"
},
{
"name": "guzzlehttp/promises",
- "version": "v1.3.1",
+ "version": "2.0.4",
"source": {
"type": "git",
"url": "https://github.com/guzzle/promises.git",
- "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646"
+ "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646",
- "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646",
+ "url": "https://api.github.com/repos/guzzle/promises/zipball/f9c436286ab2892c7db7be8c8da4ef61ccf7b455",
+ "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455",
"shasum": ""
},
"require": {
- "php": ">=5.5.0"
+ "php": "^7.2.5 || ^8.0"
},
"require-dev": {
- "phpunit/phpunit": "^4.0"
+ "bamarni/composer-bin-plugin": "^1.8.2",
+ "phpunit/phpunit": "^8.5.39 || ^9.6.20"
},
"type": "library",
"extra": {
- "branch-alias": {
- "dev-master": "1.4-dev"
+ "bamarni-bin": {
+ "bin-links": true,
+ "forward-command": false
}
},
"autoload": {
"psr-4": {
"GuzzleHttp\\Promise\\": "src/"
- },
- "files": [
- "src/functions_include.php"
- ]
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
+ {
+ "name": "Graham Campbell",
+ "email": "hello@gjcampbell.co.uk",
+ "homepage": "https://github.com/GrahamCampbell"
+ },
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
+ },
+ {
+ "name": "Tobias Nyholm",
+ "email": "tobias.nyholm@gmail.com",
+ "homepage": "https://github.com/Nyholm"
+ },
+ {
+ "name": "Tobias Schultze",
+ "email": "webmaster@tubo-world.de",
+ "homepage": "https://github.com/Tobion"
}
],
"description": "Guzzle promises library",
"keywords": [
"promise"
],
- "time": "2016-12-20T10:07:11+00:00"
+ "support": {
+ "issues": "https://github.com/guzzle/promises/issues",
+ "source": "https://github.com/guzzle/promises/tree/2.0.4"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/GrahamCampbell",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/Nyholm",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-10-17T10:06:22+00:00"
},
{
"name": "guzzlehttp/psr7",
- "version": "1.5.2",
+ "version": "2.7.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
- "reference": "9f83dded91781a01c63574e387eaa769be769115"
+ "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/psr7/zipball/9f83dded91781a01c63574e387eaa769be769115",
- "reference": "9f83dded91781a01c63574e387eaa769be769115",
+ "url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201",
+ "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201",
"shasum": ""
},
"require": {
- "php": ">=5.4.0",
- "psr/http-message": "~1.0",
- "ralouphie/getallheaders": "^2.0.5"
+ "php": "^7.2.5 || ^8.0",
+ "psr/http-factory": "^1.0",
+ "psr/http-message": "^1.1 || ^2.0",
+ "ralouphie/getallheaders": "^3.0"
},
"provide": {
+ "psr/http-factory-implementation": "1.0",
"psr/http-message-implementation": "1.0"
},
"require-dev": {
- "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8"
+ "bamarni/composer-bin-plugin": "^1.8.2",
+ "http-interop/http-factory-tests": "0.9.0",
+ "phpunit/phpunit": "^8.5.39 || ^9.6.20"
+ },
+ "suggest": {
+ "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
},
"type": "library",
"extra": {
- "branch-alias": {
- "dev-master": "1.5-dev"
+ "bamarni-bin": {
+ "bin-links": true,
+ "forward-command": false
}
},
"autoload": {
"psr-4": {
"GuzzleHttp\\Psr7\\": "src/"
- },
- "files": [
- "src/functions_include.php"
- ]
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
+ {
+ "name": "Graham Campbell",
+ "email": "hello@gjcampbell.co.uk",
+ "homepage": "https://github.com/GrahamCampbell"
+ },
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
},
+ {
+ "name": "George Mponos",
+ "email": "gmponos@gmail.com",
+ "homepage": "https://github.com/gmponos"
+ },
+ {
+ "name": "Tobias Nyholm",
+ "email": "tobias.nyholm@gmail.com",
+ "homepage": "https://github.com/Nyholm"
+ },
+ {
+ "name": "Márk Sági-Kazár",
+ "email": "mark.sagikazar@gmail.com",
+ "homepage": "https://github.com/sagikazarmark"
+ },
{
"name": "Tobias Schultze",
+ "email": "webmaster@tubo-world.de",
"homepage": "https://github.com/Tobion"
+ },
+ {
+ "name": "Márk Sági-Kazár",
+ "email": "mark.sagikazar@gmail.com",
+ "homepage": "https://sagikazarmark.hu"
}
],
"description": "PSR-7 message implementation that also provides common utility methods",
@@ -187,24 +311,43 @@
"uri",
"url"
],
- "time": "2018-12-04T20:46:45+00:00"
+ "support": {
+ "issues": "https://github.com/guzzle/psr7/issues",
+ "source": "https://github.com/guzzle/psr7/tree/2.7.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/GrahamCampbell",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/Nyholm",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-07-18T11:15:46+00:00"
},
{
- "name": "psr/http-message",
- "version": "1.0.1",
+ "name": "psr/http-client",
+ "version": "1.0.3",
"source": {
"type": "git",
- "url": "https://github.com/php-fig/http-message.git",
- "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
+ "url": "https://github.com/php-fig/http-client.git",
+ "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
- "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
+ "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90",
+ "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90",
"shasum": ""
},
"require": {
- "php": ">=5.3.0"
+ "php": "^7.0 || ^8.0",
+ "psr/http-message": "^1.0 || ^2.0"
},
"type": "library",
"extra": {
@@ -214,7 +357,7 @@
},
"autoload": {
"psr-4": {
- "Psr\\Http\\Message\\": "src/"
+ "Psr\\Http\\Client\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -224,47 +367,50 @@
"authors": [
{
"name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
+ "homepage": "https://www.php-fig.org/"
}
],
- "description": "Common interface for HTTP messages",
- "homepage": "https://github.com/php-fig/http-message",
+ "description": "Common interface for HTTP clients",
+ "homepage": "https://github.com/php-fig/http-client",
"keywords": [
"http",
- "http-message",
+ "http-client",
"psr",
- "psr-7",
- "request",
- "response"
+ "psr-18"
],
- "time": "2016-08-06T14:39:51+00:00"
+ "support": {
+ "source": "https://github.com/php-fig/http-client"
+ },
+ "time": "2023-09-23T14:17:50+00:00"
},
{
- "name": "ralouphie/getallheaders",
- "version": "2.0.5",
+ "name": "psr/http-factory",
+ "version": "1.1.0",
"source": {
"type": "git",
- "url": "https://github.com/ralouphie/getallheaders.git",
- "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa"
+ "url": "https://github.com/php-fig/http-factory.git",
+ "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa",
- "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa",
+ "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a",
+ "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a",
"shasum": ""
},
"require": {
- "php": ">=5.3"
- },
- "require-dev": {
- "phpunit/phpunit": "~3.7.0",
- "satooshi/php-coveralls": ">=1.0"
+ "php": ">=7.1",
+ "psr/http-message": "^1.0 || ^2.0"
},
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
"autoload": {
- "files": [
- "src/getallheaders.php"
- ]
+ "psr-4": {
+ "Psr\\Http\\Message\\": "src/"
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -272,48 +418,52 @@
],
"authors": [
{
- "name": "Ralph Khattar",
- "email": "ralph.khattar@gmail.com"
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
}
],
- "description": "A polyfill for getallheaders.",
- "time": "2016-02-11T07:05:27+00:00"
- }
- ],
- "packages-dev": [
+ "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories",
+ "keywords": [
+ "factory",
+ "http",
+ "message",
+ "psr",
+ "psr-17",
+ "psr-7",
+ "request",
+ "response"
+ ],
+ "support": {
+ "source": "https://github.com/php-fig/http-factory"
+ },
+ "time": "2024-04-15T12:06:14+00:00"
+ },
{
- "name": "doctrine/instantiator",
- "version": "1.0.5",
+ "name": "psr/http-message",
+ "version": "2.0",
"source": {
"type": "git",
- "url": "https://github.com/doctrine/instantiator.git",
- "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d"
+ "url": "https://github.com/php-fig/http-message.git",
+ "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d",
- "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d",
+ "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71",
+ "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71",
"shasum": ""
},
"require": {
- "php": ">=5.3,<8.0-DEV"
- },
- "require-dev": {
- "athletic/athletic": "~0.1.8",
- "ext-pdo": "*",
- "ext-phar": "*",
- "phpunit/phpunit": "~4.0",
- "squizlabs/php_codesniffer": "~2.0"
+ "php": "^7.2 || ^8.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.0.x-dev"
+ "dev-master": "2.0.x-dev"
}
},
"autoload": {
"psr-4": {
- "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
+ "Psr\\Http\\Message\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -322,59 +472,51 @@
],
"authors": [
{
- "name": "Marco Pivetta",
- "email": "ocramius@gmail.com",
- "homepage": "http://ocramius.github.com/"
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
}
],
- "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
- "homepage": "https://github.com/doctrine/instantiator",
+ "description": "Common interface for HTTP messages",
+ "homepage": "https://github.com/php-fig/http-message",
"keywords": [
- "constructor",
- "instantiate"
+ "http",
+ "http-message",
+ "psr",
+ "psr-7",
+ "request",
+ "response"
],
- "time": "2015-06-14T21:17:01+00:00"
+ "support": {
+ "source": "https://github.com/php-fig/http-message/tree/2.0"
+ },
+ "time": "2023-04-04T09:54:51+00:00"
},
{
- "name": "friendsofphp/php-cs-fixer",
- "version": "v1.13.3",
+ "name": "ralouphie/getallheaders",
+ "version": "3.0.3",
"source": {
"type": "git",
- "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git",
- "reference": "387e4c86c9dc0e1e4c475291fc114ec45b98e624"
+ "url": "https://github.com/ralouphie/getallheaders.git",
+ "reference": "120b605dfeb996808c31b6477290a714d356e822"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/387e4c86c9dc0e1e4c475291fc114ec45b98e624",
- "reference": "387e4c86c9dc0e1e4c475291fc114ec45b98e624",
+ "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822",
+ "reference": "120b605dfeb996808c31b6477290a714d356e822",
"shasum": ""
},
"require": {
- "ext-tokenizer": "*",
- "php": "^5.3.6 || >=7.0 <7.2",
- "sebastian/diff": "^1.1",
- "symfony/console": "^2.3 || ^3.0",
- "symfony/event-dispatcher": "^2.1 || ^3.0",
- "symfony/filesystem": "^2.1 || ^3.0",
- "symfony/finder": "^2.1 || ^3.0",
- "symfony/process": "^2.3 || ^3.0",
- "symfony/stopwatch": "^2.5 || ^3.0"
- },
- "conflict": {
- "hhvm": "<3.9"
+ "php": ">=5.6"
},
"require-dev": {
- "phpunit/phpunit": "^4.5|^5",
- "satooshi/php-coveralls": "^1.0"
+ "php-coveralls/php-coveralls": "^2.1",
+ "phpunit/phpunit": "^5 || ^6.5"
},
- "bin": [
- "php-cs-fixer"
- ],
- "type": "application",
+ "type": "library",
"autoload": {
- "psr-4": {
- "Symfony\\CS\\": "Symfony/CS/"
- }
+ "files": [
+ "src/getallheaders.php"
+ ]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -382,49 +524,48 @@
],
"authors": [
{
- "name": "Dariusz Rumiński",
- "email": "dariusz.ruminski@gmail.com"
- },
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "name": "Ralph Khattar",
+ "email": "ralph.khattar@gmail.com"
}
],
- "description": "A tool to automatically fix PHP code style",
- "time": "2017-09-11T14:11:16+00:00"
+ "description": "A polyfill for getallheaders.",
+ "support": {
+ "issues": "https://github.com/ralouphie/getallheaders/issues",
+ "source": "https://github.com/ralouphie/getallheaders/tree/develop"
+ },
+ "time": "2019-03-08T08:55:37+00:00"
},
{
- "name": "phpdocumentor/reflection-common",
- "version": "1.0.1",
+ "name": "symfony/deprecation-contracts",
+ "version": "v3.5.0",
"source": {
"type": "git",
- "url": "https://github.com/phpDocumentor/ReflectionCommon.git",
- "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6"
+ "url": "https://github.com/symfony/deprecation-contracts.git",
+ "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
- "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
+ "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1",
+ "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1",
"shasum": ""
},
"require": {
- "php": ">=5.5"
- },
- "require-dev": {
- "phpunit/phpunit": "^4.6"
+ "php": ">=8.1"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.0.x-dev"
+ "dev-main": "3.5-dev"
+ },
+ "thanks": {
+ "name": "symfony/contracts",
+ "url": "https://github.com/symfony/contracts"
}
},
"autoload": {
- "psr-4": {
- "phpDocumentor\\Reflection\\": [
- "src"
- ]
- }
+ "files": [
+ "function.php"
+ ]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -432,51 +573,63 @@
],
"authors": [
{
- "name": "Jaap van Otterdijk",
- "email": "opensource@ijaap.nl"
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
}
],
- "description": "Common reflection classes used by phpdocumentor to reflect the code structure",
- "homepage": "http://www.phpdoc.org",
- "keywords": [
- "FQSEN",
- "phpDocumentor",
- "phpdoc",
- "reflection",
- "static analysis"
+ "description": "A generic function and convention to trigger deprecation notices",
+ "homepage": "https://symfony.com",
+ "support": {
+ "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
],
- "time": "2017-09-11T18:02:19+00:00"
- },
+ "time": "2024-04-18T09:32:20+00:00"
+ }
+ ],
+ "packages-dev": [
{
- "name": "phpdocumentor/reflection-docblock",
- "version": "3.3.2",
+ "name": "clue/ndjson-react",
+ "version": "v1.3.0",
"source": {
"type": "git",
- "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
- "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2"
+ "url": "https://github.com/clue/reactphp-ndjson.git",
+ "reference": "392dc165fce93b5bb5c637b67e59619223c931b0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bf329f6c1aadea3299f08ee804682b7c45b326a2",
- "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2",
+ "url": "https://api.github.com/repos/clue/reactphp-ndjson/zipball/392dc165fce93b5bb5c637b67e59619223c931b0",
+ "reference": "392dc165fce93b5bb5c637b67e59619223c931b0",
"shasum": ""
},
"require": {
- "php": "^5.6 || ^7.0",
- "phpdocumentor/reflection-common": "^1.0.0",
- "phpdocumentor/type-resolver": "^0.4.0",
- "webmozart/assert": "^1.0"
+ "php": ">=5.3",
+ "react/stream": "^1.2"
},
"require-dev": {
- "mockery/mockery": "^0.9.4",
- "phpunit/phpunit": "^4.4"
+ "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35",
+ "react/event-loop": "^1.2"
},
"type": "library",
"autoload": {
"psr-4": {
- "phpDocumentor\\Reflection\\": [
- "src/"
- ]
+ "Clue\\React\\NDJson\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -485,46 +638,75 @@
],
"authors": [
{
- "name": "Mike van Riel",
- "email": "me@mikevanriel.com"
+ "name": "Christian Lück",
+ "email": "christian@clue.engineering"
+ }
+ ],
+ "description": "Streaming newline-delimited JSON (NDJSON) parser and encoder for ReactPHP.",
+ "homepage": "https://github.com/clue/reactphp-ndjson",
+ "keywords": [
+ "NDJSON",
+ "json",
+ "jsonlines",
+ "newline",
+ "reactphp",
+ "streaming"
+ ],
+ "support": {
+ "issues": "https://github.com/clue/reactphp-ndjson/issues",
+ "source": "https://github.com/clue/reactphp-ndjson/tree/v1.3.0"
+ },
+ "funding": [
+ {
+ "url": "https://clue.engineering/support",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/clue",
+ "type": "github"
}
],
- "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
- "time": "2017-11-10T14:09:06+00:00"
+ "time": "2022-12-23T10:58:28+00:00"
},
{
- "name": "phpdocumentor/type-resolver",
- "version": "0.4.0",
+ "name": "composer/pcre",
+ "version": "3.3.2",
"source": {
"type": "git",
- "url": "https://github.com/phpDocumentor/TypeResolver.git",
- "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7"
+ "url": "https://github.com/composer/pcre.git",
+ "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7",
- "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7",
+ "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e",
+ "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e",
"shasum": ""
},
"require": {
- "php": "^5.5 || ^7.0",
- "phpdocumentor/reflection-common": "^1.0"
+ "php": "^7.4 || ^8.0"
+ },
+ "conflict": {
+ "phpstan/phpstan": "<1.11.10"
},
"require-dev": {
- "mockery/mockery": "^0.9.4",
- "phpunit/phpunit": "^5.2||^4.8.24"
+ "phpstan/phpstan": "^1.12 || ^2",
+ "phpstan/phpstan-strict-rules": "^1 || ^2",
+ "phpunit/phpunit": "^8 || ^9"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.0.x-dev"
+ "dev-main": "3.x-dev"
+ },
+ "phpstan": {
+ "includes": [
+ "extension.neon"
+ ]
}
},
"autoload": {
"psr-4": {
- "phpDocumentor\\Reflection\\": [
- "src/"
- ]
+ "Composer\\Pcre\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -533,46 +715,68 @@
],
"authors": [
{
- "name": "Mike van Riel",
- "email": "me@mikevanriel.com"
+ "name": "Jordi Boggiano",
+ "email": "j.boggiano@seld.be",
+ "homepage": "http://seld.be"
+ }
+ ],
+ "description": "PCRE wrapping library that offers type-safe preg_* replacements.",
+ "keywords": [
+ "PCRE",
+ "preg",
+ "regex",
+ "regular expression"
+ ],
+ "support": {
+ "issues": "https://github.com/composer/pcre/issues",
+ "source": "https://github.com/composer/pcre/tree/3.3.2"
+ },
+ "funding": [
+ {
+ "url": "https://packagist.com",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/composer",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/composer/composer",
+ "type": "tidelift"
}
],
- "time": "2017-07-14T14:27:02+00:00"
+ "time": "2024-11-12T16:29:46+00:00"
},
{
- "name": "phpspec/prophecy",
- "version": "1.8.0",
+ "name": "composer/semver",
+ "version": "3.4.3",
"source": {
"type": "git",
- "url": "https://github.com/phpspec/prophecy.git",
- "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06"
+ "url": "https://github.com/composer/semver.git",
+ "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06",
- "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06",
+ "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12",
+ "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12",
"shasum": ""
},
"require": {
- "doctrine/instantiator": "^1.0.2",
- "php": "^5.3|^7.0",
- "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0",
- "sebastian/comparator": "^1.1|^2.0|^3.0",
- "sebastian/recursion-context": "^1.0|^2.0|^3.0"
+ "php": "^5.3.2 || ^7.0 || ^8.0"
},
"require-dev": {
- "phpspec/phpspec": "^2.5|^3.2",
- "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1"
+ "phpstan/phpstan": "^1.11",
+ "symfony/phpunit-bridge": "^3 || ^7"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.8.x-dev"
+ "dev-main": "3.x-dev"
}
},
"autoload": {
- "psr-0": {
- "Prophecy\\": "src/"
+ "psr-4": {
+ "Composer\\Semver\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -581,383 +785,493 @@
],
"authors": [
{
- "name": "Konstantin Kudryashov",
- "email": "ever.zet@gmail.com",
- "homepage": "http://everzet.com"
+ "name": "Nils Adermann",
+ "email": "naderman@naderman.de",
+ "homepage": "http://www.naderman.de"
+ },
+ {
+ "name": "Jordi Boggiano",
+ "email": "j.boggiano@seld.be",
+ "homepage": "http://seld.be"
},
{
- "name": "Marcello Duarte",
- "email": "marcello.duarte@gmail.com"
+ "name": "Rob Bast",
+ "email": "rob.bast@gmail.com",
+ "homepage": "http://robbast.nl"
}
],
- "description": "Highly opinionated mocking framework for PHP 5.3+",
- "homepage": "https://github.com/phpspec/prophecy",
+ "description": "Semver library that offers utilities, version constraint parsing and validation.",
"keywords": [
- "Double",
- "Dummy",
- "fake",
- "mock",
- "spy",
- "stub"
+ "semantic",
+ "semver",
+ "validation",
+ "versioning"
+ ],
+ "support": {
+ "irc": "ircs://irc.libera.chat:6697/composer",
+ "issues": "https://github.com/composer/semver/issues",
+ "source": "https://github.com/composer/semver/tree/3.4.3"
+ },
+ "funding": [
+ {
+ "url": "https://packagist.com",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/composer",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/composer/composer",
+ "type": "tidelift"
+ }
],
- "time": "2018-08-05T17:53:17+00:00"
+ "time": "2024-09-19T14:15:21+00:00"
},
{
- "name": "phpunit/php-code-coverage",
- "version": "2.2.4",
+ "name": "composer/xdebug-handler",
+ "version": "3.0.5",
"source": {
"type": "git",
- "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979"
+ "url": "https://github.com/composer/xdebug-handler.git",
+ "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979",
- "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979",
+ "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef",
+ "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef",
"shasum": ""
},
"require": {
- "php": ">=5.3.3",
- "phpunit/php-file-iterator": "~1.3",
- "phpunit/php-text-template": "~1.2",
- "phpunit/php-token-stream": "~1.3",
- "sebastian/environment": "^1.3.2",
- "sebastian/version": "~1.0"
+ "composer/pcre": "^1 || ^2 || ^3",
+ "php": "^7.2.5 || ^8.0",
+ "psr/log": "^1 || ^2 || ^3"
},
"require-dev": {
- "ext-xdebug": ">=2.1.4",
- "phpunit/phpunit": "~4"
- },
- "suggest": {
- "ext-dom": "*",
- "ext-xdebug": ">=2.2.1",
- "ext-xmlwriter": "*"
+ "phpstan/phpstan": "^1.0",
+ "phpstan/phpstan-strict-rules": "^1.1",
+ "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5"
},
"type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.2.x-dev"
- }
- },
"autoload": {
- "classmap": [
- "src/"
- ]
+ "psr-4": {
+ "Composer\\XdebugHandler\\": "src"
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
- "BSD-3-Clause"
+ "MIT"
],
"authors": [
{
- "name": "Sebastian Bergmann",
- "email": "sb@sebastian-bergmann.de",
- "role": "lead"
+ "name": "John Stevenson",
+ "email": "john-stevenson@blueyonder.co.uk"
}
],
- "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
- "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
+ "description": "Restarts a process without Xdebug.",
"keywords": [
- "coverage",
- "testing",
- "xunit"
+ "Xdebug",
+ "performance"
+ ],
+ "support": {
+ "irc": "ircs://irc.libera.chat:6697/composer",
+ "issues": "https://github.com/composer/xdebug-handler/issues",
+ "source": "https://github.com/composer/xdebug-handler/tree/3.0.5"
+ },
+ "funding": [
+ {
+ "url": "https://packagist.com",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/composer",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/composer/composer",
+ "type": "tidelift"
+ }
],
- "time": "2015-10-06T15:47:00+00:00"
+ "time": "2024-05-06T16:37:16+00:00"
},
{
- "name": "phpunit/php-file-iterator",
- "version": "1.4.5",
+ "name": "doctrine/instantiator",
+ "version": "2.0.0",
"source": {
"type": "git",
- "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
- "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4"
+ "url": "https://github.com/doctrine/instantiator.git",
+ "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4",
- "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4",
+ "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0",
+ "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": "^8.1"
},
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.4.x-dev"
- }
+ "require-dev": {
+ "doctrine/coding-standard": "^11",
+ "ext-pdo": "*",
+ "ext-phar": "*",
+ "phpbench/phpbench": "^1.2",
+ "phpstan/phpstan": "^1.9.4",
+ "phpstan/phpstan-phpunit": "^1.3",
+ "phpunit/phpunit": "^9.5.27",
+ "vimeo/psalm": "^5.4"
},
+ "type": "library",
"autoload": {
- "classmap": [
- "src/"
- ]
+ "psr-4": {
+ "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
- "BSD-3-Clause"
+ "MIT"
],
"authors": [
{
- "name": "Sebastian Bergmann",
- "email": "sb@sebastian-bergmann.de",
- "role": "lead"
+ "name": "Marco Pivetta",
+ "email": "ocramius@gmail.com",
+ "homepage": "https://ocramius.github.io/"
}
],
- "description": "FilterIterator implementation that filters files based on a list of suffixes.",
- "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
+ "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
+ "homepage": "https://www.doctrine-project.org/projects/instantiator.html",
"keywords": [
- "filesystem",
- "iterator"
+ "constructor",
+ "instantiate"
+ ],
+ "support": {
+ "issues": "https://github.com/doctrine/instantiator/issues",
+ "source": "https://github.com/doctrine/instantiator/tree/2.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://www.doctrine-project.org/sponsorship.html",
+ "type": "custom"
+ },
+ {
+ "url": "https://www.patreon.com/phpdoctrine",
+ "type": "patreon"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator",
+ "type": "tidelift"
+ }
],
- "time": "2017-11-27T13:52:08+00:00"
+ "time": "2022-12-30T00:23:10+00:00"
},
{
- "name": "phpunit/php-text-template",
- "version": "1.2.1",
+ "name": "evenement/evenement",
+ "version": "v3.0.2",
"source": {
"type": "git",
- "url": "https://github.com/sebastianbergmann/php-text-template.git",
- "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
+ "url": "https://github.com/igorw/evenement.git",
+ "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
- "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
+ "url": "https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc",
+ "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": ">=7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9 || ^6"
},
"type": "library",
"autoload": {
- "classmap": [
- "src/"
- ]
+ "psr-4": {
+ "Evenement\\": "src/"
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
- "BSD-3-Clause"
+ "MIT"
],
"authors": [
{
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
+ "name": "Igor Wiedler",
+ "email": "igor@wiedler.ch"
}
],
- "description": "Simple template engine.",
- "homepage": "https://github.com/sebastianbergmann/php-text-template/",
+ "description": "Événement is a very simple event dispatching library for PHP",
"keywords": [
- "template"
+ "event-dispatcher",
+ "event-emitter"
],
- "time": "2015-06-21T13:50:34+00:00"
+ "support": {
+ "issues": "https://github.com/igorw/evenement/issues",
+ "source": "https://github.com/igorw/evenement/tree/v3.0.2"
+ },
+ "time": "2023-08-08T05:53:35+00:00"
},
{
- "name": "phpunit/php-timer",
- "version": "1.0.9",
+ "name": "fidry/cpu-core-counter",
+ "version": "1.2.0",
"source": {
"type": "git",
- "url": "https://github.com/sebastianbergmann/php-timer.git",
- "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f"
+ "url": "https://github.com/theofidry/cpu-core-counter.git",
+ "reference": "8520451a140d3f46ac33042715115e290cf5785f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
- "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
+ "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/8520451a140d3f46ac33042715115e290cf5785f",
+ "reference": "8520451a140d3f46ac33042715115e290cf5785f",
"shasum": ""
},
"require": {
- "php": "^5.3.3 || ^7.0"
+ "php": "^7.2 || ^8.0"
},
"require-dev": {
- "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
+ "fidry/makefile": "^0.2.0",
+ "fidry/php-cs-fixer-config": "^1.1.2",
+ "phpstan/extension-installer": "^1.2.0",
+ "phpstan/phpstan": "^1.9.2",
+ "phpstan/phpstan-deprecation-rules": "^1.0.0",
+ "phpstan/phpstan-phpunit": "^1.2.2",
+ "phpstan/phpstan-strict-rules": "^1.4.4",
+ "phpunit/phpunit": "^8.5.31 || ^9.5.26",
+ "webmozarts/strict-phpunit": "^7.5"
},
"type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0-dev"
- }
- },
"autoload": {
- "classmap": [
- "src/"
- ]
+ "psr-4": {
+ "Fidry\\CpuCoreCounter\\": "src/"
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
- "BSD-3-Clause"
+ "MIT"
],
"authors": [
{
- "name": "Sebastian Bergmann",
- "email": "sb@sebastian-bergmann.de",
- "role": "lead"
+ "name": "Théo FIDRY",
+ "email": "theo.fidry@gmail.com"
}
],
- "description": "Utility class for timing",
- "homepage": "https://github.com/sebastianbergmann/php-timer/",
+ "description": "Tiny utility to get the number of CPU cores.",
"keywords": [
- "timer"
+ "CPU",
+ "core"
+ ],
+ "support": {
+ "issues": "https://github.com/theofidry/cpu-core-counter/issues",
+ "source": "https://github.com/theofidry/cpu-core-counter/tree/1.2.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/theofidry",
+ "type": "github"
+ }
],
- "time": "2017-02-26T11:10:40+00:00"
+ "time": "2024-08-06T10:04:20+00:00"
},
{
- "name": "phpunit/php-token-stream",
- "version": "1.4.12",
+ "name": "friendsofphp/php-cs-fixer",
+ "version": "v3.65.0",
"source": {
"type": "git",
- "url": "https://github.com/sebastianbergmann/php-token-stream.git",
- "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16"
+ "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
+ "reference": "79d4f3e77b250a7d8043d76c6af8f0695e8a469f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16",
- "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16",
+ "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/79d4f3e77b250a7d8043d76c6af8f0695e8a469f",
+ "reference": "79d4f3e77b250a7d8043d76c6af8f0695e8a469f",
"shasum": ""
},
"require": {
+ "clue/ndjson-react": "^1.0",
+ "composer/semver": "^3.4",
+ "composer/xdebug-handler": "^3.0.3",
+ "ext-filter": "*",
+ "ext-json": "*",
"ext-tokenizer": "*",
- "php": ">=5.3.3"
+ "fidry/cpu-core-counter": "^1.2",
+ "php": "^7.4 || ^8.0",
+ "react/child-process": "^0.6.5",
+ "react/event-loop": "^1.0",
+ "react/promise": "^2.0 || ^3.0",
+ "react/socket": "^1.0",
+ "react/stream": "^1.0",
+ "sebastian/diff": "^4.0 || ^5.0 || ^6.0",
+ "symfony/console": "^5.4 || ^6.0 || ^7.0",
+ "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0",
+ "symfony/filesystem": "^5.4 || ^6.0 || ^7.0",
+ "symfony/finder": "^5.4 || ^6.0 || ^7.0",
+ "symfony/options-resolver": "^5.4 || ^6.0 || ^7.0",
+ "symfony/polyfill-mbstring": "^1.28",
+ "symfony/polyfill-php80": "^1.28",
+ "symfony/polyfill-php81": "^1.28",
+ "symfony/process": "^5.4 || ^6.0 || ^7.0",
+ "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0"
},
"require-dev": {
- "phpunit/phpunit": "~4.2"
+ "facile-it/paraunit": "^1.3.1 || ^2.4",
+ "infection/infection": "^0.29.8",
+ "justinrainbow/json-schema": "^5.3 || ^6.0",
+ "keradus/cli-executor": "^2.1",
+ "mikey179/vfsstream": "^1.6.12",
+ "php-coveralls/php-coveralls": "^2.7",
+ "php-cs-fixer/accessible-object": "^1.1",
+ "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.5",
+ "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.5",
+ "phpunit/phpunit": "^9.6.21 || ^10.5.38 || ^11.4.3",
+ "symfony/var-dumper": "^5.4.47 || ^6.4.15 || ^7.1.8",
+ "symfony/yaml": "^5.4.45 || ^6.4.13 || ^7.1.6"
},
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.4-dev"
- }
+ "suggest": {
+ "ext-dom": "For handling output formats in XML",
+ "ext-mbstring": "For handling non-UTF8 characters."
},
+ "bin": [
+ "php-cs-fixer"
+ ],
+ "type": "application",
"autoload": {
- "classmap": [
- "src/"
+ "psr-4": {
+ "PhpCsFixer\\": "src/"
+ },
+ "exclude-from-classmap": [
+ "src/Fixer/Internal/*"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
- "BSD-3-Clause"
+ "MIT"
],
"authors": [
{
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Dariusz Rumiński",
+ "email": "dariusz.ruminski@gmail.com"
}
],
- "description": "Wrapper around PHP's tokenizer extension.",
- "homepage": "https://github.com/sebastianbergmann/php-token-stream/",
+ "description": "A tool to automatically fix PHP code style",
"keywords": [
- "tokenizer"
+ "Static code analysis",
+ "fixer",
+ "standards",
+ "static analysis"
+ ],
+ "support": {
+ "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
+ "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.65.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/keradus",
+ "type": "github"
+ }
],
- "time": "2017-12-04T08:55:13+00:00"
+ "time": "2024-11-25T00:39:24+00:00"
},
{
- "name": "phpunit/phpunit",
- "version": "4.8.36",
+ "name": "myclabs/deep-copy",
+ "version": "1.12.1",
"source": {
"type": "git",
- "url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "46023de9a91eec7dfb06cc56cb4e260017298517"
+ "url": "https://github.com/myclabs/DeepCopy.git",
+ "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517",
- "reference": "46023de9a91eec7dfb06cc56cb4e260017298517",
+ "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845",
+ "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845",
"shasum": ""
},
"require": {
- "ext-dom": "*",
- "ext-json": "*",
- "ext-pcre": "*",
- "ext-reflection": "*",
- "ext-spl": "*",
- "php": ">=5.3.3",
- "phpspec/prophecy": "^1.3.1",
- "phpunit/php-code-coverage": "~2.1",
- "phpunit/php-file-iterator": "~1.4",
- "phpunit/php-text-template": "~1.2",
- "phpunit/php-timer": "^1.0.6",
- "phpunit/phpunit-mock-objects": "~2.3",
- "sebastian/comparator": "~1.2.2",
- "sebastian/diff": "~1.2",
- "sebastian/environment": "~1.3",
- "sebastian/exporter": "~1.2",
- "sebastian/global-state": "~1.0",
- "sebastian/version": "~1.0",
- "symfony/yaml": "~2.1|~3.0"
+ "php": "^7.1 || ^8.0"
},
- "suggest": {
- "phpunit/php-invoker": "~1.1"
+ "conflict": {
+ "doctrine/collections": "<1.6.8",
+ "doctrine/common": "<2.13.3 || >=3 <3.2.2"
},
- "bin": [
- "phpunit"
- ],
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "4.8.x-dev"
- }
+ "require-dev": {
+ "doctrine/collections": "^1.6.8",
+ "doctrine/common": "^2.13.3 || ^3.2.2",
+ "phpspec/prophecy": "^1.10",
+ "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13"
},
+ "type": "library",
"autoload": {
- "classmap": [
- "src/"
- ]
+ "files": [
+ "src/DeepCopy/deep_copy.php"
+ ],
+ "psr-4": {
+ "DeepCopy\\": "src/DeepCopy/"
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
- "BSD-3-Clause"
+ "MIT"
],
- "authors": [
+ "description": "Create deep copies (clones) of your objects",
+ "keywords": [
+ "clone",
+ "copy",
+ "duplicate",
+ "object",
+ "object graph"
+ ],
+ "support": {
+ "issues": "https://github.com/myclabs/DeepCopy/issues",
+ "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1"
+ },
+ "funding": [
{
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
+ "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy",
+ "type": "tidelift"
}
],
- "description": "The PHP Unit Testing framework.",
- "homepage": "https://phpunit.de/",
- "keywords": [
- "phpunit",
- "testing",
- "xunit"
- ],
- "time": "2017-06-21T08:07:12+00:00"
+ "time": "2024-11-08T17:47:46+00:00"
},
{
- "name": "phpunit/phpunit-mock-objects",
- "version": "2.3.8",
+ "name": "nikic/php-parser",
+ "version": "v5.3.1",
"source": {
"type": "git",
- "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
- "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983"
+ "url": "https://github.com/nikic/PHP-Parser.git",
+ "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983",
- "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983",
+ "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8eea230464783aa9671db8eea6f8c6ac5285794b",
+ "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b",
"shasum": ""
},
"require": {
- "doctrine/instantiator": "^1.0.2",
- "php": ">=5.3.3",
- "phpunit/php-text-template": "~1.2",
- "sebastian/exporter": "~1.2"
+ "ext-ctype": "*",
+ "ext-json": "*",
+ "ext-tokenizer": "*",
+ "php": ">=7.4"
},
"require-dev": {
- "phpunit/phpunit": "~4.4"
- },
- "suggest": {
- "ext-soap": "*"
+ "ircmaxell/php-yacc": "^0.0.7",
+ "phpunit/phpunit": "^9.0"
},
+ "bin": [
+ "bin/php-parse"
+ ],
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3.x-dev"
+ "dev-master": "5.0-dev"
}
},
"autoload": {
- "classmap": [
- "src/"
- ]
+ "psr-4": {
+ "PhpParser\\": "lib/PhpParser"
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -965,46 +1279,77 @@
],
"authors": [
{
- "name": "Sebastian Bergmann",
- "email": "sb@sebastian-bergmann.de",
- "role": "lead"
+ "name": "Nikita Popov"
}
],
- "description": "Mock Object library for PHPUnit",
- "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
+ "description": "A PHP parser written in PHP",
"keywords": [
- "mock",
- "xunit"
+ "parser",
+ "php"
],
- "abandoned": true,
- "time": "2015-10-02T06:51:40+00:00"
+ "support": {
+ "issues": "https://github.com/nikic/PHP-Parser/issues",
+ "source": "https://github.com/nikic/PHP-Parser/tree/v5.3.1"
+ },
+ "time": "2024-10-08T18:51:32+00:00"
},
{
- "name": "psr/log",
- "version": "1.1.0",
+ "name": "overtrue/phplint",
+ "version": "9.5.4",
"source": {
"type": "git",
- "url": "https://github.com/php-fig/log.git",
- "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd"
+ "url": "https://github.com/overtrue/phplint.git",
+ "reference": "7999b43e4a898b8427959585e4960d71bedddb4e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd",
- "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd",
+ "url": "https://api.github.com/repos/overtrue/phplint/zipball/7999b43e4a898b8427959585e4960d71bedddb4e",
+ "reference": "7999b43e4a898b8427959585e4960d71bedddb4e",
"shasum": ""
},
"require": {
- "php": ">=5.3.0"
+ "composer-runtime-api": "^2.0",
+ "ext-dom": "*",
+ "ext-json": "*",
+ "ext-mbstring": "*",
+ "php": "^8.2",
+ "symfony/cache": "^7.0",
+ "symfony/console": "^7.0",
+ "symfony/event-dispatcher": "^7.0",
+ "symfony/finder": "^7.0",
+ "symfony/options-resolver": "^7.0",
+ "symfony/process": "^7.0",
+ "symfony/yaml": "^7.0"
},
+ "require-dev": {
+ "bamarni/composer-bin-plugin": "^1.4",
+ "brainmaestro/composer-git-hooks": "^3.0.0",
+ "jetbrains/phpstorm-stubs": "^2024.1",
+ "php-parallel-lint/php-console-highlighter": "^1.0"
+ },
+ "bin": [
+ "bin/phplint"
+ ],
"type": "library",
"extra": {
+ "bamarni-bin": {
+ "bin-links": true,
+ "target-directory": "vendor-bin",
+ "forward-command": true
+ },
+ "hooks": {
+ "pre-commit": [
+ "composer style:fix",
+ "composer code:check"
+ ]
+ },
"branch-alias": {
- "dev-master": "1.0.x-dev"
+ "dev-main": "9.5.x-dev"
}
},
"autoload": {
"psr-4": {
- "Psr\\Log\\": "Psr/Log/"
+ "Overtrue\\PHPLint\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -1013,45 +1358,60 @@
],
"authors": [
{
- "name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
+ "name": "overtrue",
+ "email": "anzhengchao@gmail.com"
+ },
+ {
+ "name": "Laurent Laville",
+ "homepage": "https://github.com/llaville"
}
],
- "description": "Common interface for logging libraries",
- "homepage": "https://github.com/php-fig/log",
+ "description": "`phplint` is a tool that can speed up linting of php files by running several lint processes at once.",
"keywords": [
- "log",
- "psr",
- "psr-3"
+ "check",
+ "lint",
+ "phplint",
+ "static analysis",
+ "syntax"
+ ],
+ "support": {
+ "issues": "https://github.com/overtrue/phplint/issues",
+ "source": "https://github.com/overtrue/phplint/tree/9.5.4"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/overtrue",
+ "type": "github"
+ }
],
- "time": "2018-11-20T15:27:04+00:00"
+ "time": "2024-11-01T04:32:38+00:00"
},
{
- "name": "sebastian/comparator",
- "version": "1.2.4",
+ "name": "phar-io/manifest",
+ "version": "2.0.4",
"source": {
"type": "git",
- "url": "https://github.com/sebastianbergmann/comparator.git",
- "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be"
+ "url": "https://github.com/phar-io/manifest.git",
+ "reference": "54750ef60c58e43759730615a392c31c80e23176"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
- "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
+ "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176",
+ "reference": "54750ef60c58e43759730615a392c31c80e23176",
"shasum": ""
},
"require": {
- "php": ">=5.3.3",
- "sebastian/diff": "~1.2",
- "sebastian/exporter": "~1.2 || ~2.0"
- },
- "require-dev": {
- "phpunit/phpunit": "~4.4"
+ "ext-dom": "*",
+ "ext-libxml": "*",
+ "ext-phar": "*",
+ "ext-xmlwriter": "*",
+ "phar-io/version": "^3.0.1",
+ "php": "^7.2 || ^8.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.2.x-dev"
+ "dev-master": "2.0.x-dev"
}
},
"autoload": {
@@ -1065,57 +1425,52 @@
],
"authors": [
{
- "name": "Jeff Welch",
- "email": "whatthejeff@gmail.com"
- },
- {
- "name": "Volker Dusch",
- "email": "github@wallbash.com"
+ "name": "Arne Blankerts",
+ "email": "arne@blankerts.de",
+ "role": "Developer"
},
{
- "name": "Bernhard Schussek",
- "email": "bschussek@2bepublished.at"
+ "name": "Sebastian Heuer",
+ "email": "sebastian@phpeople.de",
+ "role": "Developer"
},
{
"name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
+ "email": "sebastian@phpunit.de",
+ "role": "Developer"
}
],
- "description": "Provides the functionality to compare PHP values for equality",
- "homepage": "http://www.github.com/sebastianbergmann/comparator",
- "keywords": [
- "comparator",
- "compare",
- "equality"
+ "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)",
+ "support": {
+ "issues": "https://github.com/phar-io/manifest/issues",
+ "source": "https://github.com/phar-io/manifest/tree/2.0.4"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/theseer",
+ "type": "github"
+ }
],
- "time": "2017-01-29T09:50:25+00:00"
+ "time": "2024-03-03T12:33:53+00:00"
},
{
- "name": "sebastian/diff",
- "version": "1.4.3",
+ "name": "phar-io/version",
+ "version": "3.2.1",
"source": {
"type": "git",
- "url": "https://github.com/sebastianbergmann/diff.git",
- "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4"
+ "url": "https://github.com/phar-io/version.git",
+ "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4",
- "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4",
+ "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74",
+ "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74",
"shasum": ""
},
"require": {
- "php": "^5.3.3 || ^7.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
+ "php": "^7.2 || ^8.0"
},
"type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.4-dev"
- }
- },
"autoload": {
"classmap": [
"src/"
@@ -1127,45 +1482,68 @@
],
"authors": [
{
- "name": "Kore Nordmann",
- "email": "mail@kore-nordmann.de"
+ "name": "Arne Blankerts",
+ "email": "arne@blankerts.de",
+ "role": "Developer"
+ },
+ {
+ "name": "Sebastian Heuer",
+ "email": "sebastian@phpeople.de",
+ "role": "Developer"
},
{
"name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
+ "email": "sebastian@phpunit.de",
+ "role": "Developer"
}
],
- "description": "Diff implementation",
- "homepage": "https://github.com/sebastianbergmann/diff",
- "keywords": [
- "diff"
- ],
- "time": "2017-05-22T07:24:03+00:00"
+ "description": "Library for handling version information and constraints",
+ "support": {
+ "issues": "https://github.com/phar-io/version/issues",
+ "source": "https://github.com/phar-io/version/tree/3.2.1"
+ },
+ "time": "2022-02-21T01:04:05+00:00"
},
{
- "name": "sebastian/environment",
- "version": "1.3.8",
+ "name": "phpunit/php-code-coverage",
+ "version": "9.2.32",
"source": {
"type": "git",
- "url": "https://github.com/sebastianbergmann/environment.git",
- "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea"
+ "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
+ "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea",
- "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5",
+ "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5",
"shasum": ""
},
"require": {
- "php": "^5.3.3 || ^7.0"
+ "ext-dom": "*",
+ "ext-libxml": "*",
+ "ext-xmlwriter": "*",
+ "nikic/php-parser": "^4.19.1 || ^5.1.0",
+ "php": ">=7.3",
+ "phpunit/php-file-iterator": "^3.0.6",
+ "phpunit/php-text-template": "^2.0.4",
+ "sebastian/code-unit-reverse-lookup": "^2.0.3",
+ "sebastian/complexity": "^2.0.3",
+ "sebastian/environment": "^5.1.5",
+ "sebastian/lines-of-code": "^1.0.4",
+ "sebastian/version": "^3.0.2",
+ "theseer/tokenizer": "^1.2.3"
},
"require-dev": {
- "phpunit/phpunit": "^4.8 || ^5.0"
+ "phpunit/phpunit": "^9.6"
+ },
+ "suggest": {
+ "ext-pcov": "PHP extension that provides line coverage",
+ "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.3.x-dev"
+ "dev-main": "9.2.x-dev"
}
},
"autoload": {
@@ -1180,44 +1558,54 @@
"authors": [
{
"name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
}
],
- "description": "Provides functionality to handle HHVM/PHP environments",
- "homepage": "http://www.github.com/sebastianbergmann/environment",
+ "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
+ "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
"keywords": [
- "Xdebug",
- "environment",
- "hhvm"
+ "coverage",
+ "testing",
+ "xunit"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
+ "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
+ "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
],
- "time": "2016-08-18T05:49:44+00:00"
+ "time": "2024-08-22T04:23:01+00:00"
},
{
- "name": "sebastian/exporter",
- "version": "1.2.2",
+ "name": "phpunit/php-file-iterator",
+ "version": "3.0.6",
"source": {
"type": "git",
- "url": "https://github.com/sebastianbergmann/exporter.git",
- "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4"
+ "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
+ "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4",
- "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf",
+ "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf",
"shasum": ""
},
"require": {
- "php": ">=5.3.3",
- "sebastian/recursion-context": "~1.0"
+ "php": ">=7.3"
},
"require-dev": {
- "ext-mbstring": "*",
- "phpunit/phpunit": "~4.4"
+ "phpunit/phpunit": "^9.3"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.3.x-dev"
+ "dev-master": "3.0-dev"
}
},
"autoload": {
@@ -1230,62 +1618,58 @@
"BSD-3-Clause"
],
"authors": [
- {
- "name": "Jeff Welch",
- "email": "whatthejeff@gmail.com"
- },
- {
- "name": "Volker Dusch",
- "email": "github@wallbash.com"
- },
- {
- "name": "Bernhard Schussek",
- "email": "bschussek@2bepublished.at"
- },
{
"name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- },
- {
- "name": "Adam Harvey",
- "email": "aharvey@php.net"
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
}
],
- "description": "Provides the functionality to export PHP variables for visualization",
- "homepage": "http://www.github.com/sebastianbergmann/exporter",
+ "description": "FilterIterator implementation that filters files based on a list of suffixes.",
+ "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
"keywords": [
- "export",
- "exporter"
+ "filesystem",
+ "iterator"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues",
+ "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
],
- "time": "2016-06-17T09:04:28+00:00"
+ "time": "2021-12-02T12:48:52+00:00"
},
{
- "name": "sebastian/global-state",
- "version": "1.1.1",
+ "name": "phpunit/php-invoker",
+ "version": "3.1.1",
"source": {
"type": "git",
- "url": "https://github.com/sebastianbergmann/global-state.git",
- "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4"
+ "url": "https://github.com/sebastianbergmann/php-invoker.git",
+ "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4",
- "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67",
+ "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": ">=7.3"
},
"require-dev": {
- "phpunit/phpunit": "~4.2"
+ "ext-pcntl": "*",
+ "phpunit/phpunit": "^9.3"
},
"suggest": {
- "ext-uopz": "*"
+ "ext-pcntl": "*"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.0-dev"
+ "dev-master": "3.1-dev"
}
},
"autoload": {
@@ -1300,40 +1684,51 @@
"authors": [
{
"name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
}
],
- "description": "Snapshotting of global state",
- "homepage": "http://www.github.com/sebastianbergmann/global-state",
+ "description": "Invoke callables with a timeout",
+ "homepage": "https://github.com/sebastianbergmann/php-invoker/",
"keywords": [
- "global state"
+ "process"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-invoker/issues",
+ "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
],
- "time": "2015-10-12T03:26:01+00:00"
+ "time": "2020-09-28T05:58:55+00:00"
},
{
- "name": "sebastian/recursion-context",
- "version": "1.0.5",
+ "name": "phpunit/php-text-template",
+ "version": "2.0.4",
"source": {
"type": "git",
- "url": "https://github.com/sebastianbergmann/recursion-context.git",
- "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7"
+ "url": "https://github.com/sebastianbergmann/php-text-template.git",
+ "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7",
- "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28",
+ "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": ">=7.3"
},
"require-dev": {
- "phpunit/phpunit": "~4.4"
+ "phpunit/phpunit": "^9.3"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.0.x-dev"
+ "dev-master": "2.0-dev"
}
},
"autoload": {
@@ -1346,38 +1741,55 @@
"BSD-3-Clause"
],
"authors": [
- {
- "name": "Jeff Welch",
- "email": "whatthejeff@gmail.com"
- },
{
"name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- },
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Simple template engine.",
+ "homepage": "https://github.com/sebastianbergmann/php-text-template/",
+ "keywords": [
+ "template"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-text-template/issues",
+ "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4"
+ },
+ "funding": [
{
- "name": "Adam Harvey",
- "email": "aharvey@php.net"
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
}
],
- "description": "Provides functionality to recursively process PHP variables",
- "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
- "time": "2016-10-03T07:41:43+00:00"
+ "time": "2020-10-26T05:33:50+00:00"
},
{
- "name": "sebastian/version",
- "version": "1.0.6",
+ "name": "phpunit/php-timer",
+ "version": "5.0.3",
"source": {
"type": "git",
- "url": "https://github.com/sebastianbergmann/version.git",
- "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6"
+ "url": "https://github.com/sebastianbergmann/php-timer.git",
+ "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
- "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2",
+ "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2",
"shasum": ""
},
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "5.0-dev"
+ }
+ },
"autoload": {
"classmap": [
"src/"
@@ -1394,68 +1806,85 @@
"role": "lead"
}
],
- "description": "Library that helps with managing the version number of Git-hosted PHP projects",
- "homepage": "https://github.com/sebastianbergmann/version",
- "time": "2015-06-21T13:59:46+00:00"
+ "description": "Utility class for timing",
+ "homepage": "https://github.com/sebastianbergmann/php-timer/",
+ "keywords": [
+ "timer"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-timer/issues",
+ "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-10-26T13:16:10+00:00"
},
{
- "name": "squizlabs/php_codesniffer",
- "version": "2.9.2",
+ "name": "phpunit/phpunit",
+ "version": "9.6.21",
"source": {
"type": "git",
- "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
- "reference": "2acf168de78487db620ab4bc524135a13cfe6745"
+ "url": "https://github.com/sebastianbergmann/phpunit.git",
+ "reference": "de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/2acf168de78487db620ab4bc524135a13cfe6745",
- "reference": "2acf168de78487db620ab4bc524135a13cfe6745",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa",
+ "reference": "de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa",
"shasum": ""
},
"require": {
- "ext-simplexml": "*",
- "ext-tokenizer": "*",
+ "doctrine/instantiator": "^1.5.0 || ^2",
+ "ext-dom": "*",
+ "ext-json": "*",
+ "ext-libxml": "*",
+ "ext-mbstring": "*",
+ "ext-xml": "*",
"ext-xmlwriter": "*",
- "php": ">=5.1.2"
+ "myclabs/deep-copy": "^1.12.0",
+ "phar-io/manifest": "^2.0.4",
+ "phar-io/version": "^3.2.1",
+ "php": ">=7.3",
+ "phpunit/php-code-coverage": "^9.2.32",
+ "phpunit/php-file-iterator": "^3.0.6",
+ "phpunit/php-invoker": "^3.1.1",
+ "phpunit/php-text-template": "^2.0.4",
+ "phpunit/php-timer": "^5.0.3",
+ "sebastian/cli-parser": "^1.0.2",
+ "sebastian/code-unit": "^1.0.8",
+ "sebastian/comparator": "^4.0.8",
+ "sebastian/diff": "^4.0.6",
+ "sebastian/environment": "^5.1.5",
+ "sebastian/exporter": "^4.0.6",
+ "sebastian/global-state": "^5.0.7",
+ "sebastian/object-enumerator": "^4.0.4",
+ "sebastian/resource-operations": "^3.0.4",
+ "sebastian/type": "^3.2.1",
+ "sebastian/version": "^3.0.2"
},
- "require-dev": {
- "phpunit/phpunit": "~4.0"
+ "suggest": {
+ "ext-soap": "To be able to generate mocks based on WSDL files",
+ "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage"
},
"bin": [
- "scripts/phpcs",
- "scripts/phpcbf"
+ "phpunit"
],
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.x-dev"
+ "dev-master": "9.6-dev"
}
},
"autoload": {
+ "files": [
+ "src/Framework/Assert/Functions.php"
+ ],
"classmap": [
- "CodeSniffer.php",
- "CodeSniffer/CLI.php",
- "CodeSniffer/Exception.php",
- "CodeSniffer/File.php",
- "CodeSniffer/Fixer.php",
- "CodeSniffer/Report.php",
- "CodeSniffer/Reporting.php",
- "CodeSniffer/Sniff.php",
- "CodeSniffer/Tokens.php",
- "CodeSniffer/Reports/",
- "CodeSniffer/Tokenizers/",
- "CodeSniffer/DocGenerators/",
- "CodeSniffer/Standards/AbstractPatternSniff.php",
- "CodeSniffer/Standards/AbstractScopeSniff.php",
- "CodeSniffer/Standards/AbstractVariableSniff.php",
- "CodeSniffer/Standards/IncorrectPatternException.php",
- "CodeSniffer/Standards/Generic/Sniffs/",
- "CodeSniffer/Standards/MySource/Sniffs/",
- "CodeSniffer/Standards/PEAR/Sniffs/",
- "CodeSniffer/Standards/PSR1/Sniffs/",
- "CodeSniffer/Standards/PSR2/Sniffs/",
- "CodeSniffer/Standards/Squiz/Sniffs/",
- "CodeSniffer/Standards/Zend/Sniffs/"
+ "src/"
]
},
"notification-url": "https://packagist.org/downloads/",
@@ -1464,71 +1893,115 @@
],
"authors": [
{
- "name": "Greg Sherwood",
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
"role": "lead"
}
],
- "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
- "homepage": "http://www.squizlabs.com/php-codesniffer",
+ "description": "The PHP Unit Testing framework.",
+ "homepage": "https://phpunit.de/",
"keywords": [
- "phpcs",
- "standards"
+ "phpunit",
+ "testing",
+ "xunit"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/phpunit/issues",
+ "security": "https://github.com/sebastianbergmann/phpunit/security/policy",
+ "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.21"
+ },
+ "funding": [
+ {
+ "url": "https://phpunit.de/sponsors.html",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit",
+ "type": "tidelift"
+ }
],
- "time": "2018-11-07T22:31:41+00:00"
+ "time": "2024-09-19T10:50:18+00:00"
},
{
- "name": "symfony/console",
- "version": "v3.4.26",
+ "name": "psr/cache",
+ "version": "3.0.0",
"source": {
"type": "git",
- "url": "https://github.com/symfony/console.git",
- "reference": "15a9104356436cb26e08adab97706654799d31d8"
+ "url": "https://github.com/php-fig/cache.git",
+ "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/15a9104356436cb26e08adab97706654799d31d8",
- "reference": "15a9104356436cb26e08adab97706654799d31d8",
+ "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf",
+ "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf",
"shasum": ""
},
"require": {
- "php": "^5.5.9|>=7.0.8",
- "symfony/debug": "~2.8|~3.0|~4.0",
- "symfony/polyfill-mbstring": "~1.0"
+ "php": ">=8.0.0"
},
- "conflict": {
- "symfony/dependency-injection": "<3.4",
- "symfony/process": "<3.3"
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
},
- "provide": {
- "psr/log-implementation": "1.0"
+ "autoload": {
+ "psr-4": {
+ "Psr\\Cache\\": "src/"
+ }
},
- "require-dev": {
- "psr/log": "~1.0",
- "symfony/config": "~3.3|~4.0",
- "symfony/dependency-injection": "~3.4|~4.0",
- "symfony/event-dispatcher": "~2.8|~3.0|~4.0",
- "symfony/lock": "~3.4|~4.0",
- "symfony/process": "~3.3|~4.0"
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for caching libraries",
+ "keywords": [
+ "cache",
+ "psr",
+ "psr-6"
+ ],
+ "support": {
+ "source": "https://github.com/php-fig/cache/tree/3.0.0"
},
- "suggest": {
- "psr/log": "For using the console logger",
- "symfony/event-dispatcher": "",
- "symfony/lock": "",
- "symfony/process": ""
+ "time": "2021-02-03T23:26:27+00:00"
+ },
+ {
+ "name": "psr/container",
+ "version": "2.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/container.git",
+ "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963",
+ "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.4.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.4-dev"
+ "dev-master": "2.0.x-dev"
}
},
"autoload": {
"psr-4": {
- "Symfony\\Component\\Console\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
+ "Psr\\Container\\": "src/"
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -1536,117 +2009,2588 @@
],
"authors": [
{
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
}
],
- "description": "Symfony Console Component",
- "homepage": "https://symfony.com",
- "time": "2019-04-08T09:29:13+00:00"
+ "description": "Common Container Interface (PHP FIG PSR-11)",
+ "homepage": "https://github.com/php-fig/container",
+ "keywords": [
+ "PSR-11",
+ "container",
+ "container-interface",
+ "container-interop",
+ "psr"
+ ],
+ "support": {
+ "issues": "https://github.com/php-fig/container/issues",
+ "source": "https://github.com/php-fig/container/tree/2.0.2"
+ },
+ "time": "2021-11-05T16:47:00+00:00"
},
{
- "name": "symfony/debug",
- "version": "v3.4.26",
+ "name": "psr/event-dispatcher",
+ "version": "1.0.0",
"source": {
"type": "git",
- "url": "https://github.com/symfony/debug.git",
- "reference": "681afbb26488903c5ac15e63734f1d8ac430c9b9"
+ "url": "https://github.com/php-fig/event-dispatcher.git",
+ "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/debug/zipball/681afbb26488903c5ac15e63734f1d8ac430c9b9",
- "reference": "681afbb26488903c5ac15e63734f1d8ac430c9b9",
+ "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0",
+ "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0",
"shasum": ""
},
"require": {
- "php": "^5.5.9|>=7.0.8",
- "psr/log": "~1.0"
+ "php": ">=7.2.0"
},
- "conflict": {
- "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2"
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
},
- "require-dev": {
- "symfony/http-kernel": "~2.8|~3.0|~4.0"
+ "autoload": {
+ "psr-4": {
+ "Psr\\EventDispatcher\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
+ }
+ ],
+ "description": "Standard interfaces for event handling.",
+ "keywords": [
+ "events",
+ "psr",
+ "psr-14"
+ ],
+ "support": {
+ "issues": "https://github.com/php-fig/event-dispatcher/issues",
+ "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0"
+ },
+ "time": "2019-01-08T18:20:26+00:00"
+ },
+ {
+ "name": "psr/log",
+ "version": "3.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/log.git",
+ "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
+ "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.0.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.4-dev"
+ "dev-master": "3.x-dev"
}
},
"autoload": {
"psr-4": {
- "Symfony\\Component\\Debug\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
+ "Psr\\Log\\": "src"
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
- "authors": [
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for logging libraries",
+ "homepage": "https://github.com/php-fig/log",
+ "keywords": [
+ "log",
+ "psr",
+ "psr-3"
+ ],
+ "support": {
+ "source": "https://github.com/php-fig/log/tree/3.0.2"
+ },
+ "time": "2024-09-11T13:17:53+00:00"
+ },
+ {
+ "name": "react/cache",
+ "version": "v1.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/reactphp/cache.git",
+ "reference": "d47c472b64aa5608225f47965a484b75c7817d5b"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/reactphp/cache/zipball/d47c472b64aa5608225f47965a484b75c7817d5b",
+ "reference": "d47c472b64aa5608225f47965a484b75c7817d5b",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0",
+ "react/promise": "^3.0 || ^2.0 || ^1.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "React\\Cache\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Christian Lück",
+ "email": "christian@clue.engineering",
+ "homepage": "https://clue.engineering/"
+ },
+ {
+ "name": "Cees-Jan Kiewiet",
+ "email": "reactphp@ceesjankiewiet.nl",
+ "homepage": "https://wyrihaximus.net/"
+ },
+ {
+ "name": "Jan Sorgalla",
+ "email": "jsorgalla@gmail.com",
+ "homepage": "https://sorgalla.com/"
+ },
+ {
+ "name": "Chris Boden",
+ "email": "cboden@gmail.com",
+ "homepage": "https://cboden.dev/"
+ }
+ ],
+ "description": "Async, Promise-based cache interface for ReactPHP",
+ "keywords": [
+ "cache",
+ "caching",
+ "promise",
+ "reactphp"
+ ],
+ "support": {
+ "issues": "https://github.com/reactphp/cache/issues",
+ "source": "https://github.com/reactphp/cache/tree/v1.2.0"
+ },
+ "funding": [
+ {
+ "url": "https://opencollective.com/reactphp",
+ "type": "open_collective"
+ }
+ ],
+ "time": "2022-11-30T15:59:55+00:00"
+ },
+ {
+ "name": "react/child-process",
+ "version": "v0.6.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/reactphp/child-process.git",
+ "reference": "e71eb1aa55f057c7a4a0d08d06b0b0a484bead43"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/reactphp/child-process/zipball/e71eb1aa55f057c7a4a0d08d06b0b0a484bead43",
+ "reference": "e71eb1aa55f057c7a4a0d08d06b0b0a484bead43",
+ "shasum": ""
+ },
+ "require": {
+ "evenement/evenement": "^3.0 || ^2.0 || ^1.0",
+ "php": ">=5.3.0",
+ "react/event-loop": "^1.2",
+ "react/stream": "^1.2"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35",
+ "react/socket": "^1.8",
+ "sebastian/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "React\\ChildProcess\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Christian Lück",
+ "email": "christian@clue.engineering",
+ "homepage": "https://clue.engineering/"
+ },
+ {
+ "name": "Cees-Jan Kiewiet",
+ "email": "reactphp@ceesjankiewiet.nl",
+ "homepage": "https://wyrihaximus.net/"
+ },
+ {
+ "name": "Jan Sorgalla",
+ "email": "jsorgalla@gmail.com",
+ "homepage": "https://sorgalla.com/"
+ },
+ {
+ "name": "Chris Boden",
+ "email": "cboden@gmail.com",
+ "homepage": "https://cboden.dev/"
+ }
+ ],
+ "description": "Event-driven library for executing child processes with ReactPHP.",
+ "keywords": [
+ "event-driven",
+ "process",
+ "reactphp"
+ ],
+ "support": {
+ "issues": "https://github.com/reactphp/child-process/issues",
+ "source": "https://github.com/reactphp/child-process/tree/v0.6.5"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/WyriHaximus",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/clue",
+ "type": "github"
+ }
+ ],
+ "time": "2022-09-16T13:41:56+00:00"
+ },
+ {
+ "name": "react/dns",
+ "version": "v1.13.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/reactphp/dns.git",
+ "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/reactphp/dns/zipball/eb8ae001b5a455665c89c1df97f6fb682f8fb0f5",
+ "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0",
+ "react/cache": "^1.0 || ^0.6 || ^0.5",
+ "react/event-loop": "^1.2",
+ "react/promise": "^3.2 || ^2.7 || ^1.2.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36",
+ "react/async": "^4.3 || ^3 || ^2",
+ "react/promise-timer": "^1.11"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "React\\Dns\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Christian Lück",
+ "email": "christian@clue.engineering",
+ "homepage": "https://clue.engineering/"
+ },
+ {
+ "name": "Cees-Jan Kiewiet",
+ "email": "reactphp@ceesjankiewiet.nl",
+ "homepage": "https://wyrihaximus.net/"
+ },
+ {
+ "name": "Jan Sorgalla",
+ "email": "jsorgalla@gmail.com",
+ "homepage": "https://sorgalla.com/"
+ },
+ {
+ "name": "Chris Boden",
+ "email": "cboden@gmail.com",
+ "homepage": "https://cboden.dev/"
+ }
+ ],
+ "description": "Async DNS resolver for ReactPHP",
+ "keywords": [
+ "async",
+ "dns",
+ "dns-resolver",
+ "reactphp"
+ ],
+ "support": {
+ "issues": "https://github.com/reactphp/dns/issues",
+ "source": "https://github.com/reactphp/dns/tree/v1.13.0"
+ },
+ "funding": [
+ {
+ "url": "https://opencollective.com/reactphp",
+ "type": "open_collective"
+ }
+ ],
+ "time": "2024-06-13T14:18:03+00:00"
+ },
+ {
+ "name": "react/event-loop",
+ "version": "v1.5.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/reactphp/event-loop.git",
+ "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/reactphp/event-loop/zipball/bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354",
+ "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36"
+ },
+ "suggest": {
+ "ext-pcntl": "For signal handling support when using the StreamSelectLoop"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "React\\EventLoop\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Christian Lück",
+ "email": "christian@clue.engineering",
+ "homepage": "https://clue.engineering/"
+ },
+ {
+ "name": "Cees-Jan Kiewiet",
+ "email": "reactphp@ceesjankiewiet.nl",
+ "homepage": "https://wyrihaximus.net/"
+ },
+ {
+ "name": "Jan Sorgalla",
+ "email": "jsorgalla@gmail.com",
+ "homepage": "https://sorgalla.com/"
+ },
+ {
+ "name": "Chris Boden",
+ "email": "cboden@gmail.com",
+ "homepage": "https://cboden.dev/"
+ }
+ ],
+ "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.",
+ "keywords": [
+ "asynchronous",
+ "event-loop"
+ ],
+ "support": {
+ "issues": "https://github.com/reactphp/event-loop/issues",
+ "source": "https://github.com/reactphp/event-loop/tree/v1.5.0"
+ },
+ "funding": [
+ {
+ "url": "https://opencollective.com/reactphp",
+ "type": "open_collective"
+ }
+ ],
+ "time": "2023-11-13T13:48:05+00:00"
+ },
+ {
+ "name": "react/promise",
+ "version": "v3.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/reactphp/promise.git",
+ "reference": "8a164643313c71354582dc850b42b33fa12a4b63"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/reactphp/promise/zipball/8a164643313c71354582dc850b42b33fa12a4b63",
+ "reference": "8a164643313c71354582dc850b42b33fa12a4b63",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1.0"
+ },
+ "require-dev": {
+ "phpstan/phpstan": "1.10.39 || 1.4.10",
+ "phpunit/phpunit": "^9.6 || ^7.5"
+ },
+ "type": "library",
+ "autoload": {
+ "files": [
+ "src/functions_include.php"
+ ],
+ "psr-4": {
+ "React\\Promise\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jan Sorgalla",
+ "email": "jsorgalla@gmail.com",
+ "homepage": "https://sorgalla.com/"
+ },
+ {
+ "name": "Christian Lück",
+ "email": "christian@clue.engineering",
+ "homepage": "https://clue.engineering/"
+ },
+ {
+ "name": "Cees-Jan Kiewiet",
+ "email": "reactphp@ceesjankiewiet.nl",
+ "homepage": "https://wyrihaximus.net/"
+ },
+ {
+ "name": "Chris Boden",
+ "email": "cboden@gmail.com",
+ "homepage": "https://cboden.dev/"
+ }
+ ],
+ "description": "A lightweight implementation of CommonJS Promises/A for PHP",
+ "keywords": [
+ "promise",
+ "promises"
+ ],
+ "support": {
+ "issues": "https://github.com/reactphp/promise/issues",
+ "source": "https://github.com/reactphp/promise/tree/v3.2.0"
+ },
+ "funding": [
+ {
+ "url": "https://opencollective.com/reactphp",
+ "type": "open_collective"
+ }
+ ],
+ "time": "2024-05-24T10:39:05+00:00"
+ },
+ {
+ "name": "react/socket",
+ "version": "v1.16.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/reactphp/socket.git",
+ "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/reactphp/socket/zipball/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1",
+ "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1",
+ "shasum": ""
+ },
+ "require": {
+ "evenement/evenement": "^3.0 || ^2.0 || ^1.0",
+ "php": ">=5.3.0",
+ "react/dns": "^1.13",
+ "react/event-loop": "^1.2",
+ "react/promise": "^3.2 || ^2.6 || ^1.2.1",
+ "react/stream": "^1.4"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36",
+ "react/async": "^4.3 || ^3.3 || ^2",
+ "react/promise-stream": "^1.4",
+ "react/promise-timer": "^1.11"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "React\\Socket\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Christian Lück",
+ "email": "christian@clue.engineering",
+ "homepage": "https://clue.engineering/"
+ },
+ {
+ "name": "Cees-Jan Kiewiet",
+ "email": "reactphp@ceesjankiewiet.nl",
+ "homepage": "https://wyrihaximus.net/"
+ },
+ {
+ "name": "Jan Sorgalla",
+ "email": "jsorgalla@gmail.com",
+ "homepage": "https://sorgalla.com/"
+ },
+ {
+ "name": "Chris Boden",
+ "email": "cboden@gmail.com",
+ "homepage": "https://cboden.dev/"
+ }
+ ],
+ "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP",
+ "keywords": [
+ "Connection",
+ "Socket",
+ "async",
+ "reactphp",
+ "stream"
+ ],
+ "support": {
+ "issues": "https://github.com/reactphp/socket/issues",
+ "source": "https://github.com/reactphp/socket/tree/v1.16.0"
+ },
+ "funding": [
+ {
+ "url": "https://opencollective.com/reactphp",
+ "type": "open_collective"
+ }
+ ],
+ "time": "2024-07-26T10:38:09+00:00"
+ },
+ {
+ "name": "react/stream",
+ "version": "v1.4.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/reactphp/stream.git",
+ "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d",
+ "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d",
+ "shasum": ""
+ },
+ "require": {
+ "evenement/evenement": "^3.0 || ^2.0 || ^1.0",
+ "php": ">=5.3.8",
+ "react/event-loop": "^1.2"
+ },
+ "require-dev": {
+ "clue/stream-filter": "~1.2",
+ "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "React\\Stream\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Christian Lück",
+ "email": "christian@clue.engineering",
+ "homepage": "https://clue.engineering/"
+ },
+ {
+ "name": "Cees-Jan Kiewiet",
+ "email": "reactphp@ceesjankiewiet.nl",
+ "homepage": "https://wyrihaximus.net/"
+ },
+ {
+ "name": "Jan Sorgalla",
+ "email": "jsorgalla@gmail.com",
+ "homepage": "https://sorgalla.com/"
+ },
+ {
+ "name": "Chris Boden",
+ "email": "cboden@gmail.com",
+ "homepage": "https://cboden.dev/"
+ }
+ ],
+ "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP",
+ "keywords": [
+ "event-driven",
+ "io",
+ "non-blocking",
+ "pipe",
+ "reactphp",
+ "readable",
+ "stream",
+ "writable"
+ ],
+ "support": {
+ "issues": "https://github.com/reactphp/stream/issues",
+ "source": "https://github.com/reactphp/stream/tree/v1.4.0"
+ },
+ "funding": [
+ {
+ "url": "https://opencollective.com/reactphp",
+ "type": "open_collective"
+ }
+ ],
+ "time": "2024-06-11T12:45:25+00:00"
+ },
+ {
+ "name": "sebastian/cli-parser",
+ "version": "1.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/cli-parser.git",
+ "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b",
+ "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library for parsing CLI options",
+ "homepage": "https://github.com/sebastianbergmann/cli-parser",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/cli-parser/issues",
+ "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2024-03-02T06:27:43+00:00"
+ },
+ {
+ "name": "sebastian/code-unit",
+ "version": "1.0.8",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/code-unit.git",
+ "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120",
+ "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Collection of value objects that represent the PHP code units",
+ "homepage": "https://github.com/sebastianbergmann/code-unit",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/code-unit/issues",
+ "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-10-26T13:08:54+00:00"
+ },
+ {
+ "name": "sebastian/code-unit-reverse-lookup",
+ "version": "2.0.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
+ "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5",
+ "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Looks up which function or method a line of code belongs to",
+ "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues",
+ "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-09-28T05:30:19+00:00"
+ },
+ {
+ "name": "sebastian/comparator",
+ "version": "4.0.8",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/comparator.git",
+ "reference": "fa0f136dd2334583309d32b62544682ee972b51a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a",
+ "reference": "fa0f136dd2334583309d32b62544682ee972b51a",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3",
+ "sebastian/diff": "^4.0",
+ "sebastian/exporter": "^4.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Volker Dusch",
+ "email": "github@wallbash.com"
+ },
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@2bepublished.at"
+ }
+ ],
+ "description": "Provides the functionality to compare PHP values for equality",
+ "homepage": "https://github.com/sebastianbergmann/comparator",
+ "keywords": [
+ "comparator",
+ "compare",
+ "equality"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/comparator/issues",
+ "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2022-09-14T12:41:17+00:00"
+ },
+ {
+ "name": "sebastian/complexity",
+ "version": "2.0.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/complexity.git",
+ "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a",
+ "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a",
+ "shasum": ""
+ },
+ "require": {
+ "nikic/php-parser": "^4.18 || ^5.0",
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library for calculating the complexity of PHP code units",
+ "homepage": "https://github.com/sebastianbergmann/complexity",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/complexity/issues",
+ "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-12-22T06:19:30+00:00"
+ },
+ {
+ "name": "sebastian/diff",
+ "version": "4.0.6",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/diff.git",
+ "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc",
+ "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3",
+ "symfony/process": "^4.2 || ^5"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Kore Nordmann",
+ "email": "mail@kore-nordmann.de"
+ }
+ ],
+ "description": "Diff implementation",
+ "homepage": "https://github.com/sebastianbergmann/diff",
+ "keywords": [
+ "diff",
+ "udiff",
+ "unidiff",
+ "unified diff"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/diff/issues",
+ "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2024-03-02T06:30:58+00:00"
+ },
+ {
+ "name": "sebastian/environment",
+ "version": "5.1.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/environment.git",
+ "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed",
+ "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "suggest": {
+ "ext-posix": "*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "5.1-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Provides functionality to handle HHVM/PHP environments",
+ "homepage": "http://www.github.com/sebastianbergmann/environment",
+ "keywords": [
+ "Xdebug",
+ "environment",
+ "hhvm"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/environment/issues",
+ "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T06:03:51+00:00"
+ },
+ {
+ "name": "sebastian/exporter",
+ "version": "4.0.6",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/exporter.git",
+ "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72",
+ "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3",
+ "sebastian/recursion-context": "^4.0"
+ },
+ "require-dev": {
+ "ext-mbstring": "*",
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Volker Dusch",
+ "email": "github@wallbash.com"
+ },
+ {
+ "name": "Adam Harvey",
+ "email": "aharvey@php.net"
+ },
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@gmail.com"
+ }
+ ],
+ "description": "Provides the functionality to export PHP variables for visualization",
+ "homepage": "https://www.github.com/sebastianbergmann/exporter",
+ "keywords": [
+ "export",
+ "exporter"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/exporter/issues",
+ "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2024-03-02T06:33:00+00:00"
+ },
+ {
+ "name": "sebastian/global-state",
+ "version": "5.0.7",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/global-state.git",
+ "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9",
+ "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3",
+ "sebastian/object-reflector": "^2.0",
+ "sebastian/recursion-context": "^4.0"
+ },
+ "require-dev": {
+ "ext-dom": "*",
+ "phpunit/phpunit": "^9.3"
+ },
+ "suggest": {
+ "ext-uopz": "*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "5.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Snapshotting of global state",
+ "homepage": "http://www.github.com/sebastianbergmann/global-state",
+ "keywords": [
+ "global state"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/global-state/issues",
+ "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2024-03-02T06:35:11+00:00"
+ },
+ {
+ "name": "sebastian/lines-of-code",
+ "version": "1.0.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/lines-of-code.git",
+ "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5",
+ "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5",
+ "shasum": ""
+ },
+ "require": {
+ "nikic/php-parser": "^4.18 || ^5.0",
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library for counting the lines of code in PHP source code",
+ "homepage": "https://github.com/sebastianbergmann/lines-of-code",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/lines-of-code/issues",
+ "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-12-22T06:20:34+00:00"
+ },
+ {
+ "name": "sebastian/object-enumerator",
+ "version": "4.0.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/object-enumerator.git",
+ "reference": "5c9eeac41b290a3712d88851518825ad78f45c71"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71",
+ "reference": "5c9eeac41b290a3712d88851518825ad78f45c71",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3",
+ "sebastian/object-reflector": "^2.0",
+ "sebastian/recursion-context": "^4.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Traverses array structures and object graphs to enumerate all referenced objects",
+ "homepage": "https://github.com/sebastianbergmann/object-enumerator/",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/object-enumerator/issues",
+ "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-10-26T13:12:34+00:00"
+ },
+ {
+ "name": "sebastian/object-reflector",
+ "version": "2.0.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/object-reflector.git",
+ "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7",
+ "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Allows reflection of object attributes, including inherited and non-public ones",
+ "homepage": "https://github.com/sebastianbergmann/object-reflector/",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/object-reflector/issues",
+ "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-10-26T13:14:26+00:00"
+ },
+ {
+ "name": "sebastian/recursion-context",
+ "version": "4.0.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/recursion-context.git",
+ "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1",
+ "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Adam Harvey",
+ "email": "aharvey@php.net"
+ }
+ ],
+ "description": "Provides functionality to recursively process PHP variables",
+ "homepage": "https://github.com/sebastianbergmann/recursion-context",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/recursion-context/issues",
+ "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T06:07:39+00:00"
+ },
+ {
+ "name": "sebastian/resource-operations",
+ "version": "3.0.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/resource-operations.git",
+ "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e",
+ "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "3.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Provides a list of PHP built-in functions that operate on resources",
+ "homepage": "https://www.github.com/sebastianbergmann/resource-operations",
+ "support": {
+ "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2024-03-14T16:00:52+00:00"
+ },
+ {
+ "name": "sebastian/type",
+ "version": "3.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/type.git",
+ "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7",
+ "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.5"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.2-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Collection of value objects that represent the types of the PHP type system",
+ "homepage": "https://github.com/sebastianbergmann/type",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/type/issues",
+ "source": "https://github.com/sebastianbergmann/type/tree/3.2.1"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T06:13:03+00:00"
+ },
+ {
+ "name": "sebastian/version",
+ "version": "3.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/version.git",
+ "reference": "c6c1022351a901512170118436c764e473f6de8c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c",
+ "reference": "c6c1022351a901512170118436c764e473f6de8c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library that helps with managing the version number of Git-hosted PHP projects",
+ "homepage": "https://github.com/sebastianbergmann/version",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/version/issues",
+ "source": "https://github.com/sebastianbergmann/version/tree/3.0.2"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-09-28T06:39:44+00:00"
+ },
+ {
+ "name": "symfony/cache",
+ "version": "v7.1.7",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/cache.git",
+ "reference": "23b61c9592ee72233c31625f0ae805dd1571e928"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/cache/zipball/23b61c9592ee72233c31625f0ae805dd1571e928",
+ "reference": "23b61c9592ee72233c31625f0ae805dd1571e928",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.2",
+ "psr/cache": "^2.0|^3.0",
+ "psr/log": "^1.1|^2|^3",
+ "symfony/cache-contracts": "^2.5|^3",
+ "symfony/deprecation-contracts": "^2.5|^3.0",
+ "symfony/service-contracts": "^2.5|^3",
+ "symfony/var-exporter": "^6.4|^7.0"
+ },
+ "conflict": {
+ "doctrine/dbal": "<3.6",
+ "symfony/dependency-injection": "<6.4",
+ "symfony/http-kernel": "<6.4",
+ "symfony/var-dumper": "<6.4"
+ },
+ "provide": {
+ "psr/cache-implementation": "2.0|3.0",
+ "psr/simple-cache-implementation": "1.0|2.0|3.0",
+ "symfony/cache-implementation": "1.1|2.0|3.0"
+ },
+ "require-dev": {
+ "cache/integration-tests": "dev-master",
+ "doctrine/dbal": "^3.6|^4",
+ "predis/predis": "^1.1|^2.0",
+ "psr/simple-cache": "^1.0|^2.0|^3.0",
+ "symfony/config": "^6.4|^7.0",
+ "symfony/dependency-injection": "^6.4|^7.0",
+ "symfony/filesystem": "^6.4|^7.0",
+ "symfony/http-kernel": "^6.4|^7.0",
+ "symfony/messenger": "^6.4|^7.0",
+ "symfony/var-dumper": "^6.4|^7.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Cache\\": ""
+ },
+ "classmap": [
+ "Traits/ValueWrapper.php"
+ ],
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Provides extended PSR-6, PSR-16 (and tags) implementations",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "caching",
+ "psr6"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/cache/tree/v7.1.7"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-11-05T15:34:55+00:00"
+ },
+ {
+ "name": "symfony/cache-contracts",
+ "version": "v3.5.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/cache-contracts.git",
+ "reference": "df6a1a44c890faded49a5fca33c2d5c5fd3c2197"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/df6a1a44c890faded49a5fca33c2d5c5fd3c2197",
+ "reference": "df6a1a44c890faded49a5fca33c2d5c5fd3c2197",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1",
+ "psr/cache": "^3.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "3.5-dev"
+ },
+ "thanks": {
+ "name": "symfony/contracts",
+ "url": "https://github.com/symfony/contracts"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Contracts\\Cache\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Generic abstractions related to caching",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "abstractions",
+ "contracts",
+ "decoupling",
+ "interfaces",
+ "interoperability",
+ "standards"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/cache-contracts/tree/v3.5.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-04-18T09:32:20+00:00"
+ },
+ {
+ "name": "symfony/console",
+ "version": "v7.1.8",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/console.git",
+ "reference": "ff04e5b5ba043d2badfb308197b9e6b42883fcd5"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/console/zipball/ff04e5b5ba043d2badfb308197b9e6b42883fcd5",
+ "reference": "ff04e5b5ba043d2badfb308197b9e6b42883fcd5",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.2",
+ "symfony/polyfill-mbstring": "~1.0",
+ "symfony/service-contracts": "^2.5|^3",
+ "symfony/string": "^6.4|^7.0"
+ },
+ "conflict": {
+ "symfony/dependency-injection": "<6.4",
+ "symfony/dotenv": "<6.4",
+ "symfony/event-dispatcher": "<6.4",
+ "symfony/lock": "<6.4",
+ "symfony/process": "<6.4"
+ },
+ "provide": {
+ "psr/log-implementation": "1.0|2.0|3.0"
+ },
+ "require-dev": {
+ "psr/log": "^1|^2|^3",
+ "symfony/config": "^6.4|^7.0",
+ "symfony/dependency-injection": "^6.4|^7.0",
+ "symfony/event-dispatcher": "^6.4|^7.0",
+ "symfony/http-foundation": "^6.4|^7.0",
+ "symfony/http-kernel": "^6.4|^7.0",
+ "symfony/lock": "^6.4|^7.0",
+ "symfony/messenger": "^6.4|^7.0",
+ "symfony/process": "^6.4|^7.0",
+ "symfony/stopwatch": "^6.4|^7.0",
+ "symfony/var-dumper": "^6.4|^7.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Console\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Eases the creation of beautiful and testable command line interfaces",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "cli",
+ "command-line",
+ "console",
+ "terminal"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/console/tree/v7.1.8"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-11-06T14:23:19+00:00"
+ },
+ {
+ "name": "symfony/event-dispatcher",
+ "version": "v7.1.6",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/event-dispatcher.git",
+ "reference": "87254c78dd50721cfd015b62277a8281c5589702"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/87254c78dd50721cfd015b62277a8281c5589702",
+ "reference": "87254c78dd50721cfd015b62277a8281c5589702",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.2",
+ "symfony/event-dispatcher-contracts": "^2.5|^3"
+ },
+ "conflict": {
+ "symfony/dependency-injection": "<6.4",
+ "symfony/service-contracts": "<2.5"
+ },
+ "provide": {
+ "psr/event-dispatcher-implementation": "1.0",
+ "symfony/event-dispatcher-implementation": "2.0|3.0"
+ },
+ "require-dev": {
+ "psr/log": "^1|^2|^3",
+ "symfony/config": "^6.4|^7.0",
+ "symfony/dependency-injection": "^6.4|^7.0",
+ "symfony/error-handler": "^6.4|^7.0",
+ "symfony/expression-language": "^6.4|^7.0",
+ "symfony/http-foundation": "^6.4|^7.0",
+ "symfony/service-contracts": "^2.5|^3",
+ "symfony/stopwatch": "^6.4|^7.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\EventDispatcher\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them",
+ "homepage": "https://symfony.com",
+ "support": {
+ "source": "https://github.com/symfony/event-dispatcher/tree/v7.1.6"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-09-25T14:20:29+00:00"
+ },
+ {
+ "name": "symfony/event-dispatcher-contracts",
+ "version": "v3.5.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/event-dispatcher-contracts.git",
+ "reference": "8f93aec25d41b72493c6ddff14e916177c9efc50"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/8f93aec25d41b72493c6ddff14e916177c9efc50",
+ "reference": "8f93aec25d41b72493c6ddff14e916177c9efc50",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1",
+ "psr/event-dispatcher": "^1"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "3.5-dev"
+ },
+ "thanks": {
+ "name": "symfony/contracts",
+ "url": "https://github.com/symfony/contracts"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Contracts\\EventDispatcher\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Generic abstractions related to dispatching event",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "abstractions",
+ "contracts",
+ "decoupling",
+ "interfaces",
+ "interoperability",
+ "standards"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.5.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-04-18T09:32:20+00:00"
+ },
+ {
+ "name": "symfony/filesystem",
+ "version": "v7.1.6",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/filesystem.git",
+ "reference": "c835867b3c62bb05c7fe3d637c871c7ae52024d4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/filesystem/zipball/c835867b3c62bb05c7fe3d637c871c7ae52024d4",
+ "reference": "c835867b3c62bb05c7fe3d637c871c7ae52024d4",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.2",
+ "symfony/polyfill-ctype": "~1.8",
+ "symfony/polyfill-mbstring": "~1.8"
+ },
+ "require-dev": {
+ "symfony/process": "^6.4|^7.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Filesystem\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Provides basic utilities for the filesystem",
+ "homepage": "https://symfony.com",
+ "support": {
+ "source": "https://github.com/symfony/filesystem/tree/v7.1.6"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-10-25T15:11:02+00:00"
+ },
+ {
+ "name": "symfony/finder",
+ "version": "v7.1.6",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/finder.git",
+ "reference": "2cb89664897be33f78c65d3d2845954c8d7a43b8"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/finder/zipball/2cb89664897be33f78c65d3d2845954c8d7a43b8",
+ "reference": "2cb89664897be33f78c65d3d2845954c8d7a43b8",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.2"
+ },
+ "require-dev": {
+ "symfony/filesystem": "^6.4|^7.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Finder\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Finds files and directories via an intuitive fluent interface",
+ "homepage": "https://symfony.com",
+ "support": {
+ "source": "https://github.com/symfony/finder/tree/v7.1.6"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-10-01T08:31:23+00:00"
+ },
+ {
+ "name": "symfony/options-resolver",
+ "version": "v7.1.6",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/options-resolver.git",
+ "reference": "85e95eeede2d41cd146146e98c9c81d9214cae85"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/options-resolver/zipball/85e95eeede2d41cd146146e98c9c81d9214cae85",
+ "reference": "85e95eeede2d41cd146146e98c9c81d9214cae85",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.2",
+ "symfony/deprecation-contracts": "^2.5|^3"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\OptionsResolver\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Provides an improved replacement for the array_replace PHP function",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "config",
+ "configuration",
+ "options"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/options-resolver/tree/v7.1.6"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-09-25T14:20:29+00:00"
+ },
+ {
+ "name": "symfony/polyfill-ctype",
+ "version": "v1.31.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-ctype.git",
+ "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638",
+ "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2"
+ },
+ "provide": {
+ "ext-ctype": "*"
+ },
+ "suggest": {
+ "ext-ctype": "For best performance"
+ },
+ "type": "library",
+ "extra": {
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Ctype\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Gert de Pagter",
+ "email": "BackEndTea@gmail.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for ctype functions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "ctype",
+ "polyfill",
+ "portable"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-09-09T11:45:10+00:00"
+ },
+ {
+ "name": "symfony/polyfill-intl-grapheme",
+ "version": "v1.31.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-intl-grapheme.git",
+ "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe",
+ "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2"
+ },
+ "suggest": {
+ "ext-intl": "For best performance"
+ },
+ "type": "library",
+ "extra": {
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Intl\\Grapheme\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for intl's grapheme_* functions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "grapheme",
+ "intl",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-09-09T11:45:10+00:00"
+ },
+ {
+ "name": "symfony/polyfill-intl-normalizer",
+ "version": "v1.31.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-intl-normalizer.git",
+ "reference": "3833d7255cc303546435cb650316bff708a1c75c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c",
+ "reference": "3833d7255cc303546435cb650316bff708a1c75c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2"
+ },
+ "suggest": {
+ "ext-intl": "For best performance"
+ },
+ "type": "library",
+ "extra": {
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Intl\\Normalizer\\": ""
+ },
+ "classmap": [
+ "Resources/stubs"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for intl's Normalizer class and related functions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "intl",
+ "normalizer",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-09-09T11:45:10+00:00"
+ },
+ {
+ "name": "symfony/polyfill-mbstring",
+ "version": "v1.31.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-mbstring.git",
+ "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341",
+ "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2"
+ },
+ "provide": {
+ "ext-mbstring": "*"
+ },
+ "suggest": {
+ "ext-mbstring": "For best performance"
+ },
+ "type": "library",
+ "extra": {
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Mbstring\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for the Mbstring extension",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "mbstring",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0"
+ },
+ "funding": [
{
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
},
{
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
}
],
- "description": "Symfony Debug Component",
- "homepage": "https://symfony.com",
- "time": "2019-04-11T09:48:14+00:00"
+ "time": "2024-09-09T11:45:10+00:00"
},
{
- "name": "symfony/event-dispatcher",
- "version": "v3.4.26",
+ "name": "symfony/polyfill-php80",
+ "version": "v1.31.0",
"source": {
"type": "git",
- "url": "https://github.com/symfony/event-dispatcher.git",
- "reference": "a088aafcefb4eef2520a290ed82e4374092a6dff"
+ "url": "https://github.com/symfony/polyfill-php80.git",
+ "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a088aafcefb4eef2520a290ed82e4374092a6dff",
- "reference": "a088aafcefb4eef2520a290ed82e4374092a6dff",
+ "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8",
+ "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8",
"shasum": ""
},
"require": {
- "php": "^5.5.9|>=7.0.8"
- },
- "conflict": {
- "symfony/dependency-injection": "<3.3"
- },
- "require-dev": {
- "psr/log": "~1.0",
- "symfony/config": "~2.8|~3.0|~4.0",
- "symfony/dependency-injection": "~3.3|~4.0",
- "symfony/expression-language": "~2.8|~3.0|~4.0",
- "symfony/stopwatch": "~2.8|~3.0|~4.0"
- },
- "suggest": {
- "symfony/dependency-injection": "",
- "symfony/http-kernel": ""
+ "php": ">=7.2"
},
"type": "library",
"extra": {
- "branch-alias": {
- "dev-master": "3.4-dev"
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
"psr-4": {
- "Symfony\\Component\\EventDispatcher\\": ""
+ "Symfony\\Polyfill\\Php80\\": ""
},
- "exclude-from-classmap": [
- "/Tests/"
+ "classmap": [
+ "Resources/stubs"
]
},
"notification-url": "https://packagist.org/downloads/",
@@ -1655,48 +4599,78 @@
],
"authors": [
{
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "name": "Ion Bazan",
+ "email": "ion.bazan@gmail.com"
+ },
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony EventDispatcher Component",
+ "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
"homepage": "https://symfony.com",
- "time": "2019-04-02T08:51:52+00:00"
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-09-09T11:45:10+00:00"
},
{
- "name": "symfony/filesystem",
- "version": "v3.4.26",
+ "name": "symfony/polyfill-php81",
+ "version": "v1.31.0",
"source": {
"type": "git",
- "url": "https://github.com/symfony/filesystem.git",
- "reference": "acf99758b1df8e9295e6b85aa69f294565c9fedb"
+ "url": "https://github.com/symfony/polyfill-php81.git",
+ "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/filesystem/zipball/acf99758b1df8e9295e6b85aa69f294565c9fedb",
- "reference": "acf99758b1df8e9295e6b85aa69f294565c9fedb",
+ "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c",
+ "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c",
"shasum": ""
},
"require": {
- "php": "^5.5.9|>=7.0.8",
- "symfony/polyfill-ctype": "~1.8"
+ "php": ">=7.2"
},
"type": "library",
"extra": {
- "branch-alias": {
- "dev-master": "3.4-dev"
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
"psr-4": {
- "Symfony\\Component\\Filesystem\\": ""
+ "Symfony\\Polyfill\\Php81\\": ""
},
- "exclude-from-classmap": [
- "/Tests/"
+ "classmap": [
+ "Resources/stubs"
]
},
"notification-url": "https://packagist.org/downloads/",
@@ -1705,44 +4679,62 @@
],
"authors": [
{
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony Filesystem Component",
+ "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions",
"homepage": "https://symfony.com",
- "time": "2019-02-04T21:34:32+00:00"
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-09-09T11:45:10+00:00"
},
{
- "name": "symfony/finder",
- "version": "v3.4.26",
+ "name": "symfony/process",
+ "version": "v7.1.8",
"source": {
"type": "git",
- "url": "https://github.com/symfony/finder.git",
- "reference": "61af5ce0b34b942d414fe8f1b11950d0e9a90e98"
+ "url": "https://github.com/symfony/process.git",
+ "reference": "42783370fda6e538771f7c7a36e9fa2ee3a84892"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/finder/zipball/61af5ce0b34b942d414fe8f1b11950d0e9a90e98",
- "reference": "61af5ce0b34b942d414fe8f1b11950d0e9a90e98",
+ "url": "https://api.github.com/repos/symfony/process/zipball/42783370fda6e538771f7c7a36e9fa2ee3a84892",
+ "reference": "42783370fda6e538771f7c7a36e9fa2ee3a84892",
"shasum": ""
},
"require": {
- "php": "^5.5.9|>=7.0.8"
+ "php": ">=8.2"
},
"type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.4-dev"
- }
- },
"autoload": {
"psr-4": {
- "Symfony\\Component\\Finder\\": ""
+ "Symfony\\Component\\Process\\": ""
},
"exclude-from-classmap": [
"/Tests/"
@@ -1762,42 +4754,65 @@
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony Finder Component",
+ "description": "Executes commands in sub-processes",
"homepage": "https://symfony.com",
- "time": "2019-04-02T19:54:57+00:00"
+ "support": {
+ "source": "https://github.com/symfony/process/tree/v7.1.8"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-11-06T14:23:19+00:00"
},
{
- "name": "symfony/polyfill-ctype",
- "version": "v1.11.0",
+ "name": "symfony/service-contracts",
+ "version": "v3.5.0",
"source": {
"type": "git",
- "url": "https://github.com/symfony/polyfill-ctype.git",
- "reference": "82ebae02209c21113908c229e9883c419720738a"
+ "url": "https://github.com/symfony/service-contracts.git",
+ "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/82ebae02209c21113908c229e9883c419720738a",
- "reference": "82ebae02209c21113908c229e9883c419720738a",
+ "url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f",
+ "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": ">=8.1",
+ "psr/container": "^1.1|^2.0",
+ "symfony/deprecation-contracts": "^2.5|^3"
},
- "suggest": {
- "ext-ctype": "For best performance"
+ "conflict": {
+ "ext-psr": "<1.1|>=2"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.11-dev"
+ "dev-main": "3.5-dev"
+ },
+ "thanks": {
+ "name": "symfony/contracts",
+ "url": "https://github.com/symfony/contracts"
}
},
"autoload": {
"psr-4": {
- "Symfony\\Polyfill\\Ctype\\": ""
+ "Symfony\\Contracts\\Service\\": ""
},
- "files": [
- "bootstrap.php"
+ "exclude-from-classmap": [
+ "/Test/"
]
},
"notification-url": "https://packagist.org/downloads/",
@@ -1806,56 +4821,68 @@
],
"authors": [
{
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
},
{
- "name": "Gert de Pagter",
- "email": "backendtea@gmail.com"
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony polyfill for ctype functions",
+ "description": "Generic abstractions related to writing services",
"homepage": "https://symfony.com",
"keywords": [
- "compatibility",
- "ctype",
- "polyfill",
- "portable"
+ "abstractions",
+ "contracts",
+ "decoupling",
+ "interfaces",
+ "interoperability",
+ "standards"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/service-contracts/tree/v3.5.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
],
- "time": "2019-02-06T07:57:58+00:00"
+ "time": "2024-04-18T09:32:20+00:00"
},
{
- "name": "symfony/polyfill-mbstring",
- "version": "v1.11.0",
+ "name": "symfony/stopwatch",
+ "version": "v7.1.6",
"source": {
"type": "git",
- "url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "fe5e94c604826c35a32fa832f35bd036b6799609"
+ "url": "https://github.com/symfony/stopwatch.git",
+ "reference": "8b4a434e6e7faf6adedffb48783a5c75409a1a05"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fe5e94c604826c35a32fa832f35bd036b6799609",
- "reference": "fe5e94c604826c35a32fa832f35bd036b6799609",
+ "url": "https://api.github.com/repos/symfony/stopwatch/zipball/8b4a434e6e7faf6adedffb48783a5c75409a1a05",
+ "reference": "8b4a434e6e7faf6adedffb48783a5c75409a1a05",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
- },
- "suggest": {
- "ext-mbstring": "For best performance"
+ "php": ">=8.2",
+ "symfony/service-contracts": "^2.5|^3"
},
"type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.11-dev"
- }
- },
"autoload": {
"psr-4": {
- "Symfony\\Polyfill\\Mbstring\\": ""
+ "Symfony\\Component\\Stopwatch\\": ""
},
- "files": [
- "bootstrap.php"
+ "exclude-from-classmap": [
+ "/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
@@ -1864,51 +4891,74 @@
],
"authors": [
{
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony polyfill for the Mbstring extension",
+ "description": "Provides a way to profile code",
"homepage": "https://symfony.com",
- "keywords": [
- "compatibility",
- "mbstring",
- "polyfill",
- "portable",
- "shim"
+ "support": {
+ "source": "https://github.com/symfony/stopwatch/tree/v7.1.6"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
],
- "time": "2019-02-06T07:57:58+00:00"
+ "time": "2024-09-25T14:20:29+00:00"
},
{
- "name": "symfony/process",
- "version": "v3.4.26",
+ "name": "symfony/string",
+ "version": "v7.1.8",
"source": {
"type": "git",
- "url": "https://github.com/symfony/process.git",
- "reference": "a9c4dfbf653023b668c282e4e02609d131f4057a"
+ "url": "https://github.com/symfony/string.git",
+ "reference": "591ebd41565f356fcd8b090fe64dbb5878f50281"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/process/zipball/a9c4dfbf653023b668c282e4e02609d131f4057a",
- "reference": "a9c4dfbf653023b668c282e4e02609d131f4057a",
+ "url": "https://api.github.com/repos/symfony/string/zipball/591ebd41565f356fcd8b090fe64dbb5878f50281",
+ "reference": "591ebd41565f356fcd8b090fe64dbb5878f50281",
"shasum": ""
},
"require": {
- "php": "^5.5.9|>=7.0.8"
+ "php": ">=8.2",
+ "symfony/polyfill-ctype": "~1.8",
+ "symfony/polyfill-intl-grapheme": "~1.0",
+ "symfony/polyfill-intl-normalizer": "~1.0",
+ "symfony/polyfill-mbstring": "~1.0"
},
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.4-dev"
- }
+ "conflict": {
+ "symfony/translation-contracts": "<2.5"
+ },
+ "require-dev": {
+ "symfony/emoji": "^7.1",
+ "symfony/error-handler": "^6.4|^7.0",
+ "symfony/http-client": "^6.4|^7.0",
+ "symfony/intl": "^6.4|^7.0",
+ "symfony/translation-contracts": "^2.5|^3.0",
+ "symfony/var-exporter": "^6.4|^7.0"
},
+ "type": "library",
"autoload": {
+ "files": [
+ "Resources/functions.php"
+ ],
"psr-4": {
- "Symfony\\Component\\Process\\": ""
+ "Symfony\\Component\\String\\": ""
},
"exclude-from-classmap": [
"/Tests/"
@@ -1920,44 +4970,69 @@
],
"authors": [
{
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony Process Component",
+ "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way",
"homepage": "https://symfony.com",
- "time": "2019-04-08T16:15:54+00:00"
+ "keywords": [
+ "grapheme",
+ "i18n",
+ "string",
+ "unicode",
+ "utf-8",
+ "utf8"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/string/tree/v7.1.8"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-11-13T13:31:21+00:00"
},
{
- "name": "symfony/stopwatch",
- "version": "v3.4.26",
+ "name": "symfony/var-exporter",
+ "version": "v7.1.6",
"source": {
"type": "git",
- "url": "https://github.com/symfony/stopwatch.git",
- "reference": "2a651c2645c10bbedd21170771f122d935e0dd58"
+ "url": "https://github.com/symfony/var-exporter.git",
+ "reference": "90173ef89c40e7c8c616653241048705f84130ef"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/stopwatch/zipball/2a651c2645c10bbedd21170771f122d935e0dd58",
- "reference": "2a651c2645c10bbedd21170771f122d935e0dd58",
+ "url": "https://api.github.com/repos/symfony/var-exporter/zipball/90173ef89c40e7c8c616653241048705f84130ef",
+ "reference": "90173ef89c40e7c8c616653241048705f84130ef",
"shasum": ""
},
"require": {
- "php": "^5.5.9|>=7.0.8"
+ "php": ">=8.2"
},
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.4-dev"
- }
+ "require-dev": {
+ "symfony/property-access": "^6.4|^7.0",
+ "symfony/serializer": "^6.4|^7.0",
+ "symfony/var-dumper": "^6.4|^7.0"
},
+ "type": "library",
"autoload": {
"psr-4": {
- "Symfony\\Component\\Stopwatch\\": ""
+ "Symfony\\Component\\VarExporter\\": ""
},
"exclude-from-classmap": [
"/Tests/"
@@ -1969,51 +5044,73 @@
],
"authors": [
{
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony Stopwatch Component",
+ "description": "Allows exporting any serializable PHP data structure to plain PHP code",
"homepage": "https://symfony.com",
- "time": "2019-01-16T09:39:14+00:00"
+ "keywords": [
+ "clone",
+ "construct",
+ "export",
+ "hydrate",
+ "instantiate",
+ "lazy-loading",
+ "proxy",
+ "serialize"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/var-exporter/tree/v7.1.6"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-09-25T14:20:29+00:00"
},
{
"name": "symfony/yaml",
- "version": "v3.4.26",
+ "version": "v7.1.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
- "reference": "212a27b731e5bfb735679d1ffaac82bd6a1dc996"
+ "reference": "3ced3f29e4f0d6bce2170ff26719f1fe9aacc671"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/yaml/zipball/212a27b731e5bfb735679d1ffaac82bd6a1dc996",
- "reference": "212a27b731e5bfb735679d1ffaac82bd6a1dc996",
+ "url": "https://api.github.com/repos/symfony/yaml/zipball/3ced3f29e4f0d6bce2170ff26719f1fe9aacc671",
+ "reference": "3ced3f29e4f0d6bce2170ff26719f1fe9aacc671",
"shasum": ""
},
"require": {
- "php": "^5.5.9|>=7.0.8",
- "symfony/polyfill-ctype": "~1.8"
+ "php": ">=8.2",
+ "symfony/polyfill-ctype": "^1.8"
},
"conflict": {
- "symfony/console": "<3.4"
+ "symfony/console": "<6.4"
},
"require-dev": {
- "symfony/console": "~3.4|~4.0"
- },
- "suggest": {
- "symfony/console": "For validating YAML files using the lint command"
+ "symfony/console": "^6.4|^7.0"
},
+ "bin": [
+ "Resources/bin/yaml-lint"
+ ],
"type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.4-dev"
- }
- },
"autoload": {
"psr-4": {
"Symfony\\Component\\Yaml\\": ""
@@ -2036,60 +5133,76 @@
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony Yaml Component",
+ "description": "Loads and dumps YAML files",
"homepage": "https://symfony.com",
- "time": "2019-03-25T07:48:46+00:00"
+ "support": {
+ "source": "https://github.com/symfony/yaml/tree/v7.1.6"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-09-25T14:20:29+00:00"
},
{
- "name": "webmozart/assert",
- "version": "1.4.0",
+ "name": "theseer/tokenizer",
+ "version": "1.2.3",
"source": {
"type": "git",
- "url": "https://github.com/webmozart/assert.git",
- "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9"
+ "url": "https://github.com/theseer/tokenizer.git",
+ "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9",
- "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9",
+ "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2",
+ "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2",
"shasum": ""
},
"require": {
- "php": "^5.3.3 || ^7.0",
- "symfony/polyfill-ctype": "^1.8"
- },
- "require-dev": {
- "phpunit/phpunit": "^4.6",
- "sebastian/version": "^1.0.1"
+ "ext-dom": "*",
+ "ext-tokenizer": "*",
+ "ext-xmlwriter": "*",
+ "php": "^7.2 || ^8.0"
},
"type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.3-dev"
- }
- },
"autoload": {
- "psr-4": {
- "Webmozart\\Assert\\": "src/"
- }
+ "classmap": [
+ "src/"
+ ]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
- "MIT"
+ "BSD-3-Clause"
],
"authors": [
{
- "name": "Bernhard Schussek",
- "email": "bschussek@gmail.com"
+ "name": "Arne Blankerts",
+ "email": "arne@blankerts.de",
+ "role": "Developer"
}
],
- "description": "Assertions to validate method input/output with nice error messages.",
- "keywords": [
- "assert",
- "check",
- "validate"
+ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
+ "support": {
+ "issues": "https://github.com/theseer/tokenizer/issues",
+ "source": "https://github.com/theseer/tokenizer/tree/1.2.3"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/theseer",
+ "type": "github"
+ }
],
- "time": "2018-12-25T11:19:39+00:00"
+ "time": "2024-03-03T12:36:25+00:00"
}
],
"aliases": [],
@@ -2098,10 +5211,11 @@
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
- "php": ">=5.6",
+ "php": "^8.1",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*"
},
- "platform-dev": []
-}
\ No newline at end of file
+ "platform-dev": [],
+ "plugin-api-version": "2.6.0"
+}
diff --git a/config-openapi-generator.yml b/config-openapi-generator.yml
new file mode 100644
index 0000000..e6896c7
--- /dev/null
+++ b/config-openapi-generator.yml
@@ -0,0 +1,70 @@
+# config-openapi-generator.yml
+generatorName: php-nextgen
+outputDir: .
+inputSpec: swagger_definition_v3.yml
+gitHost: github.com
+gitUserId: getbrevo
+gitRepoId: brevo-php
+templateDirectory: ./template/php-nextgen
+templateDir: ./template/php-nextgen
+
+# Package configuration
+invokerPackage: Brevo\Client
+artifactVersion: 3.0.0
+packageName: Brevo\Client
+srcBasePath: lib
+variableNamingConvention: camelCase
+
+# Server configuration
+serverVariables:
+ host: https://api.brevo.com/v3
+
+# HTTP client configuration
+httpUserAgent: brevo_clientAPI/v3.0.0/php
+
+# PHP specific configurations
+modelPackage: Models
+apiPackage: Api
+composerVendorName: getbrevo
+composerProjectName: brevo-php
+
+# Composer metadata
+artifactDescription: "Brevo's API v3 Php Library"
+infoEmail: contact@brevo.com
+infoName: "Brevo Developers"
+infoUrl: https://www.brevo.com/
+licenseName: MIT
+licenseUrl: https://raw.githubusercontent.com/getbrevo/brevo-php/refs/heads/main/LICENSE.md
+artifactKeywords:
+ - brevo
+ - swagger
+ - php
+ - sdk
+ - api
+composerAuthorName: "Brevo Developers"
+composerAuthorEmail: contact@brevo.com
+composerHomepage: https://github.com/getbrevo/brevo-php
+
+# Organization information
+developerOrganization: "Brevo Developers"
+developerOrganizationUrl: https://www.brevo.com/
+artifactUrl: https://github.com/getbrevo/brevo-php
+
+# Code generation options
+sortParamsByRequiredFlag: true
+sortModelPropertiesByRequiredFlag: true
+ensureUniqueParams: true
+hideGenerationTimestamp: true
+legacyDiscriminatorBehavior: true
+
+# PHP quality settings
+phpLegacySupport: false
+phpUnitVer: 9.5.0
+disallowAdditionalPropertiesIfNotPresent: false
+
+
+files:
+ model_abstract.mustache:
+ destinationFilename: lib/Models/AbstractModel.php
+ templateType: "SupportingFiles"
+
diff --git a/docs/Api/AccountApi.md b/docs/Api/AccountApi.md
index fb8a867..109182f 100644
--- a/docs/Api/AccountApi.md
+++ b/docs/Api/AccountApi.md
@@ -1,32 +1,39 @@
# Brevo\Client\AccountApi
-All URIs are relative to *https://api.brevo.com/v3*
+All URIs are relative to https://api.brevo.com/v3, except if the operation defines another base path.
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**getAccount**](AccountApi.md#getAccount) | **GET** /account | Get your account information, plan and credits details
-[**getAccountActivity**](AccountApi.md#getAccountActivity) | **GET** /organization/activities | Get user activity logs
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**getAccount()**](AccountApi.md#getAccount) | **GET** /account | Get your account information, plan and credits details |
+| [**getAccountActivity()**](AccountApi.md#getAccountActivity) | **GET** /organization/activities | Get user activity logs |
-# **getAccount**
-> \Brevo\Client\Model\GetAccount getAccount()
+## `getAccount()`
+
+```php
+getAccount(): \Brevo\Client\Models\GetAccount
+```
Get your account information, plan and credits details
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\AccountApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
@@ -40,15 +47,15 @@ try {
} catch (Exception $e) {
echo 'Exception when calling AccountApi->getAccount: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
+
This endpoint does not need any parameter.
### Return type
-[**\Brevo\Client\Model\GetAccount**](../Model/GetAccount.md)
+[**\Brevo\Client\Models\GetAccount**](../Model/GetAccount.md)
### Authorization
@@ -56,38 +63,47 @@ This endpoint does not need any parameter.
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getAccountActivity**
-> \Brevo\Client\Model\GetAccountActivity getAccountActivity($startDate, $endDate, $limit, $offset)
+## `getAccountActivity()`
+
+```php
+getAccountActivity($startDate, $endDate, $limit, $offset): \Brevo\Client\Models\GetAccountActivity
+```
Get user activity logs
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\AccountApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$startDate = "startDate_example"; // string | Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search.
-$endDate = "endDate_example"; // string | Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month.
+$startDate = 'startDate_example'; // string | Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search.
+$endDate = 'endDate_example'; // string | Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month.
$limit = 10; // int | Number of documents per page
$offset = 0; // int | Index of the first document in the page.
@@ -97,21 +113,20 @@ try {
} catch (Exception $e) {
echo 'Exception when calling AccountApi->getAccountActivity: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **startDate** | **string**| Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search. | [optional]
- **endDate** | **string**| Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. | [optional]
- **limit** | **int**| Number of documents per page | [optional] [default to 10]
- **offset** | **int**| Index of the first document in the page. | [optional] [default to 0]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **startDate** | **string**| Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search. | [optional] |
+| **endDate** | **string**| Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. | [optional] |
+| **limit** | **int**| Number of documents per page | [optional] [default to 10] |
+| **offset** | **int**| Index of the first document in the page. | [optional] [default to 0] |
### Return type
-[**\Brevo\Client\Model\GetAccountActivity**](../Model/GetAccountActivity.md)
+[**\Brevo\Client\Models\GetAccountActivity**](../Model/GetAccountActivity.md)
### Authorization
@@ -119,8 +134,9 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+- **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/AttributesApi.md b/docs/Api/AttributesApi.md
deleted file mode 100644
index 03be401..0000000
--- a/docs/Api/AttributesApi.md
+++ /dev/null
@@ -1,243 +0,0 @@
-# Brevo\Client\AttributesApi
-
-All URIs are relative to *https://api.brevo.com/v3*
-
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**createAttribute**](AttributesApi.md#createAttribute) | **POST** /contacts/attributes/{attributeCategory}/{attributeName} | Create contact attribute
-[**deleteAttribute**](AttributesApi.md#deleteAttribute) | **DELETE** /contacts/attributes/{attributeCategory}/{attributeName} | Delete an attribute
-[**getAttributes**](AttributesApi.md#getAttributes) | **GET** /contacts/attributes | List all attributes
-[**updateAttribute**](AttributesApi.md#updateAttribute) | **PUT** /contacts/attributes/{attributeCategory}/{attributeName} | Update contact attribute
-
-
-# **createAttribute**
-> createAttribute($attributeCategory, $attributeName, $createAttribute)
-
-Create contact attribute
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\AttributesApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$attributeCategory = "attributeCategory_example"; // string | Category of the attribute
-$attributeName = "attributeName_example"; // string | Name of the attribute
-$createAttribute = new \Brevo\Client\Model\CreateAttribute(); // \Brevo\Client\Model\CreateAttribute | Values to create an attribute
-
-try {
- $apiInstance->createAttribute($attributeCategory, $attributeName, $createAttribute);
-} catch (Exception $e) {
- echo 'Exception when calling AttributesApi->createAttribute: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **attributeCategory** | **string**| Category of the attribute |
- **attributeName** | **string**| Name of the attribute |
- **createAttribute** | [**\Brevo\Client\Model\CreateAttribute**](../Model/CreateAttribute.md)| Values to create an attribute |
-
-### Return type
-
-void (empty response body)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **deleteAttribute**
-> deleteAttribute($attributeCategory, $attributeName)
-
-Delete an attribute
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\AttributesApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$attributeCategory = "attributeCategory_example"; // string | Category of the attribute
-$attributeName = "attributeName_example"; // string | Name of the existing attribute
-
-try {
- $apiInstance->deleteAttribute($attributeCategory, $attributeName);
-} catch (Exception $e) {
- echo 'Exception when calling AttributesApi->deleteAttribute: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **attributeCategory** | **string**| Category of the attribute |
- **attributeName** | **string**| Name of the existing attribute |
-
-### Return type
-
-void (empty response body)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **getAttributes**
-> \Brevo\Client\Model\GetAttributes getAttributes()
-
-List all attributes
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\AttributesApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-
-try {
- $result = $apiInstance->getAttributes();
- print_r($result);
-} catch (Exception $e) {
- echo 'Exception when calling AttributesApi->getAttributes: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-This endpoint does not need any parameter.
-
-### Return type
-
-[**\Brevo\Client\Model\GetAttributes**](../Model/GetAttributes.md)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **updateAttribute**
-> updateAttribute($attributeCategory, $attributeName, $updateAttribute)
-
-Update contact attribute
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\AttributesApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$attributeCategory = "attributeCategory_example"; // string | Category of the attribute
-$attributeName = "attributeName_example"; // string | Name of the existing attribute
-$updateAttribute = new \Brevo\Client\Model\UpdateAttribute(); // \Brevo\Client\Model\UpdateAttribute | Values to update an attribute
-
-try {
- $apiInstance->updateAttribute($attributeCategory, $attributeName, $updateAttribute);
-} catch (Exception $e) {
- echo 'Exception when calling AttributesApi->updateAttribute: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **attributeCategory** | **string**| Category of the attribute |
- **attributeName** | **string**| Name of the existing attribute |
- **updateAttribute** | [**\Brevo\Client\Model\UpdateAttribute**](../Model/UpdateAttribute.md)| Values to update an attribute |
-
-### Return type
-
-void (empty response body)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
diff --git a/docs/Api/BalanceApi.md b/docs/Api/BalanceApi.md
new file mode 100644
index 0000000..e058d21
--- /dev/null
+++ b/docs/Api/BalanceApi.md
@@ -0,0 +1,1089 @@
+# Brevo\Client\BalanceApi
+
+All URIs are relative to https://api.brevo.com/v3, except if the operation defines another base path.
+
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**beginTransaction()**](BalanceApi.md#beginTransaction) | **POST** /loyalty/balance/programs/{loyaltyProgramId}/transactions | Create new transaction |
+| [**cancelTransaction()**](BalanceApi.md#cancelTransaction) | **POST** /loyalty/balance/programs/{loyaltyProgramId}/transactions/{transactionId}/cancel | Cancel transaction |
+| [**completeTransaction()**](BalanceApi.md#completeTransaction) | **POST** /loyalty/balance/programs/{loyaltyProgramId}/transactions/{transactionId}/complete | Complete transaction |
+| [**createBalanceOrder()**](BalanceApi.md#createBalanceOrder) | **POST** /loyalty/balance/programs/{loyaltyProgramId}/create-order | Create balance order |
+| [**getBalanceDefinitionList()**](BalanceApi.md#getBalanceDefinitionList) | **GET** /loyalty/balance/programs/{loyaltyProgramId}/balance-definitions | Get balance definition list |
+| [**getContactBalances()**](BalanceApi.md#getContactBalances) | **GET** /loyalty/balance/programs/{loyaltyProgramId}/contact-balances | Get balance list |
+| [**getSubscriptionBalances()**](BalanceApi.md#getSubscriptionBalances) | **GET** /loyalty/balance/programs/{loyaltyProgramId}/subscriptions/{contactId}/balances | Get subscription balances |
+| [**loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDelete()**](BalanceApi.md#loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDelete) | **DELETE** /loyalty/balance/programs/{loyaltyProgramId}/balance-definitions/{balanceDefinitionId} | Delete balance definition |
+| [**loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGet()**](BalanceApi.md#loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGet) | **GET** /loyalty/balance/programs/{loyaltyProgramId}/balance-definitions/{balanceDefinitionId} | Get balance definition |
+| [**loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDelete()**](BalanceApi.md#loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDelete) | **DELETE** /loyalty/balance/programs/{loyaltyProgramId}/balance-definitions/{balanceDefinitionId}/limits/{balanceLimitId} | Delete balance limit |
+| [**loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGet()**](BalanceApi.md#loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGet) | **GET** /loyalty/balance/programs/{loyaltyProgramId}/balance-definitions/{balanceDefinitionId}/limits/{balanceLimitId} | Get balance limits |
+| [**loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPut()**](BalanceApi.md#loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPut) | **PUT** /loyalty/balance/programs/{loyaltyProgramId}/balance-definitions/{balanceDefinitionId}/limits/{balanceLimitId} | Updates balance limit |
+| [**loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPost()**](BalanceApi.md#loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPost) | **POST** /loyalty/balance/programs/{loyaltyProgramId}/balance-definitions/{balanceDefinitionId}/limits | Create balance limits |
+| [**loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPut()**](BalanceApi.md#loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPut) | **PUT** /loyalty/balance/programs/{loyaltyProgramId}/balance-definitions/{balanceDefinitionId} | Update balance definition |
+| [**loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPost()**](BalanceApi.md#loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPost) | **POST** /loyalty/balance/programs/{loyaltyProgramId}/balance-definitions | Create balance definition |
+
+
+## `beginTransaction()`
+
+```php
+beginTransaction($loyaltyProgramId, $createTransactionPayload): \Brevo\Client\Models\Transaction
+```
+
+Create new transaction
+
+Creates new transaction and returns information
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\BalanceApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$createTransactionPayload = new \Brevo\Client\Models\CreateTransactionPayload(); // \Brevo\Client\Models\CreateTransactionPayload | Transaction information
+
+try {
+ $result = $apiInstance->beginTransaction($loyaltyProgramId, $createTransactionPayload);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling BalanceApi->beginTransaction: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **createTransactionPayload** | [**\Brevo\Client\Models\CreateTransactionPayload**](../Model/CreateTransactionPayload.md)| Transaction information | [optional] |
+
+### Return type
+
+[**\Brevo\Client\Models\Transaction**](../Model/Transaction.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `cancelTransaction()`
+
+```php
+cancelTransaction($loyaltyProgramId, $transactionId): \Brevo\Client\Models\CancelledTransaction
+```
+
+Cancel transaction
+
+Cancels transaction
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\BalanceApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty program Id
+$transactionId = 'transactionId_example'; // string | Transaction Id
+
+try {
+ $result = $apiInstance->cancelTransaction($loyaltyProgramId, $transactionId);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling BalanceApi->cancelTransaction: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty program Id | |
+| **transactionId** | **string**| Transaction Id | |
+
+### Return type
+
+[**\Brevo\Client\Models\CancelledTransaction**](../Model/CancelledTransaction.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `completeTransaction()`
+
+```php
+completeTransaction($loyaltyProgramId, $transactionId, $completeTransactionPayload): \Brevo\Client\Models\CompletedTransaction
+```
+
+Complete transaction
+
+Completes transaction
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\BalanceApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$transactionId = 'transactionId_example'; // string | Transaction Id
+$completeTransactionPayload = new \Brevo\Client\Models\CompleteTransactionPayload(); // \Brevo\Client\Models\CompleteTransactionPayload | Transaction information
+
+try {
+ $result = $apiInstance->completeTransaction($loyaltyProgramId, $transactionId, $completeTransactionPayload);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling BalanceApi->completeTransaction: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **transactionId** | **string**| Transaction Id | |
+| **completeTransactionPayload** | [**\Brevo\Client\Models\CompleteTransactionPayload**](../Model/CompleteTransactionPayload.md)| Transaction information | [optional] |
+
+### Return type
+
+[**\Brevo\Client\Models\CompletedTransaction**](../Model/CompletedTransaction.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `createBalanceOrder()`
+
+```php
+createBalanceOrder($loyaltyProgramId, $createOrderPayload): \Brevo\Client\Models\CreateOrderPayload
+```
+
+Create balance order
+
+Returns created order
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\BalanceApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$createOrderPayload = new \Brevo\Client\Models\CreateOrderPayload(); // \Brevo\Client\Models\CreateOrderPayload | Create order information
+
+try {
+ $result = $apiInstance->createBalanceOrder($loyaltyProgramId, $createOrderPayload);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling BalanceApi->createBalanceOrder: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **createOrderPayload** | [**\Brevo\Client\Models\CreateOrderPayload**](../Model/CreateOrderPayload.md)| Create order information | [optional] |
+
+### Return type
+
+[**\Brevo\Client\Models\CreateOrderPayload**](../Model/CreateOrderPayload.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `getBalanceDefinitionList()`
+
+```php
+getBalanceDefinitionList($loyaltyProgramId, $limit, $offset, $sortField, $sort, $version): \Brevo\Client\Models\BalanceDefinitionPage
+```
+
+Get balance definition list
+
+Returns balance definition page
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\BalanceApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$limit = 50; // int | Number of documents per page
+$offset = 0; // int | Index of the first document in the page
+$sortField = 'name'; // string | Sort documents by field
+$sort = 'desc'; // string | Sort the documents in the ascending or descending order
+$version = 'draft'; // string | Select 'active' to retrieve list of all balances which are live for clients. Select draft to retrieve list of all non deleted balances.
+
+try {
+ $result = $apiInstance->getBalanceDefinitionList($loyaltyProgramId, $limit, $offset, $sortField, $sort, $version);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling BalanceApi->getBalanceDefinitionList: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **limit** | **int**| Number of documents per page | [optional] [default to 50] |
+| **offset** | **int**| Index of the first document in the page | [optional] [default to 0] |
+| **sortField** | **string**| Sort documents by field | [optional] [default to 'name'] |
+| **sort** | **string**| Sort the documents in the ascending or descending order | [optional] [default to 'desc'] |
+| **version** | **string**| Select 'active' to retrieve list of all balances which are live for clients. Select draft to retrieve list of all non deleted balances. | [optional] [default to 'draft'] |
+
+### Return type
+
+[**\Brevo\Client\Models\BalanceDefinitionPage**](../Model/BalanceDefinitionPage.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `getContactBalances()`
+
+```php
+getContactBalances($loyaltyProgramId, $balanceDefinitionId, $limit, $offset, $sort, $sortField): \Brevo\Client\Models\ContactBalances
+```
+
+Get balance list
+
+Returns balance list
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\BalanceApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty program id
+$balanceDefinitionId = 'balanceDefinitionId_example'; // string | Balance Definition Id
+$limit = 100; // int | Number of documents per page
+$offset = 0; // int | Index of the first document in the page
+$sort = 'desc'; // string | Sort the documents in the ascending or descending order
+$sortField = 'updatedAt'; // string | Sort documents by field
+
+try {
+ $result = $apiInstance->getContactBalances($loyaltyProgramId, $balanceDefinitionId, $limit, $offset, $sort, $sortField);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling BalanceApi->getContactBalances: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty program id | |
+| **balanceDefinitionId** | **string**| Balance Definition Id | |
+| **limit** | **int**| Number of documents per page | [optional] [default to 100] |
+| **offset** | **int**| Index of the first document in the page | [optional] [default to 0] |
+| **sort** | **string**| Sort the documents in the ascending or descending order | [optional] [default to 'desc'] |
+| **sortField** | **string**| Sort documents by field | [optional] [default to 'updatedAt'] |
+
+### Return type
+
+[**\Brevo\Client\Models\ContactBalances**](../Model/ContactBalances.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `getSubscriptionBalances()`
+
+```php
+getSubscriptionBalances($loyaltyProgramId, $contactId): \Brevo\Client\Models\BalancePage
+```
+
+Get subscription balances
+
+Returns subscription balances
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\BalanceApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$contactId = 'contactId_example'; // string | Contact id
+
+try {
+ $result = $apiInstance->getSubscriptionBalances($loyaltyProgramId, $contactId);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling BalanceApi->getSubscriptionBalances: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **contactId** | **string**| Contact id | |
+
+### Return type
+
+[**\Brevo\Client\Models\BalancePage**](../Model/BalancePage.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDelete()`
+
+```php
+loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDelete($loyaltyProgramId, $balanceDefinitionId)
+```
+
+Delete balance definition
+
+Delete Balance definition
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\BalanceApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$balanceDefinitionId = 'balanceDefinitionId_example'; // string | Balance Definition Id
+
+try {
+ $apiInstance->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDelete($loyaltyProgramId, $balanceDefinitionId);
+} catch (Exception $e) {
+ echo 'Exception when calling BalanceApi->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDelete: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **balanceDefinitionId** | **string**| Balance Definition Id | |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGet()`
+
+```php
+loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGet($loyaltyProgramId, $balanceDefinitionId, $version): \Brevo\Client\Models\BalanceDefinition
+```
+
+Get balance definition
+
+Returns balance definition
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\BalanceApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$balanceDefinitionId = 'balanceDefinitionId_example'; // string | Balance Definition Id
+$version = 'draft'; // string | Select active to get balance definition configuration which is live for the clients. Select draft to retrieve balance definition configuration with the recent edits
+
+try {
+ $result = $apiInstance->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGet($loyaltyProgramId, $balanceDefinitionId, $version);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling BalanceApi->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGet: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **balanceDefinitionId** | **string**| Balance Definition Id | |
+| **version** | **string**| Select active to get balance definition configuration which is live for the clients. Select draft to retrieve balance definition configuration with the recent edits | [optional] [default to 'draft'] |
+
+### Return type
+
+[**\Brevo\Client\Models\BalanceDefinition**](../Model/BalanceDefinition.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDelete()`
+
+```php
+loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDelete($loyaltyProgramId, $balanceDefinitionId, $balanceLimitId)
+```
+
+Delete balance limit
+
+Delete balance limit
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\BalanceApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$balanceDefinitionId = 'balanceDefinitionId_example'; // string | Balance Definition Id
+$balanceLimitId = 'balanceLimitId_example'; // string | Id of the limit to be deleted
+
+try {
+ $apiInstance->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDelete($loyaltyProgramId, $balanceDefinitionId, $balanceLimitId);
+} catch (Exception $e) {
+ echo 'Exception when calling BalanceApi->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDelete: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **balanceDefinitionId** | **string**| Balance Definition Id | |
+| **balanceLimitId** | **string**| Id of the limit to be deleted | |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGet()`
+
+```php
+loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGet($loyaltyProgramId, $balanceDefinitionId, $balanceLimitId, $version): \Brevo\Client\Models\BalanceLimitPayload
+```
+
+Get balance limits
+
+Fetches balance limits and send the created UUID along with the data
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\BalanceApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$balanceDefinitionId = 'balanceDefinitionId_example'; // string | Balance definition id
+$balanceLimitId = 'balanceLimitId_example'; // string | Balance limit id
+$version = 'draft'; // string | Select active to get balance definition configuration which is live for the clients. Select draft to retrieve balance definition configuration with the recent edits
+
+try {
+ $result = $apiInstance->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGet($loyaltyProgramId, $balanceDefinitionId, $balanceLimitId, $version);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling BalanceApi->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGet: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **balanceDefinitionId** | **string**| Balance definition id | |
+| **balanceLimitId** | **string**| Balance limit id | |
+| **version** | **string**| Select active to get balance definition configuration which is live for the clients. Select draft to retrieve balance definition configuration with the recent edits | [optional] [default to 'draft'] |
+
+### Return type
+
+[**\Brevo\Client\Models\BalanceLimitPayload**](../Model/BalanceLimitPayload.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPut()`
+
+```php
+loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPut($loyaltyProgramId, $balanceDefinitionId, $balanceLimitId, $balanceLimit): \Brevo\Client\Models\BalanceLimitPayload
+```
+
+Updates balance limit
+
+Updates balance limit
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\BalanceApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$balanceDefinitionId = 'balanceDefinitionId_example'; // string | Balance Definition Id
+$balanceLimitId = 'balanceLimitId_example'; // string | Balance Limit Id
+$balanceLimit = new \Brevo\Client\Models\BalanceLimit(); // \Brevo\Client\Models\BalanceLimit | Balance limit request
+
+try {
+ $result = $apiInstance->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPut($loyaltyProgramId, $balanceDefinitionId, $balanceLimitId, $balanceLimit);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling BalanceApi->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPut: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **balanceDefinitionId** | **string**| Balance Definition Id | |
+| **balanceLimitId** | **string**| Balance Limit Id | |
+| **balanceLimit** | [**\Brevo\Client\Models\BalanceLimit**](../Model/BalanceLimit.md)| Balance limit request | [optional] |
+
+### Return type
+
+[**\Brevo\Client\Models\BalanceLimitPayload**](../Model/BalanceLimitPayload.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPost()`
+
+```php
+loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPost($loyaltyProgramId, $balanceDefinitionId, $balanceLimit): \Brevo\Client\Models\BalanceLimitPayload
+```
+
+Create balance limits
+
+Creates balance limit and send the created UUID along with the data
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\BalanceApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$balanceDefinitionId = 'balanceDefinitionId_example'; // string | Balance Definition Id
+$balanceLimit = new \Brevo\Client\Models\BalanceLimit(); // \Brevo\Client\Models\BalanceLimit | Balance definition information
+
+try {
+ $result = $apiInstance->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPost($loyaltyProgramId, $balanceDefinitionId, $balanceLimit);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling BalanceApi->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPost: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **balanceDefinitionId** | **string**| Balance Definition Id | |
+| **balanceLimit** | [**\Brevo\Client\Models\BalanceLimit**](../Model/BalanceLimit.md)| Balance definition information | [optional] |
+
+### Return type
+
+[**\Brevo\Client\Models\BalanceLimitPayload**](../Model/BalanceLimitPayload.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPut()`
+
+```php
+loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPut($loyaltyProgramId, $balanceDefinitionId, $updateBalanceDefinitionPayload): \Brevo\Client\Models\BalanceDefinition
+```
+
+Update balance definition
+
+Updates Balance definition
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\BalanceApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$balanceDefinitionId = 'balanceDefinitionId_example'; // string | Balance Definition Id
+$updateBalanceDefinitionPayload = new \Brevo\Client\Models\UpdateBalanceDefinitionPayload(); // \Brevo\Client\Models\UpdateBalanceDefinitionPayload | Balance definition information
+
+try {
+ $result = $apiInstance->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPut($loyaltyProgramId, $balanceDefinitionId, $updateBalanceDefinitionPayload);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling BalanceApi->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPut: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **balanceDefinitionId** | **string**| Balance Definition Id | |
+| **updateBalanceDefinitionPayload** | [**\Brevo\Client\Models\UpdateBalanceDefinitionPayload**](../Model/UpdateBalanceDefinitionPayload.md)| Balance definition information | [optional] |
+
+### Return type
+
+[**\Brevo\Client\Models\BalanceDefinition**](../Model/BalanceDefinition.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPost()`
+
+```php
+loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPost($loyaltyProgramId, $createBalanceDefinitionPayload): \Brevo\Client\Models\BalanceDefinition
+```
+
+Create balance definition
+
+Creates balance definition and returns information
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\BalanceApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$createBalanceDefinitionPayload = new \Brevo\Client\Models\CreateBalanceDefinitionPayload(); // \Brevo\Client\Models\CreateBalanceDefinitionPayload | Balance definition information
+
+try {
+ $result = $apiInstance->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPost($loyaltyProgramId, $createBalanceDefinitionPayload);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling BalanceApi->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPost: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **createBalanceDefinitionPayload** | [**\Brevo\Client\Models\CreateBalanceDefinitionPayload**](../Model/CreateBalanceDefinitionPayload.md)| Balance definition information | |
+
+### Return type
+
+[**\Brevo\Client\Models\BalanceDefinition**](../Model/BalanceDefinition.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
diff --git a/docs/Api/CRMApi.md b/docs/Api/CRMApi.md
deleted file mode 100644
index 1802918..0000000
--- a/docs/Api/CRMApi.md
+++ /dev/null
@@ -1,678 +0,0 @@
-# Brevo\Client\CRMApi
-
-All URIs are relative to *https://api.brevo.com/v3*
-
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**crmNotesGet**](CRMApi.md#crmNotesGet) | **GET** /crm/notes | Get all notes
-[**crmNotesIdDelete**](CRMApi.md#crmNotesIdDelete) | **DELETE** /crm/notes/{id} | Delete a note
-[**crmNotesIdGet**](CRMApi.md#crmNotesIdGet) | **GET** /crm/notes/{id} | Get a note
-[**crmNotesIdPatch**](CRMApi.md#crmNotesIdPatch) | **PATCH** /crm/notes/{id} | Update a note
-[**crmNotesPost**](CRMApi.md#crmNotesPost) | **POST** /crm/notes | Create a note
-[**crmTasksGet**](CRMApi.md#crmTasksGet) | **GET** /crm/tasks | Get all tasks
-[**crmTasksIdDelete**](CRMApi.md#crmTasksIdDelete) | **DELETE** /crm/tasks/{id} | Delete a task
-[**crmTasksIdGet**](CRMApi.md#crmTasksIdGet) | **GET** /crm/tasks/{id} | Get a task
-[**crmTasksIdPatch**](CRMApi.md#crmTasksIdPatch) | **PATCH** /crm/tasks/{id} | Update a task
-[**crmTasksPost**](CRMApi.md#crmTasksPost) | **POST** /crm/tasks | Create a task
-[**crmTasktypesGet**](CRMApi.md#crmTasktypesGet) | **GET** /crm/tasktypes | Get all task types
-
-
-# **crmNotesGet**
-> \Brevo\Client\Model\NoteList crmNotesGet($entity, $entityIds, $dateFrom, $dateTo, $offset, $limit, $sort)
-
-Get all notes
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\CRMApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$entity = "entity_example"; // string | Filter by note entity type
-$entityIds = "entityIds_example"; // string | Filter by note entity IDs
-$dateFrom = 56; // int | dateFrom to date range filter type (timestamp in milliseconds)
-$dateTo = 56; // int | dateTo to date range filter type (timestamp in milliseconds)
-$offset = 789; // int | Index of the first document of the page
-$limit = 50; // int | Number of documents per page
-$sort = "sort_example"; // string | Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed
-
-try {
- $result = $apiInstance->crmNotesGet($entity, $entityIds, $dateFrom, $dateTo, $offset, $limit, $sort);
- print_r($result);
-} catch (Exception $e) {
- echo 'Exception when calling CRMApi->crmNotesGet: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **entity** | **string**| Filter by note entity type | [optional]
- **entityIds** | **string**| Filter by note entity IDs | [optional]
- **dateFrom** | **int**| dateFrom to date range filter type (timestamp in milliseconds) | [optional]
- **dateTo** | **int**| dateTo to date range filter type (timestamp in milliseconds) | [optional]
- **offset** | **int**| Index of the first document of the page | [optional]
- **limit** | **int**| Number of documents per page | [optional] [default to 50]
- **sort** | **string**| Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed | [optional]
-
-### Return type
-
-[**\Brevo\Client\Model\NoteList**](../Model/NoteList.md)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **crmNotesIdDelete**
-> crmNotesIdDelete($id)
-
-Delete a note
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\CRMApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$id = "id_example"; // string | Note ID to delete
-
-try {
- $apiInstance->crmNotesIdDelete($id);
-} catch (Exception $e) {
- echo 'Exception when calling CRMApi->crmNotesIdDelete: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| Note ID to delete |
-
-### Return type
-
-void (empty response body)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **crmNotesIdGet**
-> \Brevo\Client\Model\Note crmNotesIdGet($id)
-
-Get a note
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\CRMApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$id = "id_example"; // string | Note ID to get
-
-try {
- $result = $apiInstance->crmNotesIdGet($id);
- print_r($result);
-} catch (Exception $e) {
- echo 'Exception when calling CRMApi->crmNotesIdGet: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| Note ID to get |
-
-### Return type
-
-[**\Brevo\Client\Model\Note**](../Model/Note.md)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **crmNotesIdPatch**
-> crmNotesIdPatch($id, $body)
-
-Update a note
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\CRMApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$id = "id_example"; // string | Note ID to update
-$body = new \Brevo\Client\Model\NoteData(); // \Brevo\Client\Model\NoteData | Note data to update a note
-
-try {
- $apiInstance->crmNotesIdPatch($id, $body);
-} catch (Exception $e) {
- echo 'Exception when calling CRMApi->crmNotesIdPatch: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| Note ID to update |
- **body** | [**\Brevo\Client\Model\NoteData**](../Model/NoteData.md)| Note data to update a note |
-
-### Return type
-
-void (empty response body)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **crmNotesPost**
-> \Brevo\Client\Model\NoteId crmNotesPost($body)
-
-Create a note
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\CRMApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$body = new \Brevo\Client\Model\NoteData(); // \Brevo\Client\Model\NoteData | Note data to create a note.
-
-try {
- $result = $apiInstance->crmNotesPost($body);
- print_r($result);
-} catch (Exception $e) {
- echo 'Exception when calling CRMApi->crmNotesPost: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **body** | [**\Brevo\Client\Model\NoteData**](../Model/NoteData.md)| Note data to create a note. |
-
-### Return type
-
-[**\Brevo\Client\Model\NoteId**](../Model/NoteId.md)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **crmTasksGet**
-> \Brevo\Client\Model\TaskList crmTasksGet($filterType, $filterStatus, $filterDate, $filterAssignTo, $filterContacts, $filterDeals, $filterCompanies, $dateFrom, $dateTo, $offset, $limit, $sort, $sortBy)
-
-Get all tasks
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\CRMApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$filterType = "filterType_example"; // string | Filter by task type (ID)
-$filterStatus = "filterStatus_example"; // string | Filter by task status
-$filterDate = "filterDate_example"; // string | Filter by date
-$filterAssignTo = "filterAssignTo_example"; // string | Filter by assignTo id
-$filterContacts = "filterContacts_example"; // string | Filter by contact ids
-$filterDeals = "filterDeals_example"; // string | Filter by deals ids
-$filterCompanies = "filterCompanies_example"; // string | Filter by companies ids
-$dateFrom = 56; // int | dateFrom to date range filter type (timestamp in milliseconds)
-$dateTo = 56; // int | dateTo to date range filter type (timestamp in milliseconds)
-$offset = 789; // int | Index of the first document of the page
-$limit = 50; // int | Number of documents per page
-$sort = "sort_example"; // string | Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed
-$sortBy = "sortBy_example"; // string | The field used to sort field names.
-
-try {
- $result = $apiInstance->crmTasksGet($filterType, $filterStatus, $filterDate, $filterAssignTo, $filterContacts, $filterDeals, $filterCompanies, $dateFrom, $dateTo, $offset, $limit, $sort, $sortBy);
- print_r($result);
-} catch (Exception $e) {
- echo 'Exception when calling CRMApi->crmTasksGet: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **filterType** | **string**| Filter by task type (ID) | [optional]
- **filterStatus** | **string**| Filter by task status | [optional]
- **filterDate** | **string**| Filter by date | [optional]
- **filterAssignTo** | **string**| Filter by assignTo id | [optional]
- **filterContacts** | **string**| Filter by contact ids | [optional]
- **filterDeals** | **string**| Filter by deals ids | [optional]
- **filterCompanies** | **string**| Filter by companies ids | [optional]
- **dateFrom** | **int**| dateFrom to date range filter type (timestamp in milliseconds) | [optional]
- **dateTo** | **int**| dateTo to date range filter type (timestamp in milliseconds) | [optional]
- **offset** | **int**| Index of the first document of the page | [optional]
- **limit** | **int**| Number of documents per page | [optional] [default to 50]
- **sort** | **string**| Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed | [optional]
- **sortBy** | **string**| The field used to sort field names. | [optional]
-
-### Return type
-
-[**\Brevo\Client\Model\TaskList**](../Model/TaskList.md)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **crmTasksIdDelete**
-> crmTasksIdDelete($id)
-
-Delete a task
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\CRMApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$id = "id_example"; // string |
-
-try {
- $apiInstance->crmTasksIdDelete($id);
-} catch (Exception $e) {
- echo 'Exception when calling CRMApi->crmTasksIdDelete: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| |
-
-### Return type
-
-void (empty response body)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **crmTasksIdGet**
-> \Brevo\Client\Model\Task crmTasksIdGet($id)
-
-Get a task
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\CRMApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$id = "id_example"; // string |
-
-try {
- $result = $apiInstance->crmTasksIdGet($id);
- print_r($result);
-} catch (Exception $e) {
- echo 'Exception when calling CRMApi->crmTasksIdGet: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| |
-
-### Return type
-
-[**\Brevo\Client\Model\Task**](../Model/Task.md)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **crmTasksIdPatch**
-> crmTasksIdPatch($id, $body)
-
-Update a task
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\CRMApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$id = "id_example"; // string |
-$body = new \Brevo\Client\Model\Body1(); // \Brevo\Client\Model\Body1 | Updated task details.
-
-try {
- $apiInstance->crmTasksIdPatch($id, $body);
-} catch (Exception $e) {
- echo 'Exception when calling CRMApi->crmTasksIdPatch: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| |
- **body** | [**\Brevo\Client\Model\Body1**](../Model/Body1.md)| Updated task details. |
-
-### Return type
-
-void (empty response body)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **crmTasksPost**
-> \Brevo\Client\Model\InlineResponse201 crmTasksPost($body)
-
-Create a task
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\CRMApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$body = new \Brevo\Client\Model\Body(); // \Brevo\Client\Model\Body | Task name.
-
-try {
- $result = $apiInstance->crmTasksPost($body);
- print_r($result);
-} catch (Exception $e) {
- echo 'Exception when calling CRMApi->crmTasksPost: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **body** | [**\Brevo\Client\Model\Body**](../Model/Body.md)| Task name. |
-
-### Return type
-
-[**\Brevo\Client\Model\InlineResponse201**](../Model/InlineResponse201.md)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **crmTasktypesGet**
-> \Brevo\Client\Model\TaskTypes crmTasktypesGet()
-
-Get all task types
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\CRMApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-
-try {
- $result = $apiInstance->crmTasktypesGet();
- print_r($result);
-} catch (Exception $e) {
- echo 'Exception when calling CRMApi->crmTasktypesGet: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-This endpoint does not need any parameter.
-
-### Return type
-
-[**\Brevo\Client\Model\TaskTypes**](../Model/TaskTypes.md)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
diff --git a/docs/Api/CompaniesApi.md b/docs/Api/CompaniesApi.md
index a17f87a..7733d95 100644
--- a/docs/Api/CompaniesApi.md
+++ b/docs/Api/CompaniesApi.md
@@ -1,37 +1,45 @@
# Brevo\Client\CompaniesApi
-All URIs are relative to *https://api.brevo.com/v3*
+All URIs are relative to https://api.brevo.com/v3, except if the operation defines another base path.
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**companiesAttributesGet**](CompaniesApi.md#companiesAttributesGet) | **GET** /companies/attributes | Get company attributes
-[**companiesGet**](CompaniesApi.md#companiesGet) | **GET** /companies | Get all companies
-[**companiesIdDelete**](CompaniesApi.md#companiesIdDelete) | **DELETE** /companies/{id} | Delete a company
-[**companiesIdGet**](CompaniesApi.md#companiesIdGet) | **GET** /companies/{id} | Get a company
-[**companiesIdPatch**](CompaniesApi.md#companiesIdPatch) | **PATCH** /companies/{id} | Update a company
-[**companiesLinkUnlinkIdPatch**](CompaniesApi.md#companiesLinkUnlinkIdPatch) | **PATCH** /companies/link-unlink/{id} | Link and Unlink company with contacts and deals
-[**companiesPost**](CompaniesApi.md#companiesPost) | **POST** /companies | Create a company
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**companiesAttributesGet()**](CompaniesApi.md#companiesAttributesGet) | **GET** /companies/attributes | Get company attributes |
+| [**companiesGet()**](CompaniesApi.md#companiesGet) | **GET** /companies | Get all Companies |
+| [**companiesIdDelete()**](CompaniesApi.md#companiesIdDelete) | **DELETE** /companies/{id} | Delete a company |
+| [**companiesIdGet()**](CompaniesApi.md#companiesIdGet) | **GET** /companies/{id} | Get a company |
+| [**companiesIdPatch()**](CompaniesApi.md#companiesIdPatch) | **PATCH** /companies/{id} | Update a company |
+| [**companiesImportPost()**](CompaniesApi.md#companiesImportPost) | **POST** /companies/import | Import companies(creation and updation) |
+| [**companiesLinkUnlinkIdPatch()**](CompaniesApi.md#companiesLinkUnlinkIdPatch) | **PATCH** /companies/link-unlink/{id} | Link and Unlink company with contact and deal |
+| [**companiesPost()**](CompaniesApi.md#companiesPost) | **POST** /companies | Create a company |
-# **companiesAttributesGet**
-> \Brevo\Client\Model\CompanyAttributes companiesAttributesGet()
+## `companiesAttributesGet()`
+
+```php
+companiesAttributesGet(): \Brevo\Client\Models\CompanyAttributesInner[]
+```
Get company attributes
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\CompaniesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
@@ -45,15 +53,15 @@ try {
} catch (Exception $e) {
echo 'Exception when calling CompaniesApi->companiesAttributesGet: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
+
This endpoint does not need any parameter.
### Return type
-[**\Brevo\Client\Model\CompanyAttributes**](../Model/CompanyAttributes.md)
+[**\Brevo\Client\Models\CompanyAttributesInner[]**](../Model/CompanyAttributesInner.md)
### Authorization
@@ -61,43 +69,52 @@ This endpoint does not need any parameter.
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `companiesGet()`
-# **companiesGet**
-> \Brevo\Client\Model\CompaniesList companiesGet($filters, $linkedContactsIds, $linkedDealsIds, $page, $limit, $sort, $sortBy)
+```php
+companiesGet($filters, $linkedContactsIds, $linkedDealsIds, $page, $limit, $sort, $sortBy): \Brevo\Client\Models\CompaniesList
+```
-Get all companies
+Get all Companies
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\CompaniesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$filters = "filters_example"; // string | Filter by attrbutes. If you have filter for owner on your side please send it as {\"attributes.owner\":\"5b1a17d914b73d35a76ca0c7\"}
-$linkedContactsIds = 789; // int | Filter by linked contacts ids
-$linkedDealsIds = "linkedDealsIds_example"; // string | Filter by linked deals ids
-$page = 789; // int | Index of the first document of the page
-$limit = 50; // int | Number of documents per page
-$sort = "sort_example"; // string | Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed
-$sortBy = "sortBy_example"; // string | The field used to sort field names.
+$filters = 'filters_example'; // string | Filter by attrbutes. If you have filter for owner on your side please send it as {\"attributes.owner\":\"6299dcf3874a14eacbc65c46\"}
+$linkedContactsIds = 56; // int | Filter by linked contacts ids
+$linkedDealsIds = 'linkedDealsIds_example'; // string | Filter by linked Deals ids
+$page = 56; // int | Index of the first document of the page
+$limit = 56; // int | Number of documents per page
+$sort = 'sort_example'; // string | Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed
+$sortBy = 'sortBy_example'; // string | The field used to sort field names.
try {
$result = $apiInstance->companiesGet($filters, $linkedContactsIds, $linkedDealsIds, $page, $limit, $sort, $sortBy);
@@ -105,24 +122,23 @@ try {
} catch (Exception $e) {
echo 'Exception when calling CompaniesApi->companiesGet: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **filters** | **string**| Filter by attrbutes. If you have filter for owner on your side please send it as {\"attributes.owner\":\"5b1a17d914b73d35a76ca0c7\"} | [optional]
- **linkedContactsIds** | **int**| Filter by linked contacts ids | [optional]
- **linkedDealsIds** | **string**| Filter by linked deals ids | [optional]
- **page** | **int**| Index of the first document of the page | [optional]
- **limit** | **int**| Number of documents per page | [optional] [default to 50]
- **sort** | **string**| Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed | [optional]
- **sortBy** | **string**| The field used to sort field names. | [optional]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **filters** | **string**| Filter by attrbutes. If you have filter for owner on your side please send it as {\"attributes.owner\":\"6299dcf3874a14eacbc65c46\"} | [optional] |
+| **linkedContactsIds** | **int**| Filter by linked contacts ids | [optional] |
+| **linkedDealsIds** | **string**| Filter by linked Deals ids | [optional] |
+| **page** | **int**| Index of the first document of the page | [optional] |
+| **limit** | **int**| Number of documents per page | [optional] |
+| **sort** | **string**| Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed | [optional] |
+| **sortBy** | **string**| The field used to sort field names. | [optional] |
### Return type
-[**\Brevo\Client\Model\CompaniesList**](../Model/CompaniesList.md)
+[**\Brevo\Client\Models\CompaniesList**](../Model/CompaniesList.md)
### Authorization
@@ -130,51 +146,59 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **companiesIdDelete**
-> companiesIdDelete($id)
+## `companiesIdDelete()`
+
+```php
+companiesIdDelete($id)
+```
Delete a company
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\CompaniesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = "id_example"; // string |
+$id = 'id_example'; // string | Company ID to delete
try {
$apiInstance->companiesIdDelete($id);
} catch (Exception $e) {
echo 'Exception when calling CompaniesApi->companiesIdDelete: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| Company ID to delete | |
### Return type
@@ -186,37 +210,46 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `companiesIdGet()`
-# **companiesIdGet**
-> \Brevo\Client\Model\Company companiesIdGet($id)
+```php
+companiesIdGet($id): \Brevo\Client\Models\Company
+```
Get a company
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\CompaniesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = "id_example"; // string |
+$id = 'id_example'; // string | Get Company Details
try {
$result = $apiInstance->companiesIdGet($id);
@@ -224,18 +257,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling CompaniesApi->companiesIdGet: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| Get Company Details | |
### Return type
-[**\Brevo\Client\Model\Company**](../Model/Company.md)
+[**\Brevo\Client\Models\Company**](../Model/Company.md)
### Authorization
@@ -243,58 +275,135 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **companiesIdPatch**
-> \Brevo\Client\Model\Company companiesIdPatch($id, $body)
+## `companiesIdPatch()`
+
+```php
+companiesIdPatch($id, $companiesIdPatchRequest): \Brevo\Client\Models\Company
+```
Update a company
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\CompaniesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = "id_example"; // string |
-$body = new \Brevo\Client\Model\Body3(); // \Brevo\Client\Model\Body3 | Updated company details.
+$id = 'id_example'; // string
+$companiesIdPatchRequest = new \Brevo\Client\Models\CompaniesIdPatchRequest(); // \Brevo\Client\Models\CompaniesIdPatchRequest | Updated company details.
try {
- $result = $apiInstance->companiesIdPatch($id, $body);
+ $result = $apiInstance->companiesIdPatch($id, $companiesIdPatchRequest);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CompaniesApi->companiesIdPatch: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| |
- **body** | [**\Brevo\Client\Model\Body3**](../Model/Body3.md)| Updated company details. |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| | |
+| **companiesIdPatchRequest** | [**\Brevo\Client\Models\CompaniesIdPatchRequest**](../Model/CompaniesIdPatchRequest.md)| Updated company details. | |
+
+### Return type
+
+[**\Brevo\Client\Models\Company**](../Model/Company.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `companiesImportPost()`
+
+```php
+companiesImportPost($file, $mapping): \Brevo\Client\Models\CompaniesImportPost200Response
+```
+
+Import companies(creation and updation)
+
+Import companies from a CSV file with mapping options.
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\CompaniesApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$file = "/path/to/file.txt"; // \SplFileObject | The CSV file to upload.The file should have the first row as the mapping attribute. Some default attribute names are (a) company_id [brevo mongoID to update deals] (b) associated_contact (c) associated_deal (f) any other attribute with internal name
+$mapping = array('key' => new \stdClass); // object | The mapping options in JSON format. Here is an example of the JSON structure: ```json { \\\"link_entities\\\": true, // Determines whether to link related entities during the import process \\\"unlink_entities\\\": false, // Determines whether to unlink related entities during the import process \\\"update_existing_records\\\": true, // Determines whether to update based on company ID or treat every row as create \\\"unset_empty_attributes\\\": false // Determines whether to unset a specific attribute during update if the values input is blank } ```
+
+try {
+ $result = $apiInstance->companiesImportPost($file, $mapping);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling CompaniesApi->companiesImportPost: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **file** | **\SplFileObject****\SplFileObject**| The CSV file to upload.The file should have the first row as the mapping attribute. Some default attribute names are (a) company_id [brevo mongoID to update deals] (b) associated_contact (c) associated_deal (f) any other attribute with internal name | [optional] |
+| **mapping** | [**object**](../Model/object.md)| The mapping options in JSON format. Here is an example of the JSON structure: ```json { \\\"link_entities\\\": true, // Determines whether to link related entities during the import process \\\"unlink_entities\\\": false, // Determines whether to unlink related entities during the import process \\\"update_existing_records\\\": true, // Determines whether to update based on company ID or treat every row as create \\\"unset_empty_attributes\\\": false // Determines whether to unset a specific attribute during update if the values input is blank } ``` | [optional] |
### Return type
-[**\Brevo\Client\Model\Company**](../Model/Company.md)
+[**\Brevo\Client\Models\CompaniesImportPost200Response**](../Model/CompaniesImportPost200Response.md)
### Authorization
@@ -302,53 +411,61 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `multipart/form-data`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **companiesLinkUnlinkIdPatch**
-> companiesLinkUnlinkIdPatch($id, $body)
+## `companiesLinkUnlinkIdPatch()`
+
+```php
+companiesLinkUnlinkIdPatch($id, $companiesLinkUnlinkIdPatchRequest)
+```
-Link and Unlink company with contacts and deals
+Link and Unlink company with contact and deal
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\CompaniesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = "id_example"; // string |
-$body = new \Brevo\Client\Model\Body4(); // \Brevo\Client\Model\Body4 | Linked / Unlinked contacts and deals ids.
+$id = 'id_example'; // string
+$companiesLinkUnlinkIdPatchRequest = new \Brevo\Client\Models\CompaniesLinkUnlinkIdPatchRequest(); // \Brevo\Client\Models\CompaniesLinkUnlinkIdPatchRequest | Linked / Unlinked contacts and deals ids.
try {
- $apiInstance->companiesLinkUnlinkIdPatch($id, $body);
+ $apiInstance->companiesLinkUnlinkIdPatch($id, $companiesLinkUnlinkIdPatchRequest);
} catch (Exception $e) {
echo 'Exception when calling CompaniesApi->companiesLinkUnlinkIdPatch: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| |
- **body** | [**\Brevo\Client\Model\Body4**](../Model/Body4.md)| Linked / Unlinked contacts and deals ids. |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| | |
+| **companiesLinkUnlinkIdPatchRequest** | [**\Brevo\Client\Models\CompaniesLinkUnlinkIdPatchRequest**](../Model/CompaniesLinkUnlinkIdPatchRequest.md)| Linked / Unlinked contacts and deals ids. | |
### Return type
@@ -360,56 +477,64 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `companiesPost()`
-# **companiesPost**
-> \Brevo\Client\Model\InlineResponse2001 companiesPost($body)
+```php
+companiesPost($companiesPostRequest): \Brevo\Client\Models\CompaniesPost200Response
+```
Create a company
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\CompaniesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$body = new \Brevo\Client\Model\Body2(); // \Brevo\Client\Model\Body2 | Company create data.
+$companiesPostRequest = new \Brevo\Client\Models\CompaniesPostRequest(); // \Brevo\Client\Models\CompaniesPostRequest | Company create data.
try {
- $result = $apiInstance->companiesPost($body);
+ $result = $apiInstance->companiesPost($companiesPostRequest);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CompaniesApi->companiesPost: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **body** | [**\Brevo\Client\Model\Body2**](../Model/Body2.md)| Company create data. |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **companiesPostRequest** | [**\Brevo\Client\Models\CompaniesPostRequest**](../Model/CompaniesPostRequest.md)| Company create data. | |
### Return type
-[**\Brevo\Client\Model\InlineResponse2001**](../Model/InlineResponse2001.md)
+[**\Brevo\Client\Models\CompaniesPost200Response**](../Model/CompaniesPost200Response.md)
### Authorization
@@ -417,8 +542,9 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+- **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)
diff --git a/docs/Api/ContactsApi.md b/docs/Api/ContactsApi.md
index 2139c2d..fada3ba 100644
--- a/docs/Api/ContactsApi.md
+++ b/docs/Api/ContactsApi.md
@@ -1,88 +1,94 @@
# Brevo\Client\ContactsApi
-All URIs are relative to *https://api.brevo.com/v3*
-
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**addContactToList**](ContactsApi.md#addContactToList) | **POST** /contacts/lists/{listId}/contacts/add | Add existing contacts to a list
-[**createAttribute**](ContactsApi.md#createAttribute) | **POST** /contacts/attributes/{attributeCategory}/{attributeName} | Create contact attribute
-[**createContact**](ContactsApi.md#createContact) | **POST** /contacts | Create a contact
-[**createDoiContact**](ContactsApi.md#createDoiContact) | **POST** /contacts/doubleOptinConfirmation | Create Contact via DOI (Double-Opt-In) Flow
-[**createFolder**](ContactsApi.md#createFolder) | **POST** /contacts/folders | Create a folder
-[**createList**](ContactsApi.md#createList) | **POST** /contacts/lists | Create a list
-[**deleteAttribute**](ContactsApi.md#deleteAttribute) | **DELETE** /contacts/attributes/{attributeCategory}/{attributeName} | Delete an attribute
-[**deleteContact**](ContactsApi.md#deleteContact) | **DELETE** /contacts/{identifier} | Delete a contact
-[**deleteFolder**](ContactsApi.md#deleteFolder) | **DELETE** /contacts/folders/{folderId} | Delete a folder (and all its lists)
-[**deleteList**](ContactsApi.md#deleteList) | **DELETE** /contacts/lists/{listId} | Delete a list
-[**deleteMultiAttributeOptions**](ContactsApi.md#deleteMultiAttributeOptions) | **DELETE** /contacts/attributes/{attributeType}/{multipleChoiceAttribute}/{multipleChoiceAttributeOption} | Delete a multiple-choice attribute option
-[**getAttributes**](ContactsApi.md#getAttributes) | **GET** /contacts/attributes | List all attributes
-[**getContactInfo**](ContactsApi.md#getContactInfo) | **GET** /contacts/{identifier} | Get a contact's details
-[**getContactStats**](ContactsApi.md#getContactStats) | **GET** /contacts/{identifier}/campaignStats | Get email campaigns' statistics for a contact
-[**getContacts**](ContactsApi.md#getContacts) | **GET** /contacts | Get all the contacts
-[**getContactsFromList**](ContactsApi.md#getContactsFromList) | **GET** /contacts/lists/{listId}/contacts | Get contacts in a list
-[**getFolder**](ContactsApi.md#getFolder) | **GET** /contacts/folders/{folderId} | Returns a folder's details
-[**getFolderLists**](ContactsApi.md#getFolderLists) | **GET** /contacts/folders/{folderId}/lists | Get lists in a folder
-[**getFolders**](ContactsApi.md#getFolders) | **GET** /contacts/folders | Get all folders
-[**getList**](ContactsApi.md#getList) | **GET** /contacts/lists/{listId} | Get a list's details
-[**getLists**](ContactsApi.md#getLists) | **GET** /contacts/lists | Get all the lists
-[**getSegments**](ContactsApi.md#getSegments) | **GET** /contacts/segments | Get all the Segments
-[**importContacts**](ContactsApi.md#importContacts) | **POST** /contacts/import | Import contacts
-[**removeContactFromList**](ContactsApi.md#removeContactFromList) | **POST** /contacts/lists/{listId}/contacts/remove | Delete a contact from a list
-[**requestContactExport**](ContactsApi.md#requestContactExport) | **POST** /contacts/export | Export contacts
-[**updateAttribute**](ContactsApi.md#updateAttribute) | **PUT** /contacts/attributes/{attributeCategory}/{attributeName} | Update contact attribute
-[**updateBatchContacts**](ContactsApi.md#updateBatchContacts) | **POST** /contacts/batch | Update multiple contacts
-[**updateContact**](ContactsApi.md#updateContact) | **PUT** /contacts/{identifier} | Update a contact
-[**updateFolder**](ContactsApi.md#updateFolder) | **PUT** /contacts/folders/{folderId} | Update a folder
-[**updateList**](ContactsApi.md#updateList) | **PUT** /contacts/lists/{listId} | Update a list
-
-
-# **addContactToList**
-> \Brevo\Client\Model\PostContactInfo addContactToList($listId, $contactEmails)
+All URIs are relative to https://api.brevo.com/v3, except if the operation defines another base path.
+
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**addContactToList()**](ContactsApi.md#addContactToList) | **POST** /contacts/lists/{listId}/contacts/add | Add existing contacts to a list |
+| [**createAttribute()**](ContactsApi.md#createAttribute) | **POST** /contacts/attributes/{attributeCategory}/{attributeName} | Create contact attribute |
+| [**createContact()**](ContactsApi.md#createContact) | **POST** /contacts | Create a contact |
+| [**createDoiContact()**](ContactsApi.md#createDoiContact) | **POST** /contacts/doubleOptinConfirmation | Create Contact via DOI (Double-Opt-In) Flow |
+| [**createFolder()**](ContactsApi.md#createFolder) | **POST** /contacts/folders | Create a folder |
+| [**createList()**](ContactsApi.md#createList) | **POST** /contacts/lists | Create a list |
+| [**deleteAttribute()**](ContactsApi.md#deleteAttribute) | **DELETE** /contacts/attributes/{attributeCategory}/{attributeName} | Delete an attribute |
+| [**deleteContact()**](ContactsApi.md#deleteContact) | **DELETE** /contacts/{identifier} | Delete a contact |
+| [**deleteFolder()**](ContactsApi.md#deleteFolder) | **DELETE** /contacts/folders/{folderId} | Delete a folder (and all its lists) |
+| [**deleteList()**](ContactsApi.md#deleteList) | **DELETE** /contacts/lists/{listId} | Delete a list |
+| [**deleteMultiAttributeOptions()**](ContactsApi.md#deleteMultiAttributeOptions) | **DELETE** /contacts/attributes/{attributeType}/{multipleChoiceAttribute}/{multipleChoiceAttributeOption} | Delete a multiple-choice attribute option |
+| [**getAttributes()**](ContactsApi.md#getAttributes) | **GET** /contacts/attributes | List all attributes |
+| [**getContactInfo()**](ContactsApi.md#getContactInfo) | **GET** /contacts/{identifier} | Get a contact's details |
+| [**getContactStats()**](ContactsApi.md#getContactStats) | **GET** /contacts/{identifier}/campaignStats | Get email campaigns' statistics for a contact |
+| [**getContacts()**](ContactsApi.md#getContacts) | **GET** /contacts | Get all the contacts |
+| [**getContactsFromList()**](ContactsApi.md#getContactsFromList) | **GET** /contacts/lists/{listId}/contacts | Get contacts in a list |
+| [**getFolder()**](ContactsApi.md#getFolder) | **GET** /contacts/folders/{folderId} | Returns a folder's details |
+| [**getFolderLists()**](ContactsApi.md#getFolderLists) | **GET** /contacts/folders/{folderId}/lists | Get lists in a folder |
+| [**getFolders()**](ContactsApi.md#getFolders) | **GET** /contacts/folders | Get all folders |
+| [**getList()**](ContactsApi.md#getList) | **GET** /contacts/lists/{listId} | Get a list's details |
+| [**getLists()**](ContactsApi.md#getLists) | **GET** /contacts/lists | Get all the lists |
+| [**getSegments()**](ContactsApi.md#getSegments) | **GET** /contacts/segments | Get all the segments |
+| [**importContacts()**](ContactsApi.md#importContacts) | **POST** /contacts/import | Import contacts |
+| [**removeContactFromList()**](ContactsApi.md#removeContactFromList) | **POST** /contacts/lists/{listId}/contacts/remove | Delete a contact from a list |
+| [**requestContactExport()**](ContactsApi.md#requestContactExport) | **POST** /contacts/export | Export contacts |
+| [**updateAttribute()**](ContactsApi.md#updateAttribute) | **PUT** /contacts/attributes/{attributeCategory}/{attributeName} | Update contact attribute |
+| [**updateBatchContacts()**](ContactsApi.md#updateBatchContacts) | **POST** /contacts/batch | Update multiple contacts |
+| [**updateContact()**](ContactsApi.md#updateContact) | **PUT** /contacts/{identifier} | Update a contact |
+| [**updateFolder()**](ContactsApi.md#updateFolder) | **PUT** /contacts/folders/{folderId} | Update a folder |
+| [**updateList()**](ContactsApi.md#updateList) | **PUT** /contacts/lists/{listId} | Update a list |
+
+
+## `addContactToList()`
+
+```php
+addContactToList($listId, $addContactToListRequest): \Brevo\Client\Models\PostContactInfo
+```
Add existing contacts to a list
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ContactsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$listId = 789; // int | Id of the list
-$contactEmails = new \Brevo\Client\Model\AddContactToList(); // \Brevo\Client\Model\AddContactToList | Emails addresses OR IDs of the contacts
+$listId = 56; // int | Id of the list
+$addContactToListRequest = {"emails":["jeff32@example.com","jim56@example.com"]}; // \Brevo\Client\Models\AddContactToListRequest | Emails addresses OR IDs OR EXT_ID attributes of the contacts
try {
- $result = $apiInstance->addContactToList($listId, $contactEmails);
+ $result = $apiInstance->addContactToList($listId, $addContactToListRequest);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->addContactToList: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **listId** | **int**| Id of the list |
- **contactEmails** | [**\Brevo\Client\Model\AddContactToList**](../Model/AddContactToList.md)| Emails addresses OR IDs of the contacts |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **listId** | **int**| Id of the list | |
+| **addContactToListRequest** | [**\Brevo\Client\Models\AddContactToListRequest**](../Model/AddContactToListRequest.md)| Emails addresses OR IDs OR EXT_ID attributes of the contacts | |
### Return type
-[**\Brevo\Client\Model\PostContactInfo**](../Model/PostContactInfo.md)
+[**\Brevo\Client\Models\PostContactInfo**](../Model/PostContactInfo.md)
### Authorization
@@ -90,55 +96,63 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **createAttribute**
-> createAttribute($attributeCategory, $attributeName, $createAttribute)
+## `createAttribute()`
+
+```php
+createAttribute($attributeCategory, $attributeName, $createAttribute)
+```
Create contact attribute
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ContactsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$attributeCategory = "attributeCategory_example"; // string | Category of the attribute
-$attributeName = "attributeName_example"; // string | Name of the attribute
-$createAttribute = new \Brevo\Client\Model\CreateAttribute(); // \Brevo\Client\Model\CreateAttribute | Values to create an attribute
+$attributeCategory = 'attributeCategory_example'; // string | Category of the attribute
+$attributeName = 'attributeName_example'; // string | Name of the attribute
+$createAttribute = new \Brevo\Client\Models\CreateAttribute(); // \Brevo\Client\Models\CreateAttribute | Values to create an attribute
try {
$apiInstance->createAttribute($attributeCategory, $attributeName, $createAttribute);
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->createAttribute: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **attributeCategory** | **string**| Category of the attribute |
- **attributeName** | **string**| Name of the attribute |
- **createAttribute** | [**\Brevo\Client\Model\CreateAttribute**](../Model/CreateAttribute.md)| Values to create an attribute |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **attributeCategory** | **string**| Category of the attribute | |
+| **attributeName** | **string**| Name of the attribute | |
+| **createAttribute** | [**\Brevo\Client\Models\CreateAttribute**](../Model/CreateAttribute.md)| Values to create an attribute | |
### Return type
@@ -150,39 +164,48 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **createContact**
-> \Brevo\Client\Model\CreateUpdateContactModel createContact($createContact)
+## `createContact()`
+
+```php
+createContact($createContact): \Brevo\Client\Models\CreateUpdateContactModel
+```
Create a contact
Creates new contacts on Brevo. Contacts can be created by passing either -
1. email address of the contact (email_id),
2. phone number of the contact (to be passed as \"SMS\" field in \"attributes\" along with proper country code), For example- {\"SMS\":\"+91xxxxxxxxxx\"} or {\"SMS\":\"0091xxxxxxxxxx\"}
3. ext_id
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ContactsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$createContact = new \Brevo\Client\Model\CreateContact(); // \Brevo\Client\Model\CreateContact | Values to create a contact
+$createContact = new \Brevo\Client\Models\CreateContact(); // \Brevo\Client\Models\CreateContact | Values to create a contact
try {
$result = $apiInstance->createContact($createContact);
@@ -190,18 +213,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->createContact: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **createContact** | [**\Brevo\Client\Model\CreateContact**](../Model/CreateContact.md)| Values to create a contact |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **createContact** | [**\Brevo\Client\Models\CreateContact**](../Model/CreateContact.md)| Values to create a contact | |
### Return type
-[**\Brevo\Client\Model\CreateUpdateContactModel**](../Model/CreateUpdateContactModel.md)
+[**\Brevo\Client\Models\CreateUpdateContactModel**](../Model/CreateUpdateContactModel.md)
### Authorization
@@ -209,51 +231,59 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **createDoiContact**
-> createDoiContact($createDoiContact)
+## `createDoiContact()`
+
+```php
+createDoiContact($createDoiContact)
+```
Create Contact via DOI (Double-Opt-In) Flow
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ContactsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$createDoiContact = new \Brevo\Client\Model\CreateDoiContact(); // \Brevo\Client\Model\CreateDoiContact | Values to create the Double opt-in (DOI) contact
+$createDoiContact = new \Brevo\Client\Models\CreateDoiContact(); // \Brevo\Client\Models\CreateDoiContact | Values to create the Double opt-in (DOI) contact
try {
$apiInstance->createDoiContact($createDoiContact);
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->createDoiContact: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **createDoiContact** | [**\Brevo\Client\Model\CreateDoiContact**](../Model/CreateDoiContact.md)| Values to create the Double opt-in (DOI) contact |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **createDoiContact** | [**\Brevo\Client\Models\CreateDoiContact**](../Model/CreateDoiContact.md)| Values to create the Double opt-in (DOI) contact | |
### Return type
@@ -265,37 +295,46 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `createFolder()`
-# **createFolder**
-> \Brevo\Client\Model\CreateModel createFolder($createFolder)
+```php
+createFolder($createFolder): \Brevo\Client\Models\CreateModel
+```
Create a folder
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ContactsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$createFolder = new \Brevo\Client\Model\CreateUpdateFolder(); // \Brevo\Client\Model\CreateUpdateFolder | Name of the folder
+$createFolder = new \Brevo\Client\Models\CreateUpdateFolder(); // \Brevo\Client\Models\CreateUpdateFolder | Name of the folder
try {
$result = $apiInstance->createFolder($createFolder);
@@ -303,18 +342,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->createFolder: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **createFolder** | [**\Brevo\Client\Model\CreateUpdateFolder**](../Model/CreateUpdateFolder.md)| Name of the folder |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **createFolder** | [**\Brevo\Client\Models\CreateUpdateFolder**](../Model/CreateUpdateFolder.md)| Name of the folder | |
### Return type
-[**\Brevo\Client\Model\CreateModel**](../Model/CreateModel.md)
+[**\Brevo\Client\Models\CreateModel**](../Model/CreateModel.md)
### Authorization
@@ -322,37 +360,46 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `createList()`
-# **createList**
-> \Brevo\Client\Model\CreateModel createList($createList)
+```php
+createList($createList): \Brevo\Client\Models\CreateModel
+```
Create a list
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ContactsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$createList = new \Brevo\Client\Model\CreateList(); // \Brevo\Client\Model\CreateList | Values to create a list
+$createList = new \Brevo\Client\Models\CreateList(); // \Brevo\Client\Models\CreateList | Values to create a list
try {
$result = $apiInstance->createList($createList);
@@ -360,18 +407,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->createList: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **createList** | [**\Brevo\Client\Model\CreateList**](../Model/CreateList.md)| Values to create a list |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **createList** | [**\Brevo\Client\Models\CreateList**](../Model/CreateList.md)| Values to create a list | |
### Return type
-[**\Brevo\Client\Model\CreateModel**](../Model/CreateModel.md)
+[**\Brevo\Client\Models\CreateModel**](../Model/CreateModel.md)
### Authorization
@@ -379,53 +425,61 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **deleteAttribute**
-> deleteAttribute($attributeCategory, $attributeName)
+## `deleteAttribute()`
+
+```php
+deleteAttribute($attributeCategory, $attributeName)
+```
Delete an attribute
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ContactsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$attributeCategory = "attributeCategory_example"; // string | Category of the attribute
-$attributeName = "attributeName_example"; // string | Name of the existing attribute
+$attributeCategory = 'attributeCategory_example'; // string | Category of the attribute
+$attributeName = 'attributeName_example'; // string | Name of the existing attribute
try {
$apiInstance->deleteAttribute($attributeCategory, $attributeName);
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->deleteAttribute: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **attributeCategory** | **string**| Category of the attribute |
- **attributeName** | **string**| Name of the existing attribute |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **attributeCategory** | **string**| Category of the attribute | |
+| **attributeName** | **string**| Name of the existing attribute | |
### Return type
@@ -437,55 +491,63 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `deleteContact()`
-# **deleteContact**
-> deleteContact($identifier, $identifierType)
+```php
+deleteContact($identifier, $identifierType)
+```
Delete a contact
There are 2 ways to delete a contact
Option 1- https://api.brevo.com/v3/contacts/{identifier}
Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}
Option 1 only works if identifierType is email_id (for EMAIL) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL and ID of the contact.
Option 2 works for all identifierType, use email_id for EMAIL attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute.
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ContactsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$identifier = "identifier_example"; // string | Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded)
-$identifierType = new \stdClass; // object | email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute
+$identifier = new \Brevo\Client\Models\\Brevo\Client\Models\GetContactInfoIdentifierParameter(); // \Brevo\Client\Models\GetContactInfoIdentifierParameter | Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded)
+$identifierType = 'identifierType_example'; // string | email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute
try {
$apiInstance->deleteContact($identifier, $identifierType);
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->deleteContact: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **identifier** | **string**| Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) |
- **identifierType** | [**object**](../Model/.md)| email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute | [optional]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **identifier** | [**\Brevo\Client\Models\GetContactInfoIdentifierParameter**](../Model/.md)| Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) | |
+| **identifierType** | **string**| email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute | [optional] |
### Return type
@@ -497,51 +559,59 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **deleteFolder**
-> deleteFolder($folderId)
+## `deleteFolder()`
+
+```php
+deleteFolder($folderId)
+```
Delete a folder (and all its lists)
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ContactsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$folderId = 789; // int | Id of the folder
+$folderId = 56; // int | Id of the folder
try {
$apiInstance->deleteFolder($folderId);
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->deleteFolder: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **folderId** | **int**| Id of the folder |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **folderId** | **int**| Id of the folder | |
### Return type
@@ -553,51 +623,59 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **deleteList**
-> deleteList($listId)
+## `deleteList()`
+
+```php
+deleteList($listId)
+```
Delete a list
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ContactsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$listId = 789; // int | Id of the list
+$listId = 56; // int | Id of the list
try {
$apiInstance->deleteList($listId);
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->deleteList: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **listId** | **int**| Id of the list |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **listId** | **int**| Id of the list | |
### Return type
@@ -609,55 +687,63 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **deleteMultiAttributeOptions**
-> deleteMultiAttributeOptions($attributeType, $multipleChoiceAttribute, $multipleChoiceAttributeOption)
+## `deleteMultiAttributeOptions()`
+
+```php
+deleteMultiAttributeOptions($attributeType, $multipleChoiceAttribute, $multipleChoiceAttributeOption)
+```
Delete a multiple-choice attribute option
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ContactsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$attributeType = "attributeType_example"; // string | Type of the attribute
-$multipleChoiceAttribute = "multipleChoiceAttribute_example"; // string | Name of the existing multiple-choice attribute
-$multipleChoiceAttributeOption = "multipleChoiceAttributeOption_example"; // string | Name of the existing multiple-choice attribute option that you want to delete
+$attributeType = 'attributeType_example'; // string | Type of the attribute
+$multipleChoiceAttribute = 'multipleChoiceAttribute_example'; // string | Name of the existing muliple-choice attribute
+$multipleChoiceAttributeOption = 'multipleChoiceAttributeOption_example'; // string | Name of the existing multiple-choice attribute option that you want to delete
try {
$apiInstance->deleteMultiAttributeOptions($attributeType, $multipleChoiceAttribute, $multipleChoiceAttributeOption);
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->deleteMultiAttributeOptions: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **attributeType** | **string**| Type of the attribute |
- **multipleChoiceAttribute** | **string**| Name of the existing multiple-choice attribute |
- **multipleChoiceAttributeOption** | **string**| Name of the existing multiple-choice attribute option that you want to delete |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **attributeType** | **string**| Type of the attribute | |
+| **multipleChoiceAttribute** | **string**| Name of the existing muliple-choice attribute | |
+| **multipleChoiceAttributeOption** | **string**| Name of the existing multiple-choice attribute option that you want to delete | |
### Return type
@@ -669,30 +755,39 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getAttributes**
-> \Brevo\Client\Model\GetAttributes getAttributes()
+## `getAttributes()`
+
+```php
+getAttributes(): \Brevo\Client\Models\GetAttributes
+```
List all attributes
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ContactsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
@@ -706,15 +801,15 @@ try {
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->getAttributes: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
+
This endpoint does not need any parameter.
### Return type
-[**\Brevo\Client\Model\GetAttributes**](../Model/GetAttributes.md)
+[**\Brevo\Client\Models\GetAttributes**](../Model/GetAttributes.md)
### Authorization
@@ -722,42 +817,51 @@ This endpoint does not need any parameter.
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getContactInfo**
-> \Brevo\Client\Model\GetExtendedContactDetails getContactInfo($identifier, $identifierType, $startDate, $endDate)
+## `getContactInfo()`
+
+```php
+getContactInfo($identifier, $identifierType, $startDate, $endDate): \Brevo\Client\Models\GetExtendedContactDetails
+```
Get a contact's details
-There are 2 ways to get a contact
Option 1- https://api.brevo.com/v3/contacts/{identifier}
Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}
Option 1 only works if identifierType is email_id (for EMAIL), phone_id (for SMS) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL, SMS and ID of the contact.
Option 2 works for all identifierType, use email_id for EMAIL attribute, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute
Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats ``https://developers.brevo.com/reference/contacts-7#getcontactstats`` endpoint with the appropriate date ranges.
+There are 2 ways to get a contact
Option 1- https://api.brevo.com/v3/contacts/{identifier}
Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}
Option 1 only works if identifierType is email_id (for EMAIL), phone_id (for SMS) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL, SMS and ID of the contact.
Option 2 works for all identifierType, use email_id for EMAIL attribute, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute
Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats ``https://developers.brevo.com/reference/contacts-7#getcontactstats`` endpoint with the appropriate date ranges.
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ContactsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$identifier = "identifier_example"; // string | Email (urlencoded) OR ID of the contact OR its SMS attribute value OR EXT_ID attribute (urlencoded)
-$identifierType = new \stdClass; // object | email_id for Email, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute
-$startDate = "startDate_example"; // string | **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate
-$endDate = "endDate_example"; // string | **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate.
+$identifier = new \Brevo\Client\Models\\Brevo\Client\Models\GetContactInfoIdentifierParameter(); // \Brevo\Client\Models\GetContactInfoIdentifierParameter | Email (urlencoded) OR ID of the contact OR its SMS attribute value OR EXT_ID attribute (urlencoded)
+$identifierType = 'identifierType_example'; // string | email_id for Email, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute
+$startDate = 'startDate_example'; // string | **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate
+$endDate = 'endDate_example'; // string | **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate.
try {
$result = $apiInstance->getContactInfo($identifier, $identifierType, $startDate, $endDate);
@@ -765,21 +869,20 @@ try {
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->getContactInfo: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **identifier** | **string**| Email (urlencoded) OR ID of the contact OR its SMS attribute value OR EXT_ID attribute (urlencoded) |
- **identifierType** | [**object**](../Model/.md)| email_id for Email, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute | [optional]
- **startDate** | **string**| **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate | [optional]
- **endDate** | **string**| **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. | [optional]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **identifier** | [**\Brevo\Client\Models\GetContactInfoIdentifierParameter**](../Model/.md)| Email (urlencoded) OR ID of the contact OR its SMS attribute value OR EXT_ID attribute (urlencoded) | |
+| **identifierType** | **string**| email_id for Email, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute | [optional] |
+| **startDate** | **string**| **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate | [optional] |
+| **endDate** | **string**| **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. | [optional] |
### Return type
-[**\Brevo\Client\Model\GetExtendedContactDetails**](../Model/GetExtendedContactDetails.md)
+[**\Brevo\Client\Models\GetExtendedContactDetails**](../Model/GetExtendedContactDetails.md)
### Authorization
@@ -787,39 +890,48 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `getContactStats()`
-# **getContactStats**
-> \Brevo\Client\Model\GetContactCampaignStats getContactStats($identifier, $startDate, $endDate)
+```php
+getContactStats($identifier, $startDate, $endDate): \Brevo\Client\Models\GetContactCampaignStats
+```
Get email campaigns' statistics for a contact
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ContactsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$identifier = "identifier_example"; // string | Email (urlencoded) OR ID of the contact
-$startDate = "startDate_example"; // string | Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate
-$endDate = "endDate_example"; // string | Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days
+$identifier = new \Brevo\Client\Models\\Brevo\Client\Models\GetContactInfoIdentifierParameter(); // \Brevo\Client\Models\GetContactInfoIdentifierParameter | Email (urlencoded) OR ID of the contact
+$startDate = 'startDate_example'; // string | **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate
+$endDate = 'endDate_example'; // string | **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days
try {
$result = $apiInstance->getContactStats($identifier, $startDate, $endDate);
@@ -827,20 +939,19 @@ try {
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->getContactStats: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **identifier** | **string**| Email (urlencoded) OR ID of the contact |
- **startDate** | **string**| Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate | [optional]
- **endDate** | **string**| Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days | [optional]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **identifier** | [**\Brevo\Client\Models\GetContactInfoIdentifierParameter**](../Model/.md)| Email (urlencoded) OR ID of the contact | |
+| **startDate** | **string**| **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate | [optional] |
+| **endDate** | **string**| **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days | [optional] |
### Return type
-[**\Brevo\Client\Model\GetContactCampaignStats**](../Model/GetContactCampaignStats.md)
+[**\Brevo\Client\Models\GetContactCampaignStats**](../Model/GetContactCampaignStats.md)
### Authorization
@@ -848,30 +959,39 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getContacts**
-> \Brevo\Client\Model\GetContacts getContacts($limit, $offset, $modifiedSince, $createdSince, $sort, $segmentId, $listIds, $filter)
+## `getContacts()`
+
+```php
+getContacts($limit, $offset, $modifiedSince, $createdSince, $sort, $segmentId, $listIds, $filter): \Brevo\Client\Models\GetContacts
+```
Get all the contacts
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ContactsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
@@ -880,12 +1000,12 @@ $apiInstance = new Brevo\Client\Api\ContactsApi(
);
$limit = 50; // int | Number of documents per page
$offset = 0; // int | Index of the first document of the page
-$modifiedSince = "modifiedSince_example"; // string | Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.
-$createdSince = "createdSince_example"; // string | Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.
-$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
-$segmentId = 789; // int | Id of the segment. **Either listIds or segmentId can be passed.**
+$modifiedSince = 'modifiedSince_example'; // string | Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
+$createdSince = 'createdSince_example'; // string | Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
+$sort = 'desc'; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
+$segmentId = 56; // int | Id of the segment. **Either listIds or segmentId can be passed.**
$listIds = array(56); // int[] | Ids of the list. **Either listIds or segmentId can be passed.**
-$filter = "filter_example"; // string | Filter the contacts on the basis of attributes. **Allowed operator: equals. (e.g. filter=equals(FIRSTNAME,\"Antoine\"), filter=equals(B1, true), filter=equals(DOB, \"1989-11-23\"))**
+$filter = 'filter_example'; // string | Filter the contacts on the basis of attributes. **Allowed operator: equals. (e.g. filter=equals(FIRSTNAME,\"Antoine\"), filter=equals(B1, true), filter=equals(DOB, \"1989-11-23\"))**
try {
$result = $apiInstance->getContacts($limit, $offset, $modifiedSince, $createdSince, $sort, $segmentId, $listIds, $filter);
@@ -893,25 +1013,24 @@ try {
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->getContacts: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **limit** | **int**| Number of documents per page | [optional] [default to 50]
- **offset** | **int**| Index of the first document of the page | [optional] [default to 0]
- **modifiedSince** | **string**| Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. | [optional]
- **createdSince** | **string**| Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. | [optional]
- **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
- **segmentId** | **int**| Id of the segment. **Either listIds or segmentId can be passed.** | [optional]
- **listIds** | [**int[]**](../Model/int.md)| Ids of the list. **Either listIds or segmentId can be passed.** | [optional]
- **filter** | **string**| Filter the contacts on the basis of attributes. **Allowed operator: equals. (e.g. filter=equals(FIRSTNAME,\"Antoine\"), filter=equals(B1, true), filter=equals(DOB, \"1989-11-23\"))** | [optional]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **limit** | **int**| Number of documents per page | [optional] [default to 50] |
+| **offset** | **int**| Index of the first document of the page | [optional] [default to 0] |
+| **modifiedSince** | **string**| Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** | [optional] |
+| **createdSince** | **string**| Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** | [optional] |
+| **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to 'desc'] |
+| **segmentId** | **int**| Id of the segment. **Either listIds or segmentId can be passed.** | [optional] |
+| **listIds** | [**int[]**](../Model/int.md)| Ids of the list. **Either listIds or segmentId can be passed.** | [optional] |
+| **filter** | **string**| Filter the contacts on the basis of attributes. **Allowed operator: equals. (e.g. filter=equals(FIRSTNAME,\"Antoine\"), filter=equals(B1, true), filter=equals(DOB, \"1989-11-23\"))** | [optional] |
### Return type
-[**\Brevo\Client\Model\GetContacts**](../Model/GetContacts.md)
+[**\Brevo\Client\Models\GetContacts**](../Model/GetContacts.md)
### Authorization
@@ -919,41 +1038,50 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getContactsFromList**
-> \Brevo\Client\Model\GetContacts getContactsFromList($listId, $modifiedSince, $limit, $offset, $sort)
+## `getContactsFromList()`
+
+```php
+getContactsFromList($listId, $modifiedSince, $limit, $offset, $sort): \Brevo\Client\Models\GetContacts
+```
Get contacts in a list
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ContactsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$listId = 789; // int | Id of the list
-$modifiedSince = "modifiedSince_example"; // string | Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.
+$listId = 56; // int | Id of the list
+$modifiedSince = 'modifiedSince_example'; // string | Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
$limit = 50; // int | Number of documents per page
$offset = 0; // int | Index of the first document of the page
-$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
+$sort = 'desc'; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
try {
$result = $apiInstance->getContactsFromList($listId, $modifiedSince, $limit, $offset, $sort);
@@ -961,22 +1089,21 @@ try {
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->getContactsFromList: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **listId** | **int**| Id of the list |
- **modifiedSince** | **string**| Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. | [optional]
- **limit** | **int**| Number of documents per page | [optional] [default to 50]
- **offset** | **int**| Index of the first document of the page | [optional] [default to 0]
- **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **listId** | **int**| Id of the list | |
+| **modifiedSince** | **string**| Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** | [optional] |
+| **limit** | **int**| Number of documents per page | [optional] [default to 50] |
+| **offset** | **int**| Index of the first document of the page | [optional] [default to 0] |
+| **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to 'desc'] |
### Return type
-[**\Brevo\Client\Model\GetContacts**](../Model/GetContacts.md)
+[**\Brevo\Client\Models\GetContacts**](../Model/GetContacts.md)
### Authorization
@@ -984,37 +1111,46 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getFolder**
-> \Brevo\Client\Model\GetFolder getFolder($folderId)
+## `getFolder()`
+
+```php
+getFolder($folderId): \Brevo\Client\Models\GetFolder
+```
Returns a folder's details
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ContactsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$folderId = 789; // int | id of the folder
+$folderId = 56; // int | id of the folder
try {
$result = $apiInstance->getFolder($folderId);
@@ -1022,18 +1158,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->getFolder: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **folderId** | **int**| id of the folder |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **folderId** | **int**| id of the folder | |
### Return type
-[**\Brevo\Client\Model\GetFolder**](../Model/GetFolder.md)
+[**\Brevo\Client\Models\GetFolder**](../Model/GetFolder.md)
### Authorization
@@ -1041,40 +1176,49 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getFolderLists**
-> \Brevo\Client\Model\GetFolderLists getFolderLists($folderId, $limit, $offset, $sort)
+## `getFolderLists()`
+
+```php
+getFolderLists($folderId, $limit, $offset, $sort): \Brevo\Client\Models\GetFolderLists
+```
Get lists in a folder
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ContactsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$folderId = 789; // int | Id of the folder
+$folderId = 56; // int | Id of the folder
$limit = 10; // int | Number of documents per page
$offset = 0; // int | Index of the first document of the page
-$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
+$sort = 'desc'; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
try {
$result = $apiInstance->getFolderLists($folderId, $limit, $offset, $sort);
@@ -1082,21 +1226,20 @@ try {
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->getFolderLists: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **folderId** | **int**| Id of the folder |
- **limit** | **int**| Number of documents per page | [optional] [default to 10]
- **offset** | **int**| Index of the first document of the page | [optional] [default to 0]
- **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **folderId** | **int**| Id of the folder | |
+| **limit** | **int**| Number of documents per page | [optional] [default to 10] |
+| **offset** | **int**| Index of the first document of the page | [optional] [default to 0] |
+| **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to 'desc'] |
### Return type
-[**\Brevo\Client\Model\GetFolderLists**](../Model/GetFolderLists.md)
+[**\Brevo\Client\Models\GetFolderLists**](../Model/GetFolderLists.md)
### Authorization
@@ -1104,30 +1247,39 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getFolders**
-> \Brevo\Client\Model\GetFolders getFolders($limit, $offset, $sort)
+## `getFolders()`
+
+```php
+getFolders($limit, $offset, $sort): \Brevo\Client\Models\GetFolders
+```
Get all folders
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ContactsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
@@ -1136,7 +1288,7 @@ $apiInstance = new Brevo\Client\Api\ContactsApi(
);
$limit = 10; // int | Number of documents per page
$offset = 0; // int | Index of the first document of the page
-$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
+$sort = 'desc'; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
try {
$result = $apiInstance->getFolders($limit, $offset, $sort);
@@ -1144,20 +1296,19 @@ try {
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->getFolders: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **limit** | **int**| Number of documents per page | [default to 10]
- **offset** | **int**| Index of the first document of the page | [default to 0]
- **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **limit** | **int**| Number of documents per page | [optional] [default to 10] |
+| **offset** | **int**| Index of the first document of the page | [optional] [default to 0] |
+| **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to 'desc'] |
### Return type
-[**\Brevo\Client\Model\GetFolders**](../Model/GetFolders.md)
+[**\Brevo\Client\Models\GetFolders**](../Model/GetFolders.md)
### Authorization
@@ -1165,39 +1316,48 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `getList()`
-# **getList**
-> \Brevo\Client\Model\GetExtendedList getList($listId, $startDate, $endDate)
+```php
+getList($listId, $startDate, $endDate): \Brevo\Client\Models\GetExtendedList
+```
Get a list's details
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ContactsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$listId = 789; // int | Id of the list
-$startDate = "startDate_example"; // string | Mandatory if endDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id.Prefer to pass your timezone in date-time format for accurate result
-$endDate = "endDate_example"; // string | Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id.Prefer to pass your timezone in date-time format for accurate result
+$listId = 56; // int | Id of the list
+$startDate = 'startDate_example'; // string | **Mandatory if endDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id. **Prefer to pass your timezone in date-time format for accurate result**
+$endDate = 'endDate_example'; // string | **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id. **Prefer to pass your timezone in date-time format for accurate result**
try {
$result = $apiInstance->getList($listId, $startDate, $endDate);
@@ -1205,20 +1365,19 @@ try {
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->getList: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **listId** | **int**| Id of the list |
- **startDate** | **string**| Mandatory if endDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id.Prefer to pass your timezone in date-time format for accurate result | [optional]
- **endDate** | **string**| Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id.Prefer to pass your timezone in date-time format for accurate result | [optional]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **listId** | **int**| Id of the list | |
+| **startDate** | **string**| **Mandatory if endDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id. **Prefer to pass your timezone in date-time format for accurate result** | [optional] |
+| **endDate** | **string**| **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id. **Prefer to pass your timezone in date-time format for accurate result** | [optional] |
### Return type
-[**\Brevo\Client\Model\GetExtendedList**](../Model/GetExtendedList.md)
+[**\Brevo\Client\Models\GetExtendedList**](../Model/GetExtendedList.md)
### Authorization
@@ -1226,30 +1385,39 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `getLists()`
-# **getLists**
-> \Brevo\Client\Model\GetLists getLists($limit, $offset, $sort)
+```php
+getLists($limit, $offset, $sort): \Brevo\Client\Models\GetLists
+```
Get all the lists
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ContactsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
@@ -1258,7 +1426,7 @@ $apiInstance = new Brevo\Client\Api\ContactsApi(
);
$limit = 10; // int | Number of documents per page
$offset = 0; // int | Index of the first document of the page
-$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
+$sort = 'desc'; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
try {
$result = $apiInstance->getLists($limit, $offset, $sort);
@@ -1266,20 +1434,19 @@ try {
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->getLists: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **limit** | **int**| Number of documents per page | [optional] [default to 10]
- **offset** | **int**| Index of the first document of the page | [optional] [default to 0]
- **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **limit** | **int**| Number of documents per page | [optional] [default to 10] |
+| **offset** | **int**| Index of the first document of the page | [optional] [default to 0] |
+| **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to 'desc'] |
### Return type
-[**\Brevo\Client\Model\GetLists**](../Model/GetLists.md)
+[**\Brevo\Client\Models\GetLists**](../Model/GetLists.md)
### Authorization
@@ -1287,30 +1454,39 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getSegments**
-> \Brevo\Client\Model\GetSegments getSegments($limit, $offset, $sort)
+## `getSegments()`
-Get all the Segments
+```php
+getSegments($limit, $offset, $sort): \Brevo\Client\Models\GetSegments
+```
+
+Get all the segments
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ContactsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
@@ -1319,7 +1495,7 @@ $apiInstance = new Brevo\Client\Api\ContactsApi(
);
$limit = 10; // int | Number of documents per page
$offset = 0; // int | Index of the first document of the page
-$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
+$sort = 'desc'; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
try {
$result = $apiInstance->getSegments($limit, $offset, $sort);
@@ -1327,20 +1503,19 @@ try {
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->getSegments: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **limit** | **int**| Number of documents per page | [default to 10]
- **offset** | **int**| Index of the first document of the page | [default to 0]
- **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **limit** | **int**| Number of documents per page | [optional] [default to 10] |
+| **offset** | **int**| Index of the first document of the page | [optional] [default to 0] |
+| **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to 'desc'] |
### Return type
-[**\Brevo\Client\Model\GetSegments**](../Model/GetSegments.md)
+[**\Brevo\Client\Models\GetSegments**](../Model/GetSegments.md)
### Authorization
@@ -1348,39 +1523,48 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `importContacts()`
-# **importContacts**
-> \Brevo\Client\Model\CreatedProcessId importContacts($requestContactImport)
+```php
+importContacts($requestContactImport): \Brevo\Client\Models\CreatedProcessId
+```
Import contacts
It returns the background process ID which on completion calls the notify URL that you have set in the input. **Note**: - Any contact attribute that doesn't exist in your account will be ignored at import end.
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ContactsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$requestContactImport = new \Brevo\Client\Model\RequestContactImport(); // \Brevo\Client\Model\RequestContactImport | Values to import contacts in Brevo. To know more about the expected format, please have a look at ``https://help.brevo.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns``
+$requestContactImport = new \Brevo\Client\Models\RequestContactImport(); // \Brevo\Client\Models\RequestContactImport | Values to import contacts in Brevo. To know more about the expected format, please have a look at ``https://help.brevo.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns``
try {
$result = $apiInstance->importContacts($requestContactImport);
@@ -1388,18 +1572,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->importContacts: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **requestContactImport** | [**\Brevo\Client\Model\RequestContactImport**](../Model/RequestContactImport.md)| Values to import contacts in Brevo. To know more about the expected format, please have a look at ``https://help.brevo.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **requestContactImport** | [**\Brevo\Client\Models\RequestContactImport**](../Model/RequestContactImport.md)| Values to import contacts in Brevo. To know more about the expected format, please have a look at ``https://help.brevo.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` | |
### Return type
-[**\Brevo\Client\Model\CreatedProcessId**](../Model/CreatedProcessId.md)
+[**\Brevo\Client\Models\CreatedProcessId**](../Model/CreatedProcessId.md)
### Authorization
@@ -1407,38 +1590,47 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **removeContactFromList**
-> \Brevo\Client\Model\PostContactInfo removeContactFromList($listId, $contactEmails)
+## `removeContactFromList()`
+
+```php
+removeContactFromList($listId, $contactEmails): \Brevo\Client\Models\PostContactInfo
+```
Delete a contact from a list
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ContactsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$listId = 789; // int | Id of the list
-$contactEmails = new \Brevo\Client\Model\RemoveContactFromList(); // \Brevo\Client\Model\RemoveContactFromList | Emails addresses OR IDs of the contacts
+$listId = 56; // int | Id of the list
+$contactEmails = {"emails":["jeff32@example.com","jim56@example.com"]}; // \Brevo\Client\Models\RemoveContactFromListRequest | Emails adresses OR IDs OR EXT_ID attributes of the contacts OR 'all' true
try {
$result = $apiInstance->removeContactFromList($listId, $contactEmails);
@@ -1446,19 +1638,18 @@ try {
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->removeContactFromList: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **listId** | **int**| Id of the list |
- **contactEmails** | [**\Brevo\Client\Model\RemoveContactFromList**](../Model/RemoveContactFromList.md)| Emails addresses OR IDs of the contacts |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **listId** | **int**| Id of the list | |
+| **contactEmails** | [**\Brevo\Client\Models\RemoveContactFromListRequest**](../Model/RemoveContactFromListRequest.md)| Emails adresses OR IDs OR EXT_ID attributes of the contacts OR 'all' true | |
### Return type
-[**\Brevo\Client\Model\PostContactInfo**](../Model/PostContactInfo.md)
+[**\Brevo\Client\Models\PostContactInfo**](../Model/PostContactInfo.md)
### Authorization
@@ -1466,39 +1657,48 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **requestContactExport**
-> \Brevo\Client\Model\CreatedProcessId requestContactExport($requestContactExport)
+## `requestContactExport()`
+
+```php
+requestContactExport($requestContactExport): \Brevo\Client\Models\CreatedProcessId
+```
Export contacts
It returns the background process ID which on completion calls the notify URL that you have set in the input. File will be available in csv.
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ContactsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$requestContactExport = new \Brevo\Client\Model\RequestContactExport(); // \Brevo\Client\Model\RequestContactExport | Values to request a contact export
+$requestContactExport = new \Brevo\Client\Models\RequestContactExport(); // \Brevo\Client\Models\RequestContactExport | Values to request a contact export
try {
$result = $apiInstance->requestContactExport($requestContactExport);
@@ -1506,18 +1706,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->requestContactExport: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **requestContactExport** | [**\Brevo\Client\Model\RequestContactExport**](../Model/RequestContactExport.md)| Values to request a contact export |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **requestContactExport** | [**\Brevo\Client\Models\RequestContactExport**](../Model/RequestContactExport.md)| Values to request a contact export | |
### Return type
-[**\Brevo\Client\Model\CreatedProcessId**](../Model/CreatedProcessId.md)
+[**\Brevo\Client\Models\CreatedProcessId**](../Model/CreatedProcessId.md)
### Authorization
@@ -1525,55 +1724,63 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **updateAttribute**
-> updateAttribute($attributeCategory, $attributeName, $updateAttribute)
+## `updateAttribute()`
+
+```php
+updateAttribute($attributeCategory, $attributeName, $updateAttribute)
+```
Update contact attribute
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ContactsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$attributeCategory = "attributeCategory_example"; // string | Category of the attribute
-$attributeName = "attributeName_example"; // string | Name of the existing attribute
-$updateAttribute = new \Brevo\Client\Model\UpdateAttribute(); // \Brevo\Client\Model\UpdateAttribute | Values to update an attribute
+$attributeCategory = 'attributeCategory_example'; // string | Category of the attribute
+$attributeName = 'attributeName_example'; // string | Name of the existing attribute
+$updateAttribute = new \Brevo\Client\Models\UpdateAttribute(); // \Brevo\Client\Models\UpdateAttribute | Values to update an attribute
try {
$apiInstance->updateAttribute($attributeCategory, $attributeName, $updateAttribute);
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->updateAttribute: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **attributeCategory** | **string**| Category of the attribute |
- **attributeName** | **string**| Name of the existing attribute |
- **updateAttribute** | [**\Brevo\Client\Model\UpdateAttribute**](../Model/UpdateAttribute.md)| Values to update an attribute |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **attributeCategory** | **string**| Category of the attribute | |
+| **attributeName** | **string**| Name of the existing attribute | |
+| **updateAttribute** | [**\Brevo\Client\Models\UpdateAttribute**](../Model/UpdateAttribute.md)| Values to update an attribute | |
### Return type
@@ -1585,51 +1792,59 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **updateBatchContacts**
-> updateBatchContacts($updateBatchContacts)
+## `updateBatchContacts()`
+
+```php
+updateBatchContacts($updateBatchContacts)
+```
Update multiple contacts
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ContactsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$updateBatchContacts = new \Brevo\Client\Model\UpdateBatchContacts(); // \Brevo\Client\Model\UpdateBatchContacts | Values to update multiple contacts
+$updateBatchContacts = new \Brevo\Client\Models\UpdateBatchContacts(); // \Brevo\Client\Models\UpdateBatchContacts | Values to update multiple contacts
try {
$apiInstance->updateBatchContacts($updateBatchContacts);
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->updateBatchContacts: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **updateBatchContacts** | [**\Brevo\Client\Model\UpdateBatchContacts**](../Model/UpdateBatchContacts.md)| Values to update multiple contacts |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **updateBatchContacts** | [**\Brevo\Client\Models\UpdateBatchContacts**](../Model/UpdateBatchContacts.md)| Values to update multiple contacts | |
### Return type
@@ -1641,57 +1856,65 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **updateContact**
-> updateContact($identifier, $updateContact, $identifierType)
+## `updateContact()`
+
+```php
+updateContact($identifier, $updateContact, $identifierType)
+```
Update a contact
There are 2 ways to update a contact
Option 1- https://api.brevo.com/v3/contacts/{identifier}
Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}
Option 1 only works if identifierType is email_id (for EMAIL) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL and ID of the contact.
Option 2 works for all identifierType, use email_id for EMAIL attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ContactsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$identifier = "identifier_example"; // string | Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) OR its SMS attribute value OR its WHATSAPP attribute value OR its LANDLINE attribute value
-$updateContact = new \Brevo\Client\Model\UpdateContact(); // \Brevo\Client\Model\UpdateContact | Values to update a contact
-$identifierType = new \stdClass; // object | email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute
+$identifier = new \Brevo\Client\Models\\Brevo\Client\Models\GetContactInfoIdentifierParameter(); // \Brevo\Client\Models\GetContactInfoIdentifierParameter | Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) OR its SMS attribute value OR its WHATSAPP attribute value OR its LANDLINE attribute value
+$updateContact = new \Brevo\Client\Models\UpdateContact(); // \Brevo\Client\Models\UpdateContact | Values to update a contact
+$identifierType = 'identifierType_example'; // string | email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute
try {
$apiInstance->updateContact($identifier, $updateContact, $identifierType);
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->updateContact: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **identifier** | **string**| Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) OR its SMS attribute value OR its WHATSAPP attribute value OR its LANDLINE attribute value |
- **updateContact** | [**\Brevo\Client\Model\UpdateContact**](../Model/UpdateContact.md)| Values to update a contact |
- **identifierType** | [**object**](../Model/.md)| email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute | [optional]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **identifier** | [**\Brevo\Client\Models\GetContactInfoIdentifierParameter**](../Model/.md)| Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) OR its SMS attribute value OR its WHATSAPP attribute value OR its LANDLINE attribute value | |
+| **updateContact** | [**\Brevo\Client\Models\UpdateContact**](../Model/UpdateContact.md)| Values to update a contact | |
+| **identifierType** | **string**| email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute | [optional] |
### Return type
@@ -1703,53 +1926,61 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `updateFolder()`
-# **updateFolder**
-> updateFolder($folderId, $updateFolder)
+```php
+updateFolder($folderId, $updateFolder)
+```
Update a folder
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ContactsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$folderId = 789; // int | Id of the folder
-$updateFolder = new \Brevo\Client\Model\CreateUpdateFolder(); // \Brevo\Client\Model\CreateUpdateFolder | Name of the folder
+$folderId = 56; // int | Id of the folder
+$updateFolder = new \Brevo\Client\Models\CreateUpdateFolder(); // \Brevo\Client\Models\CreateUpdateFolder | Name of the folder
try {
$apiInstance->updateFolder($folderId, $updateFolder);
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->updateFolder: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **folderId** | **int**| Id of the folder |
- **updateFolder** | [**\Brevo\Client\Model\CreateUpdateFolder**](../Model/CreateUpdateFolder.md)| Name of the folder |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **folderId** | **int**| Id of the folder | |
+| **updateFolder** | [**\Brevo\Client\Models\CreateUpdateFolder**](../Model/CreateUpdateFolder.md)| Name of the folder | |
### Return type
@@ -1761,53 +1992,61 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **updateList**
-> updateList($listId, $updateList)
+## `updateList()`
+
+```php
+updateList($listId, $updateList)
+```
Update a list
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ContactsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$listId = 789; // int | Id of the list
-$updateList = new \Brevo\Client\Model\UpdateList(); // \Brevo\Client\Model\UpdateList | Values to update a list
+$listId = 56; // int | Id of the list
+$updateList = new \Brevo\Client\Models\UpdateList(); // \Brevo\Client\Models\UpdateList | Values to update a list
try {
$apiInstance->updateList($listId, $updateList);
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->updateList: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **listId** | **int**| Id of the list |
- **updateList** | [**\Brevo\Client\Model\UpdateList**](../Model/UpdateList.md)| Values to update a list |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **listId** | **int**| Id of the list | |
+| **updateList** | [**\Brevo\Client\Models\UpdateList**](../Model/UpdateList.md)| Values to update a list | |
### Return type
@@ -1819,8 +2058,9 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+- **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)
diff --git a/docs/Api/ConversationsApi.md b/docs/Api/ConversationsApi.md
index 429514d..19dc061 100644
--- a/docs/Api/ConversationsApi.md
+++ b/docs/Api/ConversationsApi.md
@@ -1,62 +1,68 @@
# Brevo\Client\ConversationsApi
-All URIs are relative to *https://api.brevo.com/v3*
+All URIs are relative to https://api.brevo.com/v3, except if the operation defines another base path.
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**conversationsAgentOnlinePingPost**](ConversationsApi.md#conversationsAgentOnlinePingPost) | **POST** /conversations/agentOnlinePing | Sets agent’s status to online for 2-3 minutes
-[**conversationsMessagesIdDelete**](ConversationsApi.md#conversationsMessagesIdDelete) | **DELETE** /conversations/messages/{id} | Delete a message sent by an agent
-[**conversationsMessagesIdGet**](ConversationsApi.md#conversationsMessagesIdGet) | **GET** /conversations/messages/{id} | Get a message
-[**conversationsMessagesIdPut**](ConversationsApi.md#conversationsMessagesIdPut) | **PUT** /conversations/messages/{id} | Update a message sent by an agent
-[**conversationsMessagesPost**](ConversationsApi.md#conversationsMessagesPost) | **POST** /conversations/messages | Send a message as an agent
-[**conversationsPushedMessagesIdDelete**](ConversationsApi.md#conversationsPushedMessagesIdDelete) | **DELETE** /conversations/pushedMessages/{id} | Delete an automated message
-[**conversationsPushedMessagesIdGet**](ConversationsApi.md#conversationsPushedMessagesIdGet) | **GET** /conversations/pushedMessages/{id} | Get an automated message
-[**conversationsPushedMessagesIdPut**](ConversationsApi.md#conversationsPushedMessagesIdPut) | **PUT** /conversations/pushedMessages/{id} | Update an automated message
-[**conversationsPushedMessagesPost**](ConversationsApi.md#conversationsPushedMessagesPost) | **POST** /conversations/pushedMessages | Send an automated message to a visitor
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**conversationsAgentOnlinePingPost()**](ConversationsApi.md#conversationsAgentOnlinePingPost) | **POST** /conversations/agentOnlinePing | Sets agent’s status to online for 2-3 minutes |
+| [**conversationsMessagesIdDelete()**](ConversationsApi.md#conversationsMessagesIdDelete) | **DELETE** /conversations/messages/{id} | Delete a message sent by an agent |
+| [**conversationsMessagesIdGet()**](ConversationsApi.md#conversationsMessagesIdGet) | **GET** /conversations/messages/{id} | Get a message |
+| [**conversationsMessagesIdPut()**](ConversationsApi.md#conversationsMessagesIdPut) | **PUT** /conversations/messages/{id} | Update a message sent by an agent |
+| [**conversationsMessagesPost()**](ConversationsApi.md#conversationsMessagesPost) | **POST** /conversations/messages | Send a message as an agent |
+| [**conversationsPushedMessagesIdDelete()**](ConversationsApi.md#conversationsPushedMessagesIdDelete) | **DELETE** /conversations/pushedMessages/{id} | Delete an automated message |
+| [**conversationsPushedMessagesIdGet()**](ConversationsApi.md#conversationsPushedMessagesIdGet) | **GET** /conversations/pushedMessages/{id} | Get an automated message |
+| [**conversationsPushedMessagesIdPut()**](ConversationsApi.md#conversationsPushedMessagesIdPut) | **PUT** /conversations/pushedMessages/{id} | Update an automated message |
+| [**conversationsPushedMessagesPost()**](ConversationsApi.md#conversationsPushedMessagesPost) | **POST** /conversations/pushedMessages | Send an automated message to a visitor |
-# **conversationsAgentOnlinePingPost**
-> conversationsAgentOnlinePingPost($body)
+## `conversationsAgentOnlinePingPost()`
+
+```php
+conversationsAgentOnlinePingPost($conversationsAgentOnlinePingPostRequest)
+```
Sets agent’s status to online for 2-3 minutes
We recommend pinging this endpoint every minute for as long as the agent has to be considered online.
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ConversationsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$body = new \Brevo\Client\Model\Body14(); // \Brevo\Client\Model\Body14 | Agent fields.
+$conversationsAgentOnlinePingPostRequest = {"agentId":"d9nKoegKSjmCtyK78"}; // \Brevo\Client\Models\ConversationsAgentOnlinePingPostRequest
try {
- $apiInstance->conversationsAgentOnlinePingPost($body);
+ $apiInstance->conversationsAgentOnlinePingPost($conversationsAgentOnlinePingPostRequest);
} catch (Exception $e) {
echo 'Exception when calling ConversationsApi->conversationsAgentOnlinePingPost: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **body** | [**\Brevo\Client\Model\Body14**](../Model/Body14.md)| Agent fields. |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **conversationsAgentOnlinePingPostRequest** | [**\Brevo\Client\Models\ConversationsAgentOnlinePingPostRequest**](../Model/ConversationsAgentOnlinePingPostRequest.md)| | |
### Return type
@@ -68,53 +74,61 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `conversationsMessagesIdDelete()`
-# **conversationsMessagesIdDelete**
-> conversationsMessagesIdDelete($id)
+```php
+conversationsMessagesIdDelete($id)
+```
Delete a message sent by an agent
Only agents’ messages can be deleted.
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ConversationsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = "id_example"; // string | ID of the message
+$id = 'id_example'; // string | ID of the message
try {
$apiInstance->conversationsMessagesIdDelete($id);
} catch (Exception $e) {
echo 'Exception when calling ConversationsApi->conversationsMessagesIdDelete: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| ID of the message |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| ID of the message | |
### Return type
@@ -126,37 +140,46 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **conversationsMessagesIdGet**
-> \Brevo\Client\Model\ConversationsMessage conversationsMessagesIdGet($id)
+## `conversationsMessagesIdGet()`
+
+```php
+conversationsMessagesIdGet($id): \Brevo\Client\Models\ConversationsMessage
+```
Get a message
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ConversationsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = "id_example"; // string | ID of the message
+$id = 'id_example'; // string | ID of the message
try {
$result = $apiInstance->conversationsMessagesIdGet($id);
@@ -164,18 +187,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling ConversationsApi->conversationsMessagesIdGet: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| ID of the message |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| ID of the message | |
### Return type
-[**\Brevo\Client\Model\ConversationsMessage**](../Model/ConversationsMessage.md)
+[**\Brevo\Client\Models\ConversationsMessage**](../Model/ConversationsMessage.md)
### Authorization
@@ -183,60 +205,68 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `conversationsMessagesIdPut()`
-# **conversationsMessagesIdPut**
-> \Brevo\Client\Model\ConversationsMessage conversationsMessagesIdPut($id, $body)
+```php
+conversationsMessagesIdPut($id, $conversationsMessagesIdPutRequest): \Brevo\Client\Models\ConversationsMessage
+```
Update a message sent by an agent
Only agents’ messages can be edited.
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ConversationsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = "id_example"; // string | ID of the message
-$body = new \Brevo\Client\Model\Body11(); // \Brevo\Client\Model\Body11 |
+$id = 'id_example'; // string | ID of the message
+$conversationsMessagesIdPutRequest = {"text":"Good morning! How can I help you?"}; // \Brevo\Client\Models\ConversationsMessagesIdPutRequest
try {
- $result = $apiInstance->conversationsMessagesIdPut($id, $body);
+ $result = $apiInstance->conversationsMessagesIdPut($id, $conversationsMessagesIdPutRequest);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ConversationsApi->conversationsMessagesIdPut: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| ID of the message |
- **body** | [**\Brevo\Client\Model\Body11**](../Model/Body11.md)| | [optional]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| ID of the message | |
+| **conversationsMessagesIdPutRequest** | [**\Brevo\Client\Models\ConversationsMessagesIdPutRequest**](../Model/ConversationsMessagesIdPutRequest.md)| | |
### Return type
-[**\Brevo\Client\Model\ConversationsMessage**](../Model/ConversationsMessage.md)
+[**\Brevo\Client\Models\ConversationsMessage**](../Model/ConversationsMessage.md)
### Authorization
@@ -244,56 +274,64 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **conversationsMessagesPost**
-> \Brevo\Client\Model\ConversationsMessage conversationsMessagesPost($body)
+## `conversationsMessagesPost()`
+
+```php
+conversationsMessagesPost($conversationsMessagesPostRequest): \Brevo\Client\Models\ConversationsMessage
+```
Send a message as an agent
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ConversationsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$body = new \Brevo\Client\Model\Body10(); // \Brevo\Client\Model\Body10 | Message fields.
+$conversationsMessagesPostRequest = {"visitorId":"kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg","text":"Hello! How can I help you?","agentId":"d9nKoegKSjmCtyK78"}; // \Brevo\Client\Models\ConversationsMessagesPostRequest
try {
- $result = $apiInstance->conversationsMessagesPost($body);
+ $result = $apiInstance->conversationsMessagesPost($conversationsMessagesPostRequest);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ConversationsApi->conversationsMessagesPost: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **body** | [**\Brevo\Client\Model\Body10**](../Model/Body10.md)| Message fields. |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **conversationsMessagesPostRequest** | [**\Brevo\Client\Models\ConversationsMessagesPostRequest**](../Model/ConversationsMessagesPostRequest.md)| | |
### Return type
-[**\Brevo\Client\Model\ConversationsMessage**](../Model/ConversationsMessage.md)
+[**\Brevo\Client\Models\ConversationsMessage**](../Model/ConversationsMessage.md)
### Authorization
@@ -301,51 +339,59 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `conversationsPushedMessagesIdDelete()`
-# **conversationsPushedMessagesIdDelete**
-> conversationsPushedMessagesIdDelete($id)
+```php
+conversationsPushedMessagesIdDelete($id)
+```
Delete an automated message
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ConversationsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = "id_example"; // string | ID of the message
+$id = 'id_example'; // string | ID of the message
try {
$apiInstance->conversationsPushedMessagesIdDelete($id);
} catch (Exception $e) {
echo 'Exception when calling ConversationsApi->conversationsPushedMessagesIdDelete: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| ID of the message |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| ID of the message | |
### Return type
@@ -357,37 +403,46 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **conversationsPushedMessagesIdGet**
-> \Brevo\Client\Model\ConversationsMessage conversationsPushedMessagesIdGet($id)
+## `conversationsPushedMessagesIdGet()`
+
+```php
+conversationsPushedMessagesIdGet($id): \Brevo\Client\Models\ConversationsMessage
+```
Get an automated message
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ConversationsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = "id_example"; // string | ID of the message sent previously
+$id = 'id_example'; // string | ID of the message sent previously
try {
$result = $apiInstance->conversationsPushedMessagesIdGet($id);
@@ -395,18 +450,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling ConversationsApi->conversationsPushedMessagesIdGet: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| ID of the message sent previously |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| ID of the message sent previously | |
### Return type
-[**\Brevo\Client\Model\ConversationsMessage**](../Model/ConversationsMessage.md)
+[**\Brevo\Client\Models\ConversationsMessage**](../Model/ConversationsMessage.md)
### Authorization
@@ -414,58 +468,66 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `conversationsPushedMessagesIdPut()`
-# **conversationsPushedMessagesIdPut**
-> \Brevo\Client\Model\ConversationsMessage conversationsPushedMessagesIdPut($id, $body)
+```php
+conversationsPushedMessagesIdPut($id, $conversationsMessagesIdPutRequest): \Brevo\Client\Models\ConversationsMessage
+```
Update an automated message
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ConversationsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = "id_example"; // string | ID of the message
-$body = new \Brevo\Client\Model\Body13(); // \Brevo\Client\Model\Body13 |
+$id = 'id_example'; // string | ID of the message
+$conversationsMessagesIdPutRequest = {"text":"Your order has shipped! Here’s your tracking number: 9114 5847 4668 7775 9233 54"}; // \Brevo\Client\Models\ConversationsMessagesIdPutRequest
try {
- $result = $apiInstance->conversationsPushedMessagesIdPut($id, $body);
+ $result = $apiInstance->conversationsPushedMessagesIdPut($id, $conversationsMessagesIdPutRequest);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ConversationsApi->conversationsPushedMessagesIdPut: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| ID of the message |
- **body** | [**\Brevo\Client\Model\Body13**](../Model/Body13.md)| |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| ID of the message | |
+| **conversationsMessagesIdPutRequest** | [**\Brevo\Client\Models\ConversationsMessagesIdPutRequest**](../Model/ConversationsMessagesIdPutRequest.md)| | |
### Return type
-[**\Brevo\Client\Model\ConversationsMessage**](../Model/ConversationsMessage.md)
+[**\Brevo\Client\Models\ConversationsMessage**](../Model/ConversationsMessage.md)
### Authorization
@@ -473,58 +535,66 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **conversationsPushedMessagesPost**
-> \Brevo\Client\Model\ConversationsMessage conversationsPushedMessagesPost($body)
+## `conversationsPushedMessagesPost()`
+
+```php
+conversationsPushedMessagesPost($conversationsPushedMessagesPostRequest): \Brevo\Client\Models\ConversationsMessage
+```
Send an automated message to a visitor
Example of automated messages: order status, announce new features in your web app, etc.
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ConversationsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$body = new \Brevo\Client\Model\Body12(); // \Brevo\Client\Model\Body12 |
+$conversationsPushedMessagesPostRequest = {"visitorId":"kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg","text":"Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88"}; // \Brevo\Client\Models\ConversationsPushedMessagesPostRequest
try {
- $result = $apiInstance->conversationsPushedMessagesPost($body);
+ $result = $apiInstance->conversationsPushedMessagesPost($conversationsPushedMessagesPostRequest);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ConversationsApi->conversationsPushedMessagesPost: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **body** | [**\Brevo\Client\Model\Body12**](../Model/Body12.md)| |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **conversationsPushedMessagesPostRequest** | [**\Brevo\Client\Models\ConversationsPushedMessagesPostRequest**](../Model/ConversationsPushedMessagesPostRequest.md)| | |
### Return type
-[**\Brevo\Client\Model\ConversationsMessage**](../Model/ConversationsMessage.md)
+[**\Brevo\Client\Models\ConversationsMessage**](../Model/ConversationsMessage.md)
### Authorization
@@ -532,8 +602,9 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+- **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)
diff --git a/docs/Api/CouponsApi.md b/docs/Api/CouponsApi.md
index e8acc32..729c5e4 100644
--- a/docs/Api/CouponsApi.md
+++ b/docs/Api/CouponsApi.md
@@ -1,61 +1,67 @@
# Brevo\Client\CouponsApi
-All URIs are relative to *https://api.brevo.com/v3*
+All URIs are relative to https://api.brevo.com/v3, except if the operation defines another base path.
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**createCouponCollection**](CouponsApi.md#createCouponCollection) | **POST** /couponCollections | Create а coupon collection
-[**createCoupons**](CouponsApi.md#createCoupons) | **POST** /coupons | Create coupons for a coupon collection
-[**getCouponCollection**](CouponsApi.md#getCouponCollection) | **GET** /couponCollections/{id} | Get a coupon collection by id
-[**getCouponCollections**](CouponsApi.md#getCouponCollections) | **GET** /couponCollections | Get all your coupon collections
-[**updateCouponCollection**](CouponsApi.md#updateCouponCollection) | **PATCH** /couponCollections/{id} | Update a coupon collection by id
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**createCouponCollection()**](CouponsApi.md#createCouponCollection) | **POST** /couponCollections | Create а coupon collection |
+| [**createCoupons()**](CouponsApi.md#createCoupons) | **POST** /coupons | Create coupons for a coupon collection |
+| [**getCouponCollection()**](CouponsApi.md#getCouponCollection) | **GET** /couponCollections/{id} | Get a coupon collection by id |
+| [**getCouponCollections()**](CouponsApi.md#getCouponCollections) | **GET** /couponCollections | Get all your coupon collections |
+| [**updateCouponCollection()**](CouponsApi.md#updateCouponCollection) | **PATCH** /couponCollections/{id} | Update a coupon collection by id |
-# **createCouponCollection**
-> \Brevo\Client\Model\InlineResponse2013 createCouponCollection($createCouponCollection)
+## `createCouponCollection()`
+
+```php
+createCouponCollection($createCouponCollectionRequest): \Brevo\Client\Models\CreateCouponCollection201Response
+```
Create а coupon collection
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\CouponsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$createCouponCollection = new \Brevo\Client\Model\CreateCouponCollection(); // \Brevo\Client\Model\CreateCouponCollection | Values to create a coupon collection
+$createCouponCollectionRequest = new \Brevo\Client\Models\CreateCouponCollectionRequest(); // \Brevo\Client\Models\CreateCouponCollectionRequest | Values to create a coupon collection
try {
- $result = $apiInstance->createCouponCollection($createCouponCollection);
+ $result = $apiInstance->createCouponCollection($createCouponCollectionRequest);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CouponsApi->createCouponCollection: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **createCouponCollection** | [**\Brevo\Client\Model\CreateCouponCollection**](../Model/CreateCouponCollection.md)| Values to create a coupon collection |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **createCouponCollectionRequest** | [**\Brevo\Client\Models\CreateCouponCollectionRequest**](../Model/CreateCouponCollectionRequest.md)| Values to create a coupon collection | |
### Return type
-[**\Brevo\Client\Model\InlineResponse2013**](../Model/InlineResponse2013.md)
+[**\Brevo\Client\Models\CreateCouponCollection201Response**](../Model/CreateCouponCollection201Response.md)
### Authorization
@@ -63,51 +69,59 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **createCoupons**
-> createCoupons($createCoupons)
+## `createCoupons()`
+
+```php
+createCoupons($createCouponsRequest)
+```
Create coupons for a coupon collection
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\CouponsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$createCoupons = new \Brevo\Client\Model\CreateCoupons(); // \Brevo\Client\Model\CreateCoupons | Values to create coupons
+$createCouponsRequest = new \Brevo\Client\Models\CreateCouponsRequest(); // \Brevo\Client\Models\CreateCouponsRequest | Values to create coupons
try {
- $apiInstance->createCoupons($createCoupons);
+ $apiInstance->createCoupons($createCouponsRequest);
} catch (Exception $e) {
echo 'Exception when calling CouponsApi->createCoupons: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **createCoupons** | [**\Brevo\Client\Model\CreateCoupons**](../Model/CreateCoupons.md)| Values to create coupons |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **createCouponsRequest** | [**\Brevo\Client\Models\CreateCouponsRequest**](../Model/CreateCouponsRequest.md)| Values to create coupons | |
### Return type
@@ -119,37 +133,46 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getCouponCollection**
-> \Brevo\Client\Model\GetCouponCollection getCouponCollection($id)
+## `getCouponCollection()`
+
+```php
+getCouponCollection($id): \Brevo\Client\Models\GetCouponCollection
+```
Get a coupon collection by id
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\CouponsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = "id_example"; // string | Id of the collection to return
+$id = 'id_example'; // string | Id of the collection to return
try {
$result = $apiInstance->getCouponCollection($id);
@@ -157,18 +180,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling CouponsApi->getCouponCollection: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| Id of the collection to return |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| Id of the collection to return | |
### Return type
-[**\Brevo\Client\Model\GetCouponCollection**](../Model/GetCouponCollection.md)
+[**\Brevo\Client\Models\GetCouponCollection**](../Model/GetCouponCollection.md)
### Authorization
@@ -176,30 +198,39 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getCouponCollections**
-> \Brevo\Client\Model\GetCouponCollection getCouponCollections($limit, $offset, $sort)
+## `getCouponCollections()`
+
+```php
+getCouponCollections($limit, $offset, $sort, $sortBy): \Brevo\Client\Models\GetCouponCollection
+```
Get all your coupon collections
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\CouponsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
@@ -208,28 +239,29 @@ $apiInstance = new Brevo\Client\Api\CouponsApi(
);
$limit = 50; // int | Number of documents returned per page
$offset = 0; // int | Index of the first document on the page
-$sort = "desc"; // string | Sort the results by creation time in ascending/descending order
+$sort = 'desc'; // string | Sort the results by creation time in ascending/descending order
+$sortBy = 'createdAt'; // string | The field used to sort coupon collections
try {
- $result = $apiInstance->getCouponCollections($limit, $offset, $sort);
+ $result = $apiInstance->getCouponCollections($limit, $offset, $sort, $sortBy);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CouponsApi->getCouponCollections: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **limit** | **int**| Number of documents returned per page | [optional] [default to 50]
- **offset** | **int**| Index of the first document on the page | [optional] [default to 0]
- **sort** | **string**| Sort the results by creation time in ascending/descending order | [optional] [default to desc]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **limit** | **int**| Number of documents returned per page | [optional] [default to 50] |
+| **offset** | **int**| Index of the first document on the page | [optional] [default to 0] |
+| **sort** | **string**| Sort the results by creation time in ascending/descending order | [optional] [default to 'desc'] |
+| **sortBy** | **string**| The field used to sort coupon collections | [optional] [default to 'createdAt'] |
### Return type
-[**\Brevo\Client\Model\GetCouponCollection**](../Model/GetCouponCollection.md)
+[**\Brevo\Client\Models\GetCouponCollection**](../Model/GetCouponCollection.md)
### Authorization
@@ -237,58 +269,66 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **updateCouponCollection**
-> \Brevo\Client\Model\InlineResponse2002 updateCouponCollection($id, $updateCouponCollection)
+## `updateCouponCollection()`
+
+```php
+updateCouponCollection($id, $updateCouponCollectionRequest): \Brevo\Client\Models\UpdateCouponCollection200Response
+```
Update a coupon collection by id
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\CouponsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = "id_example"; // string | Id of the collection to update
-$updateCouponCollection = new \Brevo\Client\Model\UpdateCouponCollection(); // \Brevo\Client\Model\UpdateCouponCollection | Values to update the coupon collection
+$id = 'id_example'; // string | Id of the collection to update
+$updateCouponCollectionRequest = new \Brevo\Client\Models\UpdateCouponCollectionRequest(); // \Brevo\Client\Models\UpdateCouponCollectionRequest | Values to update the coupon collection
try {
- $result = $apiInstance->updateCouponCollection($id, $updateCouponCollection);
+ $result = $apiInstance->updateCouponCollection($id, $updateCouponCollectionRequest);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CouponsApi->updateCouponCollection: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| Id of the collection to update |
- **updateCouponCollection** | [**\Brevo\Client\Model\UpdateCouponCollection**](../Model/UpdateCouponCollection.md)| Values to update the coupon collection |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| Id of the collection to update | |
+| **updateCouponCollectionRequest** | [**\Brevo\Client\Models\UpdateCouponCollectionRequest**](../Model/UpdateCouponCollectionRequest.md)| Values to update the coupon collection | [optional] |
### Return type
-[**\Brevo\Client\Model\InlineResponse2002**](../Model/InlineResponse2002.md)
+[**\Brevo\Client\Models\UpdateCouponCollection200Response**](../Model/UpdateCouponCollection200Response.md)
### Authorization
@@ -296,8 +336,9 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+- **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)
diff --git a/docs/Api/DealsApi.md b/docs/Api/DealsApi.md
index 27b1a9e..5670fde 100644
--- a/docs/Api/DealsApi.md
+++ b/docs/Api/DealsApi.md
@@ -1,40 +1,48 @@
# Brevo\Client\DealsApi
-All URIs are relative to *https://api.brevo.com/v3*
+All URIs are relative to https://api.brevo.com/v3, except if the operation defines another base path.
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**crmAttributesDealsGet**](DealsApi.md#crmAttributesDealsGet) | **GET** /crm/attributes/deals | Get deal attributes
-[**crmDealsGet**](DealsApi.md#crmDealsGet) | **GET** /crm/deals | Get all deals
-[**crmDealsIdDelete**](DealsApi.md#crmDealsIdDelete) | **DELETE** /crm/deals/{id} | Delete a deal
-[**crmDealsIdGet**](DealsApi.md#crmDealsIdGet) | **GET** /crm/deals/{id} | Get a deal
-[**crmDealsIdPatch**](DealsApi.md#crmDealsIdPatch) | **PATCH** /crm/deals/{id} | Update a deal
-[**crmDealsLinkUnlinkIdPatch**](DealsApi.md#crmDealsLinkUnlinkIdPatch) | **PATCH** /crm/deals/link-unlink/{id} | Link and Unlink a deal with contacts and companies
-[**crmDealsPost**](DealsApi.md#crmDealsPost) | **POST** /crm/deals | Create a deal
-[**crmPipelineDetailsAllGet**](DealsApi.md#crmPipelineDetailsAllGet) | **GET** /crm/pipeline/details/all | Get all pipelines
-[**crmPipelineDetailsGet**](DealsApi.md#crmPipelineDetailsGet) | **GET** /crm/pipeline/details | Get pipeline stages
-[**crmPipelineDetailsPipelineIDGet**](DealsApi.md#crmPipelineDetailsPipelineIDGet) | **GET** /crm/pipeline/details/{pipelineID} | Get a pipeline
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**crmAttributesDealsGet()**](DealsApi.md#crmAttributesDealsGet) | **GET** /crm/attributes/deals | Get deal attributes |
+| [**crmDealsGet()**](DealsApi.md#crmDealsGet) | **GET** /crm/deals | Get all deals |
+| [**crmDealsIdDelete()**](DealsApi.md#crmDealsIdDelete) | **DELETE** /crm/deals/{id} | Delete a deal |
+| [**crmDealsIdGet()**](DealsApi.md#crmDealsIdGet) | **GET** /crm/deals/{id} | Get a deal |
+| [**crmDealsIdPatch()**](DealsApi.md#crmDealsIdPatch) | **PATCH** /crm/deals/{id} | Update a deal |
+| [**crmDealsImportPost()**](DealsApi.md#crmDealsImportPost) | **POST** /crm/deals/import | Import deals(creation and updation) |
+| [**crmDealsLinkUnlinkIdPatch()**](DealsApi.md#crmDealsLinkUnlinkIdPatch) | **PATCH** /crm/deals/link-unlink/{id} | Link and Unlink a deal with contacts and companies |
+| [**crmDealsPost()**](DealsApi.md#crmDealsPost) | **POST** /crm/deals | Create a deal |
+| [**crmPipelineDetailsAllGet()**](DealsApi.md#crmPipelineDetailsAllGet) | **GET** /crm/pipeline/details/all | Get all pipelines |
+| [**crmPipelineDetailsGet()**](DealsApi.md#crmPipelineDetailsGet) | **GET** /crm/pipeline/details | Get pipeline stages |
+| [**crmPipelineDetailsPipelineIDGet()**](DealsApi.md#crmPipelineDetailsPipelineIDGet) | **GET** /crm/pipeline/details/{pipelineID} | Get a pipeline |
-# **crmAttributesDealsGet**
-> \Brevo\Client\Model\DealAttributes crmAttributesDealsGet()
+## `crmAttributesDealsGet()`
+
+```php
+crmAttributesDealsGet(): \Brevo\Client\Models\DealAttributesInner[]
+```
Get deal attributes
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\DealsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
@@ -48,15 +56,15 @@ try {
} catch (Exception $e) {
echo 'Exception when calling DealsApi->crmAttributesDealsGet: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
+
This endpoint does not need any parameter.
### Return type
-[**\Brevo\Client\Model\DealAttributes**](../Model/DealAttributes.md)
+[**\Brevo\Client\Models\DealAttributesInner[]**](../Model/DealAttributesInner.md)
### Authorization
@@ -64,68 +72,74 @@ This endpoint does not need any parameter.
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **crmDealsGet**
-> \Brevo\Client\Model\DealsList crmDealsGet($filtersAttributesDealName, $filtersLinkedCompaniesIds, $filtersLinkedContactsIds, $offset, $limit, $sort, $sortBy)
+## `crmDealsGet()`
+
+```php
+crmDealsGet($filtersAttributesDealName, $filtersLinkedCompaniesIds, $filtersLinkedContactsIds, $offset, $limit, $sort): \Brevo\Client\Models\DealsList
+```
Get all deals
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\DealsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$filtersAttributesDealName = "filtersAttributesDealName_example"; // string | Filter by attributes. If you have filter for owner on your side please send it as `filters[attributes.deal_owner]`.\"
-$filtersLinkedCompaniesIds = "filtersLinkedCompaniesIds_example"; // string | Filter by linked companies ids
-$filtersLinkedContactsIds = "filtersLinkedContactsIds_example"; // string | Filter by linked companies ids
-$offset = 789; // int | Index of the first document of the page
-$limit = 50; // int | Number of documents per page
-$sort = "sort_example"; // string | Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed
-$sortBy = "sortBy_example"; // string | The field used to sort field names.
+$filtersAttributesDealName = 'filtersAttributesDealName_example'; // string | Filter by attributes. If you have a filter for the owner on your end, please send it as filters[attributes.deal_owner] and utilize the account email for the filtering.
+$filtersLinkedCompaniesIds = 'filtersLinkedCompaniesIds_example'; // string | Filter by linked companies ids
+$filtersLinkedContactsIds = 'filtersLinkedContactsIds_example'; // string | Filter by linked companies ids
+$offset = 56; // int | Index of the first document of the page
+$limit = 56; // int | Number of documents per page
+$sort = 'sort_example'; // string | Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed
try {
- $result = $apiInstance->crmDealsGet($filtersAttributesDealName, $filtersLinkedCompaniesIds, $filtersLinkedContactsIds, $offset, $limit, $sort, $sortBy);
+ $result = $apiInstance->crmDealsGet($filtersAttributesDealName, $filtersLinkedCompaniesIds, $filtersLinkedContactsIds, $offset, $limit, $sort);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DealsApi->crmDealsGet: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **filtersAttributesDealName** | **string**| Filter by attributes. If you have filter for owner on your side please send it as `filters[attributes.deal_owner]`.\" | [optional]
- **filtersLinkedCompaniesIds** | **string**| Filter by linked companies ids | [optional]
- **filtersLinkedContactsIds** | **string**| Filter by linked companies ids | [optional]
- **offset** | **int**| Index of the first document of the page | [optional]
- **limit** | **int**| Number of documents per page | [optional] [default to 50]
- **sort** | **string**| Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed | [optional]
- **sortBy** | **string**| The field used to sort field names. | [optional]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **filtersAttributesDealName** | **string**| Filter by attributes. If you have a filter for the owner on your end, please send it as filters[attributes.deal_owner] and utilize the account email for the filtering. | [optional] |
+| **filtersLinkedCompaniesIds** | **string**| Filter by linked companies ids | [optional] |
+| **filtersLinkedContactsIds** | **string**| Filter by linked companies ids | [optional] |
+| **offset** | **int**| Index of the first document of the page | [optional] |
+| **limit** | **int**| Number of documents per page | [optional] |
+| **sort** | **string**| Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed | [optional] |
### Return type
-[**\Brevo\Client\Model\DealsList**](../Model/DealsList.md)
+[**\Brevo\Client\Models\DealsList**](../Model/DealsList.md)
### Authorization
@@ -133,51 +147,59 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `crmDealsIdDelete()`
-# **crmDealsIdDelete**
-> crmDealsIdDelete($id)
+```php
+crmDealsIdDelete($id)
+```
Delete a deal
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\DealsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = "id_example"; // string |
+$id = 'id_example'; // string
try {
$apiInstance->crmDealsIdDelete($id);
} catch (Exception $e) {
echo 'Exception when calling DealsApi->crmDealsIdDelete: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| | |
### Return type
@@ -189,37 +211,46 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **crmDealsIdGet**
-> \Brevo\Client\Model\Deal crmDealsIdGet($id)
+## `crmDealsIdGet()`
+
+```php
+crmDealsIdGet($id): \Brevo\Client\Models\Deal
+```
Get a deal
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\DealsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = "id_example"; // string |
+$id = 'id_example'; // string
try {
$result = $apiInstance->crmDealsIdGet($id);
@@ -227,18 +258,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling DealsApi->crmDealsIdGet: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| | |
### Return type
-[**\Brevo\Client\Model\Deal**](../Model/Deal.md)
+[**\Brevo\Client\Models\Deal**](../Model/Deal.md)
### Authorization
@@ -246,53 +276,61 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `crmDealsIdPatch()`
-# **crmDealsIdPatch**
-> crmDealsIdPatch($id, $body)
+```php
+crmDealsIdPatch($id, $crmDealsIdPatchRequest)
+```
Update a deal
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\DealsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = "id_example"; // string |
-$body = new \Brevo\Client\Model\Body6(); // \Brevo\Client\Model\Body6 | Updated deal details.
+$id = 'id_example'; // string
+$crmDealsIdPatchRequest = new \Brevo\Client\Models\CrmDealsIdPatchRequest(); // \Brevo\Client\Models\CrmDealsIdPatchRequest | Updated deal details.
try {
- $apiInstance->crmDealsIdPatch($id, $body);
+ $apiInstance->crmDealsIdPatch($id, $crmDealsIdPatchRequest);
} catch (Exception $e) {
echo 'Exception when calling DealsApi->crmDealsIdPatch: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| |
- **body** | [**\Brevo\Client\Model\Body6**](../Model/Body6.md)| Updated deal details. |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| | |
+| **crmDealsIdPatchRequest** | [**\Brevo\Client\Models\CrmDealsIdPatchRequest**](../Model/CrmDealsIdPatchRequest.md)| Updated deal details. | |
### Return type
@@ -304,53 +342,130 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
+
+## `crmDealsImportPost()`
+
+```php
+crmDealsImportPost($file, $mapping): \Brevo\Client\Models\CompaniesImportPost200Response
+```
+
+Import deals(creation and updation)
+
+Import deals from a CSV file with mapping options.
+
+### Example
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+```php
+ crmDealsLinkUnlinkIdPatch($id, $body)
+
+// Configure API key authorization: api-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\DealsApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$file = "/path/to/file.txt"; // \SplFileObject | The CSV file to upload.The file should have the first row as the mapping attribute. Some default attribute names are (a) deal_id [brevo mongoID to update deals] (b) associated_contact (c) associated_company (f) any other attribute with internal name
+$mapping = array('key' => new \stdClass); // object | The mapping options in JSON format. Here is an example of the JSON structure: ```json { \\\"link_entities\\\": true, // Determines whether to link related entities during the import process \\\"unlink_entities\\\": false, // Determines whether to unlink related entities during the import process \\\"update_existing_records\\\": true, // Determines whether to update based on company ID or treat every row as create \\\"unset_empty_attributes\\\": false // Determines whether to unset a specific attribute during update if the values input is blank } ```
+
+try {
+ $result = $apiInstance->crmDealsImportPost($file, $mapping);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling DealsApi->crmDealsImportPost: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **file** | **\SplFileObject****\SplFileObject**| The CSV file to upload.The file should have the first row as the mapping attribute. Some default attribute names are (a) deal_id [brevo mongoID to update deals] (b) associated_contact (c) associated_company (f) any other attribute with internal name | [optional] |
+| **mapping** | [**object**](../Model/object.md)| The mapping options in JSON format. Here is an example of the JSON structure: ```json { \\\"link_entities\\\": true, // Determines whether to link related entities during the import process \\\"unlink_entities\\\": false, // Determines whether to unlink related entities during the import process \\\"update_existing_records\\\": true, // Determines whether to update based on company ID or treat every row as create \\\"unset_empty_attributes\\\": false // Determines whether to unset a specific attribute during update if the values input is blank } ``` | [optional] |
+
+### Return type
+
+[**\Brevo\Client\Models\CompaniesImportPost200Response**](../Model/CompaniesImportPost200Response.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### HTTP request headers
+
+- **Content-Type**: `multipart/form-data`
+- **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)
+
+## `crmDealsLinkUnlinkIdPatch()`
+
+```php
+crmDealsLinkUnlinkIdPatch($id, $crmDealsLinkUnlinkIdPatchRequest)
+```
Link and Unlink a deal with contacts and companies
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\DealsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = "id_example"; // string |
-$body = new \Brevo\Client\Model\Body7(); // \Brevo\Client\Model\Body7 | Linked / Unlinked contacts and companies ids.
+$id = 'id_example'; // string
+$crmDealsLinkUnlinkIdPatchRequest = new \Brevo\Client\Models\CrmDealsLinkUnlinkIdPatchRequest(); // \Brevo\Client\Models\CrmDealsLinkUnlinkIdPatchRequest | Linked / Unlinked contacts and companies ids.
try {
- $apiInstance->crmDealsLinkUnlinkIdPatch($id, $body);
+ $apiInstance->crmDealsLinkUnlinkIdPatch($id, $crmDealsLinkUnlinkIdPatchRequest);
} catch (Exception $e) {
echo 'Exception when calling DealsApi->crmDealsLinkUnlinkIdPatch: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| |
- **body** | [**\Brevo\Client\Model\Body7**](../Model/Body7.md)| Linked / Unlinked contacts and companies ids. |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| | |
+| **crmDealsLinkUnlinkIdPatchRequest** | [**\Brevo\Client\Models\CrmDealsLinkUnlinkIdPatchRequest**](../Model/CrmDealsLinkUnlinkIdPatchRequest.md)| Linked / Unlinked contacts and companies ids. | |
### Return type
@@ -362,56 +477,64 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **crmDealsPost**
-> \Brevo\Client\Model\InlineResponse2011 crmDealsPost($body)
+## `crmDealsPost()`
+
+```php
+crmDealsPost($crmDealsPostRequest): \Brevo\Client\Models\CrmDealsPost201Response
+```
Create a deal
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\DealsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$body = new \Brevo\Client\Model\Body5(); // \Brevo\Client\Model\Body5 | Deal create data.
+$crmDealsPostRequest = new \Brevo\Client\Models\CrmDealsPostRequest(); // \Brevo\Client\Models\CrmDealsPostRequest | Deal create data.
try {
- $result = $apiInstance->crmDealsPost($body);
+ $result = $apiInstance->crmDealsPost($crmDealsPostRequest);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DealsApi->crmDealsPost: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **body** | [**\Brevo\Client\Model\Body5**](../Model/Body5.md)| Deal create data. |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **crmDealsPostRequest** | [**\Brevo\Client\Models\CrmDealsPostRequest**](../Model/CrmDealsPostRequest.md)| Deal create data. | |
### Return type
-[**\Brevo\Client\Model\InlineResponse2011**](../Model/InlineResponse2011.md)
+[**\Brevo\Client\Models\CrmDealsPost201Response**](../Model/CrmDealsPost201Response.md)
### Authorization
@@ -419,30 +542,39 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `crmPipelineDetailsAllGet()`
-# **crmPipelineDetailsAllGet**
-> \Brevo\Client\Model\Pipelines crmPipelineDetailsAllGet()
+```php
+crmPipelineDetailsAllGet(): \Brevo\Client\Models\Pipeline[]
+```
Get all pipelines
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\DealsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
@@ -456,15 +588,15 @@ try {
} catch (Exception $e) {
echo 'Exception when calling DealsApi->crmPipelineDetailsAllGet: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
+
This endpoint does not need any parameter.
### Return type
-[**\Brevo\Client\Model\Pipelines**](../Model/Pipelines.md)
+[**\Brevo\Client\Models\Pipeline[]**](../Model/Pipeline.md)
### Authorization
@@ -472,32 +604,41 @@ This endpoint does not need any parameter.
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **crmPipelineDetailsGet**
-> \Brevo\Client\Model\Pipeline crmPipelineDetailsGet()
+## `crmPipelineDetailsGet()`
+
+```php
+crmPipelineDetailsGet(): \Brevo\Client\Models\Pipeline
+```
Get pipeline stages
This endpoint is deprecated. Prefer /crm/pipeline/details/{pipelineID} instead.
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\DealsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
@@ -511,15 +652,15 @@ try {
} catch (Exception $e) {
echo 'Exception when calling DealsApi->crmPipelineDetailsGet: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
+
This endpoint does not need any parameter.
### Return type
-[**\Brevo\Client\Model\Pipeline**](../Model/Pipeline.md)
+[**\Brevo\Client\Models\Pipeline**](../Model/Pipeline.md)
### Authorization
@@ -527,37 +668,46 @@ This endpoint does not need any parameter.
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **crmPipelineDetailsPipelineIDGet**
-> \Brevo\Client\Model\Pipelines crmPipelineDetailsPipelineIDGet($pipelineID)
+## `crmPipelineDetailsPipelineIDGet()`
+
+```php
+crmPipelineDetailsPipelineIDGet($pipelineID): \Brevo\Client\Models\Pipeline[]
+```
Get a pipeline
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\DealsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$pipelineID = "pipelineID_example"; // string |
+$pipelineID = 'pipelineID_example'; // string
try {
$result = $apiInstance->crmPipelineDetailsPipelineIDGet($pipelineID);
@@ -565,18 +715,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling DealsApi->crmPipelineDetailsPipelineIDGet: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **pipelineID** | **string**| |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **pipelineID** | **string**| | |
### Return type
-[**\Brevo\Client\Model\Pipelines**](../Model/Pipelines.md)
+[**\Brevo\Client\Models\Pipeline[]**](../Model/Pipeline.md)
### Authorization
@@ -584,8 +733,9 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+- **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/DomainsApi.md b/docs/Api/DomainsApi.md
index 29d9a47..d523dc0 100644
--- a/docs/Api/DomainsApi.md
+++ b/docs/Api/DomainsApi.md
@@ -1,42 +1,49 @@
# Brevo\Client\DomainsApi
-All URIs are relative to *https://api.brevo.com/v3*
+All URIs are relative to https://api.brevo.com/v3, except if the operation defines another base path.
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**authenticateDomain**](DomainsApi.md#authenticateDomain) | **PUT** /senders/domains/{domainName}/authenticate | Authenticate a domain
-[**createDomain**](DomainsApi.md#createDomain) | **POST** /senders/domains | Create a new domain
-[**deleteDomain**](DomainsApi.md#deleteDomain) | **DELETE** /senders/domains/{domainName} | Delete a domain
-[**getDomainConfiguration**](DomainsApi.md#getDomainConfiguration) | **GET** /senders/domains/{domainName} | Validate domain configuration
-[**getDomains**](DomainsApi.md#getDomains) | **GET** /senders/domains | Get the list of all your domains
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**authenticateDomain()**](DomainsApi.md#authenticateDomain) | **PUT** /senders/domains/{domainName}/authenticate | Authenticate a domain |
+| [**createDomain()**](DomainsApi.md#createDomain) | **POST** /senders/domains | Create a new domain |
+| [**deleteDomain()**](DomainsApi.md#deleteDomain) | **DELETE** /senders/domains/{domainName} | Delete a domain |
+| [**getDomainConfiguration()**](DomainsApi.md#getDomainConfiguration) | **GET** /senders/domains/{domainName} | Validate domain configuration |
+| [**getDomains()**](DomainsApi.md#getDomains) | **GET** /senders/domains | Get the list of all your domains |
-# **authenticateDomain**
-> \Brevo\Client\Model\AuthenticateDomainModel authenticateDomain($domainName)
+## `authenticateDomain()`
+
+```php
+authenticateDomain($domainName): \Brevo\Client\Models\AuthenticateDomainModel
+```
Authenticate a domain
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\DomainsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$domainName = "domainName_example"; // string | Domain name
+$domainName = 'domainName_example'; // string | Domain name
try {
$result = $apiInstance->authenticateDomain($domainName);
@@ -44,18 +51,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling DomainsApi->authenticateDomain: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **domainName** | **string**| Domain name |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **domainName** | **string**| Domain name | |
### Return type
-[**\Brevo\Client\Model\AuthenticateDomainModel**](../Model/AuthenticateDomainModel.md)
+[**\Brevo\Client\Models\AuthenticateDomainModel**](../Model/AuthenticateDomainModel.md)
### Authorization
@@ -63,56 +69,64 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `createDomain()`
-# **createDomain**
-> \Brevo\Client\Model\CreateDomainModel createDomain($domainName)
+```php
+createDomain($domain): \Brevo\Client\Models\CreateDomainModel
+```
Create a new domain
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\DomainsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$domainName = new \Brevo\Client\Model\CreateDomain(); // \Brevo\Client\Model\CreateDomain | domain's name
+$domain = new \Brevo\Client\Models\CreateDomain(); // \Brevo\Client\Models\CreateDomain | domain's name
try {
- $result = $apiInstance->createDomain($domainName);
+ $result = $apiInstance->createDomain($domain);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DomainsApi->createDomain: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **domainName** | [**\Brevo\Client\Model\CreateDomain**](../Model/CreateDomain.md)| domain's name | [optional]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **domain** | [**\Brevo\Client\Models\CreateDomain**](../Model/CreateDomain.md)| domain's name | [optional] |
### Return type
-[**\Brevo\Client\Model\CreateDomainModel**](../Model/CreateDomainModel.md)
+[**\Brevo\Client\Models\CreateDomainModel**](../Model/CreateDomainModel.md)
### Authorization
@@ -120,51 +134,59 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **deleteDomain**
-> deleteDomain($domainName)
+## `deleteDomain()`
+
+```php
+deleteDomain($domainName)
+```
Delete a domain
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\DomainsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$domainName = "domainName_example"; // string | Domain name
+$domainName = 'domainName_example'; // string | Domain name
try {
$apiInstance->deleteDomain($domainName);
} catch (Exception $e) {
echo 'Exception when calling DomainsApi->deleteDomain: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **domainName** | **string**| Domain name |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **domainName** | **string**| Domain name | |
### Return type
@@ -176,37 +198,46 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `getDomainConfiguration()`
-# **getDomainConfiguration**
-> \Brevo\Client\Model\GetDomainConfigurationModel getDomainConfiguration($domainName)
+```php
+getDomainConfiguration($domainName): \Brevo\Client\Models\GetDomainConfigurationModel
+```
Validate domain configuration
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\DomainsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$domainName = "domainName_example"; // string | Domain name
+$domainName = 'domainName_example'; // string | Domain name
try {
$result = $apiInstance->getDomainConfiguration($domainName);
@@ -214,18 +245,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling DomainsApi->getDomainConfiguration: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **domainName** | **string**| Domain name |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **domainName** | **string**| Domain name | |
### Return type
-[**\Brevo\Client\Model\GetDomainConfigurationModel**](../Model/GetDomainConfigurationModel.md)
+[**\Brevo\Client\Models\GetDomainConfigurationModel**](../Model/GetDomainConfigurationModel.md)
### Authorization
@@ -233,30 +263,39 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getDomains**
-> \Brevo\Client\Model\GetDomainsList getDomains()
+## `getDomains()`
+
+```php
+getDomains(): \Brevo\Client\Models\GetDomainsList
+```
Get the list of all your domains
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\DomainsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
@@ -270,15 +309,15 @@ try {
} catch (Exception $e) {
echo 'Exception when calling DomainsApi->getDomains: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
+
This endpoint does not need any parameter.
### Return type
-[**\Brevo\Client\Model\GetDomainsList**](../Model/GetDomainsList.md)
+[**\Brevo\Client\Models\GetDomainsList**](../Model/GetDomainsList.md)
### Authorization
@@ -286,8 +325,9 @@ This endpoint does not need any parameter.
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+- **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/EcommerceApi.md b/docs/Api/EcommerceApi.md
index caf3e5a..677d3d4 100644
--- a/docs/Api/EcommerceApi.md
+++ b/docs/Api/EcommerceApi.md
@@ -1,69 +1,81 @@
# Brevo\Client\EcommerceApi
-All URIs are relative to *https://api.brevo.com/v3*
-
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**createBatchOrder**](EcommerceApi.md#createBatchOrder) | **POST** /orders/status/batch | Create orders in batch
-[**createOrder**](EcommerceApi.md#createOrder) | **POST** /orders/status | Managing the status of the order
-[**createUpdateBatchCategory**](EcommerceApi.md#createUpdateBatchCategory) | **POST** /categories/batch | Create categories in batch
-[**createUpdateBatchProducts**](EcommerceApi.md#createUpdateBatchProducts) | **POST** /products/batch | Create products in batch
-[**createUpdateCategory**](EcommerceApi.md#createUpdateCategory) | **POST** /categories | Create/Update a category
-[**createUpdateProduct**](EcommerceApi.md#createUpdateProduct) | **POST** /products | Create/Update a product
-[**ecommerceActivatePost**](EcommerceApi.md#ecommerceActivatePost) | **POST** /ecommerce/activate | Activate the eCommerce app
-[**getCategories**](EcommerceApi.md#getCategories) | **GET** /categories | Return all your categories
-[**getCategoryInfo**](EcommerceApi.md#getCategoryInfo) | **GET** /categories/{id} | Get a category details
-[**getOrders**](EcommerceApi.md#getOrders) | **GET** /orders | Get order details
-[**getProductInfo**](EcommerceApi.md#getProductInfo) | **GET** /products/{id} | Get a product's details
-[**getProducts**](EcommerceApi.md#getProducts) | **GET** /products | Return all your products
-
-
-# **createBatchOrder**
-> createBatchOrder($orderBatch)
+All URIs are relative to https://api.brevo.com/v3, except if the operation defines another base path.
+
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**createBatchOrder()**](EcommerceApi.md#createBatchOrder) | **POST** /orders/status/batch | Create orders in batch |
+| [**createOrder()**](EcommerceApi.md#createOrder) | **POST** /orders/status | Managing the status of the order |
+| [**createUpdateBatchCategory()**](EcommerceApi.md#createUpdateBatchCategory) | **POST** /categories/batch | Create categories in batch |
+| [**createUpdateBatchProducts()**](EcommerceApi.md#createUpdateBatchProducts) | **POST** /products/batch | Create products in batch |
+| [**createUpdateCategory()**](EcommerceApi.md#createUpdateCategory) | **POST** /categories | Create/Update a category |
+| [**createUpdateProduct()**](EcommerceApi.md#createUpdateProduct) | **POST** /products | Create/Update a product |
+| [**ecommerceActivatePost()**](EcommerceApi.md#ecommerceActivatePost) | **POST** /ecommerce/activate | Activate the eCommerce app |
+| [**ecommerceAttributionMetricsConversionSourceConversionSourceIdGet()**](EcommerceApi.md#ecommerceAttributionMetricsConversionSourceConversionSourceIdGet) | **GET** /ecommerce/attribution/metrics/{conversionSource}/{conversionSourceId} | Get detailed attribution metrics for a single Brevo campaign |
+| [**ecommerceAttributionMetricsGet()**](EcommerceApi.md#ecommerceAttributionMetricsGet) | **GET** /ecommerce/attribution/metrics | Get attribution metrics for one or more Brevo campaigns |
+| [**ecommerceAttributionProductsConversionSourceConversionSourceIdGet()**](EcommerceApi.md#ecommerceAttributionProductsConversionSourceConversionSourceIdGet) | **GET** /ecommerce/attribution/products/{conversionSource}/{conversionSourceId} | Get attributed product sales for a single Brevo campaign |
+| [**ecommerceConfigDisplayCurrencyGet()**](EcommerceApi.md#ecommerceConfigDisplayCurrencyGet) | **GET** /ecommerce/config/displayCurrency | Get the ISO 4217 compliant display currency code for your Brevo account |
+| [**getCategories()**](EcommerceApi.md#getCategories) | **GET** /categories | Return all your categories |
+| [**getCategoryInfo()**](EcommerceApi.md#getCategoryInfo) | **GET** /categories/{id} | Get a category details |
+| [**getOrders()**](EcommerceApi.md#getOrders) | **GET** /orders | Get order details |
+| [**getProductInfo()**](EcommerceApi.md#getProductInfo) | **GET** /products/{id} | Get a product's details |
+| [**getProducts()**](EcommerceApi.md#getProducts) | **GET** /products | Return all your products |
+| [**setConfigDisplayCurrency()**](EcommerceApi.md#setConfigDisplayCurrency) | **POST** /ecommerce/config/displayCurrency | Set the ISO 4217 compliant display currency code for your Brevo account |
+
+
+## `createBatchOrder()`
+
+```php
+createBatchOrder($orderBatch): \Brevo\Client\Models\CreatedBatchId
+```
Create orders in batch
Create multiple orders at one time instead of one order at a time
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\EcommerceApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$orderBatch = new \Brevo\Client\Model\OrderBatch(); // \Brevo\Client\Model\OrderBatch |
+$orderBatch = new \Brevo\Client\Models\OrderBatch(); // \Brevo\Client\Models\OrderBatch
try {
- $apiInstance->createBatchOrder($orderBatch);
+ $result = $apiInstance->createBatchOrder($orderBatch);
+ print_r($result);
} catch (Exception $e) {
echo 'Exception when calling EcommerceApi->createBatchOrder: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **orderBatch** | [**\Brevo\Client\Model\OrderBatch**](../Model/OrderBatch.md)| |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **orderBatch** | [**\Brevo\Client\Models\OrderBatch**](../Model/OrderBatch.md)| | |
### Return type
-void (empty response body)
+[**\Brevo\Client\Models\CreatedBatchId**](../Model/CreatedBatchId.md)
### Authorization
@@ -71,53 +83,61 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **createOrder**
-> createOrder($order)
+## `createOrder()`
+
+```php
+createOrder($order)
+```
Managing the status of the order
Manages the transactional status of the order
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\EcommerceApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$order = new \Brevo\Client\Model\Order(); // \Brevo\Client\Model\Order |
+$order = new \Brevo\Client\Models\Order(); // \Brevo\Client\Models\Order
try {
$apiInstance->createOrder($order);
} catch (Exception $e) {
echo 'Exception when calling EcommerceApi->createOrder: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **order** | [**\Brevo\Client\Model\Order**](../Model/Order.md)| |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **order** | [**\Brevo\Client\Models\Order**](../Model/Order.md)| | |
### Return type
@@ -129,37 +149,46 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **createUpdateBatchCategory**
-> \Brevo\Client\Model\CreateUpdateBatchCategoryModel createUpdateBatchCategory($createUpdateBatchCategory)
+## `createUpdateBatchCategory()`
+
+```php
+createUpdateBatchCategory($createUpdateBatchCategory): \Brevo\Client\Models\CreateUpdateBatchCategoryModel
+```
Create categories in batch
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\EcommerceApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$createUpdateBatchCategory = new \Brevo\Client\Model\CreateUpdateBatchCategory(); // \Brevo\Client\Model\CreateUpdateBatchCategory | Values to create a batch of categories
+$createUpdateBatchCategory = new \Brevo\Client\Models\CreateUpdateBatchCategory(); // \Brevo\Client\Models\CreateUpdateBatchCategory | Values to create a batch of categories
try {
$result = $apiInstance->createUpdateBatchCategory($createUpdateBatchCategory);
@@ -167,18 +196,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling EcommerceApi->createUpdateBatchCategory: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **createUpdateBatchCategory** | [**\Brevo\Client\Model\CreateUpdateBatchCategory**](../Model/CreateUpdateBatchCategory.md)| Values to create a batch of categories |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **createUpdateBatchCategory** | [**\Brevo\Client\Models\CreateUpdateBatchCategory**](../Model/CreateUpdateBatchCategory.md)| Values to create a batch of categories | |
### Return type
-[**\Brevo\Client\Model\CreateUpdateBatchCategoryModel**](../Model/CreateUpdateBatchCategoryModel.md)
+[**\Brevo\Client\Models\CreateUpdateBatchCategoryModel**](../Model/CreateUpdateBatchCategoryModel.md)
### Authorization
@@ -186,37 +214,46 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `createUpdateBatchProducts()`
-# **createUpdateBatchProducts**
-> \Brevo\Client\Model\CreateUpdateBatchProductsModel createUpdateBatchProducts($createUpdateBatchProducts)
+```php
+createUpdateBatchProducts($createUpdateBatchProducts): \Brevo\Client\Models\CreateUpdateBatchProductsModel
+```
Create products in batch
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\EcommerceApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$createUpdateBatchProducts = new \Brevo\Client\Model\CreateUpdateBatchProducts(); // \Brevo\Client\Model\CreateUpdateBatchProducts | Values to create a batch of products
+$createUpdateBatchProducts = new \Brevo\Client\Models\CreateUpdateBatchProducts(); // \Brevo\Client\Models\CreateUpdateBatchProducts | Values to create a batch of products
try {
$result = $apiInstance->createUpdateBatchProducts($createUpdateBatchProducts);
@@ -224,18 +261,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling EcommerceApi->createUpdateBatchProducts: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **createUpdateBatchProducts** | [**\Brevo\Client\Model\CreateUpdateBatchProducts**](../Model/CreateUpdateBatchProducts.md)| Values to create a batch of products |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **createUpdateBatchProducts** | [**\Brevo\Client\Models\CreateUpdateBatchProducts**](../Model/CreateUpdateBatchProducts.md)| Values to create a batch of products | |
### Return type
-[**\Brevo\Client\Model\CreateUpdateBatchProductsModel**](../Model/CreateUpdateBatchProductsModel.md)
+[**\Brevo\Client\Models\CreateUpdateBatchProductsModel**](../Model/CreateUpdateBatchProductsModel.md)
### Authorization
@@ -243,37 +279,46 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `createUpdateCategory()`
-# **createUpdateCategory**
-> \Brevo\Client\Model\CreateCategoryModel createUpdateCategory($createUpdateCategory)
+```php
+createUpdateCategory($createUpdateCategory): \Brevo\Client\Models\CreateCategoryModel
+```
Create/Update a category
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\EcommerceApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$createUpdateCategory = new \Brevo\Client\Model\CreateUpdateCategory(); // \Brevo\Client\Model\CreateUpdateCategory | Values to create/update a category
+$createUpdateCategory = new \Brevo\Client\Models\CreateUpdateCategory(); // \Brevo\Client\Models\CreateUpdateCategory | Values to create/update a category
try {
$result = $apiInstance->createUpdateCategory($createUpdateCategory);
@@ -281,18 +326,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling EcommerceApi->createUpdateCategory: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **createUpdateCategory** | [**\Brevo\Client\Model\CreateUpdateCategory**](../Model/CreateUpdateCategory.md)| Values to create/update a category |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **createUpdateCategory** | [**\Brevo\Client\Models\CreateUpdateCategory**](../Model/CreateUpdateCategory.md)| Values to create/update a category | |
### Return type
-[**\Brevo\Client\Model\CreateCategoryModel**](../Model/CreateCategoryModel.md)
+[**\Brevo\Client\Models\CreateCategoryModel**](../Model/CreateCategoryModel.md)
### Authorization
@@ -300,37 +344,46 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `createUpdateProduct()`
-# **createUpdateProduct**
-> \Brevo\Client\Model\CreateProductModel createUpdateProduct($createUpdateProduct)
+```php
+createUpdateProduct($createUpdateProduct): \Brevo\Client\Models\CreateProductModel
+```
Create/Update a product
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\EcommerceApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$createUpdateProduct = new \Brevo\Client\Model\CreateUpdateProduct(); // \Brevo\Client\Model\CreateUpdateProduct | Values to create/update a product
+$createUpdateProduct = new \Brevo\Client\Models\CreateUpdateProduct(); // \Brevo\Client\Models\CreateUpdateProduct | Values to create/update a product
try {
$result = $apiInstance->createUpdateProduct($createUpdateProduct);
@@ -338,18 +391,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling EcommerceApi->createUpdateProduct: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **createUpdateProduct** | [**\Brevo\Client\Model\CreateUpdateProduct**](../Model/CreateUpdateProduct.md)| Values to create/update a product |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **createUpdateProduct** | [**\Brevo\Client\Models\CreateUpdateProduct**](../Model/CreateUpdateProduct.md)| Values to create/update a product | |
### Return type
-[**\Brevo\Client\Model\CreateProductModel**](../Model/CreateProductModel.md)
+[**\Brevo\Client\Models\CreateProductModel**](../Model/CreateProductModel.md)
### Authorization
@@ -357,32 +409,41 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `ecommerceActivatePost()`
-# **ecommerceActivatePost**
-> ecommerceActivatePost()
+```php
+ecommerceActivatePost()
+```
Activate the eCommerce app
Getting access to Brevo eCommerce.
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\EcommerceApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
@@ -395,10 +456,10 @@ try {
} catch (Exception $e) {
echo 'Exception when calling EcommerceApi->ecommerceActivatePost: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
+
This endpoint does not need any parameter.
### Return type
@@ -411,30 +472,304 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
+
+## `ecommerceAttributionMetricsConversionSourceConversionSourceIdGet()`
+
+```php
+ecommerceAttributionMetricsConversionSourceConversionSourceIdGet($conversionSource, $conversionSourceId): \Brevo\Client\Models\EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response
+```
+
+Get detailed attribution metrics for a single Brevo campaign
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\EcommerceApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$conversionSource = 'conversionSource_example'; // string | The Brevo campaign type for which data will be retrieved
+$conversionSourceId = 1; // float | The Brevo campaign id for which data will be retrieved
+
+try {
+ $result = $apiInstance->ecommerceAttributionMetricsConversionSourceConversionSourceIdGet($conversionSource, $conversionSourceId);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling EcommerceApi->ecommerceAttributionMetricsConversionSourceConversionSourceIdGet: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **conversionSource** | **string**| The Brevo campaign type for which data will be retrieved | |
+| **conversionSourceId** | **float**| The Brevo campaign id for which data will be retrieved | |
+
+### Return type
+
+[**\Brevo\Client\Models\EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response**](../Model/EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getCategories**
-> \Brevo\Client\Model\GetCategories getCategories($limit, $offset, $sort, $ids, $name, $modifiedSince, $createdSince)
+## `ecommerceAttributionMetricsGet()`
+
+```php
+ecommerceAttributionMetricsGet($periodFrom, $periodTo, $emailCampaignId): \Brevo\Client\Models\EcommerceAttributionMetricsGet200Response
+```
+
+Get attribution metrics for one or more Brevo campaigns
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\EcommerceApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$periodFrom = 2022-01-02T00:00Z; // \DateTime | When getting metrics for a specific period, define the starting datetime in RFC3339 format
+$periodTo = 2022-01-03T00:00Z; // \DateTime | When getting metrics for a specific period, define the end datetime in RFC3339 format
+$emailCampaignId = array(3.4); // float[] | The email campaign id(s) to get metrics for
+
+try {
+ $result = $apiInstance->ecommerceAttributionMetricsGet($periodFrom, $periodTo, $emailCampaignId);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling EcommerceApi->ecommerceAttributionMetricsGet: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **periodFrom** | **\DateTime**| When getting metrics for a specific period, define the starting datetime in RFC3339 format | [optional] |
+| **periodTo** | **\DateTime**| When getting metrics for a specific period, define the end datetime in RFC3339 format | [optional] |
+| **emailCampaignId** | [**float[]**](../Model/float.md)| The email campaign id(s) to get metrics for | [optional] |
+
+### Return type
+
+[**\Brevo\Client\Models\EcommerceAttributionMetricsGet200Response**](../Model/EcommerceAttributionMetricsGet200Response.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `ecommerceAttributionProductsConversionSourceConversionSourceIdGet()`
+
+```php
+ecommerceAttributionProductsConversionSourceConversionSourceIdGet($conversionSource, $conversionSourceId): \Brevo\Client\Models\EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response
+```
+
+Get attributed product sales for a single Brevo campaign
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\EcommerceApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$conversionSource = 'conversionSource_example'; // string | The Brevo campaign type for which data will be retrieved
+$conversionSourceId = 1; // float | The Brevo campaign id for which data will be retrieved
+
+try {
+ $result = $apiInstance->ecommerceAttributionProductsConversionSourceConversionSourceIdGet($conversionSource, $conversionSourceId);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling EcommerceApi->ecommerceAttributionProductsConversionSourceConversionSourceIdGet: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **conversionSource** | **string**| The Brevo campaign type for which data will be retrieved | |
+| **conversionSourceId** | **float**| The Brevo campaign id for which data will be retrieved | |
+
+### Return type
+
+[**\Brevo\Client\Models\EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response**](../Model/EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `ecommerceConfigDisplayCurrencyGet()`
+
+```php
+ecommerceConfigDisplayCurrencyGet(): \Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response
+```
+
+Get the ISO 4217 compliant display currency code for your Brevo account
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\EcommerceApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+
+try {
+ $result = $apiInstance->ecommerceConfigDisplayCurrencyGet();
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling EcommerceApi->ecommerceConfigDisplayCurrencyGet: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+[**\Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response**](../Model/EcommerceConfigDisplayCurrencyGet200Response.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `getCategories()`
+
+```php
+getCategories($limit, $offset, $sort, $ids, $name, $modifiedSince, $createdSince): \Brevo\Client\Models\GetCategories
+```
Return all your categories
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\EcommerceApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
@@ -443,11 +778,11 @@ $apiInstance = new Brevo\Client\Api\EcommerceApi(
);
$limit = 50; // int | Number of documents per page
$offset = 0; // int | Index of the first document in the page
-$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
-$ids = array("ids_example"); // string[] | Filter by category ids
-$name = "name_example"; // string | Filter by category name
-$modifiedSince = "modifiedSince_example"; // string | Filter (urlencoded) the categories modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
-$createdSince = "createdSince_example"; // string | Filter (urlencoded) the categories created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
+$sort = 'desc'; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
+$ids = array('ids_example'); // string[] | Filter by category ids
+$name = 'name_example'; // string | Filter by category name
+$modifiedSince = 'modifiedSince_example'; // string | Filter (urlencoded) the categories modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
+$createdSince = 'createdSince_example'; // string | Filter (urlencoded) the categories created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
try {
$result = $apiInstance->getCategories($limit, $offset, $sort, $ids, $name, $modifiedSince, $createdSince);
@@ -455,24 +790,23 @@ try {
} catch (Exception $e) {
echo 'Exception when calling EcommerceApi->getCategories: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **limit** | **int**| Number of documents per page | [optional] [default to 50]
- **offset** | **int**| Index of the first document in the page | [optional] [default to 0]
- **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
- **ids** | [**string[]**](../Model/string.md)| Filter by category ids | [optional]
- **name** | **string**| Filter by category name | [optional]
- **modifiedSince** | **string**| Filter (urlencoded) the categories modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** | [optional]
- **createdSince** | **string**| Filter (urlencoded) the categories created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** | [optional]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **limit** | **int**| Number of documents per page | [optional] [default to 50] |
+| **offset** | **int**| Index of the first document in the page | [optional] [default to 0] |
+| **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to 'desc'] |
+| **ids** | [**string[]**](../Model/string.md)| Filter by category ids | [optional] |
+| **name** | **string**| Filter by category name | [optional] |
+| **modifiedSince** | **string**| Filter (urlencoded) the categories modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** | [optional] |
+| **createdSince** | **string**| Filter (urlencoded) the categories created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** | [optional] |
### Return type
-[**\Brevo\Client\Model\GetCategories**](../Model/GetCategories.md)
+[**\Brevo\Client\Models\GetCategories**](../Model/GetCategories.md)
### Authorization
@@ -480,37 +814,46 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getCategoryInfo**
-> \Brevo\Client\Model\GetCategoryDetails getCategoryInfo($id)
+## `getCategoryInfo()`
+
+```php
+getCategoryInfo($id): \Brevo\Client\Models\GetCategoryDetails
+```
Get a category details
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\EcommerceApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = "id_example"; // string | Category ID
+$id = 'id_example'; // string | Category ID
try {
$result = $apiInstance->getCategoryInfo($id);
@@ -518,18 +861,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling EcommerceApi->getCategoryInfo: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| Category ID |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| Category ID | |
### Return type
-[**\Brevo\Client\Model\GetCategoryDetails**](../Model/GetCategoryDetails.md)
+[**\Brevo\Client\Models\GetCategoryDetails**](../Model/GetCategoryDetails.md)
### Authorization
@@ -537,32 +879,41 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getOrders**
-> \Brevo\Client\Model\GetOrders getOrders($limit, $offset, $sort, $modifiedSince, $createdSince)
+## `getOrders()`
+
+```php
+getOrders($limit, $offset, $sort, $modifiedSince, $createdSince)
+```
Get order details
Get all the orders
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\EcommerceApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
@@ -571,32 +922,30 @@ $apiInstance = new Brevo\Client\Api\EcommerceApi(
);
$limit = 50; // int | Number of documents per page
$offset = 0; // int | Index of the first document in the page
-$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
-$modifiedSince = "modifiedSince_example"; // string | Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
-$createdSince = "createdSince_example"; // string | Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
+$sort = 'desc'; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
+$modifiedSince = 'modifiedSince_example'; // string | Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
+$createdSince = 'createdSince_example'; // string | Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
try {
- $result = $apiInstance->getOrders($limit, $offset, $sort, $modifiedSince, $createdSince);
- print_r($result);
+ $apiInstance->getOrders($limit, $offset, $sort, $modifiedSince, $createdSince);
} catch (Exception $e) {
echo 'Exception when calling EcommerceApi->getOrders: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **limit** | **int**| Number of documents per page | [optional] [default to 50]
- **offset** | **int**| Index of the first document in the page | [optional] [default to 0]
- **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
- **modifiedSince** | **string**| Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** | [optional]
- **createdSince** | **string**| Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** | [optional]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **limit** | **int**| Number of documents per page | [optional] [default to 50] |
+| **offset** | **int**| Index of the first document in the page | [optional] [default to 0] |
+| **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to 'desc'] |
+| **modifiedSince** | **string**| Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** | [optional] |
+| **createdSince** | **string**| Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** | [optional] |
### Return type
-[**\Brevo\Client\Model\GetOrders**](../Model/GetOrders.md)
+void (empty response body)
### Authorization
@@ -604,37 +953,46 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getProductInfo**
-> \Brevo\Client\Model\GetProductDetails getProductInfo($id)
+## `getProductInfo()`
+
+```php
+getProductInfo($id): \Brevo\Client\Models\GetProductDetails
+```
Get a product's details
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\EcommerceApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = "id_example"; // string | Product ID
+$id = 'id_example'; // string | Product ID
try {
$result = $apiInstance->getProductInfo($id);
@@ -642,18 +1000,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling EcommerceApi->getProductInfo: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| Product ID |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| Product ID | |
### Return type
-[**\Brevo\Client\Model\GetProductDetails**](../Model/GetProductDetails.md)
+[**\Brevo\Client\Models\GetProductDetails**](../Model/GetProductDetails.md)
### Authorization
@@ -661,30 +1018,39 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getProducts**
-> \Brevo\Client\Model\GetProducts getProducts($limit, $offset, $sort, $ids, $name, $priceLte, $priceGte, $priceLt, $priceGt, $priceEq, $priceNe, $categories, $modifiedSince, $createdSince)
+## `getProducts()`
+
+```php
+getProducts($limit, $offset, $sort, $ids, $name, $priceLte, $priceGte, $priceLt, $priceGt, $priceEq, $priceNe, $categories, $modifiedSince, $createdSince): \Brevo\Client\Models\GetProducts
+```
Return all your products
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\EcommerceApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
@@ -693,18 +1059,18 @@ $apiInstance = new Brevo\Client\Api\EcommerceApi(
);
$limit = 50; // int | Number of documents per page
$offset = 0; // int | Index of the first document in the page
-$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
-$ids = array("ids_example"); // string[] | Filter by product ids
-$name = "name_example"; // string | Filter by product name, minimum 3 characters should be present for search
-$priceLte = 8.14; // float | Price filter for products less than and equals to particular amount
-$priceGte = 8.14; // float | Price filter for products greater than and equals to particular amount
-$priceLt = 8.14; // float | Price filter for products less than particular amount
-$priceGt = 8.14; // float | Price filter for products greater than particular amount
-$priceEq = 8.14; // float | Price filter for products equals to particular amount
-$priceNe = 8.14; // float | Price filter for products not equals to particular amount
-$categories = array("categories_example"); // string[] | Filter by category ids
-$modifiedSince = "modifiedSince_example"; // string | Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
-$createdSince = "createdSince_example"; // string | Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
+$sort = 'desc'; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
+$ids = array('ids_example'); // string[] | Filter by product ids
+$name = 'name_example'; // string | Filter by product name, minimum 3 characters should be present for search
+$priceLte = 3.4; // float | Price filter for products less than and equals to particular amount
+$priceGte = 3.4; // float | Price filter for products greater than and equals to particular amount
+$priceLt = 3.4; // float | Price filter for products less than particular amount
+$priceGt = 3.4; // float | Price filter for products greater than particular amount
+$priceEq = 3.4; // float | Price filter for products equals to particular amount
+$priceNe = 3.4; // float | Price filter for products not equals to particular amount
+$categories = array('categories_example'); // string[] | Filter by product categories
+$modifiedSince = 'modifiedSince_example'; // string | Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
+$createdSince = 'createdSince_example'; // string | Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
try {
$result = $apiInstance->getProducts($limit, $offset, $sort, $ids, $name, $priceLte, $priceGte, $priceLt, $priceGt, $priceEq, $priceNe, $categories, $modifiedSince, $createdSince);
@@ -712,31 +1078,30 @@ try {
} catch (Exception $e) {
echo 'Exception when calling EcommerceApi->getProducts: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **limit** | **int**| Number of documents per page | [optional] [default to 50]
- **offset** | **int**| Index of the first document in the page | [optional] [default to 0]
- **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
- **ids** | [**string[]**](../Model/string.md)| Filter by product ids | [optional]
- **name** | **string**| Filter by product name, minimum 3 characters should be present for search | [optional]
- **priceLte** | **float**| Price filter for products less than and equals to particular amount | [optional]
- **priceGte** | **float**| Price filter for products greater than and equals to particular amount | [optional]
- **priceLt** | **float**| Price filter for products less than particular amount | [optional]
- **priceGt** | **float**| Price filter for products greater than particular amount | [optional]
- **priceEq** | **float**| Price filter for products equals to particular amount | [optional]
- **priceNe** | **float**| Price filter for products not equals to particular amount | [optional]
- **categories** | [**string[]**](../Model/string.md)| Filter by category ids | [optional]
- **modifiedSince** | **string**| Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** | [optional]
- **createdSince** | **string**| Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** | [optional]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **limit** | **int**| Number of documents per page | [optional] [default to 50] |
+| **offset** | **int**| Index of the first document in the page | [optional] [default to 0] |
+| **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to 'desc'] |
+| **ids** | [**string[]**](../Model/string.md)| Filter by product ids | [optional] |
+| **name** | **string**| Filter by product name, minimum 3 characters should be present for search | [optional] |
+| **priceLte** | **float**| Price filter for products less than and equals to particular amount | [optional] |
+| **priceGte** | **float**| Price filter for products greater than and equals to particular amount | [optional] |
+| **priceLt** | **float**| Price filter for products less than particular amount | [optional] |
+| **priceGt** | **float**| Price filter for products greater than particular amount | [optional] |
+| **priceEq** | **float**| Price filter for products equals to particular amount | [optional] |
+| **priceNe** | **float**| Price filter for products not equals to particular amount | [optional] |
+| **categories** | [**string[]**](../Model/string.md)| Filter by product categories | [optional] |
+| **modifiedSince** | **string**| Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** | [optional] |
+| **createdSince** | **string**| Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** | [optional] |
### Return type
-[**\Brevo\Client\Model\GetProducts**](../Model/GetProducts.md)
+[**\Brevo\Client\Models\GetProducts**](../Model/GetProducts.md)
### Authorization
@@ -744,8 +1109,74 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
+
+## `setConfigDisplayCurrency()`
+
+```php
+setConfigDisplayCurrency($ecommerceConfigDisplayCurrencyGet200Response): \Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response
+```
+
+Set the ISO 4217 compliant display currency code for your Brevo account
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\EcommerceApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$ecommerceConfigDisplayCurrencyGet200Response = new \Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response(); // \Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response | set ISO 4217 compliant display currency code payload
+
+try {
+ $result = $apiInstance->setConfigDisplayCurrency($ecommerceConfigDisplayCurrencyGet200Response);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling EcommerceApi->setConfigDisplayCurrency: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **ecommerceConfigDisplayCurrencyGet200Response** | [**\Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response**](../Model/EcommerceConfigDisplayCurrencyGet200Response.md)| set ISO 4217 compliant display currency code payload | [optional] |
+
+### Return type
+
+[**\Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response**](../Model/EcommerceConfigDisplayCurrencyGet200Response.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### HTTP request headers
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+- **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)
diff --git a/docs/Api/EmailCampaignsApi.md b/docs/Api/EmailCampaignsApi.md
index b25d8f3..2e9fa51 100644
--- a/docs/Api/EmailCampaignsApi.md
+++ b/docs/Api/EmailCampaignsApi.md
@@ -1,69 +1,75 @@
# Brevo\Client\EmailCampaignsApi
-All URIs are relative to *https://api.brevo.com/v3*
-
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**createEmailCampaign**](EmailCampaignsApi.md#createEmailCampaign) | **POST** /emailCampaigns | Create an email campaign
-[**deleteEmailCampaign**](EmailCampaignsApi.md#deleteEmailCampaign) | **DELETE** /emailCampaigns/{campaignId} | Delete an email campaign
-[**emailExportRecipients**](EmailCampaignsApi.md#emailExportRecipients) | **POST** /emailCampaigns/{campaignId}/exportRecipients | Export the recipients of an email campaign
-[**getAbTestCampaignResult**](EmailCampaignsApi.md#getAbTestCampaignResult) | **GET** /emailCampaigns/{campaignId}/abTestCampaignResult | Get an A/B test email campaign results
-[**getEmailCampaign**](EmailCampaignsApi.md#getEmailCampaign) | **GET** /emailCampaigns/{campaignId} | Get an email campaign report
-[**getEmailCampaigns**](EmailCampaignsApi.md#getEmailCampaigns) | **GET** /emailCampaigns | Return all your created email campaigns
-[**getSharedTemplateUrl**](EmailCampaignsApi.md#getSharedTemplateUrl) | **GET** /emailCampaigns/{campaignId}/sharedUrl | Get a shared template url
-[**sendEmailCampaignNow**](EmailCampaignsApi.md#sendEmailCampaignNow) | **POST** /emailCampaigns/{campaignId}/sendNow | Send an email campaign immediately, based on campaignId
-[**sendReport**](EmailCampaignsApi.md#sendReport) | **POST** /emailCampaigns/{campaignId}/sendReport | Send the report of a campaign
-[**sendTestEmail**](EmailCampaignsApi.md#sendTestEmail) | **POST** /emailCampaigns/{campaignId}/sendTest | Send an email campaign to your test list
-[**updateCampaignStatus**](EmailCampaignsApi.md#updateCampaignStatus) | **PUT** /emailCampaigns/{campaignId}/status | Update an email campaign status
-[**updateEmailCampaign**](EmailCampaignsApi.md#updateEmailCampaign) | **PUT** /emailCampaigns/{campaignId} | Update an email campaign
-[**uploadImageToGallery**](EmailCampaignsApi.md#uploadImageToGallery) | **POST** /emailCampaigns/images | Upload an image to your account's image gallery
-
-
-# **createEmailCampaign**
-> \Brevo\Client\Model\CreateModel createEmailCampaign($emailCampaigns)
+All URIs are relative to https://api.brevo.com/v3, except if the operation defines another base path.
+
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**createEmailCampaign()**](EmailCampaignsApi.md#createEmailCampaign) | **POST** /emailCampaigns | Create an email campaign |
+| [**deleteEmailCampaign()**](EmailCampaignsApi.md#deleteEmailCampaign) | **DELETE** /emailCampaigns/{campaignId} | Delete an email campaign |
+| [**emailExportRecipients()**](EmailCampaignsApi.md#emailExportRecipients) | **POST** /emailCampaigns/{campaignId}/exportRecipients | Export the recipients of an email campaign |
+| [**getAbTestCampaignResult()**](EmailCampaignsApi.md#getAbTestCampaignResult) | **GET** /emailCampaigns/{campaignId}/abTestCampaignResult | Get an A/B test email campaign results |
+| [**getEmailCampaign()**](EmailCampaignsApi.md#getEmailCampaign) | **GET** /emailCampaigns/{campaignId} | Get an email campaign report |
+| [**getEmailCampaigns()**](EmailCampaignsApi.md#getEmailCampaigns) | **GET** /emailCampaigns | Return all your created email campaigns |
+| [**getSharedTemplateUrl()**](EmailCampaignsApi.md#getSharedTemplateUrl) | **GET** /emailCampaigns/{campaignId}/sharedUrl | Get a shared template url |
+| [**sendEmailCampaignNow()**](EmailCampaignsApi.md#sendEmailCampaignNow) | **POST** /emailCampaigns/{campaignId}/sendNow | Send an email campaign immediately, based on campaignId |
+| [**sendReport()**](EmailCampaignsApi.md#sendReport) | **POST** /emailCampaigns/{campaignId}/sendReport | Send the report of a campaign |
+| [**sendTestEmail()**](EmailCampaignsApi.md#sendTestEmail) | **POST** /emailCampaigns/{campaignId}/sendTest | Send an email campaign to your test list |
+| [**updateCampaignStatus()**](EmailCampaignsApi.md#updateCampaignStatus) | **PUT** /emailCampaigns/{campaignId}/status | Update an email campaign status |
+| [**updateEmailCampaign()**](EmailCampaignsApi.md#updateEmailCampaign) | **PUT** /emailCampaigns/{campaignId} | Update an email campaign |
+| [**uploadImageToGallery()**](EmailCampaignsApi.md#uploadImageToGallery) | **POST** /emailCampaigns/images | Upload an image to your account's image gallery |
+
+
+## `createEmailCampaign()`
+
+```php
+createEmailCampaign($createEmailCampaign): \Brevo\Client\Models\CreateModel
+```
Create an email campaign
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\EmailCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$emailCampaigns = new \Brevo\Client\Model\CreateEmailCampaign(); // \Brevo\Client\Model\CreateEmailCampaign | Values to create a campaign
+$createEmailCampaign = new \Brevo\Client\Models\CreateEmailCampaign(); // \Brevo\Client\Models\CreateEmailCampaign | Values to create a campaign
try {
- $result = $apiInstance->createEmailCampaign($emailCampaigns);
+ $result = $apiInstance->createEmailCampaign($createEmailCampaign);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling EmailCampaignsApi->createEmailCampaign: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **emailCampaigns** | [**\Brevo\Client\Model\CreateEmailCampaign**](../Model/CreateEmailCampaign.md)| Values to create a campaign |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **createEmailCampaign** | [**\Brevo\Client\Models\CreateEmailCampaign**](../Model/CreateEmailCampaign.md)| Values to create a campaign | |
### Return type
-[**\Brevo\Client\Model\CreateModel**](../Model/CreateModel.md)
+[**\Brevo\Client\Models\CreateModel**](../Model/CreateModel.md)
### Authorization
@@ -71,51 +77,59 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `deleteEmailCampaign()`
-# **deleteEmailCampaign**
-> deleteEmailCampaign($campaignId)
+```php
+deleteEmailCampaign($campaignId)
+```
Delete an email campaign
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\EmailCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$campaignId = 789; // int | id of the campaign
+$campaignId = 56; // int | id of the campaign
try {
$apiInstance->deleteEmailCampaign($campaignId);
} catch (Exception $e) {
echo 'Exception when calling EmailCampaignsApi->deleteEmailCampaign: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **campaignId** | **int**| id of the campaign |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **campaignId** | **int**| id of the campaign | |
### Return type
@@ -127,58 +141,66 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `emailExportRecipients()`
-# **emailExportRecipients**
-> \Brevo\Client\Model\CreatedProcessId emailExportRecipients($campaignId, $recipientExport)
+```php
+emailExportRecipients($campaignId, $emailExportRecipients): \Brevo\Client\Models\CreatedProcessId
+```
Export the recipients of an email campaign
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\EmailCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$campaignId = 789; // int | Id of the campaign
-$recipientExport = new \Brevo\Client\Model\EmailExportRecipients(); // \Brevo\Client\Model\EmailExportRecipients | Values to send for a recipient export request
+$campaignId = 56; // int | Id of the campaign
+$emailExportRecipients = new \Brevo\Client\Models\EmailExportRecipients(); // \Brevo\Client\Models\EmailExportRecipients | Values to send for a recipient export request
try {
- $result = $apiInstance->emailExportRecipients($campaignId, $recipientExport);
+ $result = $apiInstance->emailExportRecipients($campaignId, $emailExportRecipients);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling EmailCampaignsApi->emailExportRecipients: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **campaignId** | **int**| Id of the campaign |
- **recipientExport** | [**\Brevo\Client\Model\EmailExportRecipients**](../Model/EmailExportRecipients.md)| Values to send for a recipient export request | [optional]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **campaignId** | **int**| Id of the campaign | |
+| **emailExportRecipients** | [**\Brevo\Client\Models\EmailExportRecipients**](../Model/EmailExportRecipients.md)| Values to send for a recipient export request | [optional] |
### Return type
-[**\Brevo\Client\Model\CreatedProcessId**](../Model/CreatedProcessId.md)
+[**\Brevo\Client\Models\CreatedProcessId**](../Model/CreatedProcessId.md)
### Authorization
@@ -186,39 +208,48 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getAbTestCampaignResult**
-> \Brevo\Client\Model\AbTestCampaignResult getAbTestCampaignResult($campaignId)
+## `getAbTestCampaignResult()`
+
+```php
+getAbTestCampaignResult($campaignId): \Brevo\Client\Models\AbTestCampaignResult
+```
Get an A/B test email campaign results
Obtain winning version of an A/B test email campaign
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\EmailCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$campaignId = 789; // int | Id of the A/B test campaign
+$campaignId = 56; // int | Id of the A/B test campaign
try {
$result = $apiInstance->getAbTestCampaignResult($campaignId);
@@ -226,18 +257,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling EmailCampaignsApi->getAbTestCampaignResult: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **campaignId** | **int**| Id of the A/B test campaign |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **campaignId** | **int**| Id of the A/B test campaign | |
### Return type
-[**\Brevo\Client\Model\AbTestCampaignResult**](../Model/AbTestCampaignResult.md)
+[**\Brevo\Client\Models\AbTestCampaignResult**](../Model/AbTestCampaignResult.md)
### Authorization
@@ -245,38 +275,47 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `getEmailCampaign()`
-# **getEmailCampaign**
-> \Brevo\Client\Model\GetEmailCampaign getEmailCampaign($campaignId, $statistics)
+```php
+getEmailCampaign($campaignId, $statistics): \Brevo\Client\Models\GetEmailCampaign
+```
Get an email campaign report
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\EmailCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$campaignId = 789; // int | Id of the campaign
-$statistics = "statistics_example"; // string | Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response.
+$campaignId = 56; // int | Id of the campaign
+$statistics = 'statistics_example'; // string | Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response.
try {
$result = $apiInstance->getEmailCampaign($campaignId, $statistics);
@@ -284,19 +323,18 @@ try {
} catch (Exception $e) {
echo 'Exception when calling EmailCampaignsApi->getEmailCampaign: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **campaignId** | **int**| Id of the campaign |
- **statistics** | **string**| Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. | [optional]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **campaignId** | **int**| Id of the campaign | |
+| **statistics** | **string**| Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. | [optional] |
### Return type
-[**\Brevo\Client\Model\GetEmailCampaign**](../Model/GetEmailCampaign.md)
+[**\Brevo\Client\Models\GetEmailCampaign**](../Model/GetEmailCampaign.md)
### Authorization
@@ -304,45 +342,54 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getEmailCampaigns**
-> \Brevo\Client\Model\GetEmailCampaigns getEmailCampaigns($type, $status, $statistics, $startDate, $endDate, $limit, $offset, $sort, $excludeHtmlContent)
+## `getEmailCampaigns()`
+
+```php
+getEmailCampaigns($type, $status, $statistics, $startDate, $endDate, $limit, $offset, $sort, $excludeHtmlContent): \Brevo\Client\Models\GetEmailCampaigns
+```
Return all your created email campaigns
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\EmailCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$type = "type_example"; // string | Filter on the type of the campaigns
-$status = "status_example"; // string | Filter on the status of the campaign
-$statistics = "statistics_example"; // string | Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response.
-$startDate = "startDate_example"; // string | Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' )
-$endDate = "endDate_example"; // string | Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' )
+$type = 'type_example'; // string | Filter on the type of the campaigns
+$status = 'status_example'; // string | Filter on the status of the campaign
+$statistics = 'statistics_example'; // string | Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response.This option only returns data for events occurred in the last 6 months.For older campaigns, it’s advisable to use the **Get Campaign Report** endpoint.
+$startDate = 'startDate_example'; // string | **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' )
+$endDate = 'endDate_example'; // string | **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' )
$limit = 50; // int | Number of documents per page
$offset = 0; // int | Index of the first document in the page
-$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
-$excludeHtmlContent = true; // bool | Use this flag to exclude htmlContent from the response body. If set to **true**, htmlContent field will be returned as empty string in the response body
+$sort = 'desc'; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
+$excludeHtmlContent = True; // bool | Use this flag to exclude htmlContent from the response body. If set to **true**, htmlContent field will be returned as empty string in the response body
try {
$result = $apiInstance->getEmailCampaigns($type, $status, $statistics, $startDate, $endDate, $limit, $offset, $sort, $excludeHtmlContent);
@@ -350,26 +397,25 @@ try {
} catch (Exception $e) {
echo 'Exception when calling EmailCampaignsApi->getEmailCampaigns: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **type** | **string**| Filter on the type of the campaigns | [optional]
- **status** | **string**| Filter on the status of the campaign | [optional]
- **statistics** | **string**| Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. | [optional]
- **startDate** | **string**| Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) | [optional]
- **endDate** | **string**| Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) | [optional]
- **limit** | **int**| Number of documents per page | [optional] [default to 50]
- **offset** | **int**| Index of the first document in the page | [optional] [default to 0]
- **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
- **excludeHtmlContent** | **bool**| Use this flag to exclude htmlContent from the response body. If set to **true**, htmlContent field will be returned as empty string in the response body | [optional]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **type** | **string**| Filter on the type of the campaigns | [optional] |
+| **status** | **string**| Filter on the status of the campaign | [optional] |
+| **statistics** | **string**| Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response.This option only returns data for events occurred in the last 6 months.For older campaigns, it’s advisable to use the **Get Campaign Report** endpoint. | [optional] |
+| **startDate** | **string**| **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) | [optional] |
+| **endDate** | **string**| **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) | [optional] |
+| **limit** | **int**| Number of documents per page | [optional] [default to 50] |
+| **offset** | **int**| Index of the first document in the page | [optional] [default to 0] |
+| **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to 'desc'] |
+| **excludeHtmlContent** | **bool**| Use this flag to exclude htmlContent from the response body. If set to **true**, htmlContent field will be returned as empty string in the response body | [optional] |
### Return type
-[**\Brevo\Client\Model\GetEmailCampaigns**](../Model/GetEmailCampaigns.md)
+[**\Brevo\Client\Models\GetEmailCampaigns**](../Model/GetEmailCampaigns.md)
### Authorization
@@ -377,39 +423,48 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getSharedTemplateUrl**
-> \Brevo\Client\Model\GetSharedTemplateUrl getSharedTemplateUrl($campaignId)
+## `getSharedTemplateUrl()`
+
+```php
+getSharedTemplateUrl($campaignId): \Brevo\Client\Models\GetSharedTemplateUrl
+```
Get a shared template url
Get a unique URL to share & import an email template from one Brevo account to another.
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\EmailCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$campaignId = 789; // int | Id of the campaign or template
+$campaignId = 56; // int | Id of the campaign or template
try {
$result = $apiInstance->getSharedTemplateUrl($campaignId);
@@ -417,18 +472,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling EmailCampaignsApi->getSharedTemplateUrl: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **campaignId** | **int**| Id of the campaign or template |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **campaignId** | **int**| Id of the campaign or template | |
### Return type
-[**\Brevo\Client\Model\GetSharedTemplateUrl**](../Model/GetSharedTemplateUrl.md)
+[**\Brevo\Client\Models\GetSharedTemplateUrl**](../Model/GetSharedTemplateUrl.md)
### Authorization
@@ -436,51 +490,59 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **sendEmailCampaignNow**
-> sendEmailCampaignNow($campaignId)
+## `sendEmailCampaignNow()`
+
+```php
+sendEmailCampaignNow($campaignId)
+```
Send an email campaign immediately, based on campaignId
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\EmailCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$campaignId = 789; // int | Id of the campaign
+$campaignId = 56; // int | Id of the campaign
try {
$apiInstance->sendEmailCampaignNow($campaignId);
} catch (Exception $e) {
echo 'Exception when calling EmailCampaignsApi->sendEmailCampaignNow: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **campaignId** | **int**| Id of the campaign |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **campaignId** | **int**| Id of the campaign | |
### Return type
@@ -492,55 +554,63 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **sendReport**
-> sendReport($campaignId, $sendReport)
+## `sendReport()`
+
+```php
+sendReport($campaignId, $sendReport)
+```
Send the report of a campaign
A PDF will be sent to the specified email addresses
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\EmailCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$campaignId = 789; // int | Id of the campaign
-$sendReport = new \Brevo\Client\Model\SendReport(); // \Brevo\Client\Model\SendReport | Values for send a report
+$campaignId = 56; // int | Id of the campaign
+$sendReport = new \Brevo\Client\Models\SendReport(); // \Brevo\Client\Models\SendReport | Values for send a report
try {
$apiInstance->sendReport($campaignId, $sendReport);
} catch (Exception $e) {
echo 'Exception when calling EmailCampaignsApi->sendReport: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **campaignId** | **int**| Id of the campaign |
- **sendReport** | [**\Brevo\Client\Model\SendReport**](../Model/SendReport.md)| Values for send a report |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **campaignId** | **int**| Id of the campaign | |
+| **sendReport** | [**\Brevo\Client\Models\SendReport**](../Model/SendReport.md)| Values for send a report | |
### Return type
@@ -552,53 +622,61 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **sendTestEmail**
-> sendTestEmail($campaignId, $emailTo)
+## `sendTestEmail()`
+
+```php
+sendTestEmail($campaignId, $sendTestEmail)
+```
Send an email campaign to your test list
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\EmailCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$campaignId = 789; // int | Id of the campaign
-$emailTo = new \Brevo\Client\Model\SendTestEmail(); // \Brevo\Client\Model\SendTestEmail |
+$campaignId = 56; // int | Id of the campaign
+$sendTestEmail = new \Brevo\Client\Models\SendTestEmail(); // \Brevo\Client\Models\SendTestEmail
try {
- $apiInstance->sendTestEmail($campaignId, $emailTo);
+ $apiInstance->sendTestEmail($campaignId, $sendTestEmail);
} catch (Exception $e) {
echo 'Exception when calling EmailCampaignsApi->sendTestEmail: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **campaignId** | **int**| Id of the campaign |
- **emailTo** | [**\Brevo\Client\Model\SendTestEmail**](../Model/SendTestEmail.md)| |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **campaignId** | **int**| Id of the campaign | |
+| **sendTestEmail** | [**\Brevo\Client\Models\SendTestEmail**](../Model/SendTestEmail.md)| | |
### Return type
@@ -610,53 +688,61 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `updateCampaignStatus()`
-# **updateCampaignStatus**
-> updateCampaignStatus($campaignId, $status)
+```php
+updateCampaignStatus($campaignId, $updateCampaignStatus)
+```
Update an email campaign status
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\EmailCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$campaignId = 789; // int | Id of the campaign
-$status = new \Brevo\Client\Model\UpdateCampaignStatus(); // \Brevo\Client\Model\UpdateCampaignStatus | Status of the campaign
+$campaignId = 56; // int | Id of the campaign
+$updateCampaignStatus = new \Brevo\Client\Models\UpdateCampaignStatus(); // \Brevo\Client\Models\UpdateCampaignStatus | Status of the campaign
try {
- $apiInstance->updateCampaignStatus($campaignId, $status);
+ $apiInstance->updateCampaignStatus($campaignId, $updateCampaignStatus);
} catch (Exception $e) {
echo 'Exception when calling EmailCampaignsApi->updateCampaignStatus: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **campaignId** | **int**| Id of the campaign |
- **status** | [**\Brevo\Client\Model\UpdateCampaignStatus**](../Model/UpdateCampaignStatus.md)| Status of the campaign |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **campaignId** | **int**| Id of the campaign | |
+| **updateCampaignStatus** | [**\Brevo\Client\Models\UpdateCampaignStatus**](../Model/UpdateCampaignStatus.md)| Status of the campaign | |
### Return type
@@ -668,53 +754,61 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `updateEmailCampaign()`
-# **updateEmailCampaign**
-> updateEmailCampaign($campaignId, $emailCampaign)
+```php
+updateEmailCampaign($campaignId, $updateEmailCampaign)
+```
Update an email campaign
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\EmailCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$campaignId = 789; // int | Id of the campaign
-$emailCampaign = new \Brevo\Client\Model\UpdateEmailCampaign(); // \Brevo\Client\Model\UpdateEmailCampaign | Values to update a campaign
+$campaignId = 56; // int | Id of the campaign
+$updateEmailCampaign = new \Brevo\Client\Models\UpdateEmailCampaign(); // \Brevo\Client\Models\UpdateEmailCampaign | Values to update a campaign
try {
- $apiInstance->updateEmailCampaign($campaignId, $emailCampaign);
+ $apiInstance->updateEmailCampaign($campaignId, $updateEmailCampaign);
} catch (Exception $e) {
echo 'Exception when calling EmailCampaignsApi->updateEmailCampaign: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **campaignId** | **int**| Id of the campaign |
- **emailCampaign** | [**\Brevo\Client\Model\UpdateEmailCampaign**](../Model/UpdateEmailCampaign.md)| Values to update a campaign |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **campaignId** | **int**| Id of the campaign | |
+| **updateEmailCampaign** | [**\Brevo\Client\Models\UpdateEmailCampaign**](../Model/UpdateEmailCampaign.md)| Values to update a campaign | |
### Return type
@@ -726,56 +820,64 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **uploadImageToGallery**
-> \Brevo\Client\Model\UploadImageModel uploadImageToGallery($uploadImage)
+## `uploadImageToGallery()`
+
+```php
+uploadImageToGallery($uploadImageToGallery): \Brevo\Client\Models\UploadImageModel
+```
Upload an image to your account's image gallery
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\EmailCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$uploadImage = new \Brevo\Client\Model\UploadImageToGallery(); // \Brevo\Client\Model\UploadImageToGallery | Parameters to upload an image
+$uploadImageToGallery = new \Brevo\Client\Models\UploadImageToGallery(); // \Brevo\Client\Models\UploadImageToGallery | Parameters to upload an image
try {
- $result = $apiInstance->uploadImageToGallery($uploadImage);
+ $result = $apiInstance->uploadImageToGallery($uploadImageToGallery);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling EmailCampaignsApi->uploadImageToGallery: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **uploadImage** | [**\Brevo\Client\Model\UploadImageToGallery**](../Model/UploadImageToGallery.md)| Parameters to upload an image |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **uploadImageToGallery** | [**\Brevo\Client\Models\UploadImageToGallery**](../Model/UploadImageToGallery.md)| Parameters to upload an image | |
### Return type
-[**\Brevo\Client\Model\UploadImageModel**](../Model/UploadImageModel.md)
+[**\Brevo\Client\Models\UploadImageModel**](../Model/UploadImageModel.md)
### Authorization
@@ -783,8 +885,9 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+- **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)
diff --git a/docs/Api/EventApi.md b/docs/Api/EventApi.md
new file mode 100644
index 0000000..a39381a
--- /dev/null
+++ b/docs/Api/EventApi.md
@@ -0,0 +1,74 @@
+# Brevo\Client\EventApi
+
+All URIs are relative to https://api.brevo.com/v3, except if the operation defines another base path.
+
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**createEvent()**](EventApi.md#createEvent) | **POST** /events | Create an event |
+
+
+## `createEvent()`
+
+```php
+createEvent($event)
+```
+
+Create an event
+
+Create an event to track a contact's interaction.
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\EventApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$event = new \Brevo\Client\Models\Event(); // \Brevo\Client\Models\Event
+
+try {
+ $apiInstance->createEvent($event);
+} catch (Exception $e) {
+ echo 'Exception when calling EventApi->createEvent: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **event** | [**\Brevo\Client\Models\Event**](../Model/Event.md)| | |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
diff --git a/docs/Api/EventsApi.md b/docs/Api/EventsApi.md
deleted file mode 100644
index 50957d9..0000000
--- a/docs/Api/EventsApi.md
+++ /dev/null
@@ -1,67 +0,0 @@
-# Brevo\Client\EventsApi
-
-All URIs are relative to *https://api.brevo.com/v3*
-
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**createEvent**](EventsApi.md#createEvent) | **POST** /events | Create an event
-
-
-# **createEvent**
-> createEvent($event)
-
-Create an event
-
-Create an event to track a contact's interaction.
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\EventsApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$event = new \Brevo\Client\Model\Event(); // \Brevo\Client\Model\Event |
-
-try {
- $apiInstance->createEvent($event);
-} catch (Exception $e) {
- echo 'Exception when calling EventsApi->createEvent: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **event** | [**\Brevo\Client\Model\Event**](../Model/Event.md)| |
-
-### Return type
-
-void (empty response body)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
diff --git a/docs/Api/ExternalFeedsApi.md b/docs/Api/ExternalFeedsApi.md
index b72ddeb..1ad8c69 100644
--- a/docs/Api/ExternalFeedsApi.md
+++ b/docs/Api/ExternalFeedsApi.md
@@ -1,44 +1,51 @@
# Brevo\Client\ExternalFeedsApi
-All URIs are relative to *https://api.brevo.com/v3*
+All URIs are relative to https://api.brevo.com/v3, except if the operation defines another base path.
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**createExternalFeed**](ExternalFeedsApi.md#createExternalFeed) | **POST** /feeds | Create an external feed
-[**deleteExternalFeed**](ExternalFeedsApi.md#deleteExternalFeed) | **DELETE** /feeds/{uuid} | Delete an external feed
-[**getAllExternalFeeds**](ExternalFeedsApi.md#getAllExternalFeeds) | **GET** /feeds | Fetch all external feeds
-[**getExternalFeedByUUID**](ExternalFeedsApi.md#getExternalFeedByUUID) | **GET** /feeds/{uuid} | Get an external feed by UUID
-[**updateExternalFeed**](ExternalFeedsApi.md#updateExternalFeed) | **PUT** /feeds/{uuid} | Update an external feed
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**createExternalFeed()**](ExternalFeedsApi.md#createExternalFeed) | **POST** /feeds | Create an external feed |
+| [**deleteExternalFeed()**](ExternalFeedsApi.md#deleteExternalFeed) | **DELETE** /feeds/{uuid} | Delete an external feed |
+| [**getAllExternalFeeds()**](ExternalFeedsApi.md#getAllExternalFeeds) | **GET** /feeds | Fetch all external feeds |
+| [**getExternalFeedByUUID()**](ExternalFeedsApi.md#getExternalFeedByUUID) | **GET** /feeds/{uuid} | Get an external feed by UUID |
+| [**updateExternalFeed()**](ExternalFeedsApi.md#updateExternalFeed) | **PUT** /feeds/{uuid} | Update an external feed |
-# **createExternalFeed**
-> \Brevo\Client\Model\InlineResponse2015 createExternalFeed($createExternalFeed)
+## `createExternalFeed()`
+
+```php
+createExternalFeed($createExternalFeed): \Brevo\Client\Models\CreateExternalFeed201Response
+```
Create an external feed
This endpoint will create an external feed.
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ExternalFeedsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$createExternalFeed = new \Brevo\Client\Model\CreateExternalFeed(); // \Brevo\Client\Model\CreateExternalFeed | Values to create a feed
+$createExternalFeed = new \Brevo\Client\Models\CreateExternalFeed(); // \Brevo\Client\Models\CreateExternalFeed | Values to create a feed
try {
$result = $apiInstance->createExternalFeed($createExternalFeed);
@@ -46,18 +53,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling ExternalFeedsApi->createExternalFeed: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **createExternalFeed** | [**\Brevo\Client\Model\CreateExternalFeed**](../Model/CreateExternalFeed.md)| Values to create a feed |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **createExternalFeed** | [**\Brevo\Client\Models\CreateExternalFeed**](../Model/CreateExternalFeed.md)| Values to create a feed | |
### Return type
-[**\Brevo\Client\Model\InlineResponse2015**](../Model/InlineResponse2015.md)
+[**\Brevo\Client\Models\CreateExternalFeed201Response**](../Model/CreateExternalFeed201Response.md)
### Authorization
@@ -65,53 +71,61 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **deleteExternalFeed**
-> deleteExternalFeed($uuid)
+## `deleteExternalFeed()`
+
+```php
+deleteExternalFeed($uuid)
+```
Delete an external feed
This endpoint will delete an external feed.
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ExternalFeedsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$uuid = "uuid_example"; // string | UUID of the feed to delete
+$uuid = 38f351fb-6e77-4b38-979a-a2465260449e; // string | UUID of the feed to delete
try {
$apiInstance->deleteExternalFeed($uuid);
} catch (Exception $e) {
echo 'Exception when calling ExternalFeedsApi->deleteExternalFeed: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **uuid** | **string**| UUID of the feed to delete |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **uuid** | **string**| UUID of the feed to delete | |
### Return type
@@ -123,44 +137,53 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getAllExternalFeeds**
-> \Brevo\Client\Model\GetAllExternalFeeds getAllExternalFeeds($search, $startDate, $endDate, $sort, $authType, $limit, $offset)
+## `getAllExternalFeeds()`
+
+```php
+getAllExternalFeeds($search, $startDate, $endDate, $sort, $authType, $limit, $offset): \Brevo\Client\Models\GetAllExternalFeeds
+```
Fetch all external feeds
This endpoint can fetch all created external feeds.
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ExternalFeedsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$search = "search_example"; // string | Can be used to filter records by search keyword on feed name
-$startDate = new \DateTime("2013-10-20"); // \DateTime | Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older than current date.
-$endDate = new \DateTime("2013-10-20"); // \DateTime | Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month.
-$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed.
-$authType = "authType_example"; // string | Filter the records by `authType` of the feed.
-$limit = 50; // int | Number of documents returned per page.
+$search = search; // string | Can be used to filter records by search keyword on feed name
+$startDate = 2022-09-04; // \DateTime | Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older than current date.
+$endDate = 2022-10-01; // \DateTime | Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month.
+$sort = 'desc'; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed.
+$authType = 'authType_example'; // string | Filter the records by `authType` of the feed.
+$limit = 100; // int | Number of documents returned per page.
$offset = 0; // int | Index of the first document on the page.
try {
@@ -169,24 +192,23 @@ try {
} catch (Exception $e) {
echo 'Exception when calling ExternalFeedsApi->getAllExternalFeeds: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **search** | **string**| Can be used to filter records by search keyword on feed name | [optional]
- **startDate** | **\DateTime**| Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older than current date. | [optional]
- **endDate** | **\DateTime**| Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. | [optional]
- **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed. | [optional] [default to desc]
- **authType** | **string**| Filter the records by `authType` of the feed. | [optional]
- **limit** | **int**| Number of documents returned per page. | [optional] [default to 50]
- **offset** | **int**| Index of the first document on the page. | [optional] [default to 0]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **search** | **string**| Can be used to filter records by search keyword on feed name | [optional] |
+| **startDate** | **\DateTime**| Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older than current date. | [optional] |
+| **endDate** | **\DateTime**| Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. | [optional] |
+| **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed. | [optional] [default to 'desc'] |
+| **authType** | **string**| Filter the records by `authType` of the feed. | [optional] |
+| **limit** | **int**| Number of documents returned per page. | [optional] [default to 50] |
+| **offset** | **int**| Index of the first document on the page. | [optional] [default to 0] |
### Return type
-[**\Brevo\Client\Model\GetAllExternalFeeds**](../Model/GetAllExternalFeeds.md)
+[**\Brevo\Client\Models\GetAllExternalFeeds**](../Model/GetAllExternalFeeds.md)
### Authorization
@@ -194,39 +216,48 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getExternalFeedByUUID**
-> \Brevo\Client\Model\GetExternalFeedByUUID getExternalFeedByUUID($uuid)
+## `getExternalFeedByUUID()`
+
+```php
+getExternalFeedByUUID($uuid): \Brevo\Client\Models\GetExternalFeedByUUID
+```
Get an external feed by UUID
This endpoint will update an external feed.
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ExternalFeedsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$uuid = "uuid_example"; // string | UUID of the feed to fetch
+$uuid = 38f351fb-6e77-4b38-979a-a2465260449e; // string | UUID of the feed to fetch
try {
$result = $apiInstance->getExternalFeedByUUID($uuid);
@@ -234,18 +265,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling ExternalFeedsApi->getExternalFeedByUUID: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **uuid** | **string**| UUID of the feed to fetch |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **uuid** | **string**| UUID of the feed to fetch | |
### Return type
-[**\Brevo\Client\Model\GetExternalFeedByUUID**](../Model/GetExternalFeedByUUID.md)
+[**\Brevo\Client\Models\GetExternalFeedByUUID**](../Model/GetExternalFeedByUUID.md)
### Authorization
@@ -253,55 +283,63 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **updateExternalFeed**
-> updateExternalFeed($uuid, $updateExternalFeed)
+## `updateExternalFeed()`
+
+```php
+updateExternalFeed($uuid, $updateExternalFeed)
+```
Update an external feed
This endpoint will update an external feed.
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ExternalFeedsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$uuid = "uuid_example"; // string | UUID of the feed to update
-$updateExternalFeed = new \Brevo\Client\Model\UpdateExternalFeed(); // \Brevo\Client\Model\UpdateExternalFeed | Values to update a feed
+$uuid = 38f351fb-6e77-4b38-979a-a2465260449e; // string | UUID of the feed to update
+$updateExternalFeed = new \Brevo\Client\Models\UpdateExternalFeed(); // \Brevo\Client\Models\UpdateExternalFeed | Values to update a feed
try {
$apiInstance->updateExternalFeed($uuid, $updateExternalFeed);
} catch (Exception $e) {
echo 'Exception when calling ExternalFeedsApi->updateExternalFeed: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **uuid** | **string**| UUID of the feed to update |
- **updateExternalFeed** | [**\Brevo\Client\Model\UpdateExternalFeed**](../Model/UpdateExternalFeed.md)| Values to update a feed |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **uuid** | **string**| UUID of the feed to update | |
+| **updateExternalFeed** | [**\Brevo\Client\Models\UpdateExternalFeed**](../Model/UpdateExternalFeed.md)| Values to update a feed | |
### Return type
@@ -313,8 +351,9 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+- **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)
diff --git a/docs/Api/FilesApi.md b/docs/Api/FilesApi.md
index 3a64955..8b481a8 100644
--- a/docs/Api/FilesApi.md
+++ b/docs/Api/FilesApi.md
@@ -1,48 +1,55 @@
# Brevo\Client\FilesApi
-All URIs are relative to *https://api.brevo.com/v3*
+All URIs are relative to https://api.brevo.com/v3, except if the operation defines another base path.
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**crmFilesGet**](FilesApi.md#crmFilesGet) | **GET** /crm/files | Get all files
-[**crmFilesIdDataGet**](FilesApi.md#crmFilesIdDataGet) | **GET** /crm/files/{id}/data | Get file details
-[**crmFilesIdDelete**](FilesApi.md#crmFilesIdDelete) | **DELETE** /crm/files/{id} | Delete a file
-[**crmFilesIdGet**](FilesApi.md#crmFilesIdGet) | **GET** /crm/files/{id} | Download a file
-[**crmFilesPost**](FilesApi.md#crmFilesPost) | **POST** /crm/files | Upload a file
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**crmFilesGet()**](FilesApi.md#crmFilesGet) | **GET** /crm/files | Get all files |
+| [**crmFilesIdDataGet()**](FilesApi.md#crmFilesIdDataGet) | **GET** /crm/files/{id}/data | Get file details |
+| [**crmFilesIdDelete()**](FilesApi.md#crmFilesIdDelete) | **DELETE** /crm/files/{id} | Delete a file |
+| [**crmFilesIdGet()**](FilesApi.md#crmFilesIdGet) | **GET** /crm/files/{id} | Download a file |
+| [**crmFilesPost()**](FilesApi.md#crmFilesPost) | **POST** /crm/files | Upload a file |
-# **crmFilesGet**
-> \Brevo\Client\Model\FileList crmFilesGet($entity, $entityIds, $dateFrom, $dateTo, $offset, $limit, $sort)
+## `crmFilesGet()`
+
+```php
+crmFilesGet($entity, $entityIds, $dateFrom, $dateTo, $offset, $limit, $sort): \Brevo\Client\Models\FileData[]
+```
Get all files
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\FilesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$entity = "entity_example"; // string | Filter by file entity type
-$entityIds = "entityIds_example"; // string | Filter by file entity IDs
+$entity = 'entity_example'; // string | Filter by file entity type
+$entityIds = 'entityIds_example'; // string | Filter by file entity IDs
$dateFrom = 56; // int | dateFrom to date range filter type (timestamp in milliseconds)
$dateTo = 56; // int | dateTo to date range filter type (timestamp in milliseconds)
-$offset = 789; // int | Index of the first document of the page
+$offset = 56; // int | Index of the first document of the page
$limit = 50; // int | Number of documents per page
-$sort = "sort_example"; // string | Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed
+$sort = 'sort_example'; // string | Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed
try {
$result = $apiInstance->crmFilesGet($entity, $entityIds, $dateFrom, $dateTo, $offset, $limit, $sort);
@@ -50,24 +57,23 @@ try {
} catch (Exception $e) {
echo 'Exception when calling FilesApi->crmFilesGet: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **entity** | **string**| Filter by file entity type | [optional]
- **entityIds** | **string**| Filter by file entity IDs | [optional]
- **dateFrom** | **int**| dateFrom to date range filter type (timestamp in milliseconds) | [optional]
- **dateTo** | **int**| dateTo to date range filter type (timestamp in milliseconds) | [optional]
- **offset** | **int**| Index of the first document of the page | [optional]
- **limit** | **int**| Number of documents per page | [optional] [default to 50]
- **sort** | **string**| Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed | [optional]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **entity** | **string**| Filter by file entity type | [optional] |
+| **entityIds** | **string**| Filter by file entity IDs | [optional] |
+| **dateFrom** | **int**| dateFrom to date range filter type (timestamp in milliseconds) | [optional] |
+| **dateTo** | **int**| dateTo to date range filter type (timestamp in milliseconds) | [optional] |
+| **offset** | **int**| Index of the first document of the page | [optional] |
+| **limit** | **int**| Number of documents per page | [optional] [default to 50] |
+| **sort** | **string**| Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed | [optional] |
### Return type
-[**\Brevo\Client\Model\FileList**](../Model/FileList.md)
+[**\Brevo\Client\Models\FileData[]**](../Model/FileData.md)
### Authorization
@@ -75,37 +81,46 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **crmFilesIdDataGet**
-> \Brevo\Client\Model\FileData crmFilesIdDataGet($id)
+## `crmFilesIdDataGet()`
+
+```php
+crmFilesIdDataGet($id): \Brevo\Client\Models\FileData
+```
Get file details
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\FilesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = "id_example"; // string | File id to get file data.
+$id = 'id_example'; // string | File id to get file data.
try {
$result = $apiInstance->crmFilesIdDataGet($id);
@@ -113,18 +128,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling FilesApi->crmFilesIdDataGet: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| File id to get file data. |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| File id to get file data. | |
### Return type
-[**\Brevo\Client\Model\FileData**](../Model/FileData.md)
+[**\Brevo\Client\Models\FileData**](../Model/FileData.md)
### Authorization
@@ -132,51 +146,59 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **crmFilesIdDelete**
-> crmFilesIdDelete($id)
+## `crmFilesIdDelete()`
+
+```php
+crmFilesIdDelete($id)
+```
Delete a file
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\FilesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = "id_example"; // string | File id to delete.
+$id = 'id_example'; // string | File id to delete.
try {
$apiInstance->crmFilesIdDelete($id);
} catch (Exception $e) {
echo 'Exception when calling FilesApi->crmFilesIdDelete: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| File id to delete. |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| File id to delete. | |
### Return type
@@ -188,37 +210,46 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **crmFilesIdGet**
-> \Brevo\Client\Model\FileDownloadableLink crmFilesIdGet($id)
+## `crmFilesIdGet()`
+
+```php
+crmFilesIdGet($id): \Brevo\Client\Models\FileDownloadableLink
+```
Download a file
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\FilesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = "id_example"; // string | File id to download.
+$id = 'id_example'; // string | File id to download.
try {
$result = $apiInstance->crmFilesIdGet($id);
@@ -226,18 +257,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling FilesApi->crmFilesIdGet: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| File id to download. |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| File id to download. | |
### Return type
-[**\Brevo\Client\Model\FileDownloadableLink**](../Model/FileDownloadableLink.md)
+[**\Brevo\Client\Models\FileDownloadableLink**](../Model/FileDownloadableLink.md)
### Authorization
@@ -245,30 +275,39 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **crmFilesPost**
-> \Brevo\Client\Model\FileData crmFilesPost($file, $dealId, $contactId, $companyId)
+## `crmFilesPost()`
+
+```php
+crmFilesPost($file, $dealId, $contactId, $companyId): \Brevo\Client\Models\FileData
+```
Upload a file
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\FilesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
@@ -276,9 +315,9 @@ $apiInstance = new Brevo\Client\Api\FilesApi(
$config
);
$file = "/path/to/file.txt"; // \SplFileObject | File data to create a file.
-$dealId = "dealId_example"; // string | Deal id linked to a file
-$contactId = 789; // int | Contact id linked to a file
-$companyId = "companyId_example"; // string | Company id linked to a file
+$dealId = 'dealId_example'; // string
+$contactId = 56; // int
+$companyId = 'companyId_example'; // string
try {
$result = $apiInstance->crmFilesPost($file, $dealId, $contactId, $companyId);
@@ -286,21 +325,20 @@ try {
} catch (Exception $e) {
echo 'Exception when calling FilesApi->crmFilesPost: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **file** | **\SplFileObject**| File data to create a file. |
- **dealId** | **string**| Deal id linked to a file | [optional]
- **contactId** | **int**| Contact id linked to a file | [optional]
- **companyId** | **string**| Company id linked to a file | [optional]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **file** | **\SplFileObject****\SplFileObject**| File data to create a file. | |
+| **dealId** | **string**| | [optional] |
+| **contactId** | **int**| | [optional] |
+| **companyId** | **string**| | [optional] |
### Return type
-[**\Brevo\Client\Model\FileData**](../Model/FileData.md)
+[**\Brevo\Client\Models\FileData**](../Model/FileData.md)
### Authorization
@@ -308,8 +346,9 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: multipart/form-data
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+- **Content-Type**: `multipart/form-data`
+- **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/FoldersApi.md b/docs/Api/FoldersApi.md
deleted file mode 100644
index e974372..0000000
--- a/docs/Api/FoldersApi.md
+++ /dev/null
@@ -1,366 +0,0 @@
-# Brevo\Client\FoldersApi
-
-All URIs are relative to *https://api.brevo.com/v3*
-
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**createFolder**](FoldersApi.md#createFolder) | **POST** /contacts/folders | Create a folder
-[**deleteFolder**](FoldersApi.md#deleteFolder) | **DELETE** /contacts/folders/{folderId} | Delete a folder (and all its lists)
-[**getFolder**](FoldersApi.md#getFolder) | **GET** /contacts/folders/{folderId} | Returns a folder's details
-[**getFolderLists**](FoldersApi.md#getFolderLists) | **GET** /contacts/folders/{folderId}/lists | Get lists in a folder
-[**getFolders**](FoldersApi.md#getFolders) | **GET** /contacts/folders | Get all folders
-[**updateFolder**](FoldersApi.md#updateFolder) | **PUT** /contacts/folders/{folderId} | Update a folder
-
-
-# **createFolder**
-> \Brevo\Client\Model\CreateModel createFolder($createFolder)
-
-Create a folder
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\FoldersApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$createFolder = new \Brevo\Client\Model\CreateUpdateFolder(); // \Brevo\Client\Model\CreateUpdateFolder | Name of the folder
-
-try {
- $result = $apiInstance->createFolder($createFolder);
- print_r($result);
-} catch (Exception $e) {
- echo 'Exception when calling FoldersApi->createFolder: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **createFolder** | [**\Brevo\Client\Model\CreateUpdateFolder**](../Model/CreateUpdateFolder.md)| Name of the folder |
-
-### Return type
-
-[**\Brevo\Client\Model\CreateModel**](../Model/CreateModel.md)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **deleteFolder**
-> deleteFolder($folderId)
-
-Delete a folder (and all its lists)
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\FoldersApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$folderId = 789; // int | Id of the folder
-
-try {
- $apiInstance->deleteFolder($folderId);
-} catch (Exception $e) {
- echo 'Exception when calling FoldersApi->deleteFolder: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **folderId** | **int**| Id of the folder |
-
-### Return type
-
-void (empty response body)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **getFolder**
-> \Brevo\Client\Model\GetFolder getFolder($folderId)
-
-Returns a folder's details
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\FoldersApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$folderId = 789; // int | id of the folder
-
-try {
- $result = $apiInstance->getFolder($folderId);
- print_r($result);
-} catch (Exception $e) {
- echo 'Exception when calling FoldersApi->getFolder: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **folderId** | **int**| id of the folder |
-
-### Return type
-
-[**\Brevo\Client\Model\GetFolder**](../Model/GetFolder.md)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **getFolderLists**
-> \Brevo\Client\Model\GetFolderLists getFolderLists($folderId, $limit, $offset, $sort)
-
-Get lists in a folder
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\FoldersApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$folderId = 789; // int | Id of the folder
-$limit = 10; // int | Number of documents per page
-$offset = 0; // int | Index of the first document of the page
-$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
-
-try {
- $result = $apiInstance->getFolderLists($folderId, $limit, $offset, $sort);
- print_r($result);
-} catch (Exception $e) {
- echo 'Exception when calling FoldersApi->getFolderLists: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **folderId** | **int**| Id of the folder |
- **limit** | **int**| Number of documents per page | [optional] [default to 10]
- **offset** | **int**| Index of the first document of the page | [optional] [default to 0]
- **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
-
-### Return type
-
-[**\Brevo\Client\Model\GetFolderLists**](../Model/GetFolderLists.md)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **getFolders**
-> \Brevo\Client\Model\GetFolders getFolders($limit, $offset, $sort)
-
-Get all folders
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\FoldersApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$limit = 10; // int | Number of documents per page
-$offset = 0; // int | Index of the first document of the page
-$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
-
-try {
- $result = $apiInstance->getFolders($limit, $offset, $sort);
- print_r($result);
-} catch (Exception $e) {
- echo 'Exception when calling FoldersApi->getFolders: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **limit** | **int**| Number of documents per page | [default to 10]
- **offset** | **int**| Index of the first document of the page | [default to 0]
- **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
-
-### Return type
-
-[**\Brevo\Client\Model\GetFolders**](../Model/GetFolders.md)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **updateFolder**
-> updateFolder($folderId, $updateFolder)
-
-Update a folder
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\FoldersApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$folderId = 789; // int | Id of the folder
-$updateFolder = new \Brevo\Client\Model\CreateUpdateFolder(); // \Brevo\Client\Model\CreateUpdateFolder | Name of the folder
-
-try {
- $apiInstance->updateFolder($folderId, $updateFolder);
-} catch (Exception $e) {
- echo 'Exception when calling FoldersApi->updateFolder: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **folderId** | **int**| Id of the folder |
- **updateFolder** | [**\Brevo\Client\Model\CreateUpdateFolder**](../Model/CreateUpdateFolder.md)| Name of the folder |
-
-### Return type
-
-void (empty response body)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
diff --git a/docs/Api/InboundParsingApi.md b/docs/Api/InboundParsingApi.md
index 00c0221..475c58f 100644
--- a/docs/Api/InboundParsingApi.md
+++ b/docs/Api/InboundParsingApi.md
@@ -1,42 +1,49 @@
# Brevo\Client\InboundParsingApi
-All URIs are relative to *https://api.brevo.com/v3*
+All URIs are relative to https://api.brevo.com/v3, except if the operation defines another base path.
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**getInboundEmailAttachment**](InboundParsingApi.md#getInboundEmailAttachment) | **GET** /inbound/attachments/{downloadToken} | Retrieve inbound attachment with download token.
-[**getInboundEmailEvents**](InboundParsingApi.md#getInboundEmailEvents) | **GET** /inbound/events | Get the list of all the events for the received emails.
-[**getInboundEmailEventsByUuid**](InboundParsingApi.md#getInboundEmailEventsByUuid) | **GET** /inbound/events/{uuid} | Fetch all events history for one particular received email.
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**getInboundEmailAttachment()**](InboundParsingApi.md#getInboundEmailAttachment) | **GET** /inbound/attachments/{downloadToken} | Retrieve inbound attachment with download token. |
+| [**getInboundEmailEvents()**](InboundParsingApi.md#getInboundEmailEvents) | **GET** /inbound/events | Get the list of all the events for the received emails. |
+| [**getInboundEmailEventsByUuid()**](InboundParsingApi.md#getInboundEmailEventsByUuid) | **GET** /inbound/events/{uuid} | Fetch all events history for one particular received email. |
-# **getInboundEmailAttachment**
-> \SplFileObject getInboundEmailAttachment($downloadToken)
+## `getInboundEmailAttachment()`
+
+```php
+getInboundEmailAttachment($downloadToken): \SplFileObject
+```
Retrieve inbound attachment with download token.
This endpoint will retrieve inbound attachment with download token.
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\InboundParsingApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$downloadToken = "downloadToken_example"; // string | Token to fetch a particular attachment
+$downloadToken = 'downloadToken_example'; // string | Token to fetch a particular attachment
try {
$result = $apiInstance->getInboundEmailAttachment($downloadToken);
@@ -44,18 +51,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling InboundParsingApi->getInboundEmailAttachment: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **downloadToken** | **string**| Token to fetch a particular attachment |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **downloadToken** | **string**| Token to fetch a particular attachment | |
### Return type
-[**\SplFileObject**](../Model/\SplFileObject.md)
+**\SplFileObject**
### Authorization
@@ -63,44 +69,53 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/octet-stream`, `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getInboundEmailEvents**
-> \Brevo\Client\Model\GetInboundEmailEvents getInboundEmailEvents($sender, $startDate, $endDate, $limit, $offset, $sort)
+## `getInboundEmailEvents()`
+
+```php
+getInboundEmailEvents($sender, $startDate, $endDate, $limit, $offset, $sort): \Brevo\Client\Models\GetInboundEmailEvents
+```
Get the list of all the events for the received emails.
This endpoint will show the list of all the events for the received emails.
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\InboundParsingApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$sender = "sender_example"; // string | Email address of the sender.
-$startDate = "startDate_example"; // string | Mandatory if endDate is used. Starting date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) from which you want to fetch the list. Maximum time period that can be selected is one month.
-$endDate = "endDate_example"; // string | Mandatory if startDate is used. Ending date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) till which you want to fetch the list. Maximum time period that can be selected is one month.
+$sender = 'sender_example'; // string | Email address of the sender.
+$startDate = 'startDate_example'; // string | Mandatory if endDate is used. Starting date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) from which you want to fetch the list. Maximum time period that can be selected is one month.
+$endDate = 'endDate_example'; // string | Mandatory if startDate is used. Ending date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) till which you want to fetch the list. Maximum time period that can be selected is one month.
$limit = 100; // int | Number of documents returned per page
$offset = 0; // int | Index of the first document on the page
-$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation
+$sort = 'desc'; // string | Sort the results in the ascending/descending order of record creation
try {
$result = $apiInstance->getInboundEmailEvents($sender, $startDate, $endDate, $limit, $offset, $sort);
@@ -108,23 +123,22 @@ try {
} catch (Exception $e) {
echo 'Exception when calling InboundParsingApi->getInboundEmailEvents: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **sender** | **string**| Email address of the sender. | [optional]
- **startDate** | **string**| Mandatory if endDate is used. Starting date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) from which you want to fetch the list. Maximum time period that can be selected is one month. | [optional]
- **endDate** | **string**| Mandatory if startDate is used. Ending date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) till which you want to fetch the list. Maximum time period that can be selected is one month. | [optional]
- **limit** | **int**| Number of documents returned per page | [optional] [default to 100]
- **offset** | **int**| Index of the first document on the page | [optional] [default to 0]
- **sort** | **string**| Sort the results in the ascending/descending order of record creation | [optional] [default to desc]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **sender** | **string**| Email address of the sender. | [optional] |
+| **startDate** | **string**| Mandatory if endDate is used. Starting date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) from which you want to fetch the list. Maximum time period that can be selected is one month. | [optional] |
+| **endDate** | **string**| Mandatory if startDate is used. Ending date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) till which you want to fetch the list. Maximum time period that can be selected is one month. | [optional] |
+| **limit** | **int**| Number of documents returned per page | [optional] [default to 100] |
+| **offset** | **int**| Index of the first document on the page | [optional] [default to 0] |
+| **sort** | **string**| Sort the results in the ascending/descending order of record creation | [optional] [default to 'desc'] |
### Return type
-[**\Brevo\Client\Model\GetInboundEmailEvents**](../Model/GetInboundEmailEvents.md)
+[**\Brevo\Client\Models\GetInboundEmailEvents**](../Model/GetInboundEmailEvents.md)
### Authorization
@@ -132,39 +146,48 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getInboundEmailEventsByUuid**
-> \Brevo\Client\Model\GetInboundEmailEventsByUuid getInboundEmailEventsByUuid($uuid)
+## `getInboundEmailEventsByUuid()`
+
+```php
+getInboundEmailEventsByUuid($uuid): \Brevo\Client\Models\GetInboundEmailEventsByUuid
+```
Fetch all events history for one particular received email.
This endpoint will show the list of all events history for one particular received email.
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\InboundParsingApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$uuid = "uuid_example"; // string | UUID to fetch events specific to recieved email
+$uuid = 'uuid_example'; // string | UUID to fetch events specific to recieved email
try {
$result = $apiInstance->getInboundEmailEventsByUuid($uuid);
@@ -172,18 +195,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling InboundParsingApi->getInboundEmailEventsByUuid: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **uuid** | **string**| UUID to fetch events specific to recieved email |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **uuid** | **string**| UUID to fetch events specific to recieved email | |
### Return type
-[**\Brevo\Client\Model\GetInboundEmailEventsByUuid**](../Model/GetInboundEmailEventsByUuid.md)
+[**\Brevo\Client\Models\GetInboundEmailEventsByUuid**](../Model/GetInboundEmailEventsByUuid.md)
### Authorization
@@ -191,8 +213,9 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+- **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/ListsApi.md b/docs/Api/ListsApi.md
deleted file mode 100644
index 94f60a1..0000000
--- a/docs/Api/ListsApi.md
+++ /dev/null
@@ -1,552 +0,0 @@
-# Brevo\Client\ListsApi
-
-All URIs are relative to *https://api.brevo.com/v3*
-
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**addContactToList**](ListsApi.md#addContactToList) | **POST** /contacts/lists/{listId}/contacts/add | Add existing contacts to a list
-[**createList**](ListsApi.md#createList) | **POST** /contacts/lists | Create a list
-[**deleteList**](ListsApi.md#deleteList) | **DELETE** /contacts/lists/{listId} | Delete a list
-[**getContactsFromList**](ListsApi.md#getContactsFromList) | **GET** /contacts/lists/{listId}/contacts | Get contacts in a list
-[**getFolderLists**](ListsApi.md#getFolderLists) | **GET** /contacts/folders/{folderId}/lists | Get lists in a folder
-[**getList**](ListsApi.md#getList) | **GET** /contacts/lists/{listId} | Get a list's details
-[**getLists**](ListsApi.md#getLists) | **GET** /contacts/lists | Get all the lists
-[**removeContactFromList**](ListsApi.md#removeContactFromList) | **POST** /contacts/lists/{listId}/contacts/remove | Delete a contact from a list
-[**updateList**](ListsApi.md#updateList) | **PUT** /contacts/lists/{listId} | Update a list
-
-
-# **addContactToList**
-> \Brevo\Client\Model\PostContactInfo addContactToList($listId, $contactEmails)
-
-Add existing contacts to a list
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\ListsApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$listId = 789; // int | Id of the list
-$contactEmails = new \Brevo\Client\Model\AddContactToList(); // \Brevo\Client\Model\AddContactToList | Emails addresses OR IDs of the contacts
-
-try {
- $result = $apiInstance->addContactToList($listId, $contactEmails);
- print_r($result);
-} catch (Exception $e) {
- echo 'Exception when calling ListsApi->addContactToList: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **listId** | **int**| Id of the list |
- **contactEmails** | [**\Brevo\Client\Model\AddContactToList**](../Model/AddContactToList.md)| Emails addresses OR IDs of the contacts |
-
-### Return type
-
-[**\Brevo\Client\Model\PostContactInfo**](../Model/PostContactInfo.md)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **createList**
-> \Brevo\Client\Model\CreateModel createList($createList)
-
-Create a list
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\ListsApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$createList = new \Brevo\Client\Model\CreateList(); // \Brevo\Client\Model\CreateList | Values to create a list
-
-try {
- $result = $apiInstance->createList($createList);
- print_r($result);
-} catch (Exception $e) {
- echo 'Exception when calling ListsApi->createList: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **createList** | [**\Brevo\Client\Model\CreateList**](../Model/CreateList.md)| Values to create a list |
-
-### Return type
-
-[**\Brevo\Client\Model\CreateModel**](../Model/CreateModel.md)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **deleteList**
-> deleteList($listId)
-
-Delete a list
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\ListsApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$listId = 789; // int | Id of the list
-
-try {
- $apiInstance->deleteList($listId);
-} catch (Exception $e) {
- echo 'Exception when calling ListsApi->deleteList: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **listId** | **int**| Id of the list |
-
-### Return type
-
-void (empty response body)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **getContactsFromList**
-> \Brevo\Client\Model\GetContacts getContactsFromList($listId, $modifiedSince, $limit, $offset, $sort)
-
-Get contacts in a list
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\ListsApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$listId = 789; // int | Id of the list
-$modifiedSince = "modifiedSince_example"; // string | Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.
-$limit = 50; // int | Number of documents per page
-$offset = 0; // int | Index of the first document of the page
-$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
-
-try {
- $result = $apiInstance->getContactsFromList($listId, $modifiedSince, $limit, $offset, $sort);
- print_r($result);
-} catch (Exception $e) {
- echo 'Exception when calling ListsApi->getContactsFromList: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **listId** | **int**| Id of the list |
- **modifiedSince** | **string**| Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. | [optional]
- **limit** | **int**| Number of documents per page | [optional] [default to 50]
- **offset** | **int**| Index of the first document of the page | [optional] [default to 0]
- **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
-
-### Return type
-
-[**\Brevo\Client\Model\GetContacts**](../Model/GetContacts.md)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **getFolderLists**
-> \Brevo\Client\Model\GetFolderLists getFolderLists($folderId, $limit, $offset, $sort)
-
-Get lists in a folder
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\ListsApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$folderId = 789; // int | Id of the folder
-$limit = 10; // int | Number of documents per page
-$offset = 0; // int | Index of the first document of the page
-$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
-
-try {
- $result = $apiInstance->getFolderLists($folderId, $limit, $offset, $sort);
- print_r($result);
-} catch (Exception $e) {
- echo 'Exception when calling ListsApi->getFolderLists: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **folderId** | **int**| Id of the folder |
- **limit** | **int**| Number of documents per page | [optional] [default to 10]
- **offset** | **int**| Index of the first document of the page | [optional] [default to 0]
- **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
-
-### Return type
-
-[**\Brevo\Client\Model\GetFolderLists**](../Model/GetFolderLists.md)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **getList**
-> \Brevo\Client\Model\GetExtendedList getList($listId)
-
-Get a list's details
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\ListsApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$listId = 789; // int | Id of the list
-
-try {
- $result = $apiInstance->getList($listId);
- print_r($result);
-} catch (Exception $e) {
- echo 'Exception when calling ListsApi->getList: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **listId** | **int**| Id of the list |
-
-### Return type
-
-[**\Brevo\Client\Model\GetExtendedList**](../Model/GetExtendedList.md)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **getLists**
-> \Brevo\Client\Model\GetLists getLists($limit, $offset, $sort)
-
-Get all the lists
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\ListsApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$limit = 10; // int | Number of documents per page
-$offset = 0; // int | Index of the first document of the page
-$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
-
-try {
- $result = $apiInstance->getLists($limit, $offset, $sort);
- print_r($result);
-} catch (Exception $e) {
- echo 'Exception when calling ListsApi->getLists: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **limit** | **int**| Number of documents per page | [optional] [default to 10]
- **offset** | **int**| Index of the first document of the page | [optional] [default to 0]
- **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
-
-### Return type
-
-[**\Brevo\Client\Model\GetLists**](../Model/GetLists.md)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **removeContactFromList**
-> \Brevo\Client\Model\PostContactInfo removeContactFromList($listId, $contactEmails)
-
-Delete a contact from a list
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\ListsApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$listId = 789; // int | Id of the list
-$contactEmails = new \Brevo\Client\Model\RemoveContactFromList(); // \Brevo\Client\Model\RemoveContactFromList | Emails addresses OR IDs of the contacts
-
-try {
- $result = $apiInstance->removeContactFromList($listId, $contactEmails);
- print_r($result);
-} catch (Exception $e) {
- echo 'Exception when calling ListsApi->removeContactFromList: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **listId** | **int**| Id of the list |
- **contactEmails** | [**\Brevo\Client\Model\RemoveContactFromList**](../Model/RemoveContactFromList.md)| Emails addresses OR IDs of the contacts |
-
-### Return type
-
-[**\Brevo\Client\Model\PostContactInfo**](../Model/PostContactInfo.md)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **updateList**
-> updateList($listId, $updateList)
-
-Update a list
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\ListsApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$listId = 789; // int | Id of the list
-$updateList = new \Brevo\Client\Model\UpdateList(); // \Brevo\Client\Model\UpdateList | Values to update a list
-
-try {
- $apiInstance->updateList($listId, $updateList);
-} catch (Exception $e) {
- echo 'Exception when calling ListsApi->updateList: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **listId** | **int**| Id of the list |
- **updateList** | [**\Brevo\Client\Model\UpdateList**](../Model/UpdateList.md)| Values to update a list |
-
-### Return type
-
-void (empty response body)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
diff --git a/docs/Api/MasterAccountApi.md b/docs/Api/MasterAccountApi.md
index a561e9c..e2cec04 100644
--- a/docs/Api/MasterAccountApi.md
+++ b/docs/Api/MasterAccountApi.md
@@ -1,71 +1,687 @@
# Brevo\Client\MasterAccountApi
-All URIs are relative to *https://api.brevo.com/v3*
-
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**corporateGroupIdPut**](MasterAccountApi.md#corporateGroupIdPut) | **PUT** /corporate/group/{id} | Update a group of sub-accounts
-[**corporateGroupPost**](MasterAccountApi.md#corporateGroupPost) | **POST** /corporate/group | Create a new group of sub-accounts
-[**corporateMasterAccountGet**](MasterAccountApi.md#corporateMasterAccountGet) | **GET** /corporate/masterAccount | Get the details of requested master account
-[**corporateSubAccountGet**](MasterAccountApi.md#corporateSubAccountGet) | **GET** /corporate/subAccount | Get the list of all the sub-accounts of the master account.
-[**corporateSubAccountIdApplicationsTogglePut**](MasterAccountApi.md#corporateSubAccountIdApplicationsTogglePut) | **PUT** /corporate/subAccount/{id}/applications/toggle | Enable/disable sub-account application(s)
-[**corporateSubAccountIdDelete**](MasterAccountApi.md#corporateSubAccountIdDelete) | **DELETE** /corporate/subAccount/{id} | Delete a sub-account
-[**corporateSubAccountIdGet**](MasterAccountApi.md#corporateSubAccountIdGet) | **GET** /corporate/subAccount/{id} | Get sub-account details
-[**corporateSubAccountIdPlanPut**](MasterAccountApi.md#corporateSubAccountIdPlanPut) | **PUT** /corporate/subAccount/{id}/plan | Update sub-account plan
-[**corporateSubAccountKeyPost**](MasterAccountApi.md#corporateSubAccountKeyPost) | **POST** /corporate/subAccount/key | Create an API key for a sub-account
-[**corporateSubAccountPost**](MasterAccountApi.md#corporateSubAccountPost) | **POST** /corporate/subAccount | Create a new sub-account under a master account.
-[**corporateSubAccountSsoTokenPost**](MasterAccountApi.md#corporateSubAccountSsoTokenPost) | **POST** /corporate/subAccount/ssoToken | Generate SSO token to access Brevo
-[**corporateUserRevokeEmailDelete**](MasterAccountApi.md#corporateUserRevokeEmailDelete) | **DELETE** /corporate/user/revoke/{email} | Revoke an admin user
-[**getAccountActivity**](MasterAccountApi.md#getAccountActivity) | **GET** /organization/activities | Get user activity logs
-[**getCorporateInvitedUsersList**](MasterAccountApi.md#getCorporateInvitedUsersList) | **GET** /corporate/invited/users | Get the list of all admin users
-[**getSubAccountGroups**](MasterAccountApi.md#getSubAccountGroups) | **GET** /corporate/groups | Get the list of groups
-[**inviteAdminUser**](MasterAccountApi.md#inviteAdminUser) | **POST** /corporate/user/invitation/send | Send invitation to an admin user
-
-
-# **corporateGroupIdPut**
-> corporateGroupIdPut($id, $body)
+All URIs are relative to https://api.brevo.com/v3, except if the operation defines another base path.
+
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**corporateGroupIdDelete()**](MasterAccountApi.md#corporateGroupIdDelete) | **DELETE** /corporate/group/{id} | Delete a group |
+| [**corporateGroupIdGet()**](MasterAccountApi.md#corporateGroupIdGet) | **GET** /corporate/group/{id} | GET a group details |
+| [**corporateGroupIdPut()**](MasterAccountApi.md#corporateGroupIdPut) | **PUT** /corporate/group/{id} | Update a group of sub-accounts |
+| [**corporateGroupPost()**](MasterAccountApi.md#corporateGroupPost) | **POST** /corporate/group | Create a group of sub-accounts |
+| [**corporateGroupUnlinkGroupIdSubAccountsPut()**](MasterAccountApi.md#corporateGroupUnlinkGroupIdSubAccountsPut) | **PUT** /corporate/group/unlink/{groupId}/subAccounts | Delete sub-account from group |
+| [**corporateIpGet()**](MasterAccountApi.md#corporateIpGet) | **GET** /corporate/ip | List of all IPs |
+| [**corporateMasterAccountGet()**](MasterAccountApi.md#corporateMasterAccountGet) | **GET** /corporate/masterAccount | Get the details of requested master account |
+| [**corporateSsoTokenPost()**](MasterAccountApi.md#corporateSsoTokenPost) | **POST** /corporate/ssoToken | Generate SSO token to access admin account |
+| [**corporateSubAccountGet()**](MasterAccountApi.md#corporateSubAccountGet) | **GET** /corporate/subAccount | Get the list of all the sub-accounts of the master account. |
+| [**corporateSubAccountIdApplicationsTogglePut()**](MasterAccountApi.md#corporateSubAccountIdApplicationsTogglePut) | **PUT** /corporate/subAccount/{id}/applications/toggle | Enable/disable sub-account application(s) |
+| [**corporateSubAccountIdDelete()**](MasterAccountApi.md#corporateSubAccountIdDelete) | **DELETE** /corporate/subAccount/{id} | Delete a sub-account |
+| [**corporateSubAccountIdGet()**](MasterAccountApi.md#corporateSubAccountIdGet) | **GET** /corporate/subAccount/{id} | Get sub-account details |
+| [**corporateSubAccountIdPlanPut()**](MasterAccountApi.md#corporateSubAccountIdPlanPut) | **PUT** /corporate/subAccount/{id}/plan | Update sub-account plan |
+| [**corporateSubAccountIpAssociatePost()**](MasterAccountApi.md#corporateSubAccountIpAssociatePost) | **POST** /corporate/subAccount/ip/associate | Associate an IP to sub-accounts |
+| [**corporateSubAccountIpDissociatePut()**](MasterAccountApi.md#corporateSubAccountIpDissociatePut) | **PUT** /corporate/subAccount/ip/dissociate | Dissociate an IP to sub-accounts |
+| [**corporateSubAccountKeyPost()**](MasterAccountApi.md#corporateSubAccountKeyPost) | **POST** /corporate/subAccount/key | Create an API key for a sub-account |
+| [**corporateSubAccountPost()**](MasterAccountApi.md#corporateSubAccountPost) | **POST** /corporate/subAccount | Create a new sub-account under a master account. |
+| [**corporateSubAccountSsoTokenPost()**](MasterAccountApi.md#corporateSubAccountSsoTokenPost) | **POST** /corporate/subAccount/ssoToken | Generate SSO token to access sub-account |
+| [**corporateUserEmailPermissionsPut()**](MasterAccountApi.md#corporateUserEmailPermissionsPut) | **PUT** /corporate/user/{email}/permissions | Change admin user permissions |
+| [**corporateUserInvitationActionEmailPut()**](MasterAccountApi.md#corporateUserInvitationActionEmailPut) | **PUT** /corporate/user/invitation/{action}/{email} | Resend / cancel admin user invitation |
+| [**corporateUserRevokeEmailDelete()**](MasterAccountApi.md#corporateUserRevokeEmailDelete) | **DELETE** /corporate/user/revoke/{email} | Revoke an admin user |
+| [**getAccountActivity_0()**](MasterAccountApi.md#getAccountActivity_0) | **GET** /organization/activities | Get user activity logs |
+| [**getCorporateInvitedUsersList()**](MasterAccountApi.md#getCorporateInvitedUsersList) | **GET** /corporate/invited/users | Get the list of all admin users |
+| [**getCorporateUserPermission()**](MasterAccountApi.md#getCorporateUserPermission) | **GET** /corporate/user/{email}/permissions | Check admin user permissions |
+| [**getSubAccountGroups()**](MasterAccountApi.md#getSubAccountGroups) | **GET** /corporate/groups | Get the list of groups |
+| [**inviteAdminUser()**](MasterAccountApi.md#inviteAdminUser) | **POST** /corporate/user/invitation/send | Send invitation to an admin user |
+
+
+## `corporateGroupIdDelete()`
+
+```php
+corporateGroupIdDelete($id)
+```
+
+Delete a group
+
+This endpoint allows you to delete a group of sub-organizations. When a group is deleted, the sub-organizations are no longer part of this group. The users associated with the group are no longer associated with the group once deleted.
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\MasterAccountApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$id = 'id_example'; // string | Id of the group
+
+try {
+ $apiInstance->corporateGroupIdDelete($id);
+} catch (Exception $e) {
+ echo 'Exception when calling MasterAccountApi->corporateGroupIdDelete: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| Id of the group | |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `corporateGroupIdGet()`
+
+```php
+corporateGroupIdGet($id): \Brevo\Client\Models\CorporateGroupDetailsResponse
+```
+
+GET a group details
+
+This endpoint allows you to retrieve a specific group’s information such as the list of sub-organizations and the user associated with the group.
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\MasterAccountApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$id = 'id_example'; // string | Id of the group of sub-organization
+
+try {
+ $result = $apiInstance->corporateGroupIdGet($id);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling MasterAccountApi->corporateGroupIdGet: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| Id of the group of sub-organization | |
+
+### Return type
+
+[**\Brevo\Client\Models\CorporateGroupDetailsResponse**](../Model/CorporateGroupDetailsResponse.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `corporateGroupIdPut()`
+
+```php
+corporateGroupIdPut($id, $corporateGroupIdPutRequest)
+```
Update a group of sub-accounts
-This endpoint allows you to update a group of sub-accounts
+This endpoint allows to update a group of sub-accounts
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\MasterAccountApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$id = 'id_example'; // string | Id of the group
+$corporateGroupIdPutRequest = new \Brevo\Client\Models\CorporateGroupIdPutRequest(); // \Brevo\Client\Models\CorporateGroupIdPutRequest | Group details to be updated.
+
+try {
+ $apiInstance->corporateGroupIdPut($id, $corporateGroupIdPutRequest);
+} catch (Exception $e) {
+ echo 'Exception when calling MasterAccountApi->corporateGroupIdPut: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| Id of the group | |
+| **corporateGroupIdPutRequest** | [**\Brevo\Client\Models\CorporateGroupIdPutRequest**](../Model/CorporateGroupIdPutRequest.md)| Group details to be updated. | |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `corporateGroupPost()`
+
+```php
+corporateGroupPost($corporateGroupPostRequest): \Brevo\Client\Models\CorporateGroupPost201Response
+```
+
+Create a group of sub-accounts
+
+This endpoint allows to create a group of sub-accounts
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\MasterAccountApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$corporateGroupPostRequest = new \Brevo\Client\Models\CorporateGroupPostRequest(); // \Brevo\Client\Models\CorporateGroupPostRequest
+
+try {
+ $result = $apiInstance->corporateGroupPost($corporateGroupPostRequest);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling MasterAccountApi->corporateGroupPost: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **corporateGroupPostRequest** | [**\Brevo\Client\Models\CorporateGroupPostRequest**](../Model/CorporateGroupPostRequest.md)| | [optional] |
+
+### Return type
+
+[**\Brevo\Client\Models\CorporateGroupPost201Response**](../Model/CorporateGroupPost201Response.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `corporateGroupUnlinkGroupIdSubAccountsPut()`
+
+```php
+corporateGroupUnlinkGroupIdSubAccountsPut($groupId, $corporateGroupUnlinkGroupIdSubAccountsPutRequest)
+```
+
+Delete sub-account from group
+
+This endpoint allows you to remove a sub-organization from a group.
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\MasterAccountApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$groupId = 'groupId_example'; // string | Group id
+$corporateGroupUnlinkGroupIdSubAccountsPutRequest = new \Brevo\Client\Models\CorporateGroupUnlinkGroupIdSubAccountsPutRequest(); // \Brevo\Client\Models\CorporateGroupUnlinkGroupIdSubAccountsPutRequest | List of sub-account ids
+
+try {
+ $apiInstance->corporateGroupUnlinkGroupIdSubAccountsPut($groupId, $corporateGroupUnlinkGroupIdSubAccountsPutRequest);
+} catch (Exception $e) {
+ echo 'Exception when calling MasterAccountApi->corporateGroupUnlinkGroupIdSubAccountsPut: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **groupId** | **string**| Group id | |
+| **corporateGroupUnlinkGroupIdSubAccountsPutRequest** | [**\Brevo\Client\Models\CorporateGroupUnlinkGroupIdSubAccountsPutRequest**](../Model/CorporateGroupUnlinkGroupIdSubAccountsPutRequest.md)| List of sub-account ids | |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `corporateIpGet()`
+
+```php
+corporateIpGet(): \Brevo\Client\Models\CorporateIpGet200ResponseInner[]
+```
+
+List of all IPs
+
+This endpoint allows you to retrieve the list of active IPs on your Admin account
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\MasterAccountApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+
+try {
+ $result = $apiInstance->corporateIpGet();
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling MasterAccountApi->corporateIpGet: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+[**\Brevo\Client\Models\CorporateIpGet200ResponseInner[]**](../Model/CorporateIpGet200ResponseInner.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `corporateMasterAccountGet()`
+
+```php
+corporateMasterAccountGet(): \Brevo\Client\Models\MasterDetailsResponse
+```
+
+Get the details of requested master account
+
+This endpoint will provide the details of the master account.
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\MasterAccountApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+
+try {
+ $result = $apiInstance->corporateMasterAccountGet();
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling MasterAccountApi->corporateMasterAccountGet: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+[**\Brevo\Client\Models\MasterDetailsResponse**](../Model/MasterDetailsResponse.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `corporateSsoTokenPost()`
+
+```php
+corporateSsoTokenPost($corporateSsoTokenPostRequest): \Brevo\Client\Models\GetSsoToken
+```
+
+Generate SSO token to access admin account
+
+This endpoint generates an SSO token to authenticate and access the admin account using the endpoint https://account-app.brevo.com/account/login/corporate/sso/[token], where [token] will be replaced by the actual token.
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\MasterAccountApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$corporateSsoTokenPostRequest = new \Brevo\Client\Models\CorporateSsoTokenPostRequest(); // \Brevo\Client\Models\CorporateSsoTokenPostRequest
+
+try {
+ $result = $apiInstance->corporateSsoTokenPost($corporateSsoTokenPostRequest);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling MasterAccountApi->corporateSsoTokenPost: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **corporateSsoTokenPostRequest** | [**\Brevo\Client\Models\CorporateSsoTokenPostRequest**](../Model/CorporateSsoTokenPostRequest.md)| | [optional] |
+
+### Return type
+
+[**\Brevo\Client\Models\GetSsoToken**](../Model/GetSsoToken.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `corporateSubAccountGet()`
+
+```php
+corporateSubAccountGet($offset, $limit): \Brevo\Client\Models\SubAccountsResponse
+```
+
+Get the list of all the sub-accounts of the master account.
+
+This endpoint will provide the list all the sub-accounts of the master account.
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\MasterAccountApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$offset = 56; // int | Index of the first sub-account in the page
+$limit = 56; // int | Number of sub-accounts to be displayed on each page
+
+try {
+ $result = $apiInstance->corporateSubAccountGet($offset, $limit);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling MasterAccountApi->corporateSubAccountGet: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **offset** | **int**| Index of the first sub-account in the page | |
+| **limit** | **int**| Number of sub-accounts to be displayed on each page | |
+
+### Return type
+
+[**\Brevo\Client\Models\SubAccountsResponse**](../Model/SubAccountsResponse.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `corporateSubAccountIdApplicationsTogglePut()`
+
+```php
+corporateSubAccountIdApplicationsTogglePut($id, $subAccountAppsToggleRequest)
+```
+
+Enable/disable sub-account application(s)
+
+API endpoints for the Corporate owner to enable/disable applications on the sub-account
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\MasterAccountApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = "id_example"; // string | Id of the group
-$body = new \Brevo\Client\Model\Body1(); // \Brevo\Client\Model\Body1 | Group details to be updated.
+$id = 56; // int | Id of the sub-account organization (mandatory)
+$subAccountAppsToggleRequest = new \Brevo\Client\Models\SubAccountAppsToggleRequest(); // \Brevo\Client\Models\SubAccountAppsToggleRequest | List of applications to activate or deactivate on a sub-account
try {
- $apiInstance->corporateGroupIdPut($id, $body);
+ $apiInstance->corporateSubAccountIdApplicationsTogglePut($id, $subAccountAppsToggleRequest);
} catch (Exception $e) {
- echo 'Exception when calling MasterAccountApi->corporateGroupIdPut: ', $e->getMessage(), PHP_EOL;
+ echo 'Exception when calling MasterAccountApi->corporateSubAccountIdApplicationsTogglePut: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| Id of the group |
- **body** | [**\Brevo\Client\Model\Body1**](../Model/Body1.md)| Group details to be updated. |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **int**| Id of the sub-account organization (mandatory) | |
+| **subAccountAppsToggleRequest** | [**\Brevo\Client\Models\SubAccountAppsToggleRequest**](../Model/SubAccountAppsToggleRequest.md)| List of applications to activate or deactivate on a sub-account | |
### Return type
@@ -77,58 +693,63 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **corporateGroupPost**
-> \Brevo\Client\Model\InlineResponse201 corporateGroupPost($body)
+## `corporateSubAccountIdDelete()`
-Create a new group of sub-accounts
+```php
+corporateSubAccountIdDelete($id)
+```
-This endpoint allows to create a group of sub-accounts
+Delete a sub-account
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\MasterAccountApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$body = new \Brevo\Client\Model\Body(); // \Brevo\Client\Model\Body | Group details to be created.
+$id = 56; // int | Id of the sub-account organization to be deleted
try {
- $result = $apiInstance->corporateGroupPost($body);
- print_r($result);
+ $apiInstance->corporateSubAccountIdDelete($id);
} catch (Exception $e) {
- echo 'Exception when calling MasterAccountApi->corporateGroupPost: ', $e->getMessage(), PHP_EOL;
+ echo 'Exception when calling MasterAccountApi->corporateSubAccountIdDelete: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **body** | [**\Brevo\Client\Model\Body**](../Model/Body.md)| Group details to be created. |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **int**| Id of the sub-account organization to be deleted | |
### Return type
-[**\Brevo\Client\Model\InlineResponse201**](../Model/InlineResponse201.md)
+void (empty response body)
### Authorization
@@ -136,54 +757,66 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **corporateMasterAccountGet**
-> \Brevo\Client\Model\MasterDetailsResponse corporateMasterAccountGet()
+## `corporateSubAccountIdGet()`
-Get the details of requested master account
+```php
+corporateSubAccountIdGet($id): \Brevo\Client\Models\SubAccountDetailsResponse
+```
-This endpoint will provide the details of the master account.
+Get sub-account details
+
+This endpoint will provide the details for the specified sub-account company
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\MasterAccountApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
+$id = 56; // int | Id of the sub-account organization
try {
- $result = $apiInstance->corporateMasterAccountGet();
+ $result = $apiInstance->corporateSubAccountIdGet($id);
print_r($result);
} catch (Exception $e) {
- echo 'Exception when calling MasterAccountApi->corporateMasterAccountGet: ', $e->getMessage(), PHP_EOL;
+ echo 'Exception when calling MasterAccountApi->corporateSubAccountIdGet: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-This endpoint does not need any parameter.
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **int**| Id of the sub-account organization | |
### Return type
-[**\Brevo\Client\Model\MasterDetailsResponse**](../Model/MasterDetailsResponse.md)
+[**\Brevo\Client\Models\SubAccountDetailsResponse**](../Model/SubAccountDetailsResponse.md)
### Authorization
@@ -191,60 +824,67 @@ This endpoint does not need any parameter.
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **corporateSubAccountGet**
-> \Brevo\Client\Model\SubAccountsResponse corporateSubAccountGet($offset, $limit)
+## `corporateSubAccountIdPlanPut()`
-Get the list of all the sub-accounts of the master account.
+```php
+corporateSubAccountIdPlanPut($id, $subAccountUpdatePlanRequest)
+```
-This endpoint will provide the list all the sub-accounts of the master account.
+Update sub-account plan
+
+This endpoint will update the sub-account plan. On the Corporate solution new version v2, you can set an unlimited number of credits in your sub-organization. Please pass the value “-1\" to set the consumable in unlimited mode.
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\MasterAccountApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$offset = 56; // int | Index of the first sub-account in the page
-$limit = 56; // int | Number of sub-accounts to be displayed on each page
+$id = 56; // int | Id of the sub-account organization
+$subAccountUpdatePlanRequest = new \Brevo\Client\Models\SubAccountUpdatePlanRequest(); // \Brevo\Client\Models\SubAccountUpdatePlanRequest | Values to update a sub-account plan
try {
- $result = $apiInstance->corporateSubAccountGet($offset, $limit);
- print_r($result);
+ $apiInstance->corporateSubAccountIdPlanPut($id, $subAccountUpdatePlanRequest);
} catch (Exception $e) {
- echo 'Exception when calling MasterAccountApi->corporateSubAccountGet: ', $e->getMessage(), PHP_EOL;
+ echo 'Exception when calling MasterAccountApi->corporateSubAccountIdPlanPut: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **offset** | **int**| Index of the first sub-account in the page |
- **limit** | **int**| Number of sub-accounts to be displayed on each page |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **int**| Id of the sub-account organization | |
+| **subAccountUpdatePlanRequest** | [**\Brevo\Client\Models\SubAccountUpdatePlanRequest**](../Model/SubAccountUpdatePlanRequest.md)| Values to update a sub-account plan | |
### Return type
-[**\Brevo\Client\Model\SubAccountsResponse**](../Model/SubAccountsResponse.md)
+void (empty response body)
### Authorization
@@ -252,59 +892,66 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **corporateSubAccountIdApplicationsTogglePut**
-> corporateSubAccountIdApplicationsTogglePut($id, $toggleApplications)
+## `corporateSubAccountIpAssociatePost()`
-Enable/disable sub-account application(s)
+```php
+corporateSubAccountIpAssociatePost($corporateSubAccountIpAssociatePostRequest): object
+```
+
+Associate an IP to sub-accounts
-API endpoint for the Corporate owner to enable/disable applications on the sub-account
+This endpoint allows to associate an IP to sub-accounts
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\MasterAccountApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = 789; // int | Id of the sub-account organization (mandatory)
-$toggleApplications = new \Brevo\Client\Model\SubAccountAppsToggleRequest(); // \Brevo\Client\Model\SubAccountAppsToggleRequest | List of applications to activate or deactivate on a sub-account
+$corporateSubAccountIpAssociatePostRequest = new \Brevo\Client\Models\CorporateSubAccountIpAssociatePostRequest(); // \Brevo\Client\Models\CorporateSubAccountIpAssociatePostRequest
try {
- $apiInstance->corporateSubAccountIdApplicationsTogglePut($id, $toggleApplications);
+ $result = $apiInstance->corporateSubAccountIpAssociatePost($corporateSubAccountIpAssociatePostRequest);
+ print_r($result);
} catch (Exception $e) {
- echo 'Exception when calling MasterAccountApi->corporateSubAccountIdApplicationsTogglePut: ', $e->getMessage(), PHP_EOL;
+ echo 'Exception when calling MasterAccountApi->corporateSubAccountIpAssociatePost: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **int**| Id of the sub-account organization (mandatory) |
- **toggleApplications** | [**\Brevo\Client\Model\SubAccountAppsToggleRequest**](../Model/SubAccountAppsToggleRequest.md)| List of applications to activate or deactivate on a sub-account |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **corporateSubAccountIpAssociatePostRequest** | [**\Brevo\Client\Models\CorporateSubAccountIpAssociatePostRequest**](../Model/CorporateSubAccountIpAssociatePostRequest.md)| | [optional] |
### Return type
-void (empty response body)
+**object**
### Authorization
@@ -312,51 +959,61 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **corporateSubAccountIdDelete**
-> corporateSubAccountIdDelete($id)
+## `corporateSubAccountIpDissociatePut()`
-Delete a sub-account
+```php
+corporateSubAccountIpDissociatePut($corporateSubAccountIpDissociatePutRequest)
+```
+
+Dissociate an IP to sub-accounts
+
+This endpoint allows to dissociate an IP from sub-accounts
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\MasterAccountApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = 789; // int | Id of the sub-account organization to be deleted
+$corporateSubAccountIpDissociatePutRequest = new \Brevo\Client\Models\CorporateSubAccountIpDissociatePutRequest(); // \Brevo\Client\Models\CorporateSubAccountIpDissociatePutRequest
try {
- $apiInstance->corporateSubAccountIdDelete($id);
+ $apiInstance->corporateSubAccountIpDissociatePut($corporateSubAccountIpDissociatePutRequest);
} catch (Exception $e) {
- echo 'Exception when calling MasterAccountApi->corporateSubAccountIdDelete: ', $e->getMessage(), PHP_EOL;
+ echo 'Exception when calling MasterAccountApi->corporateSubAccountIpDissociatePut: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **int**| Id of the sub-account organization to be deleted |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **corporateSubAccountIpDissociatePutRequest** | [**\Brevo\Client\Models\CorporateSubAccountIpDissociatePutRequest**](../Model/CorporateSubAccountIpDissociatePutRequest.md)| | [optional] |
### Return type
@@ -368,58 +1025,66 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **corporateSubAccountIdGet**
-> \Brevo\Client\Model\SubAccountDetailsResponse corporateSubAccountIdGet($id)
+## `corporateSubAccountKeyPost()`
-Get sub-account details
+```php
+corporateSubAccountKeyPost($corporateSubAccountKeyPostRequest): \Brevo\Client\Models\CreateApiKeyResponse
+```
-This endpoint will provide the details for the specified sub-account company
+Create an API key for a sub-account
+
+This endpoint will generate an API v3 key for a sub account
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\MasterAccountApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = 789; // int | Id of the sub-account organization
+$corporateSubAccountKeyPostRequest = new \Brevo\Client\Models\CorporateSubAccountKeyPostRequest(); // \Brevo\Client\Models\CorporateSubAccountKeyPostRequest
try {
- $result = $apiInstance->corporateSubAccountIdGet($id);
+ $result = $apiInstance->corporateSubAccountKeyPost($corporateSubAccountKeyPostRequest);
print_r($result);
} catch (Exception $e) {
- echo 'Exception when calling MasterAccountApi->corporateSubAccountIdGet: ', $e->getMessage(), PHP_EOL;
+ echo 'Exception when calling MasterAccountApi->corporateSubAccountKeyPost: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **int**| Id of the sub-account organization |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **corporateSubAccountKeyPostRequest** | [**\Brevo\Client\Models\CorporateSubAccountKeyPostRequest**](../Model/CorporateSubAccountKeyPostRequest.md)| | [optional] |
### Return type
-[**\Brevo\Client\Model\SubAccountDetailsResponse**](../Model/SubAccountDetailsResponse.md)
+[**\Brevo\Client\Models\CreateApiKeyResponse**](../Model/CreateApiKeyResponse.md)
### Authorization
@@ -427,59 +1092,66 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **corporateSubAccountIdPlanPut**
-> corporateSubAccountIdPlanPut($id, $updatePlanDetails)
+## `corporateSubAccountPost()`
-Update sub-account plan
+```php
+corporateSubAccountPost($createSubAccount): \Brevo\Client\Models\CreateSubAccountResponse
+```
+
+Create a new sub-account under a master account.
-This endpoint will update the sub-account plan
+This endpoint will create a new sub-account under a master account
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\MasterAccountApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = 789; // int | Id of the sub-account organization
-$updatePlanDetails = new \Brevo\Client\Model\SubAccountUpdatePlanRequest(); // \Brevo\Client\Model\SubAccountUpdatePlanRequest | Values to update a sub-account plan
+$createSubAccount = new \Brevo\Client\Models\CreateSubAccount(); // \Brevo\Client\Models\CreateSubAccount | Request body with sub-account organization name
try {
- $apiInstance->corporateSubAccountIdPlanPut($id, $updatePlanDetails);
+ $result = $apiInstance->corporateSubAccountPost($createSubAccount);
+ print_r($result);
} catch (Exception $e) {
- echo 'Exception when calling MasterAccountApi->corporateSubAccountIdPlanPut: ', $e->getMessage(), PHP_EOL;
+ echo 'Exception when calling MasterAccountApi->corporateSubAccountPost: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **int**| Id of the sub-account organization |
- **updatePlanDetails** | [**\Brevo\Client\Model\SubAccountUpdatePlanRequest**](../Model/SubAccountUpdatePlanRequest.md)| Values to update a sub-account plan |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **createSubAccount** | [**\Brevo\Client\Models\CreateSubAccount**](../Model/CreateSubAccount.md)| Request body with sub-account organization name | |
### Return type
-void (empty response body)
+[**\Brevo\Client\Models\CreateSubAccountResponse**](../Model/CreateSubAccountResponse.md)
### Authorization
@@ -487,58 +1159,66 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **corporateSubAccountKeyPost**
-> \Brevo\Client\Model\CreateApiKeyResponse corporateSubAccountKeyPost($createApiKeyRequest)
+## `corporateSubAccountSsoTokenPost()`
-Create an API key for a sub-account
+```php
+corporateSubAccountSsoTokenPost($corporateSubAccountSsoTokenPostRequest): \Brevo\Client\Models\GetSsoToken
+```
-This endpoint will generate an API v3 key for a sub account
+Generate SSO token to access sub-account
+
+This endpoint generates an sso token to authenticate and access a sub-account of the master using the account endpoint https://account-app.brevo.com/account/login/sub-account/sso/[token], where [token] will be replaced by the actual token.
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\MasterAccountApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$createApiKeyRequest = new \Brevo\Client\Model\CreateApiKeyRequest(); // \Brevo\Client\Model\CreateApiKeyRequest | Values to generate API key for sub-account
+$corporateSubAccountSsoTokenPostRequest = new \Brevo\Client\Models\CorporateSubAccountSsoTokenPostRequest(); // \Brevo\Client\Models\CorporateSubAccountSsoTokenPostRequest
try {
- $result = $apiInstance->corporateSubAccountKeyPost($createApiKeyRequest);
+ $result = $apiInstance->corporateSubAccountSsoTokenPost($corporateSubAccountSsoTokenPostRequest);
print_r($result);
} catch (Exception $e) {
- echo 'Exception when calling MasterAccountApi->corporateSubAccountKeyPost: ', $e->getMessage(), PHP_EOL;
+ echo 'Exception when calling MasterAccountApi->corporateSubAccountSsoTokenPost: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **createApiKeyRequest** | [**\Brevo\Client\Model\CreateApiKeyRequest**](../Model/CreateApiKeyRequest.md)| Values to generate API key for sub-account |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **corporateSubAccountSsoTokenPostRequest** | [**\Brevo\Client\Models\CorporateSubAccountSsoTokenPostRequest**](../Model/CorporateSubAccountSsoTokenPostRequest.md)| | [optional] |
### Return type
-[**\Brevo\Client\Model\CreateApiKeyResponse**](../Model/CreateApiKeyResponse.md)
+[**\Brevo\Client\Models\GetSsoToken**](../Model/GetSsoToken.md)
### Authorization
@@ -546,58 +1226,67 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **corporateSubAccountPost**
-> \Brevo\Client\Model\CreateSubAccountResponse corporateSubAccountPost($subAccountCreate)
+## `corporateUserEmailPermissionsPut()`
-Create a new sub-account under a master account.
+```php
+corporateUserEmailPermissionsPut($email, $corporateUserEmailPermissionsPutRequest)
+```
-This endpoint will create a new sub-account under a master account
+Change admin user permissions
+
+This endpoint will allow you to change the permissions of Admin users of your Admin account
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\MasterAccountApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$subAccountCreate = new \Brevo\Client\Model\CreateSubAccount(); // \Brevo\Client\Model\CreateSubAccount | values to create new sub-account
+$email = 'email_example'; // string | Email address of Admin user
+$corporateUserEmailPermissionsPutRequest = {"all_features_access":false,"privileges":[{"feature":"user_management","permissions":["all"]},{"feature":"api","permissions":["all"]},{"feature":"my_plan","permissions":["none"]},{"feature":"apps_management","permissions":["all"]},{"feature":"create_sub_organizations","permissions":["all"]},{"feature":"sub_organization_groups","permissions":["create","edit_delete"]},{"feature":"manage_sub_organizations","permissions":["all"]},{"feature":"security","permissions":["none"]},{"feature":"analytics","permissions":["create_alerts","download_data","my_looks","explore_create"]}]}; // \Brevo\Client\Models\CorporateUserEmailPermissionsPutRequest | Values to update an admin user permissions
try {
- $result = $apiInstance->corporateSubAccountPost($subAccountCreate);
- print_r($result);
+ $apiInstance->corporateUserEmailPermissionsPut($email, $corporateUserEmailPermissionsPutRequest);
} catch (Exception $e) {
- echo 'Exception when calling MasterAccountApi->corporateSubAccountPost: ', $e->getMessage(), PHP_EOL;
+ echo 'Exception when calling MasterAccountApi->corporateUserEmailPermissionsPut: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **subAccountCreate** | [**\Brevo\Client\Model\CreateSubAccount**](../Model/CreateSubAccount.md)| values to create new sub-account |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **email** | **string**| Email address of Admin user | |
+| **corporateUserEmailPermissionsPutRequest** | [**\Brevo\Client\Models\CorporateUserEmailPermissionsPutRequest**](../Model/CorporateUserEmailPermissionsPutRequest.md)| Values to update an admin user permissions | |
### Return type
-[**\Brevo\Client\Model\CreateSubAccountResponse**](../Model/CreateSubAccountResponse.md)
+void (empty response body)
### Authorization
@@ -605,58 +1294,68 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **corporateSubAccountSsoTokenPost**
-> \Brevo\Client\Model\GetSsoToken corporateSubAccountSsoTokenPost($ssoTokenRequest)
+## `corporateUserInvitationActionEmailPut()`
+
+```php
+corporateUserInvitationActionEmailPut($action, $email): \Brevo\Client\Models\CorporateUserInvitationActionEmailPut200Response
+```
-Generate SSO token to access Brevo
+Resend / cancel admin user invitation
-This endpoint generates an sso token to authenticate and access a sub-account of the master using the account endpoint https://account-app.brevo.com/account/login/sub-account/sso/[token], where [token] will be replaced by the actual token.
+This endpoint will allow the user to: - Resend an admin user invitation - Cancel an admin user invitation
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\MasterAccountApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$ssoTokenRequest = new \Brevo\Client\Model\SsoTokenRequest(); // \Brevo\Client\Model\SsoTokenRequest | Values to generate SSO token for sub-account
+$action = 'action_example'; // string | Action to be performed (cancel / resend)
+$email = 'email_example'; // string | Email address of the recipient
try {
- $result = $apiInstance->corporateSubAccountSsoTokenPost($ssoTokenRequest);
+ $result = $apiInstance->corporateUserInvitationActionEmailPut($action, $email);
print_r($result);
} catch (Exception $e) {
- echo 'Exception when calling MasterAccountApi->corporateSubAccountSsoTokenPost: ', $e->getMessage(), PHP_EOL;
+ echo 'Exception when calling MasterAccountApi->corporateUserInvitationActionEmailPut: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **ssoTokenRequest** | [**\Brevo\Client\Model\SsoTokenRequest**](../Model/SsoTokenRequest.md)| Values to generate SSO token for sub-account |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **action** | **string**| Action to be performed (cancel / resend) | |
+| **email** | **string**| Email address of the recipient | |
### Return type
-[**\Brevo\Client\Model\GetSsoToken**](../Model/GetSsoToken.md)
+[**\Brevo\Client\Models\CorporateUserInvitationActionEmailPut200Response**](../Model/CorporateUserInvitationActionEmailPut200Response.md)
### Authorization
@@ -664,53 +1363,61 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `corporateUserRevokeEmailDelete()`
-# **corporateUserRevokeEmailDelete**
-> corporateUserRevokeEmailDelete($email)
+```php
+corporateUserRevokeEmailDelete($email)
+```
Revoke an admin user
This endpoint allows to revoke/remove an invited member of your Admin account
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\MasterAccountApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$email = "email_example"; // string | Email of the invited user
+$email = 'email_example'; // string | Email of the invited user
try {
$apiInstance->corporateUserRevokeEmailDelete($email);
} catch (Exception $e) {
echo 'Exception when calling MasterAccountApi->corporateUserRevokeEmailDelete: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **email** | **string**| Email of the invited user |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **email** | **string**| Email of the invited user | |
### Return type
@@ -722,62 +1429,70 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getAccountActivity**
-> \Brevo\Client\Model\GetAccountActivity getAccountActivity($startDate, $endDate, $limit, $offset)
+## `getAccountActivity_0()`
+
+```php
+getAccountActivity_0($startDate, $endDate, $limit, $offset): \Brevo\Client\Models\GetAccountActivity
+```
Get user activity logs
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\MasterAccountApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$startDate = "startDate_example"; // string | Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search.
-$endDate = "endDate_example"; // string | Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month.
+$startDate = 'startDate_example'; // string | Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search.
+$endDate = 'endDate_example'; // string | Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month.
$limit = 10; // int | Number of documents per page
$offset = 0; // int | Index of the first document in the page.
try {
- $result = $apiInstance->getAccountActivity($startDate, $endDate, $limit, $offset);
+ $result = $apiInstance->getAccountActivity_0($startDate, $endDate, $limit, $offset);
print_r($result);
} catch (Exception $e) {
- echo 'Exception when calling MasterAccountApi->getAccountActivity: ', $e->getMessage(), PHP_EOL;
+ echo 'Exception when calling MasterAccountApi->getAccountActivity_0: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **startDate** | **string**| Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search. | [optional]
- **endDate** | **string**| Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. | [optional]
- **limit** | **int**| Number of documents per page | [optional] [default to 10]
- **offset** | **int**| Index of the first document in the page. | [optional] [default to 0]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **startDate** | **string**| Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search. | [optional] |
+| **endDate** | **string**| Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. | [optional] |
+| **limit** | **int**| Number of documents per page | [optional] [default to 10] |
+| **offset** | **int**| Index of the first document in the page. | [optional] [default to 0] |
### Return type
-[**\Brevo\Client\Model\GetAccountActivity**](../Model/GetAccountActivity.md)
+[**\Brevo\Client\Models\GetAccountActivity**](../Model/GetAccountActivity.md)
### Authorization
@@ -785,32 +1500,41 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `getCorporateInvitedUsersList()`
-# **getCorporateInvitedUsersList**
-> \Brevo\Client\Model\GetCorporateInvitedUsersList getCorporateInvitedUsersList()
+```php
+getCorporateInvitedUsersList(): \Brevo\Client\Models\GetCorporateInvitedUsersList
+```
Get the list of all admin users
This endpoint allows you to list all Admin users of your Admin account
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\MasterAccountApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
@@ -824,15 +1548,82 @@ try {
} catch (Exception $e) {
echo 'Exception when calling MasterAccountApi->getCorporateInvitedUsersList: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
+
This endpoint does not need any parameter.
### Return type
-[**\Brevo\Client\Model\GetCorporateInvitedUsersList**](../Model/GetCorporateInvitedUsersList.md)
+[**\Brevo\Client\Models\GetCorporateInvitedUsersList**](../Model/GetCorporateInvitedUsersList.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `getCorporateUserPermission()`
+
+```php
+getCorporateUserPermission($email): \Brevo\Client\Models\GetCorporateUserPermission
+```
+
+Check admin user permissions
+
+This endpoint will provide the list of admin user permissions
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\MasterAccountApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$email = 'email_example'; // string | Email of the invited user.
+
+try {
+ $result = $apiInstance->getCorporateUserPermission($email);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling MasterAccountApi->getCorporateUserPermission: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **email** | **string**| Email of the invited user. | |
+
+### Return type
+
+[**\Brevo\Client\Models\GetCorporateUserPermission**](../Model/GetCorporateUserPermission.md)
### Authorization
@@ -840,32 +1631,41 @@ This endpoint does not need any parameter.
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getSubAccountGroups**
-> \Brevo\Client\Model\InlineResponse200[] getSubAccountGroups()
+## `getSubAccountGroups()`
+
+```php
+getSubAccountGroups(): \Brevo\Client\Models\GetSubAccountGroups200ResponseInner[]
+```
Get the list of groups
This endpoint allows you to list all groups created on your Admin account.
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\MasterAccountApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
@@ -879,15 +1679,15 @@ try {
} catch (Exception $e) {
echo 'Exception when calling MasterAccountApi->getSubAccountGroups: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
+
This endpoint does not need any parameter.
### Return type
-[**\Brevo\Client\Model\InlineResponse200[]**](../Model/InlineResponse200.md)
+[**\Brevo\Client\Models\GetSubAccountGroups200ResponseInner[]**](../Model/GetSubAccountGroups200ResponseInner.md)
### Authorization
@@ -895,58 +1695,66 @@ This endpoint does not need any parameter.
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **inviteAdminUser**
-> \Brevo\Client\Model\InviteAdminUser inviteAdminUser($sendInvitation)
+## `inviteAdminUser()`
+
+```php
+inviteAdminUser($inviteAdminUser): \Brevo\Client\Models\CorporateGroupPost201Response
+```
Send invitation to an admin user
-`This endpoint allows you to invite a member to manage the Admin account Features and their respective permissions are as below: - `my_plan`: - \"all\" - `api`: - \"none\" - `user_management`: - \"all\" - `app_management` | Not available in ENTv2: - \"all\" **Note**: - If `all_features_access: false` then only privileges are required otherwise if `true` then it's assumed that all permissions will be there for the invited admin user.
+`This endpoint allows you to invite a member to manage the Admin account Features and their respective permissions are as below: - `my_plan`: - \"all\" - `api`: - \"none\" - `user_management`: - \"all\" - `app_management` | Not available in ENTv2: - \"all\" - `sub_organization_groups` - \"create\" - \"edit_delete\" - `create_sub_organizations` - \"all\" - `manage_sub_organizations` - \"all\" - `analytics` - \"download_data\" - \"create_alerts\" - \"my_looks\" - \"explore_create\" - `security` - \"all\" **Note**: - If `all_features_access: false` then only privileges are required otherwise if `true` then it's assumed that all permissions will be there for the invited admin user.
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\MasterAccountApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$sendInvitation = new \Brevo\Client\Model\InviteAdminUser(); // \Brevo\Client\Model\InviteAdminUser | Payload to send an invitation
+$inviteAdminUser = new \Brevo\Client\Models\InviteAdminUser(); // \Brevo\Client\Models\InviteAdminUser | Payload to send an invitation
try {
- $result = $apiInstance->inviteAdminUser($sendInvitation);
+ $result = $apiInstance->inviteAdminUser($inviteAdminUser);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling MasterAccountApi->inviteAdminUser: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **sendInvitation** | [**\Brevo\Client\Model\InviteAdminUser**](../Model/InviteAdminUser.md)| Payload to send an invitation |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **inviteAdminUser** | [**\Brevo\Client\Models\InviteAdminUser**](../Model/InviteAdminUser.md)| Payload to send an invitation | |
### Return type
-[**\Brevo\Client\Model\InviteAdminUser**](../Model/InviteAdminUser.md)
+[**\Brevo\Client\Models\CorporateGroupPost201Response**](../Model/CorporateGroupPost201Response.md)
### Authorization
@@ -954,8 +1762,9 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+- **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)
diff --git a/docs/Api/NotesApi.md b/docs/Api/NotesApi.md
index ca8e332..8457fcf 100644
--- a/docs/Api/NotesApi.md
+++ b/docs/Api/NotesApi.md
@@ -1,48 +1,55 @@
# Brevo\Client\NotesApi
-All URIs are relative to *https://api.brevo.com/v3*
+All URIs are relative to https://api.brevo.com/v3, except if the operation defines another base path.
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**crmNotesGet**](NotesApi.md#crmNotesGet) | **GET** /crm/notes | Get all notes
-[**crmNotesIdDelete**](NotesApi.md#crmNotesIdDelete) | **DELETE** /crm/notes/{id} | Delete a note
-[**crmNotesIdGet**](NotesApi.md#crmNotesIdGet) | **GET** /crm/notes/{id} | Get a note
-[**crmNotesIdPatch**](NotesApi.md#crmNotesIdPatch) | **PATCH** /crm/notes/{id} | Update a note
-[**crmNotesPost**](NotesApi.md#crmNotesPost) | **POST** /crm/notes | Create a note
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**crmNotesGet()**](NotesApi.md#crmNotesGet) | **GET** /crm/notes | Get all notes |
+| [**crmNotesIdDelete()**](NotesApi.md#crmNotesIdDelete) | **DELETE** /crm/notes/{id} | Delete a note |
+| [**crmNotesIdGet()**](NotesApi.md#crmNotesIdGet) | **GET** /crm/notes/{id} | Get a note |
+| [**crmNotesIdPatch()**](NotesApi.md#crmNotesIdPatch) | **PATCH** /crm/notes/{id} | Update a note |
+| [**crmNotesPost()**](NotesApi.md#crmNotesPost) | **POST** /crm/notes | Create a note |
-# **crmNotesGet**
-> \Brevo\Client\Model\NoteList crmNotesGet($entity, $entityIds, $dateFrom, $dateTo, $offset, $limit, $sort)
+## `crmNotesGet()`
+
+```php
+crmNotesGet($entity, $entityIds, $dateFrom, $dateTo, $offset, $limit, $sort): \Brevo\Client\Models\Note[]
+```
Get all notes
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\NotesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$entity = "entity_example"; // string | Filter by note entity type
-$entityIds = "entityIds_example"; // string | Filter by note entity IDs
+$entity = 'entity_example'; // string | Filter by note entity type
+$entityIds = 'entityIds_example'; // string | Filter by note entity IDs
$dateFrom = 56; // int | dateFrom to date range filter type (timestamp in milliseconds)
$dateTo = 56; // int | dateTo to date range filter type (timestamp in milliseconds)
-$offset = 789; // int | Index of the first document of the page
+$offset = 56; // int | Index of the first document of the page
$limit = 50; // int | Number of documents per page
-$sort = "sort_example"; // string | Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed
+$sort = 'sort_example'; // string | Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed
try {
$result = $apiInstance->crmNotesGet($entity, $entityIds, $dateFrom, $dateTo, $offset, $limit, $sort);
@@ -50,24 +57,23 @@ try {
} catch (Exception $e) {
echo 'Exception when calling NotesApi->crmNotesGet: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **entity** | **string**| Filter by note entity type | [optional]
- **entityIds** | **string**| Filter by note entity IDs | [optional]
- **dateFrom** | **int**| dateFrom to date range filter type (timestamp in milliseconds) | [optional]
- **dateTo** | **int**| dateTo to date range filter type (timestamp in milliseconds) | [optional]
- **offset** | **int**| Index of the first document of the page | [optional]
- **limit** | **int**| Number of documents per page | [optional] [default to 50]
- **sort** | **string**| Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed | [optional]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **entity** | **string**| Filter by note entity type | [optional] |
+| **entityIds** | **string**| Filter by note entity IDs | [optional] |
+| **dateFrom** | **int**| dateFrom to date range filter type (timestamp in milliseconds) | [optional] |
+| **dateTo** | **int**| dateTo to date range filter type (timestamp in milliseconds) | [optional] |
+| **offset** | **int**| Index of the first document of the page | [optional] |
+| **limit** | **int**| Number of documents per page | [optional] [default to 50] |
+| **sort** | **string**| Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed | [optional] |
### Return type
-[**\Brevo\Client\Model\NoteList**](../Model/NoteList.md)
+[**\Brevo\Client\Models\Note[]**](../Model/Note.md)
### Authorization
@@ -75,51 +81,59 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **crmNotesIdDelete**
-> crmNotesIdDelete($id)
+## `crmNotesIdDelete()`
+
+```php
+crmNotesIdDelete($id)
+```
Delete a note
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\NotesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = "id_example"; // string | Note ID to delete
+$id = 'id_example'; // string | Note ID to delete
try {
$apiInstance->crmNotesIdDelete($id);
} catch (Exception $e) {
echo 'Exception when calling NotesApi->crmNotesIdDelete: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| Note ID to delete |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| Note ID to delete | |
### Return type
@@ -131,37 +145,46 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **crmNotesIdGet**
-> \Brevo\Client\Model\Note crmNotesIdGet($id)
+## `crmNotesIdGet()`
+
+```php
+crmNotesIdGet($id): \Brevo\Client\Models\Note
+```
Get a note
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\NotesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = "id_example"; // string | Note ID to get
+$id = 'id_example'; // string | Note ID to get
try {
$result = $apiInstance->crmNotesIdGet($id);
@@ -169,18 +192,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling NotesApi->crmNotesIdGet: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| Note ID to get |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| Note ID to get | |
### Return type
-[**\Brevo\Client\Model\Note**](../Model/Note.md)
+[**\Brevo\Client\Models\Note**](../Model/Note.md)
### Authorization
@@ -188,53 +210,61 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **crmNotesIdPatch**
-> crmNotesIdPatch($id, $body)
+## `crmNotesIdPatch()`
+
+```php
+crmNotesIdPatch($id, $noteData)
+```
Update a note
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\NotesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = "id_example"; // string | Note ID to update
-$body = new \Brevo\Client\Model\NoteData(); // \Brevo\Client\Model\NoteData | Note data to update a note
+$id = 'id_example'; // string | Note ID to update
+$noteData = new \Brevo\Client\Models\NoteData(); // \Brevo\Client\Models\NoteData | Note data to update a note.
try {
- $apiInstance->crmNotesIdPatch($id, $body);
+ $apiInstance->crmNotesIdPatch($id, $noteData);
} catch (Exception $e) {
echo 'Exception when calling NotesApi->crmNotesIdPatch: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| Note ID to update |
- **body** | [**\Brevo\Client\Model\NoteData**](../Model/NoteData.md)| Note data to update a note |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| Note ID to update | |
+| **noteData** | [**\Brevo\Client\Models\NoteData**](../Model/NoteData.md)| Note data to update a note. | |
### Return type
@@ -246,56 +276,64 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **crmNotesPost**
-> \Brevo\Client\Model\NoteId crmNotesPost($body)
+## `crmNotesPost()`
+
+```php
+crmNotesPost($noteData): \Brevo\Client\Models\NoteId
+```
Create a note
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\NotesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$body = new \Brevo\Client\Model\NoteData(); // \Brevo\Client\Model\NoteData | Note data to create a note.
+$noteData = new \Brevo\Client\Models\NoteData(); // \Brevo\Client\Models\NoteData | Note data to create a note.
try {
- $result = $apiInstance->crmNotesPost($body);
+ $result = $apiInstance->crmNotesPost($noteData);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling NotesApi->crmNotesPost: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **body** | [**\Brevo\Client\Model\NoteData**](../Model/NoteData.md)| Note data to create a note. |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **noteData** | [**\Brevo\Client\Models\NoteData**](../Model/NoteData.md)| Note data to create a note. | |
### Return type
-[**\Brevo\Client\Model\NoteId**](../Model/NoteId.md)
+[**\Brevo\Client\Models\NoteId**](../Model/NoteId.md)
### Authorization
@@ -303,8 +341,9 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+- **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)
diff --git a/docs/Api/PaymentsApi.md b/docs/Api/PaymentsApi.md
new file mode 100644
index 0000000..bc1352e
--- /dev/null
+++ b/docs/Api/PaymentsApi.md
@@ -0,0 +1,204 @@
+# Brevo\Client\PaymentsApi
+
+All URIs are relative to https://api.brevo.com/v3, except if the operation defines another base path.
+
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**createPaymentRequest()**](PaymentsApi.md#createPaymentRequest) | **POST** /payments/requests | Create a payment request |
+| [**deletePaymentRequest()**](PaymentsApi.md#deletePaymentRequest) | **DELETE** /payments/requests/{id} | Delete a payment request. |
+| [**getPaymentRequest()**](PaymentsApi.md#getPaymentRequest) | **GET** /payments/requests/{id} | Get payment request details |
+
+
+## `createPaymentRequest()`
+
+```php
+createPaymentRequest($createPaymentRequest): \Brevo\Client\Models\CreatePaymentResponse
+```
+
+Create a payment request
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\PaymentsApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$createPaymentRequest = new \Brevo\Client\Models\CreatePaymentRequest(); // \Brevo\Client\Models\CreatePaymentRequest | Create a payment request
+
+try {
+ $result = $apiInstance->createPaymentRequest($createPaymentRequest);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling PaymentsApi->createPaymentRequest: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **createPaymentRequest** | [**\Brevo\Client\Models\CreatePaymentRequest**](../Model/CreatePaymentRequest.md)| Create a payment request | |
+
+### Return type
+
+[**\Brevo\Client\Models\CreatePaymentResponse**](../Model/CreatePaymentResponse.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `deletePaymentRequest()`
+
+```php
+deletePaymentRequest($id)
+```
+
+Delete a payment request.
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\PaymentsApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$id = 9ae7d68a-565c-4695-9381-d8fb3e3a14cc; // string | ID of the payment request.
+
+try {
+ $apiInstance->deletePaymentRequest($id);
+} catch (Exception $e) {
+ echo 'Exception when calling PaymentsApi->deletePaymentRequest: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| ID of the payment request. | |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `getPaymentRequest()`
+
+```php
+getPaymentRequest($id): \Brevo\Client\Models\GetPaymentRequest
+```
+
+Get payment request details
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\PaymentsApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$id = 050db7b0-9bb7-4c1e-9c68-5a8dace8c1dc; // string | Id of the payment Request
+
+try {
+ $result = $apiInstance->getPaymentRequest($id);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling PaymentsApi->getPaymentRequest: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| Id of the payment Request | |
+
+### Return type
+
+[**\Brevo\Client\Models\GetPaymentRequest**](../Model/GetPaymentRequest.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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/ProcessApi.md b/docs/Api/ProcessApi.md
index 8e37af7..542066c 100644
--- a/docs/Api/ProcessApi.md
+++ b/docs/Api/ProcessApi.md
@@ -1,39 +1,46 @@
# Brevo\Client\ProcessApi
-All URIs are relative to *https://api.brevo.com/v3*
+All URIs are relative to https://api.brevo.com/v3, except if the operation defines another base path.
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**getProcess**](ProcessApi.md#getProcess) | **GET** /processes/{processId} | Return the informations for a process
-[**getProcesses**](ProcessApi.md#getProcesses) | **GET** /processes | Return all the processes for your account
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**getProcess()**](ProcessApi.md#getProcess) | **GET** /processes/{processId} | Return the informations for a process |
+| [**getProcesses()**](ProcessApi.md#getProcesses) | **GET** /processes | Return all the processes for your account |
-# **getProcess**
-> \Brevo\Client\Model\GetProcess getProcess($processId)
+## `getProcess()`
+
+```php
+getProcess($processId): \Brevo\Client\Models\GetProcess
+```
Return the informations for a process
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ProcessApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$processId = 789; // int | Id of the process
+$processId = 56; // int | Id of the process
try {
$result = $apiInstance->getProcess($processId);
@@ -41,18 +48,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling ProcessApi->getProcess: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **processId** | **int**| Id of the process |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **processId** | **int**| Id of the process | |
### Return type
-[**\Brevo\Client\Model\GetProcess**](../Model/GetProcess.md)
+[**\Brevo\Client\Models\GetProcess**](../Model/GetProcess.md)
### Authorization
@@ -60,30 +66,39 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getProcesses**
-> \Brevo\Client\Model\GetProcesses getProcesses($limit, $offset, $sort)
+## `getProcesses()`
+
+```php
+getProcesses($limit, $offset, $sort): \Brevo\Client\Models\GetProcesses
+```
Return all the processes for your account
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\ProcessApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
@@ -92,7 +107,7 @@ $apiInstance = new Brevo\Client\Api\ProcessApi(
);
$limit = 10; // int | Number limitation for the result returned
$offset = 0; // int | Beginning point in the list to retrieve from.
-$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
+$sort = 'desc'; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
try {
$result = $apiInstance->getProcesses($limit, $offset, $sort);
@@ -100,20 +115,19 @@ try {
} catch (Exception $e) {
echo 'Exception when calling ProcessApi->getProcesses: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **limit** | **int**| Number limitation for the result returned | [optional] [default to 10]
- **offset** | **int**| Beginning point in the list to retrieve from. | [optional] [default to 0]
- **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **limit** | **int**| Number limitation for the result returned | [optional] [default to 10] |
+| **offset** | **int**| Beginning point in the list to retrieve from. | [optional] [default to 0] |
+| **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to 'desc'] |
### Return type
-[**\Brevo\Client\Model\GetProcesses**](../Model/GetProcesses.md)
+[**\Brevo\Client\Models\GetProcesses**](../Model/GetProcesses.md)
### Authorization
@@ -121,8 +135,9 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+- **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/ProgramApi.md b/docs/Api/ProgramApi.md
new file mode 100644
index 0000000..59edf8e
--- /dev/null
+++ b/docs/Api/ProgramApi.md
@@ -0,0 +1,915 @@
+# Brevo\Client\ProgramApi
+
+All URIs are relative to https://api.brevo.com/v3, except if the operation defines another base path.
+
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**createNewLP()**](ProgramApi.md#createNewLP) | **POST** /loyalty/config/programs | Create loyalty program |
+| [**deleteContactMembers()**](ProgramApi.md#deleteContactMembers) | **DELETE** /loyalty/config/programs/{loyaltyProgramId}/subscriptions-members | Delete subscription member |
+| [**deleteLoyaltyProgram()**](ProgramApi.md#deleteLoyaltyProgram) | **DELETE** /loyalty/config/programs/{loyaltyProgramId} | Delete Loyalty Program |
+| [**deleteSubscriptionMember()**](ProgramApi.md#deleteSubscriptionMember) | **DELETE** /loyalty/config/programs/{loyaltyProgramId}/contact/{contactId} | Delete subscription |
+| [**getLPList()**](ProgramApi.md#getLPList) | **GET** /loyalty/config/programs | Get loyalty program list |
+| [**getLoyaltyProgramInfo()**](ProgramApi.md#getLoyaltyProgramInfo) | **GET** /loyalty/config/programs/{loyaltyProgramId} | Get loyalty program Info |
+| [**getParameterSubscriptionInfo()**](ProgramApi.md#getParameterSubscriptionInfo) | **GET** /loyalty/config/programs/{loyaltyProgramId}/account-info | Get Subscription Data |
+| [**getSubscriptionMember()**](ProgramApi.md#getSubscriptionMember) | **GET** /loyalty/config/programs/{loyaltyProgramId}/contact/{contactId} | Get subscription info |
+| [**partiallyUpdateLoyaltyProgram()**](ProgramApi.md#partiallyUpdateLoyaltyProgram) | **PATCH** /loyalty/config/programs/{loyaltyProgramId} | Partially update loyalty program |
+| [**publishLoyaltyProgram()**](ProgramApi.md#publishLoyaltyProgram) | **POST** /loyalty/config/programs/{loyaltyProgramId}/publish | Publish loyalty program |
+| [**subscribeMemberToASubscription()**](ProgramApi.md#subscribeMemberToASubscription) | **POST** /loyalty/config/programs/{loyaltyProgramId}/subscriptions-members | Create subscription member |
+| [**subscribeToLoyaltyProgram()**](ProgramApi.md#subscribeToLoyaltyProgram) | **POST** /loyalty/config/programs/{loyaltyProgramId}/subscriptions | Create subscription |
+| [**updateLoyaltyProgram()**](ProgramApi.md#updateLoyaltyProgram) | **PUT** /loyalty/config/programs/{loyaltyProgramId} | Update loyalty program |
+
+
+## `createNewLP()`
+
+```php
+createNewLP($createLoyaltyProgramPayload): \Brevo\Client\Models\LoyaltyProgram
+```
+
+Create loyalty program
+
+Creates loyalty program
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\ProgramApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$createLoyaltyProgramPayload = new \Brevo\Client\Models\CreateLoyaltyProgramPayload(); // \Brevo\Client\Models\CreateLoyaltyProgramPayload | Loyalty Program information
+
+try {
+ $result = $apiInstance->createNewLP($createLoyaltyProgramPayload);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling ProgramApi->createNewLP: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **createLoyaltyProgramPayload** | [**\Brevo\Client\Models\CreateLoyaltyProgramPayload**](../Model/CreateLoyaltyProgramPayload.md)| Loyalty Program information | [optional] |
+
+### Return type
+
+[**\Brevo\Client\Models\LoyaltyProgram**](../Model/LoyaltyProgram.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `deleteContactMembers()`
+
+```php
+deleteContactMembers($loyaltyProgramId, $contactId, $memberContactIds)
+```
+
+Delete subscription member
+
+Deletes member from a subscription
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\ProgramApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$contactId = 56; // int | Contact Id
+$memberContactIds = 56; // int | Member Contact Ids, comma-seperated
+
+try {
+ $apiInstance->deleteContactMembers($loyaltyProgramId, $contactId, $memberContactIds);
+} catch (Exception $e) {
+ echo 'Exception when calling ProgramApi->deleteContactMembers: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **contactId** | **int**| Contact Id | |
+| **memberContactIds** | **int**| Member Contact Ids, comma-seperated | |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `deleteLoyaltyProgram()`
+
+```php
+deleteLoyaltyProgram($loyaltyProgramId)
+```
+
+Delete Loyalty Program
+
+Deletes Loyalty Program
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\ProgramApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+
+try {
+ $apiInstance->deleteLoyaltyProgram($loyaltyProgramId);
+} catch (Exception $e) {
+ echo 'Exception when calling ProgramApi->deleteLoyaltyProgram: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `deleteSubscriptionMember()`
+
+```php
+deleteSubscriptionMember($loyaltyProgramId, $contactId)
+```
+
+Delete subscription
+
+Deletes subscription
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\ProgramApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$contactId = 'contactId_example'; // string | Contact Id
+
+try {
+ $apiInstance->deleteSubscriptionMember($loyaltyProgramId, $contactId);
+} catch (Exception $e) {
+ echo 'Exception when calling ProgramApi->deleteSubscriptionMember: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **contactId** | **string**| Contact Id | |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `getLPList()`
+
+```php
+getLPList($limit, $offset, $sortField, $sort): \Brevo\Client\Models\LoyaltyProgramPage
+```
+
+Get loyalty program list
+
+Returns list of loyalty programs
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\ProgramApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$limit = 200; // int | Number of documents per page
+$offset = 0; // int | Index of the first document in the page
+$sortField = 'updatedAt'; // string | Sort documents by field
+$sort = 'desc'; // string | Sort the documents in the ascending or descending order
+
+try {
+ $result = $apiInstance->getLPList($limit, $offset, $sortField, $sort);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling ProgramApi->getLPList: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **limit** | **int**| Number of documents per page | [optional] [default to 200] |
+| **offset** | **int**| Index of the first document in the page | [optional] [default to 0] |
+| **sortField** | **string**| Sort documents by field | [optional] [default to 'updatedAt'] |
+| **sort** | **string**| Sort the documents in the ascending or descending order | [optional] [default to 'desc'] |
+
+### Return type
+
+[**\Brevo\Client\Models\LoyaltyProgramPage**](../Model/LoyaltyProgramPage.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `getLoyaltyProgramInfo()`
+
+```php
+getLoyaltyProgramInfo($loyaltyProgramId): \Brevo\Client\Models\LoyaltyProgram
+```
+
+Get loyalty program Info
+
+Returns loyalty program
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\ProgramApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+
+try {
+ $result = $apiInstance->getLoyaltyProgramInfo($loyaltyProgramId);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling ProgramApi->getLoyaltyProgramInfo: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+
+### Return type
+
+[**\Brevo\Client\Models\LoyaltyProgram**](../Model/LoyaltyProgram.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `getParameterSubscriptionInfo()`
+
+```php
+getParameterSubscriptionInfo($loyaltyProgramId, $contactId, $loyaltySubscriptionId, $params): \Brevo\Client\Models\GetSubscriptionInfoResponse
+```
+
+Get Subscription Data
+
+Get Information of balances, tiers, rewards and subscription members for a subscription
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\ProgramApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$contactId = 56; // int | One of contact id or loyalty subscription id is required
+$loyaltySubscriptionId = 'loyaltySubscriptionId_example'; // string | Loyalty Subscription Id
+$params = array('params_example'); // string[] | Add query params (balance, tier, reward, or member)
+
+try {
+ $result = $apiInstance->getParameterSubscriptionInfo($loyaltyProgramId, $contactId, $loyaltySubscriptionId, $params);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling ProgramApi->getParameterSubscriptionInfo: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **contactId** | **int**| One of contact id or loyalty subscription id is required | |
+| **loyaltySubscriptionId** | **string**| Loyalty Subscription Id | [optional] |
+| **params** | [**string[]**](../Model/string.md)| Add query params (balance, tier, reward, or member) | [optional] |
+
+### Return type
+
+[**\Brevo\Client\Models\GetSubscriptionInfoResponse**](../Model/GetSubscriptionInfoResponse.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `getSubscriptionMember()`
+
+```php
+getSubscriptionMember($loyaltyProgramId, $contactId): \Brevo\Client\Models\GetSubscriptionMemberResponse
+```
+
+Get subscription info
+
+Get subscription info
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\ProgramApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$contactId = 'contactId_example'; // string | Contact Id
+
+try {
+ $result = $apiInstance->getSubscriptionMember($loyaltyProgramId, $contactId);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling ProgramApi->getSubscriptionMember: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **contactId** | **string**| Contact Id | |
+
+### Return type
+
+[**\Brevo\Client\Models\GetSubscriptionMemberResponse**](../Model/GetSubscriptionMemberResponse.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `partiallyUpdateLoyaltyProgram()`
+
+```php
+partiallyUpdateLoyaltyProgram($loyaltyProgramId, $patchLoyaltyProgramPayload): \Brevo\Client\Models\LoyaltyProgram
+```
+
+Partially update loyalty program
+
+Partially updates loyalty program
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\ProgramApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$patchLoyaltyProgramPayload = new \Brevo\Client\Models\PatchLoyaltyProgramPayload(); // \Brevo\Client\Models\PatchLoyaltyProgramPayload | Loyalty Program information
+
+try {
+ $result = $apiInstance->partiallyUpdateLoyaltyProgram($loyaltyProgramId, $patchLoyaltyProgramPayload);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling ProgramApi->partiallyUpdateLoyaltyProgram: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **patchLoyaltyProgramPayload** | [**\Brevo\Client\Models\PatchLoyaltyProgramPayload**](../Model/PatchLoyaltyProgramPayload.md)| Loyalty Program information | [optional] |
+
+### Return type
+
+[**\Brevo\Client\Models\LoyaltyProgram**](../Model/LoyaltyProgram.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `publishLoyaltyProgram()`
+
+```php
+publishLoyaltyProgram($loyaltyProgramId)
+```
+
+Publish loyalty program
+
+Publishes loyalty program
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\ProgramApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+
+try {
+ $apiInstance->publishLoyaltyProgram($loyaltyProgramId);
+} catch (Exception $e) {
+ echo 'Exception when calling ProgramApi->publishLoyaltyProgram: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `subscribeMemberToASubscription()`
+
+```php
+subscribeMemberToASubscription($loyaltyProgramId, $createSubscriptionMemberPayload): \Brevo\Client\Models\CreateSubscriptionMemberResponse
+```
+
+Create subscription member
+
+Add member to a subscription
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\ProgramApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$createSubscriptionMemberPayload = new \Brevo\Client\Models\CreateSubscriptionMemberPayload(); // \Brevo\Client\Models\CreateSubscriptionMemberPayload | Subscription Member information
+
+try {
+ $result = $apiInstance->subscribeMemberToASubscription($loyaltyProgramId, $createSubscriptionMemberPayload);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling ProgramApi->subscribeMemberToASubscription: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **createSubscriptionMemberPayload** | [**\Brevo\Client\Models\CreateSubscriptionMemberPayload**](../Model/CreateSubscriptionMemberPayload.md)| Subscription Member information | [optional] |
+
+### Return type
+
+[**\Brevo\Client\Models\CreateSubscriptionMemberResponse**](../Model/CreateSubscriptionMemberResponse.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `subscribeToLoyaltyProgram()`
+
+```php
+subscribeToLoyaltyProgram($loyaltyProgramId, $createSubscriptionPayload): \Brevo\Client\Models\CreateSubscriptionResponse
+```
+
+Create subscription
+
+Subscribes to a loyalty program
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\ProgramApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program ID
+$createSubscriptionPayload = new \Brevo\Client\Models\CreateSubscriptionPayload(); // \Brevo\Client\Models\CreateSubscriptionPayload | Subscription information
+
+try {
+ $result = $apiInstance->subscribeToLoyaltyProgram($loyaltyProgramId, $createSubscriptionPayload);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling ProgramApi->subscribeToLoyaltyProgram: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program ID | |
+| **createSubscriptionPayload** | [**\Brevo\Client\Models\CreateSubscriptionPayload**](../Model/CreateSubscriptionPayload.md)| Subscription information | |
+
+### Return type
+
+[**\Brevo\Client\Models\CreateSubscriptionResponse**](../Model/CreateSubscriptionResponse.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `updateLoyaltyProgram()`
+
+```php
+updateLoyaltyProgram($loyaltyProgramId, $updateLoyaltyProgramPayload): \Brevo\Client\Models\LoyaltyProgram
+```
+
+Update loyalty program
+
+Updates loyalty program
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\ProgramApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$updateLoyaltyProgramPayload = new \Brevo\Client\Models\UpdateLoyaltyProgramPayload(); // \Brevo\Client\Models\UpdateLoyaltyProgramPayload | Loyalty Program information
+
+try {
+ $result = $apiInstance->updateLoyaltyProgram($loyaltyProgramId, $updateLoyaltyProgramPayload);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling ProgramApi->updateLoyaltyProgram: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **updateLoyaltyProgramPayload** | [**\Brevo\Client\Models\UpdateLoyaltyProgramPayload**](../Model/UpdateLoyaltyProgramPayload.md)| Loyalty Program information | [optional] |
+
+### Return type
+
+[**\Brevo\Client\Models\LoyaltyProgram**](../Model/LoyaltyProgram.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
diff --git a/docs/Api/ResellerApi.md b/docs/Api/ResellerApi.md
deleted file mode 100644
index 8504edf..0000000
--- a/docs/Api/ResellerApi.md
+++ /dev/null
@@ -1,952 +0,0 @@
-# Brevo\Client\ResellerApi
-
-All URIs are relative to *https://api.brevo.com/v3*
-
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**addCredits**](ResellerApi.md#addCredits) | **POST** /reseller/children/{childIdentifier}/credits/add | Add Email and/or SMS credits to a specific child account
-[**associateIpToChild**](ResellerApi.md#associateIpToChild) | **POST** /reseller/children/{childIdentifier}/ips/associate | Associate a dedicated IP to the child
-[**createChildDomain**](ResellerApi.md#createChildDomain) | **POST** /reseller/children/{childIdentifier}/domains | Create a domain for a child account
-[**createResellerChild**](ResellerApi.md#createResellerChild) | **POST** /reseller/children | Creates a reseller child
-[**deleteChildDomain**](ResellerApi.md#deleteChildDomain) | **DELETE** /reseller/children/{childIdentifier}/domains/{domainName} | Delete the sender domain of the reseller child based on the childIdentifier and domainName passed
-[**deleteResellerChild**](ResellerApi.md#deleteResellerChild) | **DELETE** /reseller/children/{childIdentifier} | Delete a single reseller child based on the child identifier supplied
-[**dissociateIpFromChild**](ResellerApi.md#dissociateIpFromChild) | **POST** /reseller/children/{childIdentifier}/ips/dissociate | Dissociate a dedicated IP to the child
-[**getChildAccountCreationStatus**](ResellerApi.md#getChildAccountCreationStatus) | **GET** /reseller/children/{childIdentifier}/accountCreationStatus | Get the status of a reseller's child account creation, whether it is successfully created (exists) or not based on the identifier supplied
-[**getChildDomains**](ResellerApi.md#getChildDomains) | **GET** /reseller/children/{childIdentifier}/domains | Get all sender domains for a specific child account
-[**getChildInfo**](ResellerApi.md#getChildInfo) | **GET** /reseller/children/{childIdentifier} | Get a child account's details
-[**getResellerChilds**](ResellerApi.md#getResellerChilds) | **GET** /reseller/children | Get the list of all children accounts
-[**getSsoToken**](ResellerApi.md#getSsoToken) | **GET** /reseller/children/{childIdentifier}/auth | Get session token to access Brevo (SSO)
-[**removeCredits**](ResellerApi.md#removeCredits) | **POST** /reseller/children/{childIdentifier}/credits/remove | Remove Email and/or SMS credits from a specific child account
-[**updateChildAccountStatus**](ResellerApi.md#updateChildAccountStatus) | **PUT** /reseller/children/{childIdentifier}/accountStatus | Update info of reseller's child account status based on the childIdentifier supplied
-[**updateChildDomain**](ResellerApi.md#updateChildDomain) | **PUT** /reseller/children/{childIdentifier}/domains/{domainName} | Update the sender domain of reseller's child based on the childIdentifier and domainName passed
-[**updateResellerChild**](ResellerApi.md#updateResellerChild) | **PUT** /reseller/children/{childIdentifier} | Update info of reseller's child based on the child identifier supplied
-
-
-# **addCredits**
-> \Brevo\Client\Model\RemainingCreditModel addCredits($childIdentifier, $addCredits)
-
-Add Email and/or SMS credits to a specific child account
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\ResellerApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$childIdentifier = "childIdentifier_example"; // string | Either auth key or id of reseller's child
-$addCredits = new \Brevo\Client\Model\AddCredits(); // \Brevo\Client\Model\AddCredits | Values to post to add credit to a specific child account
-
-try {
- $result = $apiInstance->addCredits($childIdentifier, $addCredits);
- print_r($result);
-} catch (Exception $e) {
- echo 'Exception when calling ResellerApi->addCredits: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **childIdentifier** | **string**| Either auth key or id of reseller's child |
- **addCredits** | [**\Brevo\Client\Model\AddCredits**](../Model/AddCredits.md)| Values to post to add credit to a specific child account |
-
-### Return type
-
-[**\Brevo\Client\Model\RemainingCreditModel**](../Model/RemainingCreditModel.md)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **associateIpToChild**
-> associateIpToChild($childIdentifier, $ip)
-
-Associate a dedicated IP to the child
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\ResellerApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$childIdentifier = "childIdentifier_example"; // string | Either auth key or id of reseller's child
-$ip = new \Brevo\Client\Model\ManageIp(); // \Brevo\Client\Model\ManageIp | IP to associate
-
-try {
- $apiInstance->associateIpToChild($childIdentifier, $ip);
-} catch (Exception $e) {
- echo 'Exception when calling ResellerApi->associateIpToChild: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **childIdentifier** | **string**| Either auth key or id of reseller's child |
- **ip** | [**\Brevo\Client\Model\ManageIp**](../Model/ManageIp.md)| IP to associate |
-
-### Return type
-
-void (empty response body)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **createChildDomain**
-> createChildDomain($childIdentifier, $addChildDomain)
-
-Create a domain for a child account
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\ResellerApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$childIdentifier = "childIdentifier_example"; // string | Either auth key or id of reseller's child
-$addChildDomain = new \Brevo\Client\Model\AddChildDomain(); // \Brevo\Client\Model\AddChildDomain | Sender domain to add for a specific child account. This will not be displayed to the parent account.
-
-try {
- $apiInstance->createChildDomain($childIdentifier, $addChildDomain);
-} catch (Exception $e) {
- echo 'Exception when calling ResellerApi->createChildDomain: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **childIdentifier** | **string**| Either auth key or id of reseller's child |
- **addChildDomain** | [**\Brevo\Client\Model\AddChildDomain**](../Model/AddChildDomain.md)| Sender domain to add for a specific child account. This will not be displayed to the parent account. |
-
-### Return type
-
-void (empty response body)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **createResellerChild**
-> \Brevo\Client\Model\CreateReseller createResellerChild($resellerChild)
-
-Creates a reseller child
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\ResellerApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$resellerChild = new \Brevo\Client\Model\CreateChild(); // \Brevo\Client\Model\CreateChild | reseller child to add
-
-try {
- $result = $apiInstance->createResellerChild($resellerChild);
- print_r($result);
-} catch (Exception $e) {
- echo 'Exception when calling ResellerApi->createResellerChild: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **resellerChild** | [**\Brevo\Client\Model\CreateChild**](../Model/CreateChild.md)| reseller child to add | [optional]
-
-### Return type
-
-[**\Brevo\Client\Model\CreateReseller**](../Model/CreateReseller.md)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **deleteChildDomain**
-> deleteChildDomain($childIdentifier, $domainName)
-
-Delete the sender domain of the reseller child based on the childIdentifier and domainName passed
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\ResellerApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$childIdentifier = "childIdentifier_example"; // string | Either auth key or id of reseller's child
-$domainName = "domainName_example"; // string | Pass the existing domain that needs to be deleted
-
-try {
- $apiInstance->deleteChildDomain($childIdentifier, $domainName);
-} catch (Exception $e) {
- echo 'Exception when calling ResellerApi->deleteChildDomain: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **childIdentifier** | **string**| Either auth key or id of reseller's child |
- **domainName** | **string**| Pass the existing domain that needs to be deleted |
-
-### Return type
-
-void (empty response body)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **deleteResellerChild**
-> deleteResellerChild($childIdentifier)
-
-Delete a single reseller child based on the child identifier supplied
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\ResellerApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$childIdentifier = "childIdentifier_example"; // string | Either auth key or child id of reseller's child
-
-try {
- $apiInstance->deleteResellerChild($childIdentifier);
-} catch (Exception $e) {
- echo 'Exception when calling ResellerApi->deleteResellerChild: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **childIdentifier** | **string**| Either auth key or child id of reseller's child |
-
-### Return type
-
-void (empty response body)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **dissociateIpFromChild**
-> dissociateIpFromChild($childIdentifier, $ip)
-
-Dissociate a dedicated IP to the child
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\ResellerApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$childIdentifier = "childIdentifier_example"; // string | Either auth key or id of reseller's child
-$ip = new \Brevo\Client\Model\ManageIp(); // \Brevo\Client\Model\ManageIp | IP to dissociate
-
-try {
- $apiInstance->dissociateIpFromChild($childIdentifier, $ip);
-} catch (Exception $e) {
- echo 'Exception when calling ResellerApi->dissociateIpFromChild: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **childIdentifier** | **string**| Either auth key or id of reseller's child |
- **ip** | [**\Brevo\Client\Model\ManageIp**](../Model/ManageIp.md)| IP to dissociate |
-
-### Return type
-
-void (empty response body)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **getChildAccountCreationStatus**
-> \Brevo\Client\Model\GetChildAccountCreationStatus getChildAccountCreationStatus($childIdentifier)
-
-Get the status of a reseller's child account creation, whether it is successfully created (exists) or not based on the identifier supplied
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\ResellerApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$childIdentifier = "childIdentifier_example"; // string | Either auth key or id of reseller's child
-
-try {
- $result = $apiInstance->getChildAccountCreationStatus($childIdentifier);
- print_r($result);
-} catch (Exception $e) {
- echo 'Exception when calling ResellerApi->getChildAccountCreationStatus: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **childIdentifier** | **string**| Either auth key or id of reseller's child |
-
-### Return type
-
-[**\Brevo\Client\Model\GetChildAccountCreationStatus**](../Model/GetChildAccountCreationStatus.md)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **getChildDomains**
-> \Brevo\Client\Model\GetChildDomains getChildDomains($childIdentifier)
-
-Get all sender domains for a specific child account
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\ResellerApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$childIdentifier = "childIdentifier_example"; // string | Either auth key or id of reseller's child
-
-try {
- $result = $apiInstance->getChildDomains($childIdentifier);
- print_r($result);
-} catch (Exception $e) {
- echo 'Exception when calling ResellerApi->getChildDomains: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **childIdentifier** | **string**| Either auth key or id of reseller's child |
-
-### Return type
-
-[**\Brevo\Client\Model\GetChildDomains**](../Model/GetChildDomains.md)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **getChildInfo**
-> \Brevo\Client\Model\GetChildInfo getChildInfo($childIdentifier)
-
-Get a child account's details
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\ResellerApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$childIdentifier = "childIdentifier_example"; // string | Either auth key or id of reseller's child
-
-try {
- $result = $apiInstance->getChildInfo($childIdentifier);
- print_r($result);
-} catch (Exception $e) {
- echo 'Exception when calling ResellerApi->getChildInfo: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **childIdentifier** | **string**| Either auth key or id of reseller's child |
-
-### Return type
-
-[**\Brevo\Client\Model\GetChildInfo**](../Model/GetChildInfo.md)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **getResellerChilds**
-> \Brevo\Client\Model\GetChildrenList getResellerChilds($limit, $offset)
-
-Get the list of all children accounts
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\ResellerApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$limit = 10; // int | Number of documents for child accounts information per page
-$offset = 0; // int | Index of the first document in the page
-
-try {
- $result = $apiInstance->getResellerChilds($limit, $offset);
- print_r($result);
-} catch (Exception $e) {
- echo 'Exception when calling ResellerApi->getResellerChilds: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **limit** | **int**| Number of documents for child accounts information per page | [optional] [default to 10]
- **offset** | **int**| Index of the first document in the page | [optional] [default to 0]
-
-### Return type
-
-[**\Brevo\Client\Model\GetChildrenList**](../Model/GetChildrenList.md)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **getSsoToken**
-> \Brevo\Client\Model\GetSsoToken getSsoToken($childIdentifier)
-
-Get session token to access Brevo (SSO)
-
-It returns a session [token] which will remain valid for a short period of time. A child account will be able to access a white-labeled section by using the following url pattern => https:/email.mydomain.com/login/sso?token=[token]
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\ResellerApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$childIdentifier = "childIdentifier_example"; // string | Either auth key or id of reseller's child
-
-try {
- $result = $apiInstance->getSsoToken($childIdentifier);
- print_r($result);
-} catch (Exception $e) {
- echo 'Exception when calling ResellerApi->getSsoToken: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **childIdentifier** | **string**| Either auth key or id of reseller's child |
-
-### Return type
-
-[**\Brevo\Client\Model\GetSsoToken**](../Model/GetSsoToken.md)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **removeCredits**
-> \Brevo\Client\Model\RemainingCreditModel removeCredits($childIdentifier, $removeCredits)
-
-Remove Email and/or SMS credits from a specific child account
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\ResellerApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$childIdentifier = "childIdentifier_example"; // string | Either auth key or id of reseller's child
-$removeCredits = new \Brevo\Client\Model\RemoveCredits(); // \Brevo\Client\Model\RemoveCredits | Values to post to remove email or SMS credits from a specific child account
-
-try {
- $result = $apiInstance->removeCredits($childIdentifier, $removeCredits);
- print_r($result);
-} catch (Exception $e) {
- echo 'Exception when calling ResellerApi->removeCredits: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **childIdentifier** | **string**| Either auth key or id of reseller's child |
- **removeCredits** | [**\Brevo\Client\Model\RemoveCredits**](../Model/RemoveCredits.md)| Values to post to remove email or SMS credits from a specific child account |
-
-### Return type
-
-[**\Brevo\Client\Model\RemainingCreditModel**](../Model/RemainingCreditModel.md)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **updateChildAccountStatus**
-> updateChildAccountStatus($childIdentifier, $updateChildAccountStatus)
-
-Update info of reseller's child account status based on the childIdentifier supplied
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\ResellerApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$childIdentifier = "childIdentifier_example"; // string | Either auth key or id of reseller's child
-$updateChildAccountStatus = new \Brevo\Client\Model\UpdateChildAccountStatus(); // \Brevo\Client\Model\UpdateChildAccountStatus | values to update in child account status
-
-try {
- $apiInstance->updateChildAccountStatus($childIdentifier, $updateChildAccountStatus);
-} catch (Exception $e) {
- echo 'Exception when calling ResellerApi->updateChildAccountStatus: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **childIdentifier** | **string**| Either auth key or id of reseller's child |
- **updateChildAccountStatus** | [**\Brevo\Client\Model\UpdateChildAccountStatus**](../Model/UpdateChildAccountStatus.md)| values to update in child account status |
-
-### Return type
-
-void (empty response body)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **updateChildDomain**
-> updateChildDomain($childIdentifier, $domainName, $updateChildDomain)
-
-Update the sender domain of reseller's child based on the childIdentifier and domainName passed
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\ResellerApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$childIdentifier = "childIdentifier_example"; // string | Either auth key or id of reseller's child
-$domainName = "domainName_example"; // string | Pass the existing domain that needs to be updated
-$updateChildDomain = new \Brevo\Client\Model\UpdateChildDomain(); // \Brevo\Client\Model\UpdateChildDomain | value to update for sender domain
-
-try {
- $apiInstance->updateChildDomain($childIdentifier, $domainName, $updateChildDomain);
-} catch (Exception $e) {
- echo 'Exception when calling ResellerApi->updateChildDomain: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **childIdentifier** | **string**| Either auth key or id of reseller's child |
- **domainName** | **string**| Pass the existing domain that needs to be updated |
- **updateChildDomain** | [**\Brevo\Client\Model\UpdateChildDomain**](../Model/UpdateChildDomain.md)| value to update for sender domain |
-
-### Return type
-
-void (empty response body)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **updateResellerChild**
-> updateResellerChild($childIdentifier, $resellerChild)
-
-Update info of reseller's child based on the child identifier supplied
-
-### Example
-```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\ResellerApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$childIdentifier = "childIdentifier_example"; // string | Either auth key or id of reseller's child
-$resellerChild = new \Brevo\Client\Model\UpdateChild(); // \Brevo\Client\Model\UpdateChild | values to update in child profile
-
-try {
- $apiInstance->updateResellerChild($childIdentifier, $resellerChild);
-} catch (Exception $e) {
- echo 'Exception when calling ResellerApi->updateResellerChild: ', $e->getMessage(), PHP_EOL;
-}
-?>
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **childIdentifier** | **string**| Either auth key or id of reseller's child |
- **resellerChild** | [**\Brevo\Client\Model\UpdateChild**](../Model/UpdateChild.md)| values to update in child profile |
-
-### Return type
-
-void (empty response body)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
diff --git a/docs/Api/RewardsApi.md b/docs/Api/RewardsApi.md
new file mode 100644
index 0000000..4503905
--- /dev/null
+++ b/docs/Api/RewardsApi.md
@@ -0,0 +1,362 @@
+# Brevo\Client\RewardsApi
+
+All URIs are relative to https://api.brevo.com/v3, except if the operation defines another base path.
+
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**attributeReward()**](RewardsApi.md#attributeReward) | **POST** /loyalty/offer/programs/{loyaltyProgramId}/rewards/attribute | Attribute reward to a contact |
+| [**getOffersList()**](RewardsApi.md#getOffersList) | **GET** /loyalty/offer/programs/{loyaltyProgramId}/offers | Get Reward list |
+| [**redeemReward()**](RewardsApi.md#redeemReward) | **POST** /loyalty/offer/programs/{loyaltyProgramId}/rewards/redeem | Redeem reward |
+| [**revokeReward()**](RewardsApi.md#revokeReward) | **DELETE** /loyalty/offer/programs/{loyaltyProgramId}/rewards/revoke | Revoke reward |
+| [**validateReward()**](RewardsApi.md#validateReward) | **POST** /loyalty/offer/programs/{loyaltyProgramId}/rewards/validate | Validates a voucher |
+
+
+## `attributeReward()`
+
+```php
+attributeReward($loyaltyProgramId, $attributeRewardPayload): \Brevo\Client\Models\RewardAttributionResponse
+```
+
+Attribute reward to a contact
+
+Attributes reward to a new contact
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\RewardsApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$attributeRewardPayload = new \Brevo\Client\Models\AttributeRewardPayload(); // \Brevo\Client\Models\AttributeRewardPayload | Attribute reward information (One of contactId and loyaltySubscriptionId must be provided.)
+
+try {
+ $result = $apiInstance->attributeReward($loyaltyProgramId, $attributeRewardPayload);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling RewardsApi->attributeReward: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **attributeRewardPayload** | [**\Brevo\Client\Models\AttributeRewardPayload**](../Model/AttributeRewardPayload.md)| Attribute reward information (One of contactId and loyaltySubscriptionId must be provided.) | |
+
+### Return type
+
+[**\Brevo\Client\Models\RewardAttributionResponse**](../Model/RewardAttributionResponse.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `getOffersList()`
+
+```php
+getOffersList($loyaltyProgramId, $limit, $offset, $rewardState, $rewardVersion): \Brevo\Client\Models\OffersListResponse
+```
+
+Get Reward list
+
+Returns a list of rewards for a given loyalty program
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\RewardsApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$limit = 100; // int | Number of documents per page
+$offset = 0; // int | Index of the first document in the page
+$rewardState = 'all'; // string | State of the reward
+$rewardVersion = 'draft'; // string | Select 'active' to retrieve list of all rewards which are live for clients. Select draft to retrieve list of all non deleted rewards.
+
+try {
+ $result = $apiInstance->getOffersList($loyaltyProgramId, $limit, $offset, $rewardState, $rewardVersion);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling RewardsApi->getOffersList: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **limit** | **int**| Number of documents per page | [optional] [default to 100] |
+| **offset** | **int**| Index of the first document in the page | [optional] [default to 0] |
+| **rewardState** | **string**| State of the reward | [optional] [default to 'all'] |
+| **rewardVersion** | **string**| Select 'active' to retrieve list of all rewards which are live for clients. Select draft to retrieve list of all non deleted rewards. | [optional] [default to 'draft'] |
+
+### Return type
+
+[**\Brevo\Client\Models\OffersListResponse**](../Model/OffersListResponse.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `redeemReward()`
+
+```php
+redeemReward($loyaltyProgramId, $redeemRewardPayload): \Brevo\Client\Models\RewardRedeemResponse
+```
+
+Redeem reward
+
+Redeems/Burn a reward for a contact
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\RewardsApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$redeemRewardPayload = new \Brevo\Client\Models\RedeemRewardPayload(); // \Brevo\Client\Models\RedeemRewardPayload | Redeemed reward information (Either contactId or loyaltySubscriptionId must be present.)
+
+try {
+ $result = $apiInstance->redeemReward($loyaltyProgramId, $redeemRewardPayload);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling RewardsApi->redeemReward: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **redeemRewardPayload** | [**\Brevo\Client\Models\RedeemRewardPayload**](../Model/RedeemRewardPayload.md)| Redeemed reward information (Either contactId or loyaltySubscriptionId must be present.) | |
+
+### Return type
+
+[**\Brevo\Client\Models\RewardRedeemResponse**](../Model/RewardRedeemResponse.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `revokeReward()`
+
+```php
+revokeReward($loyaltyProgramId, $attributedRewardId)
+```
+
+Revoke reward
+
+Revokes reward
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\RewardsApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$attributedRewardId = 'attributedRewardId_example'; // string | Attributed Reward Id
+
+try {
+ $apiInstance->revokeReward($loyaltyProgramId, $attributedRewardId);
+} catch (Exception $e) {
+ echo 'Exception when calling RewardsApi->revokeReward: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **attributedRewardId** | **string**| Attributed Reward Id | |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `validateReward()`
+
+```php
+validateReward($loyaltyProgramId, $validateRewardPayload): \Brevo\Client\Models\ValidatedRewardResponse
+```
+
+Validates a voucher
+
+Validates a reward for a contact and return the response
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\RewardsApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$validateRewardPayload = new \Brevo\Client\Models\ValidateRewardPayload(); // \Brevo\Client\Models\ValidateRewardPayload | Validate reward information (One of contactId and loyaltySubscriptionId must be present, or one of code and attributedRewardId must be present.)
+
+try {
+ $result = $apiInstance->validateReward($loyaltyProgramId, $validateRewardPayload);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling RewardsApi->validateReward: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **validateRewardPayload** | [**\Brevo\Client\Models\ValidateRewardPayload**](../Model/ValidateRewardPayload.md)| Validate reward information (One of contactId and loyaltySubscriptionId must be present, or one of code and attributedRewardId must be present.) | |
+
+### Return type
+
+[**\Brevo\Client\Models\ValidatedRewardResponse**](../Model/ValidatedRewardResponse.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
diff --git a/docs/Api/SMSCampaignsApi.md b/docs/Api/SMSCampaignsApi.md
index ac37a41..55a607a 100644
--- a/docs/Api/SMSCampaignsApi.md
+++ b/docs/Api/SMSCampaignsApi.md
@@ -1,47 +1,54 @@
# Brevo\Client\SMSCampaignsApi
-All URIs are relative to *https://api.brevo.com/v3*
+All URIs are relative to https://api.brevo.com/v3, except if the operation defines another base path.
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**createSmsCampaign**](SMSCampaignsApi.md#createSmsCampaign) | **POST** /smsCampaigns | Creates an SMS campaign
-[**deleteSmsCampaign**](SMSCampaignsApi.md#deleteSmsCampaign) | **DELETE** /smsCampaigns/{campaignId} | Delete an SMS campaign
-[**getSmsCampaign**](SMSCampaignsApi.md#getSmsCampaign) | **GET** /smsCampaigns/{campaignId} | Get an SMS campaign
-[**getSmsCampaigns**](SMSCampaignsApi.md#getSmsCampaigns) | **GET** /smsCampaigns | Returns the information for all your created SMS campaigns
-[**requestSmsRecipientExport**](SMSCampaignsApi.md#requestSmsRecipientExport) | **POST** /smsCampaigns/{campaignId}/exportRecipients | Export an SMS campaign's recipients
-[**sendSmsCampaignNow**](SMSCampaignsApi.md#sendSmsCampaignNow) | **POST** /smsCampaigns/{campaignId}/sendNow | Send your SMS campaign immediately
-[**sendSmsReport**](SMSCampaignsApi.md#sendSmsReport) | **POST** /smsCampaigns/{campaignId}/sendReport | Send an SMS campaign's report
-[**sendTestSms**](SMSCampaignsApi.md#sendTestSms) | **POST** /smsCampaigns/{campaignId}/sendTest | Send a test SMS campaign
-[**updateSmsCampaign**](SMSCampaignsApi.md#updateSmsCampaign) | **PUT** /smsCampaigns/{campaignId} | Update an SMS campaign
-[**updateSmsCampaignStatus**](SMSCampaignsApi.md#updateSmsCampaignStatus) | **PUT** /smsCampaigns/{campaignId}/status | Update a campaign's status
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**createSmsCampaign()**](SMSCampaignsApi.md#createSmsCampaign) | **POST** /smsCampaigns | Creates an SMS campaign |
+| [**deleteSmsCampaign()**](SMSCampaignsApi.md#deleteSmsCampaign) | **DELETE** /smsCampaigns/{campaignId} | Delete an SMS campaign |
+| [**getSmsCampaign()**](SMSCampaignsApi.md#getSmsCampaign) | **GET** /smsCampaigns/{campaignId} | Get an SMS campaign |
+| [**getSmsCampaigns()**](SMSCampaignsApi.md#getSmsCampaigns) | **GET** /smsCampaigns | Returns the information for all your created SMS campaigns |
+| [**requestSmsRecipientExport()**](SMSCampaignsApi.md#requestSmsRecipientExport) | **POST** /smsCampaigns/{campaignId}/exportRecipients | Export an SMS campaign's recipients |
+| [**sendSmsCampaignNow()**](SMSCampaignsApi.md#sendSmsCampaignNow) | **POST** /smsCampaigns/{campaignId}/sendNow | Send your SMS campaign immediately |
+| [**sendSmsReport()**](SMSCampaignsApi.md#sendSmsReport) | **POST** /smsCampaigns/{campaignId}/sendReport | Send an SMS campaign's report |
+| [**sendTestSms()**](SMSCampaignsApi.md#sendTestSms) | **POST** /smsCampaigns/{campaignId}/sendTest | Send a test SMS campaign |
+| [**updateSmsCampaign()**](SMSCampaignsApi.md#updateSmsCampaign) | **PUT** /smsCampaigns/{campaignId} | Update an SMS campaign |
+| [**updateSmsCampaignStatus()**](SMSCampaignsApi.md#updateSmsCampaignStatus) | **PUT** /smsCampaigns/{campaignId}/status | Update a campaign's status |
-# **createSmsCampaign**
-> \Brevo\Client\Model\CreateModel createSmsCampaign($createSmsCampaign)
+## `createSmsCampaign()`
+
+```php
+createSmsCampaign($createSmsCampaign): \Brevo\Client\Models\CreateModel
+```
Creates an SMS campaign
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\SMSCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$createSmsCampaign = new \Brevo\Client\Model\CreateSmsCampaign(); // \Brevo\Client\Model\CreateSmsCampaign | Values to create an SMS Campaign
+$createSmsCampaign = new \Brevo\Client\Models\CreateSmsCampaign(); // \Brevo\Client\Models\CreateSmsCampaign | Values to create an SMS Campaign
try {
$result = $apiInstance->createSmsCampaign($createSmsCampaign);
@@ -49,18 +56,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling SMSCampaignsApi->createSmsCampaign: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **createSmsCampaign** | [**\Brevo\Client\Model\CreateSmsCampaign**](../Model/CreateSmsCampaign.md)| Values to create an SMS Campaign |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **createSmsCampaign** | [**\Brevo\Client\Models\CreateSmsCampaign**](../Model/CreateSmsCampaign.md)| Values to create an SMS Campaign | |
### Return type
-[**\Brevo\Client\Model\CreateModel**](../Model/CreateModel.md)
+[**\Brevo\Client\Models\CreateModel**](../Model/CreateModel.md)
### Authorization
@@ -68,51 +74,59 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **deleteSmsCampaign**
-> deleteSmsCampaign($campaignId)
+## `deleteSmsCampaign()`
+
+```php
+deleteSmsCampaign($campaignId)
+```
Delete an SMS campaign
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\SMSCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$campaignId = 789; // int | id of the SMS campaign
+$campaignId = 56; // int | id of the SMS campaign
try {
$apiInstance->deleteSmsCampaign($campaignId);
} catch (Exception $e) {
echo 'Exception when calling SMSCampaignsApi->deleteSmsCampaign: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **campaignId** | **int**| id of the SMS campaign |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **campaignId** | **int**| id of the SMS campaign | |
### Return type
@@ -124,37 +138,46 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getSmsCampaign**
-> \Brevo\Client\Model\GetSmsCampaign getSmsCampaign($campaignId)
+## `getSmsCampaign()`
+
+```php
+getSmsCampaign($campaignId): \Brevo\Client\Models\GetSmsCampaign
+```
Get an SMS campaign
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\SMSCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$campaignId = 789; // int | id of the SMS campaign
+$campaignId = 56; // int | id of the SMS campaign
try {
$result = $apiInstance->getSmsCampaign($campaignId);
@@ -162,18 +185,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling SMSCampaignsApi->getSmsCampaign: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **campaignId** | **int**| id of the SMS campaign |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **campaignId** | **int**| id of the SMS campaign | |
### Return type
-[**\Brevo\Client\Model\GetSmsCampaign**](../Model/GetSmsCampaign.md)
+[**\Brevo\Client\Models\GetSmsCampaign**](../Model/GetSmsCampaign.md)
### Authorization
@@ -181,42 +203,51 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getSmsCampaigns**
-> \Brevo\Client\Model\GetSmsCampaigns getSmsCampaigns($status, $startDate, $endDate, $limit, $offset, $sort)
+## `getSmsCampaigns()`
+
+```php
+getSmsCampaigns($status, $startDate, $endDate, $limit, $offset, $sort): \Brevo\Client\Models\GetSmsCampaigns
+```
Returns the information for all your created SMS campaigns
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\SMSCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$status = "status_example"; // string | Status of campaign.
-$startDate = "startDate_example"; // string | Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' )
-$endDate = "endDate_example"; // string | Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' )
+$status = 'status_example'; // string | Status of campaign.
+$startDate = 'startDate_example'; // string | **Mandatory if endDate is used.** Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' )
+$endDate = 'endDate_example'; // string | **Mandatory if startDate is used.** Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' )
$limit = 500; // int | Number limitation for the result returned
$offset = 0; // int | Beginning point in the list to retrieve from.
-$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
+$sort = 'desc'; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
try {
$result = $apiInstance->getSmsCampaigns($status, $startDate, $endDate, $limit, $offset, $sort);
@@ -224,23 +255,22 @@ try {
} catch (Exception $e) {
echo 'Exception when calling SMSCampaignsApi->getSmsCampaigns: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **status** | **string**| Status of campaign. | [optional]
- **startDate** | **string**| Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) | [optional]
- **endDate** | **string**| Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) | [optional]
- **limit** | **int**| Number limitation for the result returned | [optional] [default to 500]
- **offset** | **int**| Beginning point in the list to retrieve from. | [optional] [default to 0]
- **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **status** | **string**| Status of campaign. | [optional] |
+| **startDate** | **string**| **Mandatory if endDate is used.** Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) | [optional] |
+| **endDate** | **string**| **Mandatory if startDate is used.** Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) | [optional] |
+| **limit** | **int**| Number limitation for the result returned | [optional] [default to 500] |
+| **offset** | **int**| Beginning point in the list to retrieve from. | [optional] [default to 0] |
+| **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to 'desc'] |
### Return type
-[**\Brevo\Client\Model\GetSmsCampaigns**](../Model/GetSmsCampaigns.md)
+[**\Brevo\Client\Models\GetSmsCampaigns**](../Model/GetSmsCampaigns.md)
### Authorization
@@ -248,40 +278,49 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **requestSmsRecipientExport**
-> \Brevo\Client\Model\CreatedProcessId requestSmsRecipientExport($campaignId, $recipientExport)
+## `requestSmsRecipientExport()`
+
+```php
+requestSmsRecipientExport($campaignId, $recipientExport): \Brevo\Client\Models\CreatedProcessId
+```
Export an SMS campaign's recipients
It returns the background process ID which on completion calls the notify URL that you have set in the input.
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\SMSCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$campaignId = 789; // int | id of the campaign
-$recipientExport = new \Brevo\Client\Model\RequestSmsRecipientExport(); // \Brevo\Client\Model\RequestSmsRecipientExport | Values to send for a recipient export request
+$campaignId = 56; // int | id of the campaign
+$recipientExport = new \Brevo\Client\Models\RequestSmsRecipientExport(); // \Brevo\Client\Models\RequestSmsRecipientExport | Values to send for a recipient export request
try {
$result = $apiInstance->requestSmsRecipientExport($campaignId, $recipientExport);
@@ -289,19 +328,18 @@ try {
} catch (Exception $e) {
echo 'Exception when calling SMSCampaignsApi->requestSmsRecipientExport: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **campaignId** | **int**| id of the campaign |
- **recipientExport** | [**\Brevo\Client\Model\RequestSmsRecipientExport**](../Model/RequestSmsRecipientExport.md)| Values to send for a recipient export request | [optional]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **campaignId** | **int**| id of the campaign | |
+| **recipientExport** | [**\Brevo\Client\Models\RequestSmsRecipientExport**](../Model/RequestSmsRecipientExport.md)| Values to send for a recipient export request | [optional] |
### Return type
-[**\Brevo\Client\Model\CreatedProcessId**](../Model/CreatedProcessId.md)
+[**\Brevo\Client\Models\CreatedProcessId**](../Model/CreatedProcessId.md)
### Authorization
@@ -309,51 +347,59 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **sendSmsCampaignNow**
-> sendSmsCampaignNow($campaignId)
+## `sendSmsCampaignNow()`
+
+```php
+sendSmsCampaignNow($campaignId)
+```
Send your SMS campaign immediately
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\SMSCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$campaignId = 789; // int | id of the campaign
+$campaignId = 56; // int | id of the campaign
try {
$apiInstance->sendSmsCampaignNow($campaignId);
} catch (Exception $e) {
echo 'Exception when calling SMSCampaignsApi->sendSmsCampaignNow: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **campaignId** | **int**| id of the campaign |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **campaignId** | **int**| id of the campaign | |
### Return type
@@ -365,55 +411,63 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `sendSmsReport()`
-# **sendSmsReport**
-> sendSmsReport($campaignId, $sendReport)
+```php
+sendSmsReport($campaignId, $sendReport)
+```
Send an SMS campaign's report
Send report of Sent and Archived campaign, to the specified email addresses, with respective data and a pdf attachment in detail.
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\SMSCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$campaignId = 789; // int | id of the campaign
-$sendReport = new \Brevo\Client\Model\SendReport(); // \Brevo\Client\Model\SendReport | Values for send a report
+$campaignId = 56; // int | id of the campaign
+$sendReport = new \Brevo\Client\Models\SendReport(); // \Brevo\Client\Models\SendReport | Values for send a report
try {
$apiInstance->sendSmsReport($campaignId, $sendReport);
} catch (Exception $e) {
echo 'Exception when calling SMSCampaignsApi->sendSmsReport: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **campaignId** | **int**| id of the campaign |
- **sendReport** | [**\Brevo\Client\Model\SendReport**](../Model/SendReport.md)| Values for send a report |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **campaignId** | **int**| id of the campaign | |
+| **sendReport** | [**\Brevo\Client\Models\SendReport**](../Model/SendReport.md)| Values for send a report | |
### Return type
@@ -425,53 +479,61 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **sendTestSms**
-> sendTestSms($campaignId, $phoneNumber)
+## `sendTestSms()`
+
+```php
+sendTestSms($campaignId, $sendTestSms)
+```
Send a test SMS campaign
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\SMSCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$campaignId = 789; // int | Id of the SMS campaign
-$phoneNumber = new \Brevo\Client\Model\SendTestSms(); // \Brevo\Client\Model\SendTestSms | Mobile number of the recipient with the country code. This number must belong to one of your contacts in Brevo account and must not be blacklisted
+$campaignId = 56; // int | Id of the SMS campaign
+$sendTestSms = new \Brevo\Client\Models\SendTestSms(); // \Brevo\Client\Models\SendTestSms | Mobile number of the recipient with the country code. This number **must belong to one of your contacts in Brevo account and must not be blacklisted**
try {
- $apiInstance->sendTestSms($campaignId, $phoneNumber);
+ $apiInstance->sendTestSms($campaignId, $sendTestSms);
} catch (Exception $e) {
echo 'Exception when calling SMSCampaignsApi->sendTestSms: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **campaignId** | **int**| Id of the SMS campaign |
- **phoneNumber** | [**\Brevo\Client\Model\SendTestSms**](../Model/SendTestSms.md)| Mobile number of the recipient with the country code. This number must belong to one of your contacts in Brevo account and must not be blacklisted |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **campaignId** | **int**| Id of the SMS campaign | |
+| **sendTestSms** | [**\Brevo\Client\Models\SendTestSms**](../Model/SendTestSms.md)| Mobile number of the recipient with the country code. This number **must belong to one of your contacts in Brevo account and must not be blacklisted** | |
### Return type
@@ -483,53 +545,61 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `updateSmsCampaign()`
-# **updateSmsCampaign**
-> updateSmsCampaign($campaignId, $updateSmsCampaign)
+```php
+updateSmsCampaign($campaignId, $updateSmsCampaign)
+```
Update an SMS campaign
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\SMSCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$campaignId = 789; // int | id of the SMS campaign
-$updateSmsCampaign = new \Brevo\Client\Model\UpdateSmsCampaign(); // \Brevo\Client\Model\UpdateSmsCampaign | Values to update an SMS Campaign
+$campaignId = 56; // int | id of the SMS campaign
+$updateSmsCampaign = new \Brevo\Client\Models\UpdateSmsCampaign(); // \Brevo\Client\Models\UpdateSmsCampaign | Values to update an SMS Campaign
try {
$apiInstance->updateSmsCampaign($campaignId, $updateSmsCampaign);
} catch (Exception $e) {
echo 'Exception when calling SMSCampaignsApi->updateSmsCampaign: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **campaignId** | **int**| id of the SMS campaign |
- **updateSmsCampaign** | [**\Brevo\Client\Model\UpdateSmsCampaign**](../Model/UpdateSmsCampaign.md)| Values to update an SMS Campaign |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **campaignId** | **int**| id of the SMS campaign | |
+| **updateSmsCampaign** | [**\Brevo\Client\Models\UpdateSmsCampaign**](../Model/UpdateSmsCampaign.md)| Values to update an SMS Campaign | |
### Return type
@@ -541,53 +611,61 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **updateSmsCampaignStatus**
-> updateSmsCampaignStatus($campaignId, $status)
+## `updateSmsCampaignStatus()`
+
+```php
+updateSmsCampaignStatus($campaignId, $status)
+```
Update a campaign's status
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\SMSCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$campaignId = 789; // int | id of the campaign
-$status = new \Brevo\Client\Model\UpdateCampaignStatus(); // \Brevo\Client\Model\UpdateCampaignStatus | Status of the campaign.
+$campaignId = 56; // int | id of the campaign
+$status = new \Brevo\Client\Models\UpdateCampaignStatus(); // \Brevo\Client\Models\UpdateCampaignStatus | Status of the campaign.
try {
$apiInstance->updateSmsCampaignStatus($campaignId, $status);
} catch (Exception $e) {
echo 'Exception when calling SMSCampaignsApi->updateSmsCampaignStatus: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **campaignId** | **int**| id of the campaign |
- **status** | [**\Brevo\Client\Model\UpdateCampaignStatus**](../Model/UpdateCampaignStatus.md)| Status of the campaign. |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **campaignId** | **int**| id of the campaign | |
+| **status** | [**\Brevo\Client\Models\UpdateCampaignStatus**](../Model/UpdateCampaignStatus.md)| Status of the campaign. | |
### Return type
@@ -599,8 +677,9 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+- **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)
diff --git a/docs/Api/SendersApi.md b/docs/Api/SendersApi.md
index 53a1e77..58da459 100644
--- a/docs/Api/SendersApi.md
+++ b/docs/Api/SendersApi.md
@@ -1,44 +1,51 @@
# Brevo\Client\SendersApi
-All URIs are relative to *https://api.brevo.com/v3*
+All URIs are relative to https://api.brevo.com/v3, except if the operation defines another base path.
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**createSender**](SendersApi.md#createSender) | **POST** /senders | Create a new sender
-[**deleteSender**](SendersApi.md#deleteSender) | **DELETE** /senders/{senderId} | Delete a sender
-[**getIps**](SendersApi.md#getIps) | **GET** /senders/ips | Get all the dedicated IPs for your account
-[**getIpsFromSender**](SendersApi.md#getIpsFromSender) | **GET** /senders/{senderId}/ips | Get all the dedicated IPs for a sender
-[**getSenders**](SendersApi.md#getSenders) | **GET** /senders | Get the list of all your senders
-[**updateSender**](SendersApi.md#updateSender) | **PUT** /senders/{senderId} | Update a sender
-[**validateSenderByOTP**](SendersApi.md#validateSenderByOTP) | **PUT** /senders/{senderId}/validate | Update a sender
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**createSender()**](SendersApi.md#createSender) | **POST** /senders | Create a new sender |
+| [**deleteSender()**](SendersApi.md#deleteSender) | **DELETE** /senders/{senderId} | Delete a sender |
+| [**getIps()**](SendersApi.md#getIps) | **GET** /senders/ips | Get all the dedicated IPs for your account |
+| [**getIpsFromSender()**](SendersApi.md#getIpsFromSender) | **GET** /senders/{senderId}/ips | Get all the dedicated IPs for a sender |
+| [**getSenders()**](SendersApi.md#getSenders) | **GET** /senders | Get the list of all your senders |
+| [**updateSender()**](SendersApi.md#updateSender) | **PUT** /senders/{senderId} | Update a sender |
+| [**validateSenderByOTP()**](SendersApi.md#validateSenderByOTP) | **PUT** /senders/{senderId}/validate | Validate Sender using OTP |
-# **createSender**
-> \Brevo\Client\Model\CreateSenderModel createSender($sender)
+## `createSender()`
+
+```php
+createSender($sender): \Brevo\Client\Models\CreateSenderModel
+```
Create a new sender
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\SendersApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$sender = new \Brevo\Client\Model\CreateSender(); // \Brevo\Client\Model\CreateSender | sender's name
+$sender = new \Brevo\Client\Models\CreateSender(); // \Brevo\Client\Models\CreateSender | sender's name
try {
$result = $apiInstance->createSender($sender);
@@ -46,18 +53,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling SendersApi->createSender: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **sender** | [**\Brevo\Client\Model\CreateSender**](../Model/CreateSender.md)| sender's name | [optional]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **sender** | [**\Brevo\Client\Models\CreateSender**](../Model/CreateSender.md)| sender's name | [optional] |
### Return type
-[**\Brevo\Client\Model\CreateSenderModel**](../Model/CreateSenderModel.md)
+[**\Brevo\Client\Models\CreateSenderModel**](../Model/CreateSenderModel.md)
### Authorization
@@ -65,51 +71,59 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **deleteSender**
-> deleteSender($senderId)
+## `deleteSender()`
+
+```php
+deleteSender($senderId)
+```
Delete a sender
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\SendersApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$senderId = 789; // int | Id of the sender
+$senderId = 56; // int | Id of the sender
try {
$apiInstance->deleteSender($senderId);
} catch (Exception $e) {
echo 'Exception when calling SendersApi->deleteSender: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **senderId** | **int**| Id of the sender |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **senderId** | **int**| Id of the sender | |
### Return type
@@ -121,30 +135,39 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `getIps()`
-# **getIps**
-> \Brevo\Client\Model\GetIps getIps()
+```php
+getIps(): \Brevo\Client\Models\GetIps
+```
Get all the dedicated IPs for your account
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\SendersApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
@@ -158,15 +181,15 @@ try {
} catch (Exception $e) {
echo 'Exception when calling SendersApi->getIps: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
+
This endpoint does not need any parameter.
### Return type
-[**\Brevo\Client\Model\GetIps**](../Model/GetIps.md)
+[**\Brevo\Client\Models\GetIps**](../Model/GetIps.md)
### Authorization
@@ -174,37 +197,46 @@ This endpoint does not need any parameter.
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `getIpsFromSender()`
-# **getIpsFromSender**
-> \Brevo\Client\Model\GetIpsFromSender getIpsFromSender($senderId)
+```php
+getIpsFromSender($senderId): \Brevo\Client\Models\GetIpsFromSender
+```
Get all the dedicated IPs for a sender
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\SendersApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$senderId = 789; // int | Id of the sender
+$senderId = 56; // int | Id of the sender
try {
$result = $apiInstance->getIpsFromSender($senderId);
@@ -212,18 +244,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling SendersApi->getIpsFromSender: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **senderId** | **int**| Id of the sender |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **senderId** | **int**| Id of the sender | |
### Return type
-[**\Brevo\Client\Model\GetIpsFromSender**](../Model/GetIpsFromSender.md)
+[**\Brevo\Client\Models\GetIpsFromSender**](../Model/GetIpsFromSender.md)
### Authorization
@@ -231,38 +262,47 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getSenders**
-> \Brevo\Client\Model\GetSendersList getSenders($ip, $domain)
+## `getSenders()`
+
+```php
+getSenders($ip, $domain): \Brevo\Client\Models\GetSendersList
+```
Get the list of all your senders
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\SendersApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$ip = "ip_example"; // string | Filter your senders for a specific ip (available for dedicated IP usage only)
-$domain = "domain_example"; // string | Filter your senders for a specific domain
+$ip = 'ip_example'; // string | Filter your senders for a specific ip. **Available for dedicated IP usage only**
+$domain = 'domain_example'; // string | Filter your senders for a specific domain
try {
$result = $apiInstance->getSenders($ip, $domain);
@@ -270,19 +310,18 @@ try {
} catch (Exception $e) {
echo 'Exception when calling SendersApi->getSenders: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **ip** | **string**| Filter your senders for a specific ip (available for dedicated IP usage only) | [optional]
- **domain** | **string**| Filter your senders for a specific domain | [optional]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **ip** | **string**| Filter your senders for a specific ip. **Available for dedicated IP usage only** | [optional] |
+| **domain** | **string**| Filter your senders for a specific domain | [optional] |
### Return type
-[**\Brevo\Client\Model\GetSendersList**](../Model/GetSendersList.md)
+[**\Brevo\Client\Models\GetSendersList**](../Model/GetSendersList.md)
### Authorization
@@ -290,53 +329,61 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **updateSender**
-> updateSender($senderId, $sender)
+## `updateSender()`
+
+```php
+updateSender($senderId, $sender)
+```
Update a sender
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\SendersApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$senderId = 789; // int | Id of the sender
-$sender = new \Brevo\Client\Model\UpdateSender(); // \Brevo\Client\Model\UpdateSender | sender's name
+$senderId = 56; // int | Id of the sender
+$sender = new \Brevo\Client\Models\UpdateSender(); // \Brevo\Client\Models\UpdateSender | sender's name
try {
$apiInstance->updateSender($senderId, $sender);
} catch (Exception $e) {
echo 'Exception when calling SendersApi->updateSender: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **senderId** | **int**| Id of the sender |
- **sender** | [**\Brevo\Client\Model\UpdateSender**](../Model/UpdateSender.md)| sender's name | [optional]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **senderId** | **int**| Id of the sender | |
+| **sender** | [**\Brevo\Client\Models\UpdateSender**](../Model/UpdateSender.md)| sender's name | [optional] |
### Return type
@@ -348,53 +395,61 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **validateSenderByOTP**
-> validateSenderByOTP($senderId, $otp)
+## `validateSenderByOTP()`
-Update a sender
+```php
+validateSenderByOTP($senderId, $sender)
+```
+
+Validate Sender using OTP
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\SendersApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$senderId = 789; // int | Id of the sender
-$otp = new \Brevo\Client\Model\Otp(); // \Brevo\Client\Model\Otp | otp
+$senderId = 56; // int | Id of the sender
+$sender = new \Brevo\Client\Models\Otp(); // \Brevo\Client\Models\Otp | otp
try {
- $apiInstance->validateSenderByOTP($senderId, $otp);
+ $apiInstance->validateSenderByOTP($senderId, $sender);
} catch (Exception $e) {
echo 'Exception when calling SendersApi->validateSenderByOTP: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **senderId** | **int**| Id of the sender |
- **otp** | [**\Brevo\Client\Model\Otp**](../Model/Otp.md)| otp | [optional]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **senderId** | **int**| Id of the sender | |
+| **sender** | [**\Brevo\Client\Models\Otp**](../Model/Otp.md)| otp | [optional] |
### Return type
@@ -406,8 +461,9 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+- **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)
diff --git a/docs/Api/TasksApi.md b/docs/Api/TasksApi.md
index 0d9a90e..64d29ea 100644
--- a/docs/Api/TasksApi.md
+++ b/docs/Api/TasksApi.md
@@ -1,55 +1,62 @@
# Brevo\Client\TasksApi
-All URIs are relative to *https://api.brevo.com/v3*
+All URIs are relative to https://api.brevo.com/v3, except if the operation defines another base path.
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**crmTasksGet**](TasksApi.md#crmTasksGet) | **GET** /crm/tasks | Get all tasks
-[**crmTasksIdDelete**](TasksApi.md#crmTasksIdDelete) | **DELETE** /crm/tasks/{id} | Delete a task
-[**crmTasksIdGet**](TasksApi.md#crmTasksIdGet) | **GET** /crm/tasks/{id} | Get a task
-[**crmTasksIdPatch**](TasksApi.md#crmTasksIdPatch) | **PATCH** /crm/tasks/{id} | Update a task
-[**crmTasksPost**](TasksApi.md#crmTasksPost) | **POST** /crm/tasks | Create a task
-[**crmTasktypesGet**](TasksApi.md#crmTasktypesGet) | **GET** /crm/tasktypes | Get all task types
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**crmTasksGet()**](TasksApi.md#crmTasksGet) | **GET** /crm/tasks | Get all tasks |
+| [**crmTasksIdDelete()**](TasksApi.md#crmTasksIdDelete) | **DELETE** /crm/tasks/{id} | Delete a task |
+| [**crmTasksIdGet()**](TasksApi.md#crmTasksIdGet) | **GET** /crm/tasks/{id} | Get a task |
+| [**crmTasksIdPatch()**](TasksApi.md#crmTasksIdPatch) | **PATCH** /crm/tasks/{id} | Update a task |
+| [**crmTasksPost()**](TasksApi.md#crmTasksPost) | **POST** /crm/tasks | Create a task |
+| [**crmTasktypesGet()**](TasksApi.md#crmTasktypesGet) | **GET** /crm/tasktypes | Get all task types |
-# **crmTasksGet**
-> \Brevo\Client\Model\TaskList crmTasksGet($filterType, $filterStatus, $filterDate, $filterAssignTo, $filterContacts, $filterDeals, $filterCompanies, $dateFrom, $dateTo, $offset, $limit, $sort, $sortBy)
+## `crmTasksGet()`
+
+```php
+crmTasksGet($filterType, $filterStatus, $filterDate, $filterAssignTo, $filterContacts, $filterDeals, $filterCompanies, $dateFrom, $dateTo, $offset, $limit, $sort, $sortBy): \Brevo\Client\Models\TaskList
+```
Get all tasks
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TasksApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$filterType = "filterType_example"; // string | Filter by task type (ID)
-$filterStatus = "filterStatus_example"; // string | Filter by task status
-$filterDate = "filterDate_example"; // string | Filter by date
-$filterAssignTo = "filterAssignTo_example"; // string | Filter by assignTo id
-$filterContacts = "filterContacts_example"; // string | Filter by contact ids
-$filterDeals = "filterDeals_example"; // string | Filter by deals ids
-$filterCompanies = "filterCompanies_example"; // string | Filter by companies ids
+$filterType = 'filterType_example'; // string | Filter by task type (ID)
+$filterStatus = 'filterStatus_example'; // string | Filter by task status
+$filterDate = 'filterDate_example'; // string | Filter by date
+$filterAssignTo = 'filterAssignTo_example'; // string | Filter by the \"assignTo\" ID. You can utilize account emails for the \"assignTo\" attribute.
+$filterContacts = 'filterContacts_example'; // string | Filter by contact ids
+$filterDeals = 'filterDeals_example'; // string | Filter by deals ids
+$filterCompanies = 'filterCompanies_example'; // string | Filter by companies ids
$dateFrom = 56; // int | dateFrom to date range filter type (timestamp in milliseconds)
$dateTo = 56; // int | dateTo to date range filter type (timestamp in milliseconds)
-$offset = 789; // int | Index of the first document of the page
+$offset = 56; // int | Index of the first document of the page
$limit = 50; // int | Number of documents per page
-$sort = "sort_example"; // string | Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed
-$sortBy = "sortBy_example"; // string | The field used to sort field names.
+$sort = 'sort_example'; // string | Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed
+$sortBy = name; // string | The field used to sort field names.
try {
$result = $apiInstance->crmTasksGet($filterType, $filterStatus, $filterDate, $filterAssignTo, $filterContacts, $filterDeals, $filterCompanies, $dateFrom, $dateTo, $offset, $limit, $sort, $sortBy);
@@ -57,30 +64,29 @@ try {
} catch (Exception $e) {
echo 'Exception when calling TasksApi->crmTasksGet: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **filterType** | **string**| Filter by task type (ID) | [optional]
- **filterStatus** | **string**| Filter by task status | [optional]
- **filterDate** | **string**| Filter by date | [optional]
- **filterAssignTo** | **string**| Filter by assignTo id | [optional]
- **filterContacts** | **string**| Filter by contact ids | [optional]
- **filterDeals** | **string**| Filter by deals ids | [optional]
- **filterCompanies** | **string**| Filter by companies ids | [optional]
- **dateFrom** | **int**| dateFrom to date range filter type (timestamp in milliseconds) | [optional]
- **dateTo** | **int**| dateTo to date range filter type (timestamp in milliseconds) | [optional]
- **offset** | **int**| Index of the first document of the page | [optional]
- **limit** | **int**| Number of documents per page | [optional] [default to 50]
- **sort** | **string**| Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed | [optional]
- **sortBy** | **string**| The field used to sort field names. | [optional]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **filterType** | **string**| Filter by task type (ID) | [optional] |
+| **filterStatus** | **string**| Filter by task status | [optional] |
+| **filterDate** | **string**| Filter by date | [optional] |
+| **filterAssignTo** | **string**| Filter by the \"assignTo\" ID. You can utilize account emails for the \"assignTo\" attribute. | [optional] |
+| **filterContacts** | **string**| Filter by contact ids | [optional] |
+| **filterDeals** | **string**| Filter by deals ids | [optional] |
+| **filterCompanies** | **string**| Filter by companies ids | [optional] |
+| **dateFrom** | **int**| dateFrom to date range filter type (timestamp in milliseconds) | [optional] |
+| **dateTo** | **int**| dateTo to date range filter type (timestamp in milliseconds) | [optional] |
+| **offset** | **int**| Index of the first document of the page | [optional] |
+| **limit** | **int**| Number of documents per page | [optional] [default to 50] |
+| **sort** | **string**| Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed | [optional] |
+| **sortBy** | **string**| The field used to sort field names. | [optional] |
### Return type
-[**\Brevo\Client\Model\TaskList**](../Model/TaskList.md)
+[**\Brevo\Client\Models\TaskList**](../Model/TaskList.md)
### Authorization
@@ -88,51 +94,59 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **crmTasksIdDelete**
-> crmTasksIdDelete($id)
+## `crmTasksIdDelete()`
+
+```php
+crmTasksIdDelete($id)
+```
Delete a task
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TasksApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = "id_example"; // string |
+$id = 'id_example'; // string
try {
$apiInstance->crmTasksIdDelete($id);
} catch (Exception $e) {
echo 'Exception when calling TasksApi->crmTasksIdDelete: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| | |
### Return type
@@ -144,37 +158,46 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **crmTasksIdGet**
-> \Brevo\Client\Model\Task crmTasksIdGet($id)
+## `crmTasksIdGet()`
+
+```php
+crmTasksIdGet($id): \Brevo\Client\Models\Task
+```
Get a task
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TasksApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = "id_example"; // string |
+$id = 'id_example'; // string
try {
$result = $apiInstance->crmTasksIdGet($id);
@@ -182,18 +205,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling TasksApi->crmTasksIdGet: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| | |
### Return type
-[**\Brevo\Client\Model\Task**](../Model/Task.md)
+[**\Brevo\Client\Models\Task**](../Model/Task.md)
### Authorization
@@ -201,53 +223,61 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `crmTasksIdPatch()`
-# **crmTasksIdPatch**
-> crmTasksIdPatch($id, $body)
+```php
+crmTasksIdPatch($id, $crmTasksIdPatchRequest)
+```
Update a task
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TasksApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$id = "id_example"; // string |
-$body = new \Brevo\Client\Model\Body9(); // \Brevo\Client\Model\Body9 | Updated task details.
+$id = 'id_example'; // string
+$crmTasksIdPatchRequest = new \Brevo\Client\Models\CrmTasksIdPatchRequest(); // \Brevo\Client\Models\CrmTasksIdPatchRequest | Updated task details.
try {
- $apiInstance->crmTasksIdPatch($id, $body);
+ $apiInstance->crmTasksIdPatch($id, $crmTasksIdPatchRequest);
} catch (Exception $e) {
echo 'Exception when calling TasksApi->crmTasksIdPatch: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **id** | **string**| |
- **body** | [**\Brevo\Client\Model\Body9**](../Model/Body9.md)| Updated task details. |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **id** | **string**| | |
+| **crmTasksIdPatchRequest** | [**\Brevo\Client\Models\CrmTasksIdPatchRequest**](../Model/CrmTasksIdPatchRequest.md)| Updated task details. | |
### Return type
@@ -259,56 +289,64 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **crmTasksPost**
-> \Brevo\Client\Model\InlineResponse2012 crmTasksPost($body)
+## `crmTasksPost()`
+
+```php
+crmTasksPost($crmTasksPostRequest): \Brevo\Client\Models\CrmTasksPost201Response
+```
Create a task
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TasksApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$body = new \Brevo\Client\Model\Body8(); // \Brevo\Client\Model\Body8 | Task name.
+$crmTasksPostRequest = new \Brevo\Client\Models\CrmTasksPostRequest(); // \Brevo\Client\Models\CrmTasksPostRequest | Task name.
try {
- $result = $apiInstance->crmTasksPost($body);
+ $result = $apiInstance->crmTasksPost($crmTasksPostRequest);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TasksApi->crmTasksPost: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **body** | [**\Brevo\Client\Model\Body8**](../Model/Body8.md)| Task name. |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **crmTasksPostRequest** | [**\Brevo\Client\Models\CrmTasksPostRequest**](../Model/CrmTasksPostRequest.md)| Task name. | |
### Return type
-[**\Brevo\Client\Model\InlineResponse2012**](../Model/InlineResponse2012.md)
+[**\Brevo\Client\Models\CrmTasksPost201Response**](../Model/CrmTasksPost201Response.md)
### Authorization
@@ -316,30 +354,39 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `crmTasktypesGet()`
-# **crmTasktypesGet**
-> \Brevo\Client\Model\TaskTypes crmTasktypesGet()
+```php
+crmTasktypesGet(): \Brevo\Client\Models\TaskTypes
+```
Get all task types
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TasksApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
@@ -353,15 +400,15 @@ try {
} catch (Exception $e) {
echo 'Exception when calling TasksApi->crmTasktypesGet: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
+
This endpoint does not need any parameter.
### Return type
-[**\Brevo\Client\Model\TaskTypes**](../Model/TaskTypes.md)
+[**\Brevo\Client\Models\TaskTypes**](../Model/TaskTypes.md)
### Authorization
@@ -369,8 +416,9 @@ This endpoint does not need any parameter.
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+- **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/TierApi.md b/docs/Api/TierApi.md
new file mode 100644
index 0000000..1e86e72
--- /dev/null
+++ b/docs/Api/TierApi.md
@@ -0,0 +1,715 @@
+# Brevo\Client\TierApi
+
+All URIs are relative to https://api.brevo.com/v3, except if the operation defines another base path.
+
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**createTierForTierGroup()**](TierApi.md#createTierForTierGroup) | **POST** /loyalty/tier/programs/{loyaltyProgramId}/tier-groups/{tierGroupId}/tiers | Create new tier |
+| [**createTierGroup()**](TierApi.md#createTierGroup) | **POST** /loyalty/tier/programs/{loyaltyProgramId}/tier-groups | Create tier group |
+| [**deleteTierGroup()**](TierApi.md#deleteTierGroup) | **DELETE** /loyalty/tier/programs/{loyaltyProgramId}/tier-groups/{tierGroupId} | Delete tier group |
+| [**getListOfTierGroups()**](TierApi.md#getListOfTierGroups) | **GET** /loyalty/tier/programs/{loyaltyProgramId}/tier-groups | Get tier group page |
+| [**getLoyaltyProgramTier()**](TierApi.md#getLoyaltyProgramTier) | **GET** /loyalty/tier/programs/{loyaltyProgramId}/tiers | Get tier page |
+| [**getTierGroup()**](TierApi.md#getTierGroup) | **GET** /loyalty/tier/programs/{loyaltyProgramId}/tier-groups/{tierGroupId} | Get tier group by Id |
+| [**loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPost()**](TierApi.md#loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPost) | **POST** /loyalty/tier/programs/{loyaltyProgramId}/contacts/{contactId}/tiers/{tierId} | Add subscription to a tier |
+| [**loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDelete()**](TierApi.md#loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDelete) | **DELETE** /loyalty/tier/programs/{loyaltyProgramId}/tiers/{tierId} | Delete tier |
+| [**loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPut()**](TierApi.md#loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPut) | **PUT** /loyalty/tier/programs/{loyaltyProgramId}/tiers/{tierId} | Update tier |
+| [**updateTierGroup()**](TierApi.md#updateTierGroup) | **PUT** /loyalty/tier/programs/{loyaltyProgramId}/tier-groups/{tierGroupId} | Update tier group |
+
+
+## `createTierForTierGroup()`
+
+```php
+createTierForTierGroup($loyaltyProgramId, $tierGroupId, $tierRequest): \Brevo\Client\Models\Tier
+```
+
+Create new tier
+
+Creates a new tier for the specified tier group
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\TierApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$tierGroupId = 'tierGroupId_example'; // string | Tier group Id
+$tierRequest = new \Brevo\Client\Models\TierRequest(); // \Brevo\Client\Models\TierRequest
+
+try {
+ $result = $apiInstance->createTierForTierGroup($loyaltyProgramId, $tierGroupId, $tierRequest);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling TierApi->createTierForTierGroup: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **tierGroupId** | **string**| Tier group Id | |
+| **tierRequest** | [**\Brevo\Client\Models\TierRequest**](../Model/TierRequest.md)| | |
+
+### Return type
+
+[**\Brevo\Client\Models\Tier**](../Model/Tier.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `createTierGroup()`
+
+```php
+createTierGroup($loyaltyProgramId, $createTierGroupRequest): \Brevo\Client\Models\TierGroup
+```
+
+Create tier group
+
+Creates tier group for the specified loyalty program
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\TierApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$createTierGroupRequest = new \Brevo\Client\Models\CreateTierGroupRequest(); // \Brevo\Client\Models\CreateTierGroupRequest | Subscription Member information
+
+try {
+ $result = $apiInstance->createTierGroup($loyaltyProgramId, $createTierGroupRequest);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling TierApi->createTierGroup: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **createTierGroupRequest** | [**\Brevo\Client\Models\CreateTierGroupRequest**](../Model/CreateTierGroupRequest.md)| Subscription Member information | |
+
+### Return type
+
+[**\Brevo\Client\Models\TierGroup**](../Model/TierGroup.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `deleteTierGroup()`
+
+```php
+deleteTierGroup($loyaltyProgramId, $tierGroupId)
+```
+
+Delete tier group
+
+Deletes tier group for the specified loyalty program
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\TierApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$tierGroupId = 'tierGroupId_example'; // string | Tier group Id
+
+try {
+ $apiInstance->deleteTierGroup($loyaltyProgramId, $tierGroupId);
+} catch (Exception $e) {
+ echo 'Exception when calling TierApi->deleteTierGroup: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **tierGroupId** | **string**| Tier group Id | |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `getListOfTierGroups()`
+
+```php
+getListOfTierGroups($loyaltyProgramId, $version): \Brevo\Client\Models\TierGroupPage
+```
+
+Get tier group page
+
+Return a list of tier groups for the specified loyalty program
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\TierApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$version = 'draft'; // string | Select 'active' to retrieve list of all tier groups which are live for clients. Select draft to retrieve list of all non deleted tier groups.
+
+try {
+ $result = $apiInstance->getListOfTierGroups($loyaltyProgramId, $version);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling TierApi->getListOfTierGroups: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **version** | **string**| Select 'active' to retrieve list of all tier groups which are live for clients. Select draft to retrieve list of all non deleted tier groups. | [optional] [default to 'draft'] |
+
+### Return type
+
+[**\Brevo\Client\Models\TierGroupPage**](../Model/TierGroupPage.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `getLoyaltyProgramTier()`
+
+```php
+getLoyaltyProgramTier($loyaltyProgramId, $version): \Brevo\Client\Models\LoyaltyTierPage
+```
+
+Get tier page
+
+Returns tier page
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\TierApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$version = 'draft'; // string | Select 'active' to retrieve list of all tiers which are live for clients. Select draft to retrieve list of all non deleted tiers.
+
+try {
+ $result = $apiInstance->getLoyaltyProgramTier($loyaltyProgramId, $version);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling TierApi->getLoyaltyProgramTier: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **version** | **string**| Select 'active' to retrieve list of all tiers which are live for clients. Select draft to retrieve list of all non deleted tiers. | [optional] [default to 'draft'] |
+
+### Return type
+
+[**\Brevo\Client\Models\LoyaltyTierPage**](../Model/LoyaltyTierPage.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `getTierGroup()`
+
+```php
+getTierGroup($loyaltyProgramId, $tierGroupId, $version): \Brevo\Client\Models\TierGroup
+```
+
+Get tier group by Id
+
+Returns the specified tier group for the specified loyalty program
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\TierApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$tierGroupId = 'tierGroupId_example'; // string | Tier group Id
+$version = 'draft'; // string | Select active to retrieve active version of tier group. Select draft to retrieve latest changes in tier group.
+
+try {
+ $result = $apiInstance->getTierGroup($loyaltyProgramId, $tierGroupId, $version);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling TierApi->getTierGroup: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **tierGroupId** | **string**| Tier group Id | |
+| **version** | **string**| Select active to retrieve active version of tier group. Select draft to retrieve latest changes in tier group. | [optional] [default to 'draft'] |
+
+### Return type
+
+[**\Brevo\Client\Models\TierGroup**](../Model/TierGroup.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPost()`
+
+```php
+loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPost($loyaltyProgramId, $contactId, $tierId): \Brevo\Client\Models\TierForContact
+```
+
+Add subscription to a tier
+
+Assigns a subscription tier to a specific contact within a loyalty program
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\TierApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$contactId = 'contactId_example'; // string | Contact Id
+$tierId = 'tierId_example'; // string | Tier Id
+
+try {
+ $result = $apiInstance->loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPost($loyaltyProgramId, $contactId, $tierId);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling TierApi->loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPost: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **contactId** | **string**| Contact Id | |
+| **tierId** | **string**| Tier Id | |
+
+### Return type
+
+[**\Brevo\Client\Models\TierForContact**](../Model/TierForContact.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDelete()`
+
+```php
+loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDelete($loyaltyProgramId, $tierId)
+```
+
+Delete tier
+
+Deletes an existing tier for the specified tier group
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\TierApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$tierId = 'tierId_example'; // string | Tier Id
+
+try {
+ $apiInstance->loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDelete($loyaltyProgramId, $tierId);
+} catch (Exception $e) {
+ echo 'Exception when calling TierApi->loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDelete: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **tierId** | **string**| Tier Id | |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPut()`
+
+```php
+loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPut($loyaltyProgramId, $tierId, $tierRequest): \Brevo\Client\Models\Tier
+```
+
+Update tier
+
+Modifies an existing tier for the specified tier group
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\TierApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$tierId = 'tierId_example'; // string | Tier Id
+$tierRequest = new \Brevo\Client\Models\TierRequest(); // \Brevo\Client\Models\TierRequest
+
+try {
+ $result = $apiInstance->loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPut($loyaltyProgramId, $tierId, $tierRequest);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling TierApi->loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPut: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **tierId** | **string**| Tier Id | |
+| **tierRequest** | [**\Brevo\Client\Models\TierRequest**](../Model/TierRequest.md)| | |
+
+### Return type
+
+[**\Brevo\Client\Models\Tier**](../Model/Tier.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
+
+## `updateTierGroup()`
+
+```php
+updateTierGroup($loyaltyProgramId, $tierGroupId, $updateTierGroupRequest): \Brevo\Client\Models\TierGroup
+```
+
+Update tier group
+
+Modifies an existing tier group for the specified loyalty program
+
+### Example
+
+```php
+setApiKey('api-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
+// Configure API key authorization: partner-key
+$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
+
+$apiInstance = new Brevo\Client\Api\TierApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$loyaltyProgramId = 'loyaltyProgramId_example'; // string | Loyalty Program Id
+$tierGroupId = 'tierGroupId_example'; // string | Tier group Id
+$updateTierGroupRequest = new \Brevo\Client\Models\UpdateTierGroupRequest(); // \Brevo\Client\Models\UpdateTierGroupRequest
+
+try {
+ $result = $apiInstance->updateTierGroup($loyaltyProgramId, $tierGroupId, $updateTierGroupRequest);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling TierApi->updateTierGroup: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **loyaltyProgramId** | **string**| Loyalty Program Id | |
+| **tierGroupId** | **string**| Tier group Id | |
+| **updateTierGroupRequest** | [**\Brevo\Client\Models\UpdateTierGroupRequest**](../Model/UpdateTierGroupRequest.md)| | |
+
+### Return type
+
+[**\Brevo\Client\Models\TierGroup**](../Model/TierGroup.md)
+
+### Authorization
+
+[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
+
+### 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)
diff --git a/docs/Api/TransactionalEmailsApi.md b/docs/Api/TransactionalEmailsApi.md
index 52efc93..d7d4c31 100644
--- a/docs/Api/TransactionalEmailsApi.md
+++ b/docs/Api/TransactionalEmailsApi.md
@@ -1,75 +1,80 @@
# Brevo\Client\TransactionalEmailsApi
-All URIs are relative to *https://api.brevo.com/v3*
-
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**blockNewDomain**](TransactionalEmailsApi.md#blockNewDomain) | **POST** /smtp/blockedDomains | Add a new domain to the list of blocked domains
-[**createSmtpTemplate**](TransactionalEmailsApi.md#createSmtpTemplate) | **POST** /smtp/templates | Create an email template
-[**deleteBlockedDomain**](TransactionalEmailsApi.md#deleteBlockedDomain) | **DELETE** /smtp/blockedDomains/{domain} | Unblock an existing domain from the list of blocked domains
-[**deleteHardbounces**](TransactionalEmailsApi.md#deleteHardbounces) | **POST** /smtp/deleteHardbounces | Delete hardbounces
-[**deleteScheduledEmailById**](TransactionalEmailsApi.md#deleteScheduledEmailById) | **DELETE** /smtp/email/{identifier} | Delete scheduled emails by batchId or messageId
-[**deleteSmtpTemplate**](TransactionalEmailsApi.md#deleteSmtpTemplate) | **DELETE** /smtp/templates/{templateId} | Delete an inactive email template
-[**getAggregatedSmtpReport**](TransactionalEmailsApi.md#getAggregatedSmtpReport) | **GET** /smtp/statistics/aggregatedReport | Get your transactional email activity aggregated over a period of time
-[**getBlockedDomains**](TransactionalEmailsApi.md#getBlockedDomains) | **GET** /smtp/blockedDomains | Get the list of blocked domains
-[**getEmailEventReport**](TransactionalEmailsApi.md#getEmailEventReport) | **GET** /smtp/statistics/events | Get all your transactional email activity (unaggregated events)
-[**getScheduledEmailByBatchId**](TransactionalEmailsApi.md#getScheduledEmailByBatchId) | **GET** /smtp/emailStatus/{batchId} | Fetch scheduled emails by batchId
-[**getScheduledEmailByMessageId**](TransactionalEmailsApi.md#getScheduledEmailByMessageId) | **GET** /smtp/emailStatus/{messageId} | Fetch scheduled email by messageId
-[**getSmtpReport**](TransactionalEmailsApi.md#getSmtpReport) | **GET** /smtp/statistics/reports | Get your transactional email activity aggregated per day
-[**getSmtpTemplate**](TransactionalEmailsApi.md#getSmtpTemplate) | **GET** /smtp/templates/{templateId} | Returns the template information
-[**getSmtpTemplates**](TransactionalEmailsApi.md#getSmtpTemplates) | **GET** /smtp/templates | Get the list of email templates
-[**getTransacBlockedContacts**](TransactionalEmailsApi.md#getTransacBlockedContacts) | **GET** /smtp/blockedContacts | Get the list of blocked or unsubscribed transactional contacts
-[**getTransacEmailContent**](TransactionalEmailsApi.md#getTransacEmailContent) | **GET** /smtp/emails/{uuid} | Get the personalized content of a sent transactional email
-[**getTransacEmailsList**](TransactionalEmailsApi.md#getTransacEmailsList) | **GET** /smtp/emails | Get the list of transactional emails on the basis of allowed filters
-[**sendTestTemplate**](TransactionalEmailsApi.md#sendTestTemplate) | **POST** /smtp/templates/{templateId}/sendTest | Send a template to your test list
-[**sendTransacEmail**](TransactionalEmailsApi.md#sendTransacEmail) | **POST** /smtp/email | Send a transactional email
-[**smtpBlockedContactsEmailDelete**](TransactionalEmailsApi.md#smtpBlockedContactsEmailDelete) | **DELETE** /smtp/blockedContacts/{email} | Unblock or resubscribe a transactional contact
-[**smtpLogIdentifierDelete**](TransactionalEmailsApi.md#smtpLogIdentifierDelete) | **DELETE** /smtp/log/{identifier} | Delete an SMTP transactional log
-[**updateSmtpTemplate**](TransactionalEmailsApi.md#updateSmtpTemplate) | **PUT** /smtp/templates/{templateId} | Update an email template
-
-
-# **blockNewDomain**
-> blockNewDomain($blockDomain)
+All URIs are relative to https://api.brevo.com/v3, except if the operation defines another base path.
+
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**blockNewDomain()**](TransactionalEmailsApi.md#blockNewDomain) | **POST** /smtp/blockedDomains | Add a new domain to the list of blocked domains |
+| [**createSmtpTemplate()**](TransactionalEmailsApi.md#createSmtpTemplate) | **POST** /smtp/templates | Create an email template |
+| [**deleteBlockedDomain()**](TransactionalEmailsApi.md#deleteBlockedDomain) | **DELETE** /smtp/blockedDomains/{domain} | Unblock an existing domain from the list of blocked domains |
+| [**deleteHardbounces()**](TransactionalEmailsApi.md#deleteHardbounces) | **POST** /smtp/deleteHardbounces | Delete hardbounces |
+| [**deleteScheduledEmailById()**](TransactionalEmailsApi.md#deleteScheduledEmailById) | **DELETE** /smtp/email/{identifier} | Delete scheduled emails by batchId or messageId |
+| [**deleteSmtpTemplate()**](TransactionalEmailsApi.md#deleteSmtpTemplate) | **DELETE** /smtp/templates/{templateId} | Delete an inactive email template |
+| [**getAggregatedSmtpReport()**](TransactionalEmailsApi.md#getAggregatedSmtpReport) | **GET** /smtp/statistics/aggregatedReport | Get your transactional email activity aggregated over a period of time |
+| [**getBlockedDomains()**](TransactionalEmailsApi.md#getBlockedDomains) | **GET** /smtp/blockedDomains | Get the list of blocked domains |
+| [**getEmailEventReport()**](TransactionalEmailsApi.md#getEmailEventReport) | **GET** /smtp/statistics/events | Get all your transactional email activity (unaggregated events) |
+| [**getScheduledEmailById()**](TransactionalEmailsApi.md#getScheduledEmailById) | **GET** /smtp/emailStatus/{identifier} | Fetch scheduled emails by batchId or messageId |
+| [**getSmtpReport()**](TransactionalEmailsApi.md#getSmtpReport) | **GET** /smtp/statistics/reports | Get your transactional email activity aggregated per day |
+| [**getSmtpTemplate()**](TransactionalEmailsApi.md#getSmtpTemplate) | **GET** /smtp/templates/{templateId} | Returns the template information |
+| [**getSmtpTemplates()**](TransactionalEmailsApi.md#getSmtpTemplates) | **GET** /smtp/templates | Get the list of email templates |
+| [**getTransacBlockedContacts()**](TransactionalEmailsApi.md#getTransacBlockedContacts) | **GET** /smtp/blockedContacts | Get the list of blocked or unsubscribed transactional contacts |
+| [**getTransacEmailContent()**](TransactionalEmailsApi.md#getTransacEmailContent) | **GET** /smtp/emails/{uuid} | Get the personalized content of a sent transactional email |
+| [**getTransacEmailsList()**](TransactionalEmailsApi.md#getTransacEmailsList) | **GET** /smtp/emails | Get the list of transactional emails on the basis of allowed filters |
+| [**sendTestTemplate()**](TransactionalEmailsApi.md#sendTestTemplate) | **POST** /smtp/templates/{templateId}/sendTest | Send a template to your test list |
+| [**sendTransacEmail()**](TransactionalEmailsApi.md#sendTransacEmail) | **POST** /smtp/email | Send a transactional email |
+| [**smtpBlockedContactsEmailDelete()**](TransactionalEmailsApi.md#smtpBlockedContactsEmailDelete) | **DELETE** /smtp/blockedContacts/{email} | Unblock or resubscribe a transactional contact |
+| [**smtpLogIdentifierDelete()**](TransactionalEmailsApi.md#smtpLogIdentifierDelete) | **DELETE** /smtp/log/{identifier} | Delete an SMTP transactional log |
+| [**updateSmtpTemplate()**](TransactionalEmailsApi.md#updateSmtpTemplate) | **PUT** /smtp/templates/{templateId} | Update an email template |
+
+
+## `blockNewDomain()`
+
+```php
+blockNewDomain($blockDomain)
+```
Add a new domain to the list of blocked domains
Blocks a new domain in order to avoid messages being sent to the same
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TransactionalEmailsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$blockDomain = new \Brevo\Client\Model\BlockDomain(); // \Brevo\Client\Model\BlockDomain |
+$blockDomain = new \Brevo\Client\Models\BlockDomain(); // \Brevo\Client\Models\BlockDomain | Name of the domain to be blocked
try {
$apiInstance->blockNewDomain($blockDomain);
} catch (Exception $e) {
echo 'Exception when calling TransactionalEmailsApi->blockNewDomain: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **blockDomain** | [**\Brevo\Client\Model\BlockDomain**](../Model/BlockDomain.md)| |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **blockDomain** | [**\Brevo\Client\Models\BlockDomain**](../Model/BlockDomain.md)| Name of the domain to be blocked | |
### Return type
@@ -81,56 +86,64 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `createSmtpTemplate()`
-# **createSmtpTemplate**
-> \Brevo\Client\Model\CreateModel createSmtpTemplate($smtpTemplate)
+```php
+createSmtpTemplate($createSmtpTemplate): \Brevo\Client\Models\CreateModel
+```
Create an email template
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TransactionalEmailsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$smtpTemplate = new \Brevo\Client\Model\CreateSmtpTemplate(); // \Brevo\Client\Model\CreateSmtpTemplate | values to update in transactional email template
+$createSmtpTemplate = new \Brevo\Client\Models\CreateSmtpTemplate(); // \Brevo\Client\Models\CreateSmtpTemplate | values to update in transactional email template
try {
- $result = $apiInstance->createSmtpTemplate($smtpTemplate);
+ $result = $apiInstance->createSmtpTemplate($createSmtpTemplate);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TransactionalEmailsApi->createSmtpTemplate: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **smtpTemplate** | [**\Brevo\Client\Model\CreateSmtpTemplate**](../Model/CreateSmtpTemplate.md)| values to update in transactional email template |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **createSmtpTemplate** | [**\Brevo\Client\Models\CreateSmtpTemplate**](../Model/CreateSmtpTemplate.md)| values to update in transactional email template | |
### Return type
-[**\Brevo\Client\Model\CreateModel**](../Model/CreateModel.md)
+[**\Brevo\Client\Models\CreateModel**](../Model/CreateModel.md)
### Authorization
@@ -138,53 +151,61 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `deleteBlockedDomain()`
-# **deleteBlockedDomain**
-> deleteBlockedDomain($domain)
+```php
+deleteBlockedDomain($domain)
+```
Unblock an existing domain from the list of blocked domains
Unblocks an existing domain from the list of blocked domains
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TransactionalEmailsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$domain = "domain_example"; // string | The name of the domain to be deleted
+$domain = 'domain_example'; // string | The name of the domain to be deleted
try {
$apiInstance->deleteBlockedDomain($domain);
} catch (Exception $e) {
echo 'Exception when calling TransactionalEmailsApi->deleteBlockedDomain: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **domain** | **string**| The name of the domain to be deleted |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **domain** | **string**| The name of the domain to be deleted | |
### Return type
@@ -196,53 +217,61 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **deleteHardbounces**
-> deleteHardbounces($deleteHardbounces)
+## `deleteHardbounces()`
+
+```php
+deleteHardbounces($deleteHardbounces)
+```
Delete hardbounces
Delete hardbounces. To use carefully (e.g. in case of temporary ISP failures)
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TransactionalEmailsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$deleteHardbounces = new \Brevo\Client\Model\DeleteHardbounces(); // \Brevo\Client\Model\DeleteHardbounces | values to delete hardbounces
+$deleteHardbounces = new \Brevo\Client\Models\DeleteHardbounces(); // \Brevo\Client\Models\DeleteHardbounces | values to delete hardbounces
try {
$apiInstance->deleteHardbounces($deleteHardbounces);
} catch (Exception $e) {
echo 'Exception when calling TransactionalEmailsApi->deleteHardbounces: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **deleteHardbounces** | [**\Brevo\Client\Model\DeleteHardbounces**](../Model/DeleteHardbounces.md)| values to delete hardbounces | [optional]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **deleteHardbounces** | [**\Brevo\Client\Models\DeleteHardbounces**](../Model/DeleteHardbounces.md)| values to delete hardbounces | [optional] |
### Return type
@@ -254,53 +283,61 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `deleteScheduledEmailById()`
-# **deleteScheduledEmailById**
-> deleteScheduledEmailById($identifier)
+```php
+deleteScheduledEmailById($identifier)
+```
Delete scheduled emails by batchId or messageId
Delete scheduled batch of emails by batchId or single scheduled email by messageId
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TransactionalEmailsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$identifier = "identifier_example"; // string | The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email.
+$identifier = 4320f270-a4e3-4a2e-b591-edfe30a5e627; // string | The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email.
try {
$apiInstance->deleteScheduledEmailById($identifier);
} catch (Exception $e) {
echo 'Exception when calling TransactionalEmailsApi->deleteScheduledEmailById: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **identifier** | **string**| The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **identifier** | **string**| The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. | |
### Return type
@@ -312,51 +349,59 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **deleteSmtpTemplate**
-> deleteSmtpTemplate($templateId)
+## `deleteSmtpTemplate()`
+
+```php
+deleteSmtpTemplate($templateId)
+```
Delete an inactive email template
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TransactionalEmailsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$templateId = 789; // int | id of the template
+$templateId = 56; // int | id of the template
try {
$apiInstance->deleteSmtpTemplate($templateId);
} catch (Exception $e) {
echo 'Exception when calling TransactionalEmailsApi->deleteSmtpTemplate: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **templateId** | **int**| id of the template |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **templateId** | **int**| id of the template | |
### Return type
@@ -368,42 +413,51 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getAggregatedSmtpReport**
-> \Brevo\Client\Model\GetAggregatedReport getAggregatedSmtpReport($startDate, $endDate, $days, $tag)
+## `getAggregatedSmtpReport()`
+
+```php
+getAggregatedSmtpReport($startDate, $endDate, $days, $tag): \Brevo\Client\Models\GetAggregatedReport
+```
Get your transactional email activity aggregated over a period of time
This endpoint will show the aggregated stats for past 90 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TransactionalEmailsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$startDate = "startDate_example"; // string | Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate
-$endDate = "endDate_example"; // string | Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate
-$days = 789; // int | Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate'
-$tag = "tag_example"; // string | Tag of the emails
+$startDate = 'startDate_example'; // string | **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate
+$endDate = 'endDate_example'; // string | **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate
+$days = 56; // int | Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_
+$tag = 'tag_example'; // string | Tag of the emails
try {
$result = $apiInstance->getAggregatedSmtpReport($startDate, $endDate, $days, $tag);
@@ -411,21 +465,20 @@ try {
} catch (Exception $e) {
echo 'Exception when calling TransactionalEmailsApi->getAggregatedSmtpReport: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **startDate** | **string**| Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate | [optional]
- **endDate** | **string**| Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate | [optional]
- **days** | **int**| Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' | [optional]
- **tag** | **string**| Tag of the emails | [optional]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **startDate** | **string**| **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate | [optional] |
+| **endDate** | **string**| **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate | [optional] |
+| **days** | **int**| Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ | [optional] |
+| **tag** | **string**| Tag of the emails | [optional] |
### Return type
-[**\Brevo\Client\Model\GetAggregatedReport**](../Model/GetAggregatedReport.md)
+[**\Brevo\Client\Models\GetAggregatedReport**](../Model/GetAggregatedReport.md)
### Authorization
@@ -433,32 +486,41 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `getBlockedDomains()`
-# **getBlockedDomains**
-> \Brevo\Client\Model\GetBlockedDomains getBlockedDomains()
+```php
+getBlockedDomains(): \Brevo\Client\Models\GetBlockedDomains
+```
Get the list of blocked domains
Get the list of blocked domains
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TransactionalEmailsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
@@ -472,15 +534,15 @@ try {
} catch (Exception $e) {
echo 'Exception when calling TransactionalEmailsApi->getBlockedDomains: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
+
This endpoint does not need any parameter.
### Return type
-[**\Brevo\Client\Model\GetBlockedDomains**](../Model/GetBlockedDomains.md)
+[**\Brevo\Client\Models\GetBlockedDomains**](../Model/GetBlockedDomains.md)
### Authorization
@@ -488,32 +550,41 @@ This endpoint does not need any parameter.
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `getEmailEventReport()`
-# **getEmailEventReport**
-> \Brevo\Client\Model\GetEmailEventReport getEmailEventReport($limit, $offset, $startDate, $endDate, $days, $email, $event, $tags, $messageId, $templateId, $sort)
+```php
+getEmailEventReport($limit, $offset, $startDate, $endDate, $days, $email, $event, $tags, $messageId, $templateId, $sort): \Brevo\Client\Models\GetEmailEventReport
+```
Get all your transactional email activity (unaggregated events)
This endpoint will show the aggregated stats for past 30 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TransactionalEmailsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
@@ -522,15 +593,15 @@ $apiInstance = new Brevo\Client\Api\TransactionalEmailsApi(
);
$limit = 2500; // int | Number limitation for the result returned
$offset = 0; // int | Beginning point in the list to retrieve from.
-$startDate = "startDate_example"; // string | Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate
-$endDate = "endDate_example"; // string | Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate
-$days = 789; // int | Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate'
-$email = "email_example"; // string | Filter the report for a specific email addresses
-$event = "event_example"; // string | Filter the report for a specific event type
-$tags = "tags_example"; // string | Filter the report for tags (serialized and urlencoded array)
-$messageId = "messageId_example"; // string | Filter on a specific message id
-$templateId = 789; // int | Filter on a specific template id
-$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
+$startDate = 'startDate_example'; // string | **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate
+$endDate = 'endDate_example'; // string | **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate
+$days = 56; // int | Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_
+$email = 'email_example'; // string | Filter the report for a specific email addresses
+$event = 'event_example'; // string | Filter the report for a specific event type
+$tags = 'tags_example'; // string | Filter the report for tags (serialized and urlencoded array). To pass multiple tags, a format of string separated by commas is used such as **\"one, two, three\"**
+$messageId = 'messageId_example'; // string | Filter on a specific message id
+$templateId = 56; // int | Filter on a specific template id
+$sort = 'desc'; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
try {
$result = $apiInstance->getEmailEventReport($limit, $offset, $startDate, $endDate, $days, $email, $event, $tags, $messageId, $templateId, $sort);
@@ -538,28 +609,27 @@ try {
} catch (Exception $e) {
echo 'Exception when calling TransactionalEmailsApi->getEmailEventReport: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **limit** | **int**| Number limitation for the result returned | [optional] [default to 2500]
- **offset** | **int**| Beginning point in the list to retrieve from. | [optional] [default to 0]
- **startDate** | **string**| Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate | [optional]
- **endDate** | **string**| Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate | [optional]
- **days** | **int**| Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' | [optional]
- **email** | **string**| Filter the report for a specific email addresses | [optional]
- **event** | **string**| Filter the report for a specific event type | [optional]
- **tags** | **string**| Filter the report for tags (serialized and urlencoded array) | [optional]
- **messageId** | **string**| Filter on a specific message id | [optional]
- **templateId** | **int**| Filter on a specific template id | [optional]
- **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **limit** | **int**| Number limitation for the result returned | [optional] [default to 2500] |
+| **offset** | **int**| Beginning point in the list to retrieve from. | [optional] [default to 0] |
+| **startDate** | **string**| **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate | [optional] |
+| **endDate** | **string**| **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate | [optional] |
+| **days** | **int**| Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ | [optional] |
+| **email** | **string**| Filter the report for a specific email addresses | [optional] |
+| **event** | **string**| Filter the report for a specific event type | [optional] |
+| **tags** | **string**| Filter the report for tags (serialized and urlencoded array). To pass multiple tags, a format of string separated by commas is used such as **\"one, two, three\"** | [optional] |
+| **messageId** | **string**| Filter on a specific message id | [optional] |
+| **templateId** | **int**| Filter on a specific template id | [optional] |
+| **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to 'desc'] |
### Return type
-[**\Brevo\Client\Model\GetEmailEventReport**](../Model/GetEmailEventReport.md)
+[**\Brevo\Client\Models\GetEmailEventReport**](../Model/GetEmailEventReport.md)
### Authorization
@@ -567,133 +637,78 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-# **getScheduledEmailByBatchId**
-> \Brevo\Client\Model\GetScheduledEmailByBatchId getScheduledEmailByBatchId($batchId, $startDate, $endDate, $sort, $status, $limit, $offset)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-Fetch scheduled emails by batchId
+## `getScheduledEmailById()`
-Fetch scheduled batch of emails by batchId (Can retrieve data upto 30 days old)
-
-### Example
```php
-setApiKey('api-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
-// Configure API key authorization: partner-key
-$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
-
-$apiInstance = new Brevo\Client\Api\TransactionalEmailsApi(
- // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
- // This is optional, `GuzzleHttp\Client` will be used as default.
- new GuzzleHttp\Client(),
- $config
-);
-$batchId = "batchId_example"; // string | The batchId of scheduled emails batch (Should be a valid UUIDv4)
-$startDate = new \DateTime("2013-10-20"); // \DateTime | Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date.
-$endDate = new \DateTime("2013-10-20"); // \DateTime | Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month.
-$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
-$status = "status_example"; // string | Filter the records by `status` of the scheduled email batch or message.
-$limit = 100; // int | Number of documents returned per page
-$offset = 0; // int | Index of the first document on the page
-
-try {
- $result = $apiInstance->getScheduledEmailByBatchId($batchId, $startDate, $endDate, $sort, $status, $limit, $offset);
- print_r($result);
-} catch (Exception $e) {
- echo 'Exception when calling TransactionalEmailsApi->getScheduledEmailByBatchId: ', $e->getMessage(), PHP_EOL;
-}
-?>
+getScheduledEmailById($identifier, $startDate, $endDate, $sort, $status, $limit, $offset): \Brevo\Client\Models\GetScheduledEmailById200Response
```
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **batchId** | **string**| The batchId of scheduled emails batch (Should be a valid UUIDv4) |
- **startDate** | **\DateTime**| Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. | [optional]
- **endDate** | **\DateTime**| Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. | [optional]
- **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
- **status** | **string**| Filter the records by `status` of the scheduled email batch or message. | [optional]
- **limit** | **int**| Number of documents returned per page | [optional] [default to 100]
- **offset** | **int**| Index of the first document on the page | [optional] [default to 0]
-
-### Return type
-
-[**\Brevo\Client\Model\GetScheduledEmailByBatchId**](../Model/GetScheduledEmailByBatchId.md)
-
-### Authorization
-
-[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
-
-# **getScheduledEmailByMessageId**
-> \Brevo\Client\Model\GetScheduledEmailByMessageId getScheduledEmailByMessageId($messageId, $startDate, $endDate)
-
-Fetch scheduled email by messageId
+Fetch scheduled emails by batchId or messageId
-Fetch scheduled email by messageId (Can retrieve data upto 30 days old)
+Fetch scheduled batch of emails by batchId or single scheduled email by messageId (Can retrieve data upto 30 days old)
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TransactionalEmailsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$messageId = "messageId_example"; // string | The messageId of scheduled email
-$startDate = new \DateTime("2013-10-20"); // \DateTime | Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date.
-$endDate = new \DateTime("2013-10-20"); // \DateTime | Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month.
+$identifier = 4320f270-a4e3-4a2e-b591-edfe30a5e627; // string | The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email.
+$startDate = 2022-02-02; // \DateTime | Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date.
+$endDate = 2022-03-02; // \DateTime | Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month.
+$sort = 'desc'; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed. Not valid when identifier is `messageId`.
+$status = 'status_example'; // string | Filter the records by `status` of the scheduled email batch or message. Not valid when identifier is `messageId`.
+$limit = 100; // int | Number of documents returned per page. Not valid when identifier is `messageId`.
+$offset = 0; // int | Index of the first document on the page. Not valid when identifier is `messageId`.
try {
- $result = $apiInstance->getScheduledEmailByMessageId($messageId, $startDate, $endDate);
+ $result = $apiInstance->getScheduledEmailById($identifier, $startDate, $endDate, $sort, $status, $limit, $offset);
print_r($result);
} catch (Exception $e) {
- echo 'Exception when calling TransactionalEmailsApi->getScheduledEmailByMessageId: ', $e->getMessage(), PHP_EOL;
+ echo 'Exception when calling TransactionalEmailsApi->getScheduledEmailById: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **messageId** | **string**| The messageId of scheduled email |
- **startDate** | **\DateTime**| Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. | [optional]
- **endDate** | **\DateTime**| Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. | [optional]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **identifier** | **string**| The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. | |
+| **startDate** | **\DateTime**| Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. | [optional] |
+| **endDate** | **\DateTime**| Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. | [optional] |
+| **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed. Not valid when identifier is `messageId`. | [optional] [default to 'desc'] |
+| **status** | **string**| Filter the records by `status` of the scheduled email batch or message. Not valid when identifier is `messageId`. | [optional] |
+| **limit** | **int**| Number of documents returned per page. Not valid when identifier is `messageId`. | [optional] [default to 100] |
+| **offset** | **int**| Index of the first document on the page. Not valid when identifier is `messageId`. | [optional] [default to 0] |
### Return type
-[**\Brevo\Client\Model\GetScheduledEmailByMessageId**](../Model/GetScheduledEmailByMessageId.md)
+[**\Brevo\Client\Models\GetScheduledEmailById200Response**](../Model/GetScheduledEmailById200Response.md)
### Authorization
@@ -701,30 +716,39 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `getSmtpReport()`
-# **getSmtpReport**
-> \Brevo\Client\Model\GetReports getSmtpReport($limit, $offset, $startDate, $endDate, $days, $tag, $sort)
+```php
+getSmtpReport($limit, $offset, $startDate, $endDate, $days, $tag, $sort): \Brevo\Client\Models\GetReports
+```
Get your transactional email activity aggregated per day
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TransactionalEmailsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
@@ -733,11 +757,11 @@ $apiInstance = new Brevo\Client\Api\TransactionalEmailsApi(
);
$limit = 10; // int | Number of documents returned per page
$offset = 0; // int | Index of the first document on the page
-$startDate = "startDate_example"; // string | Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD)
-$endDate = "endDate_example"; // string | Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD)
-$days = 789; // int | Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate'
-$tag = "tag_example"; // string | Tag of the emails
-$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
+$startDate = 'startDate_example'; // string | **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD)
+$endDate = 'endDate_example'; // string | **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD)
+$days = 56; // int | Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_
+$tag = 'tag_example'; // string | Tag of the emails
+$sort = 'desc'; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
try {
$result = $apiInstance->getSmtpReport($limit, $offset, $startDate, $endDate, $days, $tag, $sort);
@@ -745,24 +769,23 @@ try {
} catch (Exception $e) {
echo 'Exception when calling TransactionalEmailsApi->getSmtpReport: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **limit** | **int**| Number of documents returned per page | [optional] [default to 10]
- **offset** | **int**| Index of the first document on the page | [optional] [default to 0]
- **startDate** | **string**| Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) | [optional]
- **endDate** | **string**| Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) | [optional]
- **days** | **int**| Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' | [optional]
- **tag** | **string**| Tag of the emails | [optional]
- **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **limit** | **int**| Number of documents returned per page | [optional] [default to 10] |
+| **offset** | **int**| Index of the first document on the page | [optional] [default to 0] |
+| **startDate** | **string**| **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD) | [optional] |
+| **endDate** | **string**| **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD) | [optional] |
+| **days** | **int**| Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ | [optional] |
+| **tag** | **string**| Tag of the emails | [optional] |
+| **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to 'desc'] |
### Return type
-[**\Brevo\Client\Model\GetReports**](../Model/GetReports.md)
+[**\Brevo\Client\Models\GetReports**](../Model/GetReports.md)
### Authorization
@@ -770,37 +793,46 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getSmtpTemplate**
-> \Brevo\Client\Model\GetSmtpTemplateOverview getSmtpTemplate($templateId)
+## `getSmtpTemplate()`
+
+```php
+getSmtpTemplate($templateId): \Brevo\Client\Models\GetSmtpTemplateOverview
+```
Returns the template information
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TransactionalEmailsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$templateId = 789; // int | id of the template
+$templateId = 56; // int | id of the template
try {
$result = $apiInstance->getSmtpTemplate($templateId);
@@ -808,18 +840,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling TransactionalEmailsApi->getSmtpTemplate: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **templateId** | **int**| id of the template |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **templateId** | **int**| id of the template | |
### Return type
-[**\Brevo\Client\Model\GetSmtpTemplateOverview**](../Model/GetSmtpTemplateOverview.md)
+[**\Brevo\Client\Models\GetSmtpTemplateOverview**](../Model/GetSmtpTemplateOverview.md)
### Authorization
@@ -827,40 +858,49 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getSmtpTemplates**
-> \Brevo\Client\Model\GetSmtpTemplates getSmtpTemplates($templateStatus, $limit, $offset, $sort)
+## `getSmtpTemplates()`
+
+```php
+getSmtpTemplates($templateStatus, $limit, $offset, $sort): \Brevo\Client\Models\GetSmtpTemplates
+```
Get the list of email templates
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TransactionalEmailsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$templateStatus = true; // bool | Filter on the status of the template. Active = true, inactive = false
+$templateStatus = True; // bool | Filter on the status of the template. Active = true, inactive = false
$limit = 50; // int | Number of documents returned per page
$offset = 0; // int | Index of the first document in the page
-$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
+$sort = 'desc'; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
try {
$result = $apiInstance->getSmtpTemplates($templateStatus, $limit, $offset, $sort);
@@ -868,21 +908,20 @@ try {
} catch (Exception $e) {
echo 'Exception when calling TransactionalEmailsApi->getSmtpTemplates: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **templateStatus** | **bool**| Filter on the status of the template. Active = true, inactive = false | [optional]
- **limit** | **int**| Number of documents returned per page | [optional] [default to 50]
- **offset** | **int**| Index of the first document in the page | [optional] [default to 0]
- **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **templateStatus** | **bool**| Filter on the status of the template. Active = true, inactive = false | [optional] |
+| **limit** | **int**| Number of documents returned per page | [optional] [default to 50] |
+| **offset** | **int**| Index of the first document in the page | [optional] [default to 0] |
+| **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to 'desc'] |
### Return type
-[**\Brevo\Client\Model\GetSmtpTemplates**](../Model/GetSmtpTemplates.md)
+[**\Brevo\Client\Models\GetSmtpTemplates**](../Model/GetSmtpTemplates.md)
### Authorization
@@ -890,42 +929,51 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `getTransacBlockedContacts()`
-# **getTransacBlockedContacts**
-> \Brevo\Client\Model\GetTransacBlockedContacts getTransacBlockedContacts($startDate, $endDate, $limit, $offset, $senders, $sort)
+```php
+getTransacBlockedContacts($startDate, $endDate, $limit, $offset, $senders, $sort): \Brevo\Client\Models\GetTransacBlockedContacts
+```
Get the list of blocked or unsubscribed transactional contacts
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TransactionalEmailsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$startDate = "startDate_example"; // string | Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts
-$endDate = "endDate_example"; // string | Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts
+$startDate = 'startDate_example'; // string | **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts
+$endDate = 'endDate_example'; // string | **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts
$limit = 50; // int | Number of documents returned per page
$offset = 0; // int | Index of the first document on the page
-$senders = array("senders_example"); // string[] | Comma separated list of emails of the senders from which contacts are blocked or unsubscribed
-$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
+$senders = array('senders_example'); // string[] | Comma separated list of emails of the senders from which contacts are blocked or unsubscribed
+$sort = 'desc'; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
try {
$result = $apiInstance->getTransacBlockedContacts($startDate, $endDate, $limit, $offset, $senders, $sort);
@@ -933,23 +981,22 @@ try {
} catch (Exception $e) {
echo 'Exception when calling TransactionalEmailsApi->getTransacBlockedContacts: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **startDate** | **string**| Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts | [optional]
- **endDate** | **string**| Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts | [optional]
- **limit** | **int**| Number of documents returned per page | [optional] [default to 50]
- **offset** | **int**| Index of the first document on the page | [optional] [default to 0]
- **senders** | [**string[]**](../Model/string.md)| Comma separated list of emails of the senders from which contacts are blocked or unsubscribed | [optional]
- **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **startDate** | **string**| **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts | [optional] |
+| **endDate** | **string**| **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts | [optional] |
+| **limit** | **int**| Number of documents returned per page | [optional] [default to 50] |
+| **offset** | **int**| Index of the first document on the page | [optional] [default to 0] |
+| **senders** | [**string[]**](../Model/string.md)| Comma separated list of emails of the senders from which contacts are blocked or unsubscribed | [optional] |
+| **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to 'desc'] |
### Return type
-[**\Brevo\Client\Model\GetTransacBlockedContacts**](../Model/GetTransacBlockedContacts.md)
+[**\Brevo\Client\Models\GetTransacBlockedContacts**](../Model/GetTransacBlockedContacts.md)
### Authorization
@@ -957,37 +1004,46 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `getTransacEmailContent()`
-# **getTransacEmailContent**
-> \Brevo\Client\Model\GetTransacEmailContent getTransacEmailContent($uuid)
+```php
+getTransacEmailContent($uuid): \Brevo\Client\Models\GetTransacEmailContent
+```
Get the personalized content of a sent transactional email
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TransactionalEmailsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$uuid = "uuid_example"; // string | Unique id of the transactional email that has been sent to a particular contact
+$uuid = 'uuid_example'; // string | Unique id of the transactional email that has been sent to a particular contact
try {
$result = $apiInstance->getTransacEmailContent($uuid);
@@ -995,18 +1051,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling TransactionalEmailsApi->getTransacEmailContent: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **uuid** | **string**| Unique id of the transactional email that has been sent to a particular contact |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **uuid** | **string**| Unique id of the transactional email that has been sent to a particular contact | |
### Return type
-[**\Brevo\Client\Model\GetTransacEmailContent**](../Model/GetTransacEmailContent.md)
+[**\Brevo\Client\Models\GetTransacEmailContent**](../Model/GetTransacEmailContent.md)
### Authorization
@@ -1014,44 +1069,53 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `getTransacEmailsList()`
-# **getTransacEmailsList**
-> \Brevo\Client\Model\GetTransacEmailsList getTransacEmailsList($email, $templateId, $messageId, $startDate, $endDate, $sort, $limit, $offset)
+```php
+getTransacEmailsList($email, $templateId, $messageId, $startDate, $endDate, $sort, $limit, $offset): \Brevo\Client\Models\GetTransacEmailsList
+```
Get the list of transactional emails on the basis of allowed filters
This endpoint will show the list of emails for past 30 days by default. To retrieve emails before that time, please pass startDate and endDate in query filters.
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TransactionalEmailsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$email = "email_example"; // string | Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent.
-$templateId = 789; // int | Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email.
-$messageId = "messageId_example"; // string | Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent.
-$startDate = "startDate_example"; // string | Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month.
-$endDate = "endDate_example"; // string | Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month.
-$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
+$email = 'email_example'; // string | **Mandatory if templateId and messageId are not passed in query filters.** Email address to which transactional email has been sent.
+$templateId = 56; // int | **Mandatory if email and messageId are not passed in query filters.** Id of the template that was used to compose transactional email.
+$messageId = 'messageId_example'; // string | **Mandatory if templateId and email are not passed in query filters.** Message ID of the transactional email sent.
+$startDate = 'startDate_example'; // string | **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) from which you want to fetch the list. **Maximum time period that can be selected is one month**.
+$endDate = 'endDate_example'; // string | **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) till which you want to fetch the list. **Maximum time period that can be selected is one month.**
+$sort = 'desc'; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
$limit = 500; // int | Number of documents returned per page
$offset = 0; // int | Index of the first document in the page
@@ -1061,25 +1125,24 @@ try {
} catch (Exception $e) {
echo 'Exception when calling TransactionalEmailsApi->getTransacEmailsList: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **email** | **string**| Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. | [optional]
- **templateId** | **int**| Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email. | [optional]
- **messageId** | **string**| Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. | [optional]
- **startDate** | **string**| Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. | [optional]
- **endDate** | **string**| Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. | [optional]
- **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
- **limit** | **int**| Number of documents returned per page | [optional] [default to 500]
- **offset** | **int**| Index of the first document in the page | [optional] [default to 0]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **email** | **string**| **Mandatory if templateId and messageId are not passed in query filters.** Email address to which transactional email has been sent. | [optional] |
+| **templateId** | **int**| **Mandatory if email and messageId are not passed in query filters.** Id of the template that was used to compose transactional email. | [optional] |
+| **messageId** | **string**| **Mandatory if templateId and email are not passed in query filters.** Message ID of the transactional email sent. | [optional] |
+| **startDate** | **string**| **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) from which you want to fetch the list. **Maximum time period that can be selected is one month**. | [optional] |
+| **endDate** | **string**| **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) till which you want to fetch the list. **Maximum time period that can be selected is one month.** | [optional] |
+| **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to 'desc'] |
+| **limit** | **int**| Number of documents returned per page | [optional] [default to 500] |
+| **offset** | **int**| Index of the first document in the page | [optional] [default to 0] |
### Return type
-[**\Brevo\Client\Model\GetTransacEmailsList**](../Model/GetTransacEmailsList.md)
+[**\Brevo\Client\Models\GetTransacEmailsList**](../Model/GetTransacEmailsList.md)
### Authorization
@@ -1087,53 +1150,61 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `sendTestTemplate()`
-# **sendTestTemplate**
-> sendTestTemplate($templateId, $sendTestEmail)
+```php
+sendTestTemplate($templateId, $sendTestEmail)
+```
Send a template to your test list
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TransactionalEmailsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$templateId = 789; // int | Id of the template
-$sendTestEmail = new \Brevo\Client\Model\SendTestEmail(); // \Brevo\Client\Model\SendTestEmail |
+$templateId = 56; // int | Id of the template
+$sendTestEmail = new \Brevo\Client\Models\SendTestEmail(); // \Brevo\Client\Models\SendTestEmail
try {
$apiInstance->sendTestTemplate($templateId, $sendTestEmail);
} catch (Exception $e) {
echo 'Exception when calling TransactionalEmailsApi->sendTestTemplate: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **templateId** | **int**| Id of the template |
- **sendTestEmail** | [**\Brevo\Client\Model\SendTestEmail**](../Model/SendTestEmail.md)| |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **templateId** | **int**| Id of the template | |
+| **sendTestEmail** | [**\Brevo\Client\Models\SendTestEmail**](../Model/SendTestEmail.md)| | |
### Return type
@@ -1145,37 +1216,46 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **sendTransacEmail**
-> \Brevo\Client\Model\CreateSmtpEmail sendTransacEmail($sendSmtpEmail)
+## `sendTransacEmail()`
+
+```php
+sendTransacEmail($sendSmtpEmail): \Brevo\Client\Models\CreateSmtpEmail
+```
Send a transactional email
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TransactionalEmailsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$sendSmtpEmail = new \Brevo\Client\Model\SendSmtpEmail(); // \Brevo\Client\Model\SendSmtpEmail | Values to send a transactional email
+$sendSmtpEmail = new \Brevo\Client\Models\SendSmtpEmail(); // \Brevo\Client\Models\SendSmtpEmail | Values to send a transactional email
try {
$result = $apiInstance->sendTransacEmail($sendSmtpEmail);
@@ -1183,18 +1263,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling TransactionalEmailsApi->sendTransacEmail: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **sendSmtpEmail** | [**\Brevo\Client\Model\SendSmtpEmail**](../Model/SendSmtpEmail.md)| Values to send a transactional email |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **sendSmtpEmail** | [**\Brevo\Client\Models\SendSmtpEmail**](../Model/SendSmtpEmail.md)| Values to send a transactional email | |
### Return type
-[**\Brevo\Client\Model\CreateSmtpEmail**](../Model/CreateSmtpEmail.md)
+[**\Brevo\Client\Models\CreateSmtpEmail**](../Model/CreateSmtpEmail.md)
### Authorization
@@ -1202,51 +1281,59 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `smtpBlockedContactsEmailDelete()`
-# **smtpBlockedContactsEmailDelete**
-> smtpBlockedContactsEmailDelete($email)
+```php
+smtpBlockedContactsEmailDelete($email)
+```
Unblock or resubscribe a transactional contact
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TransactionalEmailsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$email = "email_example"; // string | contact email (urlencoded) to unblock.
+$email = 'email_example'; // string | contact email (urlencoded) to unblock.
try {
$apiInstance->smtpBlockedContactsEmailDelete($email);
} catch (Exception $e) {
echo 'Exception when calling TransactionalEmailsApi->smtpBlockedContactsEmailDelete: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **email** | **string**| contact email (urlencoded) to unblock. |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **email** | **string**| contact email (urlencoded) to unblock. | |
### Return type
@@ -1258,51 +1345,59 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `smtpLogIdentifierDelete()`
-# **smtpLogIdentifierDelete**
-> smtpLogIdentifierDelete($identifier)
+```php
+smtpLogIdentifierDelete($identifier)
+```
Delete an SMTP transactional log
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TransactionalEmailsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$identifier = "identifier_example"; // string | MessageId or Email of the transactional log(s) to delete
+$identifier = 'identifier_example'; // string | MessageId or Email of the transactional log(s) to delete
try {
$apiInstance->smtpLogIdentifierDelete($identifier);
} catch (Exception $e) {
echo 'Exception when calling TransactionalEmailsApi->smtpLogIdentifierDelete: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **identifier** | **string**| MessageId or Email of the transactional log(s) to delete |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **identifier** | **string**| MessageId or Email of the transactional log(s) to delete | |
### Return type
@@ -1314,53 +1409,61 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **updateSmtpTemplate**
-> updateSmtpTemplate($templateId, $smtpTemplate)
+## `updateSmtpTemplate()`
+
+```php
+updateSmtpTemplate($templateId, $updateSmtpTemplate)
+```
Update an email template
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TransactionalEmailsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$templateId = 789; // int | id of the template
-$smtpTemplate = new \Brevo\Client\Model\UpdateSmtpTemplate(); // \Brevo\Client\Model\UpdateSmtpTemplate | values to update in transactional email template
+$templateId = 56; // int | id of the template
+$updateSmtpTemplate = new \Brevo\Client\Models\UpdateSmtpTemplate(); // \Brevo\Client\Models\UpdateSmtpTemplate | values to update in transactional email template
try {
- $apiInstance->updateSmtpTemplate($templateId, $smtpTemplate);
+ $apiInstance->updateSmtpTemplate($templateId, $updateSmtpTemplate);
} catch (Exception $e) {
echo 'Exception when calling TransactionalEmailsApi->updateSmtpTemplate: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **templateId** | **int**| id of the template |
- **smtpTemplate** | [**\Brevo\Client\Model\UpdateSmtpTemplate**](../Model/UpdateSmtpTemplate.md)| values to update in transactional email template |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **templateId** | **int**| id of the template | |
+| **updateSmtpTemplate** | [**\Brevo\Client\Models\UpdateSmtpTemplate**](../Model/UpdateSmtpTemplate.md)| values to update in transactional email template | |
### Return type
@@ -1372,8 +1475,9 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+- **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)
diff --git a/docs/Api/TransactionalSMSApi.md b/docs/Api/TransactionalSMSApi.md
index 685d4ba..ecb3e14 100644
--- a/docs/Api/TransactionalSMSApi.md
+++ b/docs/Api/TransactionalSMSApi.md
@@ -1,34 +1,41 @@
# Brevo\Client\TransactionalSMSApi
-All URIs are relative to *https://api.brevo.com/v3*
+All URIs are relative to https://api.brevo.com/v3, except if the operation defines another base path.
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**getSmsEvents**](TransactionalSMSApi.md#getSmsEvents) | **GET** /transactionalSMS/statistics/events | Get all your SMS activity (unaggregated events)
-[**getTransacAggregatedSmsReport**](TransactionalSMSApi.md#getTransacAggregatedSmsReport) | **GET** /transactionalSMS/statistics/aggregatedReport | Get your SMS activity aggregated over a period of time
-[**getTransacSmsReport**](TransactionalSMSApi.md#getTransacSmsReport) | **GET** /transactionalSMS/statistics/reports | Get your SMS activity aggregated per day
-[**sendTransacSms**](TransactionalSMSApi.md#sendTransacSms) | **POST** /transactionalSMS/sms | Send SMS message to a mobile number
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**getSmsEvents()**](TransactionalSMSApi.md#getSmsEvents) | **GET** /transactionalSMS/statistics/events | Get all your SMS activity (unaggregated events) |
+| [**getTransacAggregatedSmsReport()**](TransactionalSMSApi.md#getTransacAggregatedSmsReport) | **GET** /transactionalSMS/statistics/aggregatedReport | Get your SMS activity aggregated over a period of time |
+| [**getTransacSmsReport()**](TransactionalSMSApi.md#getTransacSmsReport) | **GET** /transactionalSMS/statistics/reports | Get your SMS activity aggregated per day |
+| [**sendTransacSms()**](TransactionalSMSApi.md#sendTransacSms) | **POST** /transactionalSMS/sms | Send SMS message to a mobile number |
-# **getSmsEvents**
-> \Brevo\Client\Model\GetSmsEventReport getSmsEvents($limit, $startDate, $endDate, $offset, $days, $phoneNumber, $event, $tags, $sort)
+## `getSmsEvents()`
+
+```php
+getSmsEvents($limit, $startDate, $endDate, $offset, $days, $phoneNumber, $event, $tags, $sort): \Brevo\Client\Models\GetSmsEventReport
+```
Get all your SMS activity (unaggregated events)
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TransactionalSMSApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
@@ -36,14 +43,14 @@ $apiInstance = new Brevo\Client\Api\TransactionalSMSApi(
$config
);
$limit = 50; // int | Number of documents per page
-$startDate = "startDate_example"; // string | Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report
-$endDate = "endDate_example"; // string | Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report
+$startDate = 'startDate_example'; // string | **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report
+$endDate = 'endDate_example'; // string | **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report
$offset = 0; // int | Index of the first document of the page
-$days = 789; // int | Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate'
-$phoneNumber = "phoneNumber_example"; // string | Filter the report for a specific phone number
-$event = "event_example"; // string | Filter the report for specific events
-$tags = "tags_example"; // string | Filter the report for specific tags passed as a serialized urlencoded array
-$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
+$days = 56; // int | Number of days in the past including today (positive integer). **Not compatible with 'startDate' and 'endDate'**
+$phoneNumber = 'phoneNumber_example'; // string | Filter the report for a specific phone number
+$event = 'event_example'; // string | Filter the report for specific events
+$tags = 'tags_example'; // string | Filter the report for specific tags passed as a serialized urlencoded array
+$sort = 'desc'; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
try {
$result = $apiInstance->getSmsEvents($limit, $startDate, $endDate, $offset, $days, $phoneNumber, $event, $tags, $sort);
@@ -51,26 +58,25 @@ try {
} catch (Exception $e) {
echo 'Exception when calling TransactionalSMSApi->getSmsEvents: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **limit** | **int**| Number of documents per page | [optional] [default to 50]
- **startDate** | **string**| Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report | [optional]
- **endDate** | **string**| Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report | [optional]
- **offset** | **int**| Index of the first document of the page | [optional] [default to 0]
- **days** | **int**| Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' | [optional]
- **phoneNumber** | **string**| Filter the report for a specific phone number | [optional]
- **event** | **string**| Filter the report for specific events | [optional]
- **tags** | **string**| Filter the report for specific tags passed as a serialized urlencoded array | [optional]
- **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **limit** | **int**| Number of documents per page | [optional] [default to 50] |
+| **startDate** | **string**| **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report | [optional] |
+| **endDate** | **string**| **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report | [optional] |
+| **offset** | **int**| Index of the first document of the page | [optional] [default to 0] |
+| **days** | **int**| Number of days in the past including today (positive integer). **Not compatible with 'startDate' and 'endDate'** | [optional] |
+| **phoneNumber** | **string**| Filter the report for a specific phone number | [optional] |
+| **event** | **string**| Filter the report for specific events | [optional] |
+| **tags** | **string**| Filter the report for specific tags passed as a serialized urlencoded array | [optional] |
+| **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to 'desc'] |
### Return type
-[**\Brevo\Client\Model\GetSmsEventReport**](../Model/GetSmsEventReport.md)
+[**\Brevo\Client\Models\GetSmsEventReport**](../Model/GetSmsEventReport.md)
### Authorization
@@ -78,40 +84,49 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getTransacAggregatedSmsReport**
-> \Brevo\Client\Model\GetTransacAggregatedSmsReport getTransacAggregatedSmsReport($startDate, $endDate, $days, $tag)
+## `getTransacAggregatedSmsReport()`
+
+```php
+getTransacAggregatedSmsReport($startDate, $endDate, $days, $tag): \Brevo\Client\Models\GetTransacAggregatedSmsReport
+```
Get your SMS activity aggregated over a period of time
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TransactionalSMSApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$startDate = "startDate_example"; // string | Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report
-$endDate = "endDate_example"; // string | Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report
-$days = 789; // int | Number of days in the past including today (positive integer). Not compatible with startDate and endDate
-$tag = "tag_example"; // string | Filter on a tag
+$startDate = 'startDate_example'; // string | **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report
+$endDate = 'endDate_example'; // string | **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report
+$days = 56; // int | Number of days in the past including today (positive integer). **Not compatible with startDate and endDate**
+$tag = 'tag_example'; // string | Filter on a tag
try {
$result = $apiInstance->getTransacAggregatedSmsReport($startDate, $endDate, $days, $tag);
@@ -119,21 +134,20 @@ try {
} catch (Exception $e) {
echo 'Exception when calling TransactionalSMSApi->getTransacAggregatedSmsReport: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **startDate** | **string**| Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report | [optional]
- **endDate** | **string**| Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report | [optional]
- **days** | **int**| Number of days in the past including today (positive integer). Not compatible with startDate and endDate | [optional]
- **tag** | **string**| Filter on a tag | [optional]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **startDate** | **string**| **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report | [optional] |
+| **endDate** | **string**| **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report | [optional] |
+| **days** | **int**| Number of days in the past including today (positive integer). **Not compatible with startDate and endDate** | [optional] |
+| **tag** | **string**| Filter on a tag | [optional] |
### Return type
-[**\Brevo\Client\Model\GetTransacAggregatedSmsReport**](../Model/GetTransacAggregatedSmsReport.md)
+[**\Brevo\Client\Models\GetTransacAggregatedSmsReport**](../Model/GetTransacAggregatedSmsReport.md)
### Authorization
@@ -141,41 +155,50 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getTransacSmsReport**
-> \Brevo\Client\Model\GetTransacSmsReport getTransacSmsReport($startDate, $endDate, $days, $tag, $sort)
+## `getTransacSmsReport()`
+
+```php
+getTransacSmsReport($startDate, $endDate, $days, $tag, $sort): \Brevo\Client\Models\GetTransacSmsReport
+```
Get your SMS activity aggregated per day
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TransactionalSMSApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$startDate = "startDate_example"; // string | Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report
-$endDate = "endDate_example"; // string | Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report
-$days = 789; // int | Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate'
-$tag = "tag_example"; // string | Filter on a tag
-$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
+$startDate = 'startDate_example'; // string | **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report
+$endDate = 'endDate_example'; // string | **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report
+$days = 56; // int | Number of days in the past including today (positive integer). **Not compatible with 'startDate' and 'endDate'**
+$tag = 'tag_example'; // string | Filter on a tag
+$sort = 'desc'; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
try {
$result = $apiInstance->getTransacSmsReport($startDate, $endDate, $days, $tag, $sort);
@@ -183,22 +206,21 @@ try {
} catch (Exception $e) {
echo 'Exception when calling TransactionalSMSApi->getTransacSmsReport: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **startDate** | **string**| Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report | [optional]
- **endDate** | **string**| Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report | [optional]
- **days** | **int**| Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' | [optional]
- **tag** | **string**| Filter on a tag | [optional]
- **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **startDate** | **string**| **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report | [optional] |
+| **endDate** | **string**| **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report | [optional] |
+| **days** | **int**| Number of days in the past including today (positive integer). **Not compatible with 'startDate' and 'endDate'** | [optional] |
+| **tag** | **string**| Filter on a tag | [optional] |
+| **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to 'desc'] |
### Return type
-[**\Brevo\Client\Model\GetTransacSmsReport**](../Model/GetTransacSmsReport.md)
+[**\Brevo\Client\Models\GetTransacSmsReport**](../Model/GetTransacSmsReport.md)
### Authorization
@@ -206,37 +228,46 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `sendTransacSms()`
-# **sendTransacSms**
-> \Brevo\Client\Model\SendSms sendTransacSms($sendTransacSms)
+```php
+sendTransacSms($sendTransacSms): \Brevo\Client\Models\SendSms
+```
Send SMS message to a mobile number
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TransactionalSMSApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$sendTransacSms = new \Brevo\Client\Model\SendTransacSms(); // \Brevo\Client\Model\SendTransacSms | Values to send a transactional SMS
+$sendTransacSms = new \Brevo\Client\Models\SendTransacSms(); // \Brevo\Client\Models\SendTransacSms | Values to send a transactional SMS
try {
$result = $apiInstance->sendTransacSms($sendTransacSms);
@@ -244,18 +275,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling TransactionalSMSApi->sendTransacSms: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **sendTransacSms** | [**\Brevo\Client\Model\SendTransacSms**](../Model/SendTransacSms.md)| Values to send a transactional SMS |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **sendTransacSms** | [**\Brevo\Client\Models\SendTransacSms**](../Model/SendTransacSms.md)| Values to send a transactional SMS | |
### Return type
-[**\Brevo\Client\Model\SendSms**](../Model/SendSms.md)
+[**\Brevo\Client\Models\SendSms**](../Model/SendSms.md)
### Authorization
@@ -263,8 +293,9 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+- **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)
diff --git a/docs/Api/TransactionalWhatsAppApi.md b/docs/Api/TransactionalWhatsAppApi.md
index e1641af..ee1854b 100644
--- a/docs/Api/TransactionalWhatsAppApi.md
+++ b/docs/Api/TransactionalWhatsAppApi.md
@@ -1,34 +1,41 @@
# Brevo\Client\TransactionalWhatsAppApi
-All URIs are relative to *https://api.brevo.com/v3*
+All URIs are relative to https://api.brevo.com/v3, except if the operation defines another base path.
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**getWhatsappEventReport**](TransactionalWhatsAppApi.md#getWhatsappEventReport) | **GET** /whatsapp/statistics/events | Get all your WhatsApp activity (unaggregated events)
-[**sendWhatsappMessage**](TransactionalWhatsAppApi.md#sendWhatsappMessage) | **POST** /whatsapp/sendMessage | Send a WhatsApp message
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**getWhatsappEventReport()**](TransactionalWhatsAppApi.md#getWhatsappEventReport) | **GET** /whatsapp/statistics/events | Get all your WhatsApp activity (unaggregated events) |
+| [**sendWhatsappMessage()**](TransactionalWhatsAppApi.md#sendWhatsappMessage) | **POST** /whatsapp/sendMessage | Send a WhatsApp message |
-# **getWhatsappEventReport**
-> \Brevo\Client\Model\GetWhatsappEventReport getWhatsappEventReport($limit, $offset, $startDate, $endDate, $days, $contactNumber, $event, $sort)
+## `getWhatsappEventReport()`
+
+```php
+getWhatsappEventReport($limit, $offset, $startDate, $endDate, $days, $contactNumber, $event, $sort): \Brevo\Client\Models\GetWhatsappEventReport
+```
Get all your WhatsApp activity (unaggregated events)
This endpoint will show the unaggregated statistics for WhatsApp activity (30 days by default if `startDate` and `endDate` or `days` is not passed. The date range can not exceed 90 days)
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TransactionalWhatsAppApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
@@ -37,12 +44,12 @@ $apiInstance = new Brevo\Client\Api\TransactionalWhatsAppApi(
);
$limit = 2500; // int | Number limitation for the result returned
$offset = 0; // int | Beginning point in the list to retrieve from
-$startDate = "startDate_example"; // string | **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate
-$endDate = "endDate_example"; // string | **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate
-$days = 789; // int | Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_
-$contactNumber = "contactNumber_example"; // string | Filter results for specific contact (WhatsApp Number with country code. Example, 85264318721)
-$event = "event_example"; // string | Filter the report for a specific event type
-$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
+$startDate = 'startDate_example'; // string | **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate
+$endDate = 'endDate_example'; // string | **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate
+$days = 56; // int | Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_
+$contactNumber = 'contactNumber_example'; // string | Filter results for specific contact (WhatsApp Number with country code. Example, 85264318721)
+$event = 'event_example'; // string | Filter the report for a specific event type
+$sort = 'desc'; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
try {
$result = $apiInstance->getWhatsappEventReport($limit, $offset, $startDate, $endDate, $days, $contactNumber, $event, $sort);
@@ -50,25 +57,24 @@ try {
} catch (Exception $e) {
echo 'Exception when calling TransactionalWhatsAppApi->getWhatsappEventReport: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **limit** | **int**| Number limitation for the result returned | [optional] [default to 2500]
- **offset** | **int**| Beginning point in the list to retrieve from | [optional] [default to 0]
- **startDate** | **string**| **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate | [optional]
- **endDate** | **string**| **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate | [optional]
- **days** | **int**| Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ | [optional]
- **contactNumber** | **string**| Filter results for specific contact (WhatsApp Number with country code. Example, 85264318721) | [optional]
- **event** | **string**| Filter the report for a specific event type | [optional]
- **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **limit** | **int**| Number limitation for the result returned | [optional] [default to 2500] |
+| **offset** | **int**| Beginning point in the list to retrieve from | [optional] [default to 0] |
+| **startDate** | **string**| **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate | [optional] |
+| **endDate** | **string**| **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate | [optional] |
+| **days** | **int**| Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ | [optional] |
+| **contactNumber** | **string**| Filter results for specific contact (WhatsApp Number with country code. Example, 85264318721) | [optional] |
+| **event** | **string**| Filter the report for a specific event type | [optional] |
+| **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to 'desc'] |
### Return type
-[**\Brevo\Client\Model\GetWhatsappEventReport**](../Model/GetWhatsappEventReport.md)
+[**\Brevo\Client\Models\GetWhatsappEventReport**](../Model/GetWhatsappEventReport.md)
### Authorization
@@ -76,58 +82,66 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **sendWhatsappMessage**
-> \Brevo\Client\Model\InlineResponse2014 sendWhatsappMessage($sendWhatsappMessage)
+## `sendWhatsappMessage()`
+
+```php
+sendWhatsappMessage($sendWhatsappMessageRequest): \Brevo\Client\Models\SendWhatsappMessage201Response
+```
Send a WhatsApp message
This endpoint is used to send a WhatsApp message.
(**The first message you send using the API must contain a Template ID. You must create a template on WhatsApp on the Brevo platform to fetch the Template ID.**)
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\TransactionalWhatsAppApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$sendWhatsappMessage = new \Brevo\Client\Model\SendWhatsappMessage(); // \Brevo\Client\Model\SendWhatsappMessage | Values to send WhatsApp message
+$sendWhatsappMessageRequest = new \Brevo\Client\Models\SendWhatsappMessageRequest(); // \Brevo\Client\Models\SendWhatsappMessageRequest | Values to send WhatsApp message
try {
- $result = $apiInstance->sendWhatsappMessage($sendWhatsappMessage);
+ $result = $apiInstance->sendWhatsappMessage($sendWhatsappMessageRequest);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TransactionalWhatsAppApi->sendWhatsappMessage: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **sendWhatsappMessage** | [**\Brevo\Client\Model\SendWhatsappMessage**](../Model/SendWhatsappMessage.md)| Values to send WhatsApp message |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **sendWhatsappMessageRequest** | [**\Brevo\Client\Models\SendWhatsappMessageRequest**](../Model/SendWhatsappMessageRequest.md)| Values to send WhatsApp message | |
### Return type
-[**\Brevo\Client\Model\InlineResponse2014**](../Model/InlineResponse2014.md)
+[**\Brevo\Client\Models\SendWhatsappMessage201Response**](../Model/SendWhatsappMessage201Response.md)
### Authorization
@@ -135,8 +149,9 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+- **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)
diff --git a/docs/Api/UserApi.md b/docs/Api/UserApi.md
index 87f3900..5c3a94f 100644
--- a/docs/Api/UserApi.md
+++ b/docs/Api/UserApi.md
@@ -1,64 +1,70 @@
# Brevo\Client\UserApi
-All URIs are relative to *https://api.brevo.com/v3*
+All URIs are relative to https://api.brevo.com/v3, except if the operation defines another base path.
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**editUserPermission**](UserApi.md#editUserPermission) | **POST** /organization/user/update/permissions | Update permission for a user
-[**getInvitedUsersList**](UserApi.md#getInvitedUsersList) | **GET** /organization/invited/users | Get the list of all your users
-[**getUserPermission**](UserApi.md#getUserPermission) | **GET** /organization/user/{email}/permissions | Check user permission
-[**inviteuser**](UserApi.md#inviteuser) | **POST** /organization/user/invitation/send | Send invitation to user
-[**putRevokeUserPermission**](UserApi.md#putRevokeUserPermission) | **PUT** /organization/user/invitation/revoke/{email} | Revoke user permission
-[**putresendcancelinvitation**](UserApi.md#putresendcancelinvitation) | **PUT** /organization/user/invitation/{action}/{email} | Resend / Cancel invitation
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**editUserPermission()**](UserApi.md#editUserPermission) | **POST** /organization/user/update/permissions | Update permission for a user |
+| [**getInvitedUsersList()**](UserApi.md#getInvitedUsersList) | **GET** /organization/invited/users | Get the list of all your users |
+| [**getUserPermission()**](UserApi.md#getUserPermission) | **GET** /organization/user/{email}/permissions | Check user permission |
+| [**inviteuser()**](UserApi.md#inviteuser) | **POST** /organization/user/invitation/send | Send invitation to user |
+| [**putRevokeUserPermission()**](UserApi.md#putRevokeUserPermission) | **PUT** /organization/user/invitation/revoke/{email} | Revoke user permission |
+| [**putresendcancelinvitation()**](UserApi.md#putresendcancelinvitation) | **PUT** /organization/user/invitation/{action}/{email} | Resend / Cancel invitation |
-# **editUserPermission**
-> \Brevo\Client\Model\Inviteuser editUserPermission($updatePermissions)
+## `editUserPermission()`
+
+```php
+editUserPermission($inviteuser): \Brevo\Client\Models\UpdateUserResponse
+```
Update permission for a user
-`Feature` - A Feature represents a specific functionality like Email campaign, Deals, Calls, Automations, etc. on Brevo. While inviting a user, determine which feature you want to manage access to. You must specify the feature accurately to avoid errors. `Permission` - A Permission defines the level of access or control a user has over a specific feature. While inviting user, decide on the permission level required for the selected feature. Make sure the chosen permission is related to the selected feature. Features and their respective permissions are as below: - `email_campaigns`: - \"create_edit_delete\" - \"send_schedule_suspend\" - `sms_campaigns`: - \"create_edit_delete\" - \"send_schedule_suspend\" - `contacts`: - \"view\" - \"send_schedule_suspend\" - \"import\" - \"export\" - \"list_and_attributes\" - \"forms\" - `templates`: - \"create_edit_delete\" - \"activate_deactivate\" - `workflows`: - \"create_edit_delete\" - \"activate_deactivate_pause\" - \"settings\" - `facebook_ads`: - \"create_edit_delete\" - \"schedule_pause\" - `landing_pages`: - \"all\" - `transactional_emails`: - \"settings\" - \"logs\" - `smtp_api`: - \"smtp\" - \"api_keys\" - \"authorized_ips\" - `user_management`: - \"all\" - `sales_platform`: - \"manage_owned_deals_tasks_companies\" - \"manage_others_deals_tasks_companies\" - \"reports\" - \"settings\" - `phone`: - \"all\" - `conversations`: - \"access\" - \"assign\" - \"configure\" - `senders_domains_dedicated_ips`: - \"senders_management\" - \"domains_management\" - \"dedicated_ips_management\" - `push_notifications`: - \"view\" - \"create_edit_delete\" - \"send\" - \"settings\" **Note**: - The privileges array remains the same as in the send invitation; the user simply needs to provide the permissions that need to be updated. - The availability of feature and its permission depends on your current plan. Please select the features and permissions accordingly.
+`Feature` - A Feature represents a specific functionality like Email campaign, Deals, Calls, Automations, etc. on Brevo. While inviting a user, determine which feature you want to manage access to. You must specify the feature accurately to avoid errors. `Permission` - A Permission defines the level of access or control a user has over a specific feature. While inviting user, decide on the permission level required for the selected feature. Make sure the chosen permission is related to the selected feature. Features and their respective permissions are as below: - `email_campaigns`: - \"create_edit_delete\" - \"send_schedule_suspend\" - `sms_campaigns`: - \"create_edit_delete\" - \"send_schedule_suspend\" - `contacts`: - \"view\" - \"create_edit_delete\" - \"import\" - \"export\" - \"list_and_attributes\" - \"forms\" - `templates`: - \"create_edit_delete\" - \"activate_deactivate\" - `workflows`: - \"create_edit_delete\" - \"activate_deactivate_pause\" - \"settings\" - `facebook_ads`: - \"create_edit_delete\" - \"schedule_pause\" - `landing_pages`: - \"all\" - `transactional_emails`: - \"settings\" - \"logs\" - `smtp_api`: - \"smtp\" - \"api_keys\" - \"authorized_ips\" - `user_management`: - \"all\" - `sales_platform`: - \"create_edit_deals\" - \"delete_owned_deals\" - \"manage_others_deals_tasks\" - \"reports\" - \"settings\" - `phone`: - \"all\" - `conversations`: - \"access\" - \"assign\" - \"configure\" - `senders_domains_dedicated_ips`: - \"senders_management\" - \"domains_management\" - \"dedicated_ips_management\" - `push_notifications`: - \"view\" - \"create_edit_delete\" - \"send\" - \"settings\" - `companies`: - \"manage_owned_companies\" - \"manage_other_companies\" - \"settings\" **Note**: - The privileges array remains the same as in the send invitation; the user simply needs to provide the permissions that need to be updated. - The availability of feature and its permission depends on your current plan. Please select the features and permissions accordingly.
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\UserApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$updatePermissions = new \Brevo\Client\Model\Inviteuser(); // \Brevo\Client\Model\Inviteuser | Values to update permissions for an invited user
+$inviteuser = new \Brevo\Client\Models\Inviteuser(); // \Brevo\Client\Models\Inviteuser | Values to create an invitation
try {
- $result = $apiInstance->editUserPermission($updatePermissions);
+ $result = $apiInstance->editUserPermission($inviteuser);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling UserApi->editUserPermission: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **updatePermissions** | [**\Brevo\Client\Model\Inviteuser**](../Model/Inviteuser.md)| Values to update permissions for an invited user |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **inviteuser** | [**\Brevo\Client\Models\Inviteuser**](../Model/Inviteuser.md)| Values to create an invitation | |
### Return type
-[**\Brevo\Client\Model\Inviteuser**](../Model/Inviteuser.md)
+[**\Brevo\Client\Models\UpdateUserResponse**](../Model/UpdateUserResponse.md)
### Authorization
@@ -66,30 +72,39 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getInvitedUsersList**
-> \Brevo\Client\Model\GetInvitedUsersList getInvitedUsersList()
+## `getInvitedUsersList()`
+
+```php
+getInvitedUsersList(): \Brevo\Client\Models\GetInvitedUsersList
+```
Get the list of all your users
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\UserApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
@@ -103,15 +118,15 @@ try {
} catch (Exception $e) {
echo 'Exception when calling UserApi->getInvitedUsersList: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
+
This endpoint does not need any parameter.
### Return type
-[**\Brevo\Client\Model\GetInvitedUsersList**](../Model/GetInvitedUsersList.md)
+[**\Brevo\Client\Models\GetInvitedUsersList**](../Model/GetInvitedUsersList.md)
### Authorization
@@ -119,37 +134,46 @@ This endpoint does not need any parameter.
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getUserPermission**
-> \Brevo\Client\Model\GetUserPermission getUserPermission($email)
+## `getUserPermission()`
+
+```php
+getUserPermission($email): \Brevo\Client\Models\GetUserPermission
+```
Check user permission
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\UserApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$email = "email_example"; // string | Email of the invited user.
+$email = 'email_example'; // string | Email of the invited user.
try {
$result = $apiInstance->getUserPermission($email);
@@ -157,18 +181,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling UserApi->getUserPermission: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **email** | **string**| Email of the invited user. |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **email** | **string**| Email of the invited user. | |
### Return type
-[**\Brevo\Client\Model\GetUserPermission**](../Model/GetUserPermission.md)
+[**\Brevo\Client\Models\GetUserPermission**](../Model/GetUserPermission.md)
### Authorization
@@ -176,58 +199,66 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **inviteuser**
-> \Brevo\Client\Model\Inviteuser inviteuser($sendInvitation)
+## `inviteuser()`
+
+```php
+inviteuser($inviteuser): \Brevo\Client\Models\InviteuserResponse
+```
Send invitation to user
-`Feature` - A Feature represents a specific functionality like Email campaign, Deals, Calls, Automations, etc. on Brevo. While inviting a user, determine which feature you want to manage access to. You must specify the feature accurately to avoid errors. `Permission` - A Permission defines the level of access or control a user has over a specific feature. While inviting user, decide on the permission level required for the selected feature. Make sure the chosen permission is related to the selected feature. Features and their respective permissions are as below: - `email_campaigns`: - \"create_edit_delete\" - \"send_schedule_suspend\" - `sms_campaigns`: - \"create_edit_delete\" - \"send_schedule_suspend\" - `contacts`: - \"view\" - \"send_schedule_suspend\" - \"import\" - \"export\" - \"list_and_attributes\" - \"forms\" - `templates`: - \"create_edit_delete\" - \"activate_deactivate\" - `workflows`: - \"create_edit_delete\" - \"activate_deactivate_pause\" - \"settings\" - `facebook_ads`: - \"create_edit_delete\" - \"schedule_pause\" - `landing_pages`: - \"all\" - `transactional_emails`: - \"settings\" - \"logs\" - `smtp_api`: - \"smtp\" - \"api_keys\" - \"authorized_ips\" - `user_management`: - \"all\" - `sales_platform`: - \"manage_owned_deals_tasks_companies\" - \"manage_others_deals_tasks_companies\" - \"reports\" - \"settings\" - `phone`: - \"all\" - `conversations`: - \"access\" - \"assign\" - \"configure\" - `senders_domains_dedicated_ips`: - \"senders_management\" - \"domains_management\" - \"dedicated_ips_management\" - `push_notifications`: - \"view\" - \"create_edit_delete\" - \"send\" - \"settings\" **Note**: - If `all_features_access: false` then only privileges are required otherwise if `true` then it's assumed that all permissions will be there for the invited user. - The availability of feature and its permission depends on your current plan. Please select the features and permissions accordingly.
+`Feature` - A Feature represents a specific functionality like Email campaign, Deals, Calls, Automations, etc. on Brevo. While inviting a user, determine which feature you want to manage access to. You must specify the feature accurately to avoid errors. `Permission` - A Permission defines the level of access or control a user has over a specific feature. While inviting user, decide on the permission level required for the selected feature. Make sure the chosen permission is related to the selected feature. Features and their respective permissions are as below: - `email_campaigns`: - \"create_edit_delete\" - \"send_schedule_suspend\" - `sms_campaigns`: - \"create_edit_delete\" - \"send_schedule_suspend\" - `contacts`: - \"view\" - \"create_edit_delete\" - \"import\" - \"export\" - \"list_and_attributes\" - \"forms\" - `templates`: - \"create_edit_delete\" - \"activate_deactivate\" - `workflows`: - \"create_edit_delete\" - \"activate_deactivate_pause\" - \"settings\" - `facebook_ads`: - \"create_edit_delete\" - \"schedule_pause\" - `landing_pages`: - \"all\" - `transactional_emails`: - \"settings\" - \"logs\" - `smtp_api`: - \"smtp\" - \"api_keys\" - \"authorized_ips\" - `user_management`: - \"all\" - `sales_platform`: - \"create_edit_deals\" - \"delete_owned_deals\" - \"manage_others_deals_tasks\" - \"reports\" - \"settings\" - `phone`: - \"all\" - `conversations`: - \"access\" - \"assign\" - \"configure\" - `senders_domains_dedicated_ips`: - \"senders_management\" - \"domains_management\" - \"dedicated_ips_management\" - `push_notifications`: - \"view\" - \"create_edit_delete\" - \"send\" - \"settings\" - `companies`: - \"manage_owned_companies\" - \"manage_other_companies\" - \"settings\" **Note**: - If `all_features_access: false` then only privileges are required otherwise if `true` then it's assumed that all permissions will be there for the invited user. - The availability of feature and its permission depends on your current plan. Please select the features and permissions accordingly.
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\UserApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$sendInvitation = new \Brevo\Client\Model\Inviteuser(); // \Brevo\Client\Model\Inviteuser | Values to create an invitation
+$inviteuser = new \Brevo\Client\Models\Inviteuser(); // \Brevo\Client\Models\Inviteuser | Values to create an invitation
try {
- $result = $apiInstance->inviteuser($sendInvitation);
+ $result = $apiInstance->inviteuser($inviteuser);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling UserApi->inviteuser: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **sendInvitation** | [**\Brevo\Client\Model\Inviteuser**](../Model/Inviteuser.md)| Values to create an invitation |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **inviteuser** | [**\Brevo\Client\Models\Inviteuser**](../Model/Inviteuser.md)| Values to create an invitation | |
### Return type
-[**\Brevo\Client\Model\Inviteuser**](../Model/Inviteuser.md)
+[**\Brevo\Client\Models\InviteuserResponse**](../Model/InviteuserResponse.md)
### Authorization
@@ -235,37 +266,46 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **putRevokeUserPermission**
-> \Brevo\Client\Model\PutRevokeUserPermission putRevokeUserPermission($email)
+## `putRevokeUserPermission()`
+
+```php
+putRevokeUserPermission($email): \Brevo\Client\Models\PutRevokeUserPermissionResponse
+```
Revoke user permission
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\UserApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$email = "email_example"; // string | Email of the invited user.
+$email = 'email_example'; // string | Email of the invited user.
try {
$result = $apiInstance->putRevokeUserPermission($email);
@@ -273,18 +313,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling UserApi->putRevokeUserPermission: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **email** | **string**| Email of the invited user. |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **email** | **string**| Email of the invited user. | |
### Return type
-[**\Brevo\Client\Model\PutRevokeUserPermission**](../Model/PutRevokeUserPermission.md)
+[**\Brevo\Client\Models\PutRevokeUserPermissionResponse**](../Model/PutRevokeUserPermissionResponse.md)
### Authorization
@@ -292,38 +331,47 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **putresendcancelinvitation**
-> \Brevo\Client\Model\Putresendcancelinvitation putresendcancelinvitation($action, $email)
+## `putresendcancelinvitation()`
+
+```php
+putresendcancelinvitation($action, $email): \Brevo\Client\Models\PutresendcancelinvitationResponse
+```
Resend / Cancel invitation
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\UserApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$action = "action_example"; // string | action
-$email = "email_example"; // string | Email of the invited user.
+$action = 'action_example'; // string | action
+$email = 'email_example'; // string | Email of the invited user.
try {
$result = $apiInstance->putresendcancelinvitation($action, $email);
@@ -331,19 +379,18 @@ try {
} catch (Exception $e) {
echo 'Exception when calling UserApi->putresendcancelinvitation: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **action** | **string**| action |
- **email** | **string**| Email of the invited user. |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **action** | **string**| action | |
+| **email** | **string**| Email of the invited user. | |
### Return type
-[**\Brevo\Client\Model\Putresendcancelinvitation**](../Model/Putresendcancelinvitation.md)
+[**\Brevo\Client\Models\PutresendcancelinvitationResponse**](../Model/PutresendcancelinvitationResponse.md)
### Authorization
@@ -351,8 +398,9 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+- **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/WebhooksApi.md b/docs/Api/WebhooksApi.md
index 9dca158..ebfd98f 100644
--- a/docs/Api/WebhooksApi.md
+++ b/docs/Api/WebhooksApi.md
@@ -1,43 +1,50 @@
# Brevo\Client\WebhooksApi
-All URIs are relative to *https://api.brevo.com/v3*
+All URIs are relative to https://api.brevo.com/v3, except if the operation defines another base path.
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**createWebhook**](WebhooksApi.md#createWebhook) | **POST** /webhooks | Create a webhook
-[**deleteWebhook**](WebhooksApi.md#deleteWebhook) | **DELETE** /webhooks/{webhookId} | Delete a webhook
-[**exportWebhooksHistory**](WebhooksApi.md#exportWebhooksHistory) | **POST** /webhooks/export | Export all webhook events
-[**getWebhook**](WebhooksApi.md#getWebhook) | **GET** /webhooks/{webhookId} | Get a webhook details
-[**getWebhooks**](WebhooksApi.md#getWebhooks) | **GET** /webhooks | Get all webhooks
-[**updateWebhook**](WebhooksApi.md#updateWebhook) | **PUT** /webhooks/{webhookId} | Update a webhook
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**createWebhook()**](WebhooksApi.md#createWebhook) | **POST** /webhooks | Create a webhook |
+| [**deleteWebhook()**](WebhooksApi.md#deleteWebhook) | **DELETE** /webhooks/{webhookId} | Delete a webhook |
+| [**exportWebhooksHistory()**](WebhooksApi.md#exportWebhooksHistory) | **POST** /webhooks/export | Export all webhook events |
+| [**getWebhook()**](WebhooksApi.md#getWebhook) | **GET** /webhooks/{webhookId} | Get a webhook details |
+| [**getWebhooks()**](WebhooksApi.md#getWebhooks) | **GET** /webhooks | Get all webhooks |
+| [**updateWebhook()**](WebhooksApi.md#updateWebhook) | **PUT** /webhooks/{webhookId} | Update a webhook |
-# **createWebhook**
-> \Brevo\Client\Model\CreateModel createWebhook($createWebhook)
+## `createWebhook()`
+
+```php
+createWebhook($createWebhook): \Brevo\Client\Models\CreateModel
+```
Create a webhook
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\WebhooksApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$createWebhook = new \Brevo\Client\Model\CreateWebhook(); // \Brevo\Client\Model\CreateWebhook | Values to create a webhook
+$createWebhook = new \Brevo\Client\Models\CreateWebhook(); // \Brevo\Client\Models\CreateWebhook | Values to create a webhook
try {
$result = $apiInstance->createWebhook($createWebhook);
@@ -45,18 +52,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling WebhooksApi->createWebhook: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **createWebhook** | [**\Brevo\Client\Model\CreateWebhook**](../Model/CreateWebhook.md)| Values to create a webhook |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **createWebhook** | [**\Brevo\Client\Models\CreateWebhook**](../Model/CreateWebhook.md)| Values to create a webhook | |
### Return type
-[**\Brevo\Client\Model\CreateModel**](../Model/CreateModel.md)
+[**\Brevo\Client\Models\CreateModel**](../Model/CreateModel.md)
### Authorization
@@ -64,51 +70,59 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **deleteWebhook**
-> deleteWebhook($webhookId)
+## `deleteWebhook()`
+
+```php
+deleteWebhook($webhookId)
+```
Delete a webhook
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\WebhooksApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$webhookId = 789; // int | Id of the webhook
+$webhookId = 56; // int | Id of the webhook
try {
$apiInstance->deleteWebhook($webhookId);
} catch (Exception $e) {
echo 'Exception when calling WebhooksApi->deleteWebhook: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **webhookId** | **int**| Id of the webhook |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **webhookId** | **int**| Id of the webhook | |
### Return type
@@ -120,58 +134,66 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **exportWebhooksHistory**
-> \Brevo\Client\Model\CreatedProcessId exportWebhooksHistory($exportWebhookHistory)
+## `exportWebhooksHistory()`
+
+```php
+exportWebhooksHistory($exportWebhooksHistoryRequest): \Brevo\Client\Models\CreatedProcessId
+```
Export all webhook events
This endpoint will submit a request to get the history of webhooks in the CSV file. The link to download the CSV file will be sent to the webhook that was provided in the notifyURL.
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\WebhooksApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$exportWebhookHistory = new \Brevo\Client\Model\ExportWebhooksHistory(); // \Brevo\Client\Model\ExportWebhooksHistory | Values to submit for webhooks history
+$exportWebhooksHistoryRequest = new \Brevo\Client\Models\ExportWebhooksHistoryRequest(); // \Brevo\Client\Models\ExportWebhooksHistoryRequest | Values to submit for webhooks history
try {
- $result = $apiInstance->exportWebhooksHistory($exportWebhookHistory);
+ $result = $apiInstance->exportWebhooksHistory($exportWebhooksHistoryRequest);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling WebhooksApi->exportWebhooksHistory: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **exportWebhookHistory** | [**\Brevo\Client\Model\ExportWebhooksHistory**](../Model/ExportWebhooksHistory.md)| Values to submit for webhooks history |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **exportWebhooksHistoryRequest** | [**\Brevo\Client\Models\ExportWebhooksHistoryRequest**](../Model/ExportWebhooksHistoryRequest.md)| Values to submit for webhooks history | |
### Return type
-[**\Brevo\Client\Model\CreatedProcessId**](../Model/CreatedProcessId.md)
+[**\Brevo\Client\Models\CreatedProcessId**](../Model/CreatedProcessId.md)
### Authorization
@@ -179,37 +201,46 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getWebhook**
-> \Brevo\Client\Model\GetWebhook getWebhook($webhookId)
+## `getWebhook()`
+
+```php
+getWebhook($webhookId): \Brevo\Client\Models\GetWebhook
+```
Get a webhook details
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\WebhooksApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$webhookId = 789; // int | Id of the webhook
+$webhookId = 56; // int | Id of the webhook
try {
$result = $apiInstance->getWebhook($webhookId);
@@ -217,18 +248,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling WebhooksApi->getWebhook: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **webhookId** | **int**| Id of the webhook |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **webhookId** | **int**| Id of the webhook | |
### Return type
-[**\Brevo\Client\Model\GetWebhook**](../Model/GetWebhook.md)
+[**\Brevo\Client\Models\GetWebhook**](../Model/GetWebhook.md)
### Authorization
@@ -236,38 +266,47 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getWebhooks**
-> \Brevo\Client\Model\GetWebhooks getWebhooks($type, $sort)
+## `getWebhooks()`
+
+```php
+getWebhooks($type, $sort): \Brevo\Client\Models\GetWebhooks
+```
Get all webhooks
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\WebhooksApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$type = "transactional"; // string | Filter on webhook type
-$sort = "desc"; // string | Sort the results in the ascending/descending order of webhook creation
+$type = 'transactional'; // string | Filter on webhook type
+$sort = 'desc'; // string | Sort the results in the ascending/descending order of webhook creation
try {
$result = $apiInstance->getWebhooks($type, $sort);
@@ -275,19 +314,18 @@ try {
} catch (Exception $e) {
echo 'Exception when calling WebhooksApi->getWebhooks: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **type** | **string**| Filter on webhook type | [optional] [default to transactional]
- **sort** | **string**| Sort the results in the ascending/descending order of webhook creation | [optional] [default to desc]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **type** | **string**| Filter on webhook type | [optional] [default to 'transactional'] |
+| **sort** | **string**| Sort the results in the ascending/descending order of webhook creation | [optional] [default to 'desc'] |
### Return type
-[**\Brevo\Client\Model\GetWebhooks**](../Model/GetWebhooks.md)
+[**\Brevo\Client\Models\GetWebhooks**](../Model/GetWebhooks.md)
### Authorization
@@ -295,53 +333,61 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `updateWebhook()`
-# **updateWebhook**
-> updateWebhook($webhookId, $updateWebhook)
+```php
+updateWebhook($webhookId, $updateWebhook)
+```
Update a webhook
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\WebhooksApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$webhookId = 789; // int | Id of the webhook
-$updateWebhook = new \Brevo\Client\Model\UpdateWebhook(); // \Brevo\Client\Model\UpdateWebhook | Values to update a webhook
+$webhookId = 56; // int | Id of the webhook
+$updateWebhook = new \Brevo\Client\Models\UpdateWebhook(); // \Brevo\Client\Models\UpdateWebhook | Values to update a webhook
try {
$apiInstance->updateWebhook($webhookId, $updateWebhook);
} catch (Exception $e) {
echo 'Exception when calling WebhooksApi->updateWebhook: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **webhookId** | **int**| Id of the webhook |
- **updateWebhook** | [**\Brevo\Client\Model\UpdateWebhook**](../Model/UpdateWebhook.md)| Values to update a webhook |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **webhookId** | **int**| Id of the webhook | |
+| **updateWebhook** | [**\Brevo\Client\Models\UpdateWebhook**](../Model/UpdateWebhook.md)| Values to update a webhook | |
### Return type
@@ -353,8 +399,9 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+- **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)
diff --git a/docs/Api/WhatsAppCampaignsApi.md b/docs/Api/WhatsAppCampaignsApi.md
index 32b4a15..75ff85a 100644
--- a/docs/Api/WhatsAppCampaignsApi.md
+++ b/docs/Api/WhatsAppCampaignsApi.md
@@ -1,65 +1,71 @@
# Brevo\Client\WhatsAppCampaignsApi
-All URIs are relative to *https://api.brevo.com/v3*
+All URIs are relative to https://api.brevo.com/v3, except if the operation defines another base path.
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**createWhatsAppCampaign**](WhatsAppCampaignsApi.md#createWhatsAppCampaign) | **POST** /whatsappCampaigns | Create and Send a WhatsApp campaign
-[**createWhatsAppTemplate**](WhatsAppCampaignsApi.md#createWhatsAppTemplate) | **POST** /whatsppCampaigns/template | Create a WhatsApp template
-[**deleteWhatsAppCampaign**](WhatsAppCampaignsApi.md#deleteWhatsAppCampaign) | **DELETE** /whatsappCampaigns/{campaignId} | Delete a WhatsApp campaign
-[**getWhatsAppCampaign**](WhatsAppCampaignsApi.md#getWhatsAppCampaign) | **GET** /whatsappCampaigns/{campaignId} | Get a WhatsApp campaign
-[**getWhatsAppCampaigns**](WhatsAppCampaignsApi.md#getWhatsAppCampaigns) | **GET** /whatsappCampaigns | Return all your created WhatsApp campaigns
-[**getWhatsAppConfig**](WhatsAppCampaignsApi.md#getWhatsAppConfig) | **GET** /whatsappCampaigns/config | Get your WhatsApp API account information
-[**getWhatsAppTemplates**](WhatsAppCampaignsApi.md#getWhatsAppTemplates) | **GET** /whatsappCampaigns/template-list | Return all your created WhatsApp templates
-[**sendWhatsAppTemplateApproval**](WhatsAppCampaignsApi.md#sendWhatsAppTemplateApproval) | **POST** /whatsappCampaigns/template/approval/{templateId} | Send your WhatsApp template for approval
-[**updateWhatsAppCampaign**](WhatsAppCampaignsApi.md#updateWhatsAppCampaign) | **PUT** /whatsappCampaigns/{campaignId} | Update a WhatsApp campaign
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**createWhatsAppCampaign()**](WhatsAppCampaignsApi.md#createWhatsAppCampaign) | **POST** /whatsappCampaigns | Create and Send a WhatsApp campaign |
+| [**createWhatsAppTemplate()**](WhatsAppCampaignsApi.md#createWhatsAppTemplate) | **POST** /whatsappCampaigns/template | Create a WhatsApp template |
+| [**deleteWhatsAppCampaign()**](WhatsAppCampaignsApi.md#deleteWhatsAppCampaign) | **DELETE** /whatsappCampaigns/{campaignId} | Delete a WhatsApp campaign |
+| [**getWhatsAppCampaign()**](WhatsAppCampaignsApi.md#getWhatsAppCampaign) | **GET** /whatsappCampaigns/{campaignId} | Get a WhatsApp campaign |
+| [**getWhatsAppCampaigns()**](WhatsAppCampaignsApi.md#getWhatsAppCampaigns) | **GET** /whatsappCampaigns | Return all your created WhatsApp campaigns |
+| [**getWhatsAppConfig()**](WhatsAppCampaignsApi.md#getWhatsAppConfig) | **GET** /whatsappCampaigns/config | Get your WhatsApp API account information |
+| [**getWhatsAppTemplates()**](WhatsAppCampaignsApi.md#getWhatsAppTemplates) | **GET** /whatsappCampaigns/template-list | Return all your created WhatsApp templates |
+| [**sendWhatsAppTemplateApproval()**](WhatsAppCampaignsApi.md#sendWhatsAppTemplateApproval) | **POST** /whatsappCampaigns/template/approval/{templateId} | Send your WhatsApp template for approval |
+| [**updateWhatsAppCampaign()**](WhatsAppCampaignsApi.md#updateWhatsAppCampaign) | **PUT** /whatsappCampaigns/{campaignId} | Update a WhatsApp campaign |
-# **createWhatsAppCampaign**
-> \Brevo\Client\Model\CreateModel createWhatsAppCampaign($whatsAppCampaigns)
+## `createWhatsAppCampaign()`
+
+```php
+createWhatsAppCampaign($createWhatsAppCampaign): \Brevo\Client\Models\CreateModel
+```
Create and Send a WhatsApp campaign
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\WhatsAppCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$whatsAppCampaigns = new \Brevo\Client\Model\CreateWhatsAppCampaign(); // \Brevo\Client\Model\CreateWhatsAppCampaign | Values to create a campaign
+$createWhatsAppCampaign = new \Brevo\Client\Models\CreateWhatsAppCampaign(); // \Brevo\Client\Models\CreateWhatsAppCampaign | Values to create a WhatsApp Campaign
try {
- $result = $apiInstance->createWhatsAppCampaign($whatsAppCampaigns);
+ $result = $apiInstance->createWhatsAppCampaign($createWhatsAppCampaign);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling WhatsAppCampaignsApi->createWhatsAppCampaign: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **whatsAppCampaigns** | [**\Brevo\Client\Model\CreateWhatsAppCampaign**](../Model/CreateWhatsAppCampaign.md)| Values to create a campaign |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **createWhatsAppCampaign** | [**\Brevo\Client\Models\CreateWhatsAppCampaign**](../Model/CreateWhatsAppCampaign.md)| Values to create a WhatsApp Campaign | |
### Return type
-[**\Brevo\Client\Model\CreateModel**](../Model/CreateModel.md)
+[**\Brevo\Client\Models\CreateModel**](../Model/CreateModel.md)
### Authorization
@@ -67,56 +73,64 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **createWhatsAppTemplate**
-> \Brevo\Client\Model\CreateModel createWhatsAppTemplate($whatsAppTemplates)
+## `createWhatsAppTemplate()`
+
+```php
+createWhatsAppTemplate($createWhatsAppTemplate): \Brevo\Client\Models\CreateModel
+```
Create a WhatsApp template
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\WhatsAppCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$whatsAppTemplates = new \Brevo\Client\Model\CreateWhatsAppTemplate(); // \Brevo\Client\Model\CreateWhatsAppTemplate | Values to create a template
+$createWhatsAppTemplate = new \Brevo\Client\Models\CreateWhatsAppTemplate(); // \Brevo\Client\Models\CreateWhatsAppTemplate | Values to create a WhatsApp template
try {
- $result = $apiInstance->createWhatsAppTemplate($whatsAppTemplates);
+ $result = $apiInstance->createWhatsAppTemplate($createWhatsAppTemplate);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling WhatsAppCampaignsApi->createWhatsAppTemplate: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **whatsAppTemplates** | [**\Brevo\Client\Model\CreateWhatsAppTemplate**](../Model/CreateWhatsAppTemplate.md)| Values to create a template |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **createWhatsAppTemplate** | [**\Brevo\Client\Models\CreateWhatsAppTemplate**](../Model/CreateWhatsAppTemplate.md)| Values to create a WhatsApp template | |
### Return type
-[**\Brevo\Client\Model\CreateModel**](../Model/CreateModel.md)
+[**\Brevo\Client\Models\CreateModel**](../Model/CreateModel.md)
### Authorization
@@ -124,51 +138,59 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `deleteWhatsAppCampaign()`
-# **deleteWhatsAppCampaign**
-> deleteWhatsAppCampaign($campaignId)
+```php
+deleteWhatsAppCampaign($campaignId)
+```
Delete a WhatsApp campaign
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\WhatsAppCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$campaignId = 789; // int | id of the campaign
+$campaignId = 56; // int | id of the campaign
try {
$apiInstance->deleteWhatsAppCampaign($campaignId);
} catch (Exception $e) {
echo 'Exception when calling WhatsAppCampaignsApi->deleteWhatsAppCampaign: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **campaignId** | **int**| id of the campaign |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **campaignId** | **int**| id of the campaign | |
### Return type
@@ -180,37 +202,46 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getWhatsAppCampaign**
-> \Brevo\Client\Model\GetWhatsappCampaignOverview getWhatsAppCampaign($campaignId)
+## `getWhatsAppCampaign()`
+
+```php
+getWhatsAppCampaign($campaignId): \Brevo\Client\Models\GetWhatsappCampaignOverview
+```
Get a WhatsApp campaign
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\WhatsAppCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$campaignId = 789; // int | Id of the campaign
+$campaignId = 56; // int | Id of the campaign
try {
$result = $apiInstance->getWhatsAppCampaign($campaignId);
@@ -218,18 +249,17 @@ try {
} catch (Exception $e) {
echo 'Exception when calling WhatsAppCampaignsApi->getWhatsAppCampaign: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **campaignId** | **int**| Id of the campaign |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **campaignId** | **int**| Id of the campaign | |
### Return type
-[**\Brevo\Client\Model\GetWhatsappCampaignOverview**](../Model/GetWhatsappCampaignOverview.md)
+[**\Brevo\Client\Models\GetWhatsappCampaignOverview**](../Model/GetWhatsappCampaignOverview.md)
### Authorization
@@ -237,41 +267,50 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `getWhatsAppCampaigns()`
-# **getWhatsAppCampaigns**
-> \Brevo\Client\Model\GetWhatsappCampaigns getWhatsAppCampaigns($startDate, $endDate, $limit, $offset, $sort)
+```php
+getWhatsAppCampaigns($startDate, $endDate, $limit, $offset, $sort): \Brevo\Client\Models\GetWhatsappCampaigns
+```
Return all your created WhatsApp campaigns
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\WhatsAppCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$startDate = "startDate_example"; // string | **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the campaigns created. **Prefer to pass your timezone in date-time format for accurate result**
-$endDate = "endDate_example"; // string | **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the campaigns created. **Prefer to pass your timezone in date-time format for accurate result**
+$startDate = 'startDate_example'; // string | **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the WhatsApp campaigns created. **Prefer to pass your timezone in date-time format for accurate result**
+$endDate = 'endDate_example'; // string | **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the WhatsApp campaigns created. **Prefer to pass your timezone in date-time format for accurate result**
$limit = 50; // int | Number of documents per page
$offset = 0; // int | Index of the first document in the page
-$sort = "desc"; // string | Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed
+$sort = 'desc'; // string | Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed
try {
$result = $apiInstance->getWhatsAppCampaigns($startDate, $endDate, $limit, $offset, $sort);
@@ -279,22 +318,21 @@ try {
} catch (Exception $e) {
echo 'Exception when calling WhatsAppCampaignsApi->getWhatsAppCampaigns: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **startDate** | **string**| **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the campaigns created. **Prefer to pass your timezone in date-time format for accurate result** | [optional]
- **endDate** | **string**| **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the campaigns created. **Prefer to pass your timezone in date-time format for accurate result** | [optional]
- **limit** | **int**| Number of documents per page | [optional] [default to 50]
- **offset** | **int**| Index of the first document in the page | [optional] [default to 0]
- **sort** | **string**| Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **startDate** | **string**| **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the WhatsApp campaigns created. **Prefer to pass your timezone in date-time format for accurate result** | [optional] |
+| **endDate** | **string**| **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the WhatsApp campaigns created. **Prefer to pass your timezone in date-time format for accurate result** | [optional] |
+| **limit** | **int**| Number of documents per page | [optional] [default to 50] |
+| **offset** | **int**| Index of the first document in the page | [optional] [default to 0] |
+| **sort** | **string**| Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed | [optional] [default to 'desc'] |
### Return type
-[**\Brevo\Client\Model\GetWhatsappCampaigns**](../Model/GetWhatsappCampaigns.md)
+[**\Brevo\Client\Models\GetWhatsappCampaigns**](../Model/GetWhatsappCampaigns.md)
### Authorization
@@ -302,30 +340,39 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getWhatsAppConfig**
-> \Brevo\Client\Model\GetWhatsAppConfig getWhatsAppConfig()
+## `getWhatsAppConfig()`
+
+```php
+getWhatsAppConfig(): \Brevo\Client\Models\GetWhatsAppConfig
+```
Get your WhatsApp API account information
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\WhatsAppCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
@@ -339,15 +386,15 @@ try {
} catch (Exception $e) {
echo 'Exception when calling WhatsAppCampaignsApi->getWhatsAppConfig: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
+
This endpoint does not need any parameter.
### Return type
-[**\Brevo\Client\Model\GetWhatsAppConfig**](../Model/GetWhatsAppConfig.md)
+[**\Brevo\Client\Models\GetWhatsAppConfig**](../Model/GetWhatsAppConfig.md)
### Authorization
@@ -355,42 +402,51 @@ This endpoint does not need any parameter.
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **getWhatsAppTemplates**
-> \Brevo\Client\Model\GetWATemplates getWhatsAppTemplates($startDate, $endDate, $limit, $offset, $sort, $source)
+## `getWhatsAppTemplates()`
+
+```php
+getWhatsAppTemplates($startDate, $endDate, $limit, $offset, $sort, $source): \Brevo\Client\Models\GetWhatsappTemplates
+```
Return all your created WhatsApp templates
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\WhatsAppCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$startDate = "startDate_example"; // string | **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result**
-$endDate = "endDate_example"; // string | **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result**
+$startDate = 'startDate_example'; // string | **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result**
+$endDate = 'endDate_example'; // string | **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result**
$limit = 50; // int | Number of documents per page
$offset = 0; // int | Index of the first document in the page
-$sort = "desc"; // string | Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed
-$source = "source_example"; // string | source of the template
+$sort = 'desc'; // string | Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed
+$source = 'source_example'; // string | source of the template
try {
$result = $apiInstance->getWhatsAppTemplates($startDate, $endDate, $limit, $offset, $sort, $source);
@@ -398,23 +454,22 @@ try {
} catch (Exception $e) {
echo 'Exception when calling WhatsAppCampaignsApi->getWhatsAppTemplates: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **startDate** | **string**| **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** | [optional]
- **endDate** | **string**| **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** | [optional]
- **limit** | **int**| Number of documents per page | [optional] [default to 50]
- **offset** | **int**| Index of the first document in the page | [optional] [default to 0]
- **sort** | **string**| Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
- **source** | **string**| source of the template | [optional]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **startDate** | **string**| **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** | [optional] |
+| **endDate** | **string**| **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** | [optional] |
+| **limit** | **int**| Number of documents per page | [optional] [default to 50] |
+| **offset** | **int**| Index of the first document in the page | [optional] [default to 0] |
+| **sort** | **string**| Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed | [optional] [default to 'desc'] |
+| **source** | **string**| source of the template | [optional] |
### Return type
-[**\Brevo\Client\Model\GetWATemplates**](../Model/GetWATemplates.md)
+[**\Brevo\Client\Models\GetWhatsappTemplates**](../Model/GetWhatsappTemplates.md)
### Authorization
@@ -422,51 +477,59 @@ Name | Type | Description | Notes
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **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)
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+## `sendWhatsAppTemplateApproval()`
-# **sendWhatsAppTemplateApproval**
-> sendWhatsAppTemplateApproval($templateId)
+```php
+sendWhatsAppTemplateApproval($templateId)
+```
Send your WhatsApp template for approval
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\WhatsAppCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$templateId = 789; // int | id of the campaign
+$templateId = 56; // int | id of the template
try {
$apiInstance->sendWhatsAppTemplateApproval($templateId);
} catch (Exception $e) {
echo 'Exception when calling WhatsAppCampaignsApi->sendWhatsAppTemplateApproval: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **templateId** | **int**| id of the campaign |
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **templateId** | **int**| id of the template | |
### Return type
@@ -478,53 +541,61 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
-# **updateWhatsAppCampaign**
-> updateWhatsAppCampaign($campaignId, $whatsAppCampaign)
+## `updateWhatsAppCampaign()`
+
+```php
+updateWhatsAppCampaign($campaignId, $updateWhatsAppCampaign)
+```
Update a WhatsApp campaign
### Example
+
```php
setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
+
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
+
$apiInstance = new Brevo\Client\Api\WhatsAppCampaignsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
-$campaignId = 789; // int | Id of the campaign
-$whatsAppCampaign = new \Brevo\Client\Model\UpdateWhatsAppCampaign(); // \Brevo\Client\Model\UpdateWhatsAppCampaign | values to update WhatsApp Campaign
+$campaignId = 56; // int | id of the campaign
+$updateWhatsAppCampaign = new \Brevo\Client\Models\UpdateWhatsAppCampaign(); // \Brevo\Client\Models\UpdateWhatsAppCampaign | Values to update a WhatsApp Campaign
try {
- $apiInstance->updateWhatsAppCampaign($campaignId, $whatsAppCampaign);
+ $apiInstance->updateWhatsAppCampaign($campaignId, $updateWhatsAppCampaign);
} catch (Exception $e) {
echo 'Exception when calling WhatsAppCampaignsApi->updateWhatsAppCampaign: ', $e->getMessage(), PHP_EOL;
}
-?>
```
### Parameters
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **campaignId** | **int**| Id of the campaign |
- **whatsAppCampaign** | [**\Brevo\Client\Model\UpdateWhatsAppCampaign**](../Model/UpdateWhatsAppCampaign.md)| values to update WhatsApp Campaign | [optional]
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **campaignId** | **int**| id of the campaign | |
+| **updateWhatsAppCampaign** | [**\Brevo\Client\Models\UpdateWhatsAppCampaign**](../Model/UpdateWhatsAppCampaign.md)| Values to update a WhatsApp Campaign | |
### Return type
@@ -536,8 +607,9 @@ void (empty response body)
### HTTP request headers
- - **Content-Type**: application/json
- - **Accept**: application/json
-
-[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
+- **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)
diff --git a/docs/Model/AbTestCampaignResult.md b/docs/Model/AbTestCampaignResult.md
index b3c5ae9..eacad24 100644
--- a/docs/Model/AbTestCampaignResult.md
+++ b/docs/Model/AbTestCampaignResult.md
@@ -1,17 +1,16 @@
-# AbTestCampaignResult
+# # AbTestCampaignResult
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**winningVersion** | **string** | Winning Campaign Info. pending = Campaign has been picked for sending and winning version is yet to be decided, tie = A tie happened between both the versions, notAvailable = Campaign has not yet been picked for sending. | [optional]
-**winningCriteria** | **string** | Criteria choosen for winning version (Open/Click) | [optional]
-**winningSubjectLine** | **string** | Subject Line of current winning version | [optional]
-**openRate** | **string** | Open rate for current winning version | [optional]
-**clickRate** | **string** | Click rate for current winning version | [optional]
-**winningVersionRate** | **string** | Open/Click rate for the winner version | [optional]
-**statistics** | [**\Brevo\Client\Model\AbTestCampaignResultStatistics**](AbTestCampaignResultStatistics.md) | | [optional]
-**clickedLinks** | [**\Brevo\Client\Model\AbTestCampaignResultClickedLinks**](AbTestCampaignResultClickedLinks.md) | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**winningVersion** | **string** | Winning Campaign Info. pending = Campaign has been picked for sending and winning version is yet to be decided, tie = A tie happened between both the versions, notAvailable = Campaign has not yet been picked for sending. | [optional]
+**winningCriteria** | **string** | Criteria choosen for winning version (Open/Click) | [optional]
+**winningSubjectLine** | **string** | Subject Line of current winning version | [optional]
+**openRate** | **string** | Open rate for current winning version | [optional]
+**clickRate** | **string** | Click rate for current winning version | [optional]
+**winningVersionRate** | **string** | Open/Click rate for the winner version | [optional]
+**statistics** | [**\Brevo\Client\Models\AbTestCampaignResultStatistics**](AbTestCampaignResultStatistics.md) | | [optional]
+**clickedLinks** | [**\Brevo\Client\Models\AbTestCampaignResultClickedLinks**](AbTestCampaignResultClickedLinks.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/AbTestCampaignResultClickedLinks.md b/docs/Model/AbTestCampaignResultClickedLinks.md
index 64a07a5..a87adbb 100644
--- a/docs/Model/AbTestCampaignResultClickedLinks.md
+++ b/docs/Model/AbTestCampaignResultClickedLinks.md
@@ -1,11 +1,10 @@
-# AbTestCampaignResultClickedLinks
+# # AbTestCampaignResultClickedLinks
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**versionA** | [**\Brevo\Client\Model\AbTestVersionClicks**](AbTestVersionClicks.md) | |
-**versionB** | [**\Brevo\Client\Model\AbTestVersionClicks**](AbTestVersionClicks.md) | |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**versionA** | [**\Brevo\Client\Models\AbTestVersionClicksInner[]**](AbTestVersionClicksInner.md) | Information on clicked links for a particular version |
+**versionB** | [**\Brevo\Client\Models\AbTestVersionClicksInner[]**](AbTestVersionClicksInner.md) | Information on clicked links for a particular version |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/AbTestCampaignResultStatistics.md b/docs/Model/AbTestCampaignResultStatistics.md
index 8a081d2..37d2f53 100644
--- a/docs/Model/AbTestCampaignResultStatistics.md
+++ b/docs/Model/AbTestCampaignResultStatistics.md
@@ -1,15 +1,14 @@
-# AbTestCampaignResultStatistics
+# # AbTestCampaignResultStatistics
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**openers** | [**\Brevo\Client\Model\AbTestVersionStats**](AbTestVersionStats.md) | |
-**clicks** | [**\Brevo\Client\Model\AbTestVersionStats**](AbTestVersionStats.md) | |
-**unsubscribed** | [**\Brevo\Client\Model\AbTestVersionStats**](AbTestVersionStats.md) | |
-**hardBounces** | [**\Brevo\Client\Model\AbTestVersionStats**](AbTestVersionStats.md) | |
-**softBounces** | [**\Brevo\Client\Model\AbTestVersionStats**](AbTestVersionStats.md) | |
-**complaints** | [**\Brevo\Client\Model\AbTestVersionStats**](AbTestVersionStats.md) | |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
+**openers** | [**\Brevo\Client\Models\AbTestVersionStats**](AbTestVersionStats.md) | |
+**clicks** | [**\Brevo\Client\Models\AbTestVersionStats**](AbTestVersionStats.md) | |
+**unsubscribed** | [**\Brevo\Client\Models\AbTestVersionStats**](AbTestVersionStats.md) | |
+**hardBounces** | [**\Brevo\Client\Models\AbTestVersionStats**](AbTestVersionStats.md) | |
+**softBounces** | [**\Brevo\Client\Models\AbTestVersionStats**](AbTestVersionStats.md) | |
+**complaints** | [**\Brevo\Client\Models\AbTestVersionStats**](AbTestVersionStats.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/AbTestVersionClicks.md b/docs/Model/AbTestVersionClicks.md
deleted file mode 100644
index b178c69..0000000
--- a/docs/Model/AbTestVersionClicks.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# AbTestVersionClicks
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/AbTestVersionClicksInner.md b/docs/Model/AbTestVersionClicksInner.md
index e83fd39..b4c8784 100644
--- a/docs/Model/AbTestVersionClicksInner.md
+++ b/docs/Model/AbTestVersionClicksInner.md
@@ -1,12 +1,11 @@
-# AbTestVersionClicksInner
+# # AbTestVersionClicksInner
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**link** | **string** | URL of the link |
-**clicksCount** | **int** | Number of times a link is clicked |
-**clickRate** | **string** | Percentage of clicks of link with respect to total clicks |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**link** | **string** | URL of the link |
+**clicksCount** | **int** | Number of times a link is clicked |
+**clickRate** | **string** | Percentage of clicks of link with respect to total clicks |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/AbTestVersionStats.md b/docs/Model/AbTestVersionStats.md
index 270d356..8eda7a3 100644
--- a/docs/Model/AbTestVersionStats.md
+++ b/docs/Model/AbTestVersionStats.md
@@ -1,11 +1,10 @@
-# AbTestVersionStats
+# # AbTestVersionStats
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**versionA** | **string** | percentage of an event for version A |
-**versionB** | **string** | percentage of an event for version B |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**versionA** | **string** | percentage of an event for version A |
+**versionB** | **string** | percentage of an event for version B |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/AddChildDomain.md b/docs/Model/AddChildDomain.md
deleted file mode 100644
index 25d5a30..0000000
--- a/docs/Model/AddChildDomain.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# AddChildDomain
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**domain** | **string** | Sender domain to add for a specific child account | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/AddContactToList.md b/docs/Model/AddContactToList.md
deleted file mode 100644
index 8153336..0000000
--- a/docs/Model/AddContactToList.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# AddContactToList
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**emails** | **string[]** | Mandatory if IDs are not passed, ignored otherwise. Emails to add to a list. You can pass a maximum of 150 emails for addition in one request. If you need to add the emails in bulk, please prefer /contacts/import api. | [optional]
-**ids** | **int[]** | Mandatory if Emails are not passed, ignored otherwise. Emails to add to a list. You can pass a maximum of 150 emails for addition in one request. If you need to add the emails in bulk, please prefer /contacts/import api. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/AddContactToListByEmails.md b/docs/Model/AddContactToListByEmails.md
new file mode 100644
index 0000000..0482f54
--- /dev/null
+++ b/docs/Model/AddContactToListByEmails.md
@@ -0,0 +1,9 @@
+# # AddContactToListByEmails
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**emails** | **string[]** | Emails to add to a list. You can pass a **maximum of 150 emails** for addition in one request. **_If you need to add the emails in bulk, please prefer /contacts/import api._** | [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/AddContactToListByExtIDs.md b/docs/Model/AddContactToListByExtIDs.md
new file mode 100644
index 0000000..de08f1f
--- /dev/null
+++ b/docs/Model/AddContactToListByExtIDs.md
@@ -0,0 +1,9 @@
+# # AddContactToListByExtIDs
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**extIds** | **string[]** | EXT_ID attributes to add to a list. You can pass a **maximum of 150 EXT_ID attributes** for addition in one request. **_If you need to add the emails in bulk, please prefer /contacts/import api._** | [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/AddContactToListByIDs.md b/docs/Model/AddContactToListByIDs.md
new file mode 100644
index 0000000..70d36b6
--- /dev/null
+++ b/docs/Model/AddContactToListByIDs.md
@@ -0,0 +1,9 @@
+# # AddContactToListByIDs
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**ids** | **int[]** | IDs to add to a list. You can pass a **maximum of 150 IDs** for addition in one request. **_If you need to add the emails in bulk, please prefer /contacts/import api._** | [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/AddContactToListRequest.md b/docs/Model/AddContactToListRequest.md
new file mode 100644
index 0000000..c3d6df2
--- /dev/null
+++ b/docs/Model/AddContactToListRequest.md
@@ -0,0 +1,11 @@
+# # AddContactToListRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**emails** | **string[]** | Emails to add to a list. You can pass a **maximum of 150 emails** for addition in one request. **_If you need to add the emails in bulk, please prefer /contacts/import api._** | [optional]
+**ids** | **int[]** | IDs to add to a list. You can pass a **maximum of 150 IDs** for addition in one request. **_If you need to add the emails in bulk, please prefer /contacts/import api._** | [optional]
+**extIds** | **string[]** | EXT_ID attributes to add to a list. You can pass a **maximum of 150 EXT_ID attributes** for addition in one request. **_If you need to add the emails in bulk, please prefer /contacts/import api._** | [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/AddCredits.md b/docs/Model/AddCredits.md
deleted file mode 100644
index 81e3694..0000000
--- a/docs/Model/AddCredits.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# AddCredits
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**sms** | **int** | Required if email credits are empty. SMS credits to be added to the child account | [optional]
-**email** | **int** | Required if sms credits are empty. Email credits to be added to the child account | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/AttributeRewardPayload.md b/docs/Model/AttributeRewardPayload.md
new file mode 100644
index 0000000..d3e8c0b
--- /dev/null
+++ b/docs/Model/AttributeRewardPayload.md
@@ -0,0 +1,11 @@
+# # AttributeRewardPayload
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**rewardId** | **string** | Reward id |
+**contactId** | **float** | Contact to attribute the reward | [optional]
+**loyaltySubscriptionId** | **string** | One of contactId or loyaltySubscriptionId is required | [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/AttributedRewardFailedConditionErrorResponse.md b/docs/Model/AttributedRewardFailedConditionErrorResponse.md
new file mode 100644
index 0000000..ec57fd2
--- /dev/null
+++ b/docs/Model/AttributedRewardFailedConditionErrorResponse.md
@@ -0,0 +1,9 @@
+# # AttributedRewardFailedConditionErrorResponse
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**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/AuthenticateDomainModel.md b/docs/Model/AuthenticateDomainModel.md
index fdebfed..517dbb3 100644
--- a/docs/Model/AuthenticateDomainModel.md
+++ b/docs/Model/AuthenticateDomainModel.md
@@ -1,11 +1,10 @@
-# AuthenticateDomainModel
+# # AuthenticateDomainModel
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**domainName** | **string** | Domain |
-**message** | **string** | Success message |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**domainName** | **string** | Domain |
+**message** | **string** | Success message |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/BadRequestPayload.md b/docs/Model/BadRequestPayload.md
new file mode 100644
index 0000000..c7c7a04
--- /dev/null
+++ b/docs/Model/BadRequestPayload.md
@@ -0,0 +1,9 @@
+# # BadRequestPayload
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**error** | **string** | Readable message associated to the failure | [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/Balance.md b/docs/Model/Balance.md
new file mode 100644
index 0000000..a384b26
--- /dev/null
+++ b/docs/Model/Balance.md
@@ -0,0 +1,11 @@
+# # Balance
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**loyaltyProgramId** | **string** | Loyalty program Id | [optional]
+**contactId** | **int** | Contact Id associated with the balance | [optional]
+**balances** | [**\Brevo\Client\Models\BalanceBalancesInner[]**](BalanceBalancesInner.md) | List of balances | [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/BalanceBalancesInner.md b/docs/Model/BalanceBalancesInner.md
new file mode 100644
index 0000000..8470993
--- /dev/null
+++ b/docs/Model/BalanceBalancesInner.md
@@ -0,0 +1,10 @@
+# # BalanceBalancesInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**balanceDefinitionId** | **string** | Balance definition Id | [optional]
+**value** | **float** | The monetary value corresponding to the current balance | [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/BalanceDefinition.md b/docs/Model/BalanceDefinition.md
new file mode 100644
index 0000000..71bc412
--- /dev/null
+++ b/docs/Model/BalanceDefinition.md
@@ -0,0 +1,26 @@
+# # BalanceDefinition
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | Unique identifier for the balance definition. | [optional]
+**name** | **string** | Name for the balance definition | [optional]
+**description** | **string** | Description for the balance definition | [optional]
+**meta** | **object** | Additional metadata related to the balance definition. | [optional]
+**unit** | **string** | The unit for this balance definition | [optional]
+**minAmount** | **float** | Minimum possible amount for balance | [optional]
+**maxAmount** | **float** | Maximum possible amount for balance | [optional]
+**maximumCreditAmountLimit** | **float** | Maximum credit amount limit per operation | [optional]
+**maximumDebitAmountLimit** | **float** | Maximum debit amount limit per operation | [optional]
+**balanceOptionAmountOvertakingStrategy** | **string** | Partial enables partial credit of balance if maximum balance limit is reaching. Strict enables rejection of transaction if it will breach the max credit amount limit. | [optional]
+**balanceOptionCreditRounding** | **string** | | [optional]
+**balanceOptionDebitRounding** | **string** | | [optional]
+**balanceAvailabilityDurationValue** | **float** | Number of days/weeks/month/year for balance expiry | [optional]
+**balanceAvailabilityDurationUnit** | **string** | Unit of time for the balance's availability (e.g., day/week/month/year). | [optional]
+**balanceAvailabilityDurationModifier** | **string** | startOfPeriod depicts the balancy expiry on start of day/week/month/year. endOfPeriod depicts the balancy expiry on end of day/week/month/year | [optional]
+**balanceExpirationDate** | **\DateTime** | Date when the balance expires and can no longer be used, in dd/mm format. The balance will be expired when this date appears next in the calendar and only one of balanceExpirationDate or balance availability fields can be used. | [optional]
+**createdAt** | **\DateTime** | | [optional]
+**updatedAt** | **\DateTime** | | [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/BalanceDefinitionIdDoesNotExist.md b/docs/Model/BalanceDefinitionIdDoesNotExist.md
new file mode 100644
index 0000000..8f440f7
--- /dev/null
+++ b/docs/Model/BalanceDefinitionIdDoesNotExist.md
@@ -0,0 +1,9 @@
+# # BalanceDefinitionIdDoesNotExist
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**error** | **string** | Provided balance definition id does not exist | [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/BalanceDefinitionPage.md b/docs/Model/BalanceDefinitionPage.md
new file mode 100644
index 0000000..eac0497
--- /dev/null
+++ b/docs/Model/BalanceDefinitionPage.md
@@ -0,0 +1,9 @@
+# # BalanceDefinitionPage
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**items** | [**\Brevo\Client\Models\BalanceDefinition[]**](BalanceDefinition.md) | Balance definition list | [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/BalanceLimit.md b/docs/Model/BalanceLimit.md
new file mode 100644
index 0000000..b96ece7
--- /dev/null
+++ b/docs/Model/BalanceLimit.md
@@ -0,0 +1,13 @@
+# # BalanceLimit
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**constraintType** | **string** | Select amount to define constraints on amount and transaction to define constraints on transaction | [optional] [default to 'amount']
+**transactionType** | **string** | Select debit to configure limit for debit transaction type. Select credit to configure limit for credit transaction type | [optional] [default to 'debit']
+**durationValue** | **int** | Number of days/weeks/month/year for balance limit | [optional]
+**durationUnit** | **string** | Unit for the balance's availability | [optional] [default to 'day']
+**value** | **float** | The value or amount associated with the balance limit. | [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/BalanceLimitPayload.md b/docs/Model/BalanceLimitPayload.md
new file mode 100644
index 0000000..ad7907b
--- /dev/null
+++ b/docs/Model/BalanceLimitPayload.md
@@ -0,0 +1,14 @@
+# # BalanceLimitPayload
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | Unique identifier for the balance limit in UUID format. | [optional]
+**transactionType** | **string** | | [optional]
+**durationValue** | **int** | Number of days/weeks/month/year for balance expiry | [optional]
+**durationUnit** | **string** | Unit of time for the balance's availability (e.g., day/week/month/year). | [optional]
+**value** | **float** | The value or amount associated with the balance limit. | [optional]
+**constraintType** | **string** | Defines the type of constraint imposed by the balance limit. | [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/BalancePage.md b/docs/Model/BalancePage.md
new file mode 100644
index 0000000..7669778
--- /dev/null
+++ b/docs/Model/BalancePage.md
@@ -0,0 +1,9 @@
+# # BalancePage
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**balance** | [**\Brevo\Client\Models\Balance**](Balance.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/BlockDomain.md b/docs/Model/BlockDomain.md
index 4410eda..ebd9056 100644
--- a/docs/Model/BlockDomain.md
+++ b/docs/Model/BlockDomain.md
@@ -1,10 +1,9 @@
-# BlockDomain
+# # BlockDomain
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**domain** | **string** | name of the domain to be blocked |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**domain** | **string** | name of the domain to be blocked |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/Body.md b/docs/Model/Body.md
deleted file mode 100644
index a8259be..0000000
--- a/docs/Model/Body.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# Body
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**groupName** | **string** | The name of the group of sub-accounts |
-**subAccountIds** | **int[]** | Pass the list of sub-account Ids to be included in the group | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/Body1.md b/docs/Model/Body1.md
deleted file mode 100644
index 4ddc5ee..0000000
--- a/docs/Model/Body1.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# Body1
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**groupName** | **string** | The name of the group of sub-accounts |
-**subAccountIds** | **int[]** | Pass the list of sub-account Ids to be included in the group | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/Body10.md b/docs/Model/Body10.md
deleted file mode 100644
index 5552229..0000000
--- a/docs/Model/Body10.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# Body10
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**visitorId** | **string** | visitor’s ID received <a href=\"https://developers.brevo.com/docs/conversations-webhooks\">from a webhook</a> or generated by you to <a href=\"https://developers.brevo.com/docs/customize-the-widget#identifying-existing-users\">bind existing user account to Conversations</a> |
-**text** | **string** | message text |
-**agentId** | **string** | agent ID. It can be found on agent’s page or received <a href=\"https://developers.brevo.com/docs/conversations-webhooks\">from a webhook</a>. Alternatively, you can use `agentEmail` + `agentName` + `receivedFrom` instead (all 3 fields required). | [optional]
-**receivedFrom** | **string** | mark your messages to distinguish messages created by you from the others. | [optional]
-**agentEmail** | **string** | agent email. When sending messages from a standalone system, it’s hard to maintain a 1-to-1 relationship between the users of both systems. In this case, an agent can be specified by their email address. | [optional]
-**agentName** | **string** | agent name | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/Body11.md b/docs/Model/Body11.md
deleted file mode 100644
index e74265d..0000000
--- a/docs/Model/Body11.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# Body11
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**text** | **string** | edited message text |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/Body12.md b/docs/Model/Body12.md
deleted file mode 100644
index 6ca690c..0000000
--- a/docs/Model/Body12.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# Body12
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**visitorId** | **string** | visitor’s ID received <a href=\"https://developers.brevo.com/docs/conversations-webhooks\">from a webhook</a> or generated by you to <a href=\"https://developers.brevo.com/docs/customize-the-widget#identifying-existing-users\">bind existing user account to Conversations</a> |
-**text** | **string** | message text |
-**agentId** | **string** | agent ID. It can be found on agent’s page or received <a href=\"https://developers.brevo.com/docs/conversations-webhooks\">from a webhook</a>. Optional if `groupId` is set. | [optional]
-**groupId** | **string** | group ID. It can be found on group’s page. Optional if `agentId` is set. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/Body13.md b/docs/Model/Body13.md
deleted file mode 100644
index c317817..0000000
--- a/docs/Model/Body13.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# Body13
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**text** | **string** | edited message text |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/Body14.md b/docs/Model/Body14.md
deleted file mode 100644
index 00d11af..0000000
--- a/docs/Model/Body14.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# Body14
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**agentId** | **string** | agent ID. It can be found on agent’s page or received <a href=\"https://developers.brevo.com/docs/conversations-webhooks\">from a webhook</a>. Alternatively, you can use `agentEmail` + `agentName` + `receivedFrom` instead (all 3 fields required). | [optional]
-**receivedFrom** | **string** | mark your messages to distinguish messages created by you from the others. | [optional]
-**agentEmail** | **string** | agent email. When sending online pings from a standalone system, it’s hard to maintain a 1-to-1 relationship between the users of both systems. In this case, an agent can be specified by their email address. If there’s no agent with the specified email address in your Brevo organization, a dummy agent will be created automatically. | [optional]
-**agentName** | **string** | agent name. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/Body2.md b/docs/Model/Body2.md
deleted file mode 100644
index 49657a1..0000000
--- a/docs/Model/Body2.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# Body2
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**name** | **string** | Name of company |
-**attributes** | **object** | Attributes for company creation | [optional]
-**countryCode** | **int** | Country code if phone_number is passed in attributes. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/Body3.md b/docs/Model/Body3.md
deleted file mode 100644
index 66ca62b..0000000
--- a/docs/Model/Body3.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# Body3
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**name** | **string** | Name of company | [optional]
-**attributes** | **object** | Attributes for company update | [optional]
-**countryCode** | **int** | Country code if phone_number is passed in attributes. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/Body4.md b/docs/Model/Body4.md
deleted file mode 100644
index 5229618..0000000
--- a/docs/Model/Body4.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# Body4
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**linkContactIds** | **int[]** | Contact ids for contacts to be linked with company | [optional]
-**unlinkContactIds** | **int[]** | Contact ids for contacts to be unlinked from company | [optional]
-**linkDealsIds** | **string[]** | Deals ids for deals to be linked with company | [optional]
-**unlinkDealsIds** | **string[]** | Deals ids for deals to be unlinked from company | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/Body5.md b/docs/Model/Body5.md
deleted file mode 100644
index 12bb233..0000000
--- a/docs/Model/Body5.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# Body5
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**name** | **string** | Name of deal |
-**attributes** | **object** | Attributes for deal creation If you want to create a deal on a specific pipeline and stage you can use the following attributes `pipeline` and `deal_stage`. Pipeline and deal_stage are ids you can fetch using this endpoint `/crm/pipeline/details/{pipelineID}` | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/Body6.md b/docs/Model/Body6.md
deleted file mode 100644
index b9e9d14..0000000
--- a/docs/Model/Body6.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# Body6
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**name** | **string** | Name of deal | [optional]
-**attributes** | **object** | Attributes for deal update If you wish to update the pipeline of a deal you need to provide the `pipeline` and the `deal_stage`. Pipeline and deal_stage are ids you can fetch using this endpoint `/crm/pipeline/details/{pipelineID}` | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/Body7.md b/docs/Model/Body7.md
deleted file mode 100644
index 409dc33..0000000
--- a/docs/Model/Body7.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# Body7
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**linkContactIds** | **int[]** | Contact ids for contacts to be linked with deal | [optional]
-**unlinkContactIds** | **int[]** | Contact ids for contacts to be unlinked from deal | [optional]
-**linkCompanyIds** | **string[]** | Company ids to be linked with deal | [optional]
-**unlinkCompanyIds** | **string[]** | Company ids to be unlinked from deal | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/Body8.md b/docs/Model/Body8.md
deleted file mode 100644
index a35d577..0000000
--- a/docs/Model/Body8.md
+++ /dev/null
@@ -1,20 +0,0 @@
-# Body8
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**name** | **string** | Name of task |
-**duration** | **int** | Duration of task in milliseconds [1 minute = 60000 ms] | [optional]
-**taskTypeId** | **string** | Id for type of task e.g Call / Email / Meeting etc. |
-**date** | [**\DateTime**] | Task due date and time |
-**notes** | **string** | Notes added to a task | [optional]
-**done** | **bool** | Task marked as done | [optional]
-**assignToId** | **string** | User id to whom task is assigned | [optional]
-**contactsIds** | **int[]** | Contact ids for contacts linked to this task | [optional]
-**dealsIds** | **string[]** | Deal ids for deals a task is linked to | [optional]
-**companiesIds** | **string[]** | Companies ids for companies a task is linked to | [optional]
-**reminder** | [**\Brevo\Client\Model\TaskReminder**](TaskReminder.md) | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/Body9.md b/docs/Model/Body9.md
deleted file mode 100644
index 393dac0..0000000
--- a/docs/Model/Body9.md
+++ /dev/null
@@ -1,19 +0,0 @@
-# Body9
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**name** | **string** | Name of task | [optional]
-**duration** | **int** | Duration of task in milliseconds [1 minute = 60000 ms] | [optional]
-**taskTypeId** | **string** | Id for type of task e.g Call / Email / Meeting etc. | [optional]
-**date** | [**\DateTime**] | Task date/time | [optional]
-**notes** | **string** | Notes added to a task | [optional]
-**done** | **bool** | Task marked as done | [optional]
-**assignToId** | **string** | User id to whom task is assigned | [optional]
-**contactsIds** | **int[]** | Contact ids for contacts linked to this task | [optional]
-**dealsIds** | **string[]** | Deal ids for deals a task is linked to | [optional]
-**companiesIds** | **string[]** | Companies ids for companies a task is linked to | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/BodyVariablesItems.md b/docs/Model/BodyVariablesItems.md
deleted file mode 100644
index 71240ad..0000000
--- a/docs/Model/BodyVariablesItems.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# BodyVariablesItems
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/CancelledTransaction.md b/docs/Model/CancelledTransaction.md
new file mode 100644
index 0000000..f30850b
--- /dev/null
+++ b/docs/Model/CancelledTransaction.md
@@ -0,0 +1,19 @@
+# # CancelledTransaction
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | Unique identifier for the transaction. | [optional]
+**status** | **string** | Current status of the transaction, indicating its state (draft/complete/cancelled/rejected/expired) | [optional]
+**amount** | **float** | The monetary value of the transaction. | [optional]
+**meta** | **object** | Additional metadata related to the transaction | [optional]
+**rejectedAt** | **\DateTime** | Timestamp indicating when the transaction was rejected | [optional]
+**rejectReason** | **string** | Reason for rejecting the transaction | [optional]
+**expirationDate** | **\DateTime** | Date when the transaction expires if not completed. | [optional]
+**completedAt** | **\DateTime** | | [optional]
+**cancelledAt** | **\DateTime** | | [optional]
+**createdAt** | **\DateTime** | | [optional]
+**updatedAt** | **\DateTime** | | [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/Cart.md b/docs/Model/Cart.md
new file mode 100644
index 0000000..93e7a93
--- /dev/null
+++ b/docs/Model/Cart.md
@@ -0,0 +1,10 @@
+# # Cart
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**currency** | **string** | Currency code for the payment amount. |
+**specificAmount** | **int** | Payment amount, in cents. e.g. if you want to request €12.00, then the amount in cents is 1200. |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/CompaniesIdPatchRequest.md b/docs/Model/CompaniesIdPatchRequest.md
new file mode 100644
index 0000000..51eb8f6
--- /dev/null
+++ b/docs/Model/CompaniesIdPatchRequest.md
@@ -0,0 +1,11 @@
+# # CompaniesIdPatchRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | Name of company | [optional]
+**attributes** | **object** | Attributes for company update | [optional]
+**countryCode** | **int** | Country code if phone_number is passed in attributes. | [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/CompaniesImportPost200Response.md b/docs/Model/CompaniesImportPost200Response.md
new file mode 100644
index 0000000..e799bd3
--- /dev/null
+++ b/docs/Model/CompaniesImportPost200Response.md
@@ -0,0 +1,9 @@
+# # CompaniesImportPost200Response
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**processId** | **int** | The ID of the import process | [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/CompaniesImportPost400Response.md b/docs/Model/CompaniesImportPost400Response.md
new file mode 100644
index 0000000..1b2992e
--- /dev/null
+++ b/docs/Model/CompaniesImportPost400Response.md
@@ -0,0 +1,9 @@
+# # CompaniesImportPost400Response
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**message** | **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/CompaniesLinkUnlinkIdPatchRequest.md b/docs/Model/CompaniesLinkUnlinkIdPatchRequest.md
new file mode 100644
index 0000000..884e4de
--- /dev/null
+++ b/docs/Model/CompaniesLinkUnlinkIdPatchRequest.md
@@ -0,0 +1,12 @@
+# # CompaniesLinkUnlinkIdPatchRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**linkContactIds** | **int[]** | Contact ids for contacts to be linked with company | [optional]
+**unlinkContactIds** | **int[]** | Contact ids for contacts to be unlinked from company | [optional]
+**linkDealsIds** | **string[]** | Deal ids for deals to be linked with company | [optional]
+**unlinkDealsIds** | **string[]** | Deal ids for deals to be unlinked from company | [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/CompaniesList.md b/docs/Model/CompaniesList.md
index ec65186..bc2c553 100644
--- a/docs/Model/CompaniesList.md
+++ b/docs/Model/CompaniesList.md
@@ -1,10 +1,9 @@
-# CompaniesList
+# # CompaniesList
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**items** | [**\Brevo\Client\Model\Company[]**](Company.md) | List of compaies | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**items** | [**\Brevo\Client\Models\Company[]**](Company.md) | List of compaies | [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/CompaniesPost200Response.md b/docs/Model/CompaniesPost200Response.md
new file mode 100644
index 0000000..9c20d05
--- /dev/null
+++ b/docs/Model/CompaniesPost200Response.md
@@ -0,0 +1,9 @@
+# # CompaniesPost200Response
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | Unique company id |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/CompaniesPostRequest.md b/docs/Model/CompaniesPostRequest.md
new file mode 100644
index 0000000..7ef98b9
--- /dev/null
+++ b/docs/Model/CompaniesPostRequest.md
@@ -0,0 +1,13 @@
+# # CompaniesPostRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | Name of company |
+**attributes** | **object** | Attributes for company creation | [optional]
+**countryCode** | **int** | Country code if phone_number is passed in attributes. | [optional]
+**linkedContactsIds** | **int[]** | Contact ids to be linked with company | [optional]
+**linkedDealsIds** | **string[]** | Deal ids to be linked with company | [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/Company.md b/docs/Model/Company.md
index 7bfb6b3..10e242f 100644
--- a/docs/Model/Company.md
+++ b/docs/Model/Company.md
@@ -1,13 +1,12 @@
-# Company
+# # Company
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **string** | Unique company id | [optional]
-**attributes** | **object** | Company attributes with values | [optional]
-**linkedContactsIds** | **int[]** | Contact ids for contacts linked to this company | [optional]
-**linkedDealsIds** | **string[]** | Deals ids for companies linked to this company | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**id** | **string** | Unique comoany id | [optional]
+**attributes** | **object** | Company attributes with values | [optional]
+**linkedContactsIds** | **int[]** | Contact ids for contacts linked to this company | [optional]
+**linkedDealsIds** | **string[]** | Deals ids for companies linked to this company | [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/CompanyAttributes.md b/docs/Model/CompanyAttributes.md
deleted file mode 100644
index 3698f9e..0000000
--- a/docs/Model/CompanyAttributes.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# CompanyAttributes
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/CompanyAttributesInner.md b/docs/Model/CompanyAttributesInner.md
index c0011f0..eb30ae6 100644
--- a/docs/Model/CompanyAttributesInner.md
+++ b/docs/Model/CompanyAttributesInner.md
@@ -1,14 +1,13 @@
-# CompanyAttributesInner
+# # CompanyAttributesInner
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**internalName** | **string** | | [optional]
-**label** | **string** | | [optional]
-**attributeTypeName** | **string** | | [optional]
-**attributeOptions** | **object[]** | | [optional]
-**isRequired** | **bool** | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**internalName** | **string** | | [optional]
+**label** | **string** | | [optional]
+**attributeTypeName** | **string** | | [optional]
+**attributeOptions** | **object[]** | | [optional]
+**isRequired** | **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/CompleteTransactionPayload.md b/docs/Model/CompleteTransactionPayload.md
new file mode 100644
index 0000000..a31641a
--- /dev/null
+++ b/docs/Model/CompleteTransactionPayload.md
@@ -0,0 +1,9 @@
+# # CompleteTransactionPayload
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**balanceExpiryInMinutes** | **float** | Adds expiry in minutes to the balance on completion of transaction | [optional] [default to 0]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/CompletedTransaction.md b/docs/Model/CompletedTransaction.md
new file mode 100644
index 0000000..03dde9a
--- /dev/null
+++ b/docs/Model/CompletedTransaction.md
@@ -0,0 +1,19 @@
+# # CompletedTransaction
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | Unique identifier for the transaction. | [optional]
+**status** | **string** | Current status of the transaction, indicating its state (draft/complete/cancelled/rejected/expired) | [optional]
+**amount** | **float** | The monetary value of the transaction. | [optional]
+**meta** | **object** | Additional metadata related to the transaction | [optional]
+**rejectedAt** | **\DateTime** | Timestamp indicating when the transaction was rejected | [optional]
+**rejectReason** | **string** | Reason for rejecting the transaction | [optional]
+**expirationDate** | **\DateTime** | Date when the transaction expires if not completed. | [optional]
+**completedAt** | **\DateTime** | | [optional]
+**cancelledAt** | **\DateTime** | | [optional]
+**createdAt** | **\DateTime** | | [optional]
+**updatedAt** | **\DateTime** | | [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/ComponentItems.md b/docs/Model/ComponentItems.md
index 9b44af1..df429f0 100644
--- a/docs/Model/ComponentItems.md
+++ b/docs/Model/ComponentItems.md
@@ -1,11 +1,10 @@
-# ComponentItems
+# # ComponentItems
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**type** | **string** | | [optional]
-**text** | **string** | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**type** | **string** | | [optional]
+**text** | **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/Configuration.md b/docs/Model/Configuration.md
new file mode 100644
index 0000000..35718da
--- /dev/null
+++ b/docs/Model/Configuration.md
@@ -0,0 +1,9 @@
+# # Configuration
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**customSuccessUrl** | **string** | Absolute URL of the custom success page. |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/Contact.md b/docs/Model/Contact.md
deleted file mode 100644
index aa35bd3..0000000
--- a/docs/Model/Contact.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# Contact
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**virtualNextTask** | **object** | Next incomplete task of contact | [optional]
-**email** | **string** | Contact email |
-**assignToId** | **string** | User id to whom contact is assigned | [optional]
-**contactsId** | **int** | Contact id | [optional]
-**crmLists** | **object** | CRM lists in which contact is added |
-**attributes** | **object** | Contact attributes e.g firstname / lastname / SMS etc. | [optional]
-**createdAt** | [**\DateTime**] | Contact created date/time | [optional]
-**updatedAt** | [**\DateTime**] | Contact updated date/time | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/ContactBalances.md b/docs/Model/ContactBalances.md
new file mode 100644
index 0000000..866e65d
--- /dev/null
+++ b/docs/Model/ContactBalances.md
@@ -0,0 +1,12 @@
+# # ContactBalances
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**loyaltyProgramId** | **string** | Unique identifier for the loyalty program. |
+**balanceDefinitionId** | **string** | Unique identifier for the balance definition. |
+**count** | **int** | Total count of balances. |
+**balances** | [**\Brevo\Client\Models\ContactBalancesBalancesInner[]**](ContactBalancesBalancesInner.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/ContactBalancesBalancesInner.md b/docs/Model/ContactBalancesBalancesInner.md
new file mode 100644
index 0000000..134072e
--- /dev/null
+++ b/docs/Model/ContactBalancesBalancesInner.md
@@ -0,0 +1,12 @@
+# # ContactBalancesBalancesInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**contactId** | **int** | Unique identifier for the contact. |
+**value** | **int** | Total balance value associated with the contact. |
+**updatedAt** | **\DateTime** | Timestamp of the last update to the contact's balance record. |
+**loyaltySubscriptionId** | **string** | Identifier for the contact's loyalty subscription. |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/ContactErrorModel.md b/docs/Model/ContactErrorModel.md
new file mode 100644
index 0000000..4bb8abf
--- /dev/null
+++ b/docs/Model/ContactErrorModel.md
@@ -0,0 +1,11 @@
+# # ContactErrorModel
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**code** | **string** | Error code displayed in case of a failure |
+**message** | **string** | Readable message associated to the failure |
+**metadata** | **object** | Additional information about the error | [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/ContactIdInvalidResponse.md b/docs/Model/ContactIdInvalidResponse.md
new file mode 100644
index 0000000..6ea0c1f
--- /dev/null
+++ b/docs/Model/ContactIdInvalidResponse.md
@@ -0,0 +1,9 @@
+# # ContactIdInvalidResponse
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**error** | **string** | Readable message associated to the failure | [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/ConversationsAgentOnlinePingPostRequest.md b/docs/Model/ConversationsAgentOnlinePingPostRequest.md
new file mode 100644
index 0000000..929eb13
--- /dev/null
+++ b/docs/Model/ConversationsAgentOnlinePingPostRequest.md
@@ -0,0 +1,12 @@
+# # ConversationsAgentOnlinePingPostRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**agentId** | **mixed** | agent ID. It can be found on agent’s page or received <a href=\"https://developers.brevo.com/docs/conversations-webhooks\">from a webhook</a>. Alternatively, you can use `agentEmail` + `agentName` + `receivedFrom` instead (all 3 fields required). | [optional]
+**receivedFrom** | **mixed** | mark your messages to distinguish messages created by you from the others. | [optional]
+**agentEmail** | **mixed** | agent email. When sending online pings from a standalone system, it’s hard to maintain a 1-to-1 relationship between the users of both systems. In this case, an agent can be specified by their email address. If there’s no agent with the specified email address in your Brevo organization, a dummy agent will be created automatically. | [optional]
+**agentName** | **mixed** | agent name | [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/ConversationsMessage.md b/docs/Model/ConversationsMessage.md
new file mode 100644
index 0000000..49cea6c
--- /dev/null
+++ b/docs/Model/ConversationsMessage.md
@@ -0,0 +1,18 @@
+# # ConversationsMessage
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | Message ID. It can be used for further manipulations with the message. | [optional]
+**type** | **string** | `\"agent\"` for agents’ messages, `\"visitor\"` for visitors’ messages. | [optional]
+**text** | **string** | Message text or name of the attached file | [optional]
+**visitorId** | **string** | visitor’s ID | [optional]
+**agentId** | **string** | ID of the agent on whose behalf the message was sent (only in messages sent by an agent). | [optional]
+**agentName** | **string** | Agent’s name as displayed to the visitor. Only in the messages sent by an agent. | [optional]
+**createdAt** | **int** | Timestamp in milliseconds. | [optional]
+**isPushed** | **bool** | `true` for pushed messages | [optional]
+**receivedFrom** | **string** | In two-way integrations, messages sent via REST API can be marked with receivedFrom property and then filtered out when received in a webhook to avoid infinite loop. | [optional]
+**file** | [**\Brevo\Client\Models\ConversationsMessageFile**](ConversationsMessageFile.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/ConversationsMessageFile.md b/docs/Model/ConversationsMessageFile.md
index d9d691d..f616a00 100644
--- a/docs/Model/ConversationsMessageFile.md
+++ b/docs/Model/ConversationsMessageFile.md
@@ -1,14 +1,13 @@
-# ConversationsMessageFile
+# # ConversationsMessageFile
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**filename** | **string** | Name of the file | [optional]
-**size** | **int** | Size in bytes | [optional]
-**isImage** | **bool** | Whether the file is an image | [optional]
-**url** | **string** | URL of the file | [optional]
-**imageInfo** | [**\Brevo\Client\Model\ConversationsMessageFileImageInfo**](ConversationsMessageFileImageInfo.md) | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**filename** | **string** | Name of the file | [optional]
+**size** | **int** | Size in bytes | [optional]
+**isImage** | **bool** | Whether the file is an image | [optional]
+**url** | **string** | URL of the file | [optional]
+**imageInfo** | [**\Brevo\Client\Models\ConversationsMessageFileImageInfo**](ConversationsMessageFileImageInfo.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/ConversationsMessagesIdPutRequest.md b/docs/Model/ConversationsMessagesIdPutRequest.md
new file mode 100644
index 0000000..c8ea286
--- /dev/null
+++ b/docs/Model/ConversationsMessagesIdPutRequest.md
@@ -0,0 +1,9 @@
+# # ConversationsMessagesIdPutRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**text** | **string** | edited message text |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/ConversationsMessagesPostRequest.md b/docs/Model/ConversationsMessagesPostRequest.md
new file mode 100644
index 0000000..888c36a
--- /dev/null
+++ b/docs/Model/ConversationsMessagesPostRequest.md
@@ -0,0 +1,14 @@
+# # ConversationsMessagesPostRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**visitorId** | **mixed** | visitor’s ID received <a href=\"https://developers.brevo.com/docs/conversations-webhooks\">from a webhook</a> or generated by you to <a href=\"https://developers.brevo.com/docs/customize-the-widget#identifying-existing-users\">bind existing user account to Conversations</a> |
+**text** | **mixed** | message text |
+**agentId** | **mixed** | agent ID. It can be found on agent’s page or received <a href=\"https://developers.brevo.com/docs/conversations-webhooks\">from a webhook</a>. Alternatively, you can use `agentEmail` + `agentName` + `receivedFrom` instead (all 3 fields required). | [optional]
+**receivedFrom** | **mixed** | mark your messages to distinguish messages created by you from the others. | [optional]
+**agentEmail** | **mixed** | agent email. When sending messages from a standalone system, it’s hard to maintain a 1-to-1 relationship between the users of both systems. In this case, an agent can be specified by their email address. | [optional]
+**agentName** | **mixed** | agent name | [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/ConversationsPushedMessagesPostRequest.md b/docs/Model/ConversationsPushedMessagesPostRequest.md
new file mode 100644
index 0000000..f07380e
--- /dev/null
+++ b/docs/Model/ConversationsPushedMessagesPostRequest.md
@@ -0,0 +1,12 @@
+# # ConversationsPushedMessagesPostRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**visitorId** | **mixed** | visitor’s ID received <a href=\"https://developers.brevo.com/docs/conversations-webhooks\">from a webhook</a> or generated by you to <a href=\"https://developers.brevo.com/docs/customize-the-widget#identifying-existing-users\">bind existing user account to Conversations</a> |
+**text** | **mixed** | message text |
+**agentId** | **mixed** | agent ID. It can be found on agent’s page or received <a href=\"https://developers.brevo.com/docs/conversations-webhooks\">from a webhook</a>. | [optional]
+**groupId** | **mixed** | group ID. It can be found on group’s page. | [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/Conversationsmessage.md b/docs/Model/Conversationsmessage.md
deleted file mode 100644
index 7c0dc49..0000000
--- a/docs/Model/Conversationsmessage.md
+++ /dev/null
@@ -1,19 +0,0 @@
-# ConversationsMessage
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**id** | **string** | Message ID. It can be used for further manipulations with the message. | [optional]
-**type** | **string** | `\"agent\"` for agents’ messages, `\"visitor\"` for visitors’ messages. | [optional]
-**text** | **string** | Message text or name of the attached file | [optional]
-**visitorId** | **string** | visitor’s ID | [optional]
-**agentId** | **string** | ID of the agent on whose behalf the message was sent (only in messages sent by an agent). | [optional]
-**agentName** | **string** | Agent’s name as displayed to the visitor. Only in the messages sent by an agent. | [optional]
-**createdAt** | **int** | Timestamp in milliseconds. | [optional]
-**isPushed** | **bool** | `true` for pushed messages | [optional]
-**receivedFrom** | **string** | In two-way integrations, messages sent via REST API can be marked with receivedFrom property and then filtered out when received in a webhook to avoid infinite loop. | [optional]
-**file** | [**\Brevo\Client\Model\ConversationsMessageFile**](ConversationsMessageFile.md) | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/ConversationsmessageFileImageInfo.md b/docs/Model/ConversationsmessageFileImageInfo.md
index 12e18ca..286e683 100644
--- a/docs/Model/ConversationsmessageFileImageInfo.md
+++ b/docs/Model/ConversationsmessageFileImageInfo.md
@@ -1,12 +1,11 @@
-# ConversationsMessageFileImageInfo
+# # ConversationsMessageFileImageInfo
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**width** | **int** | Width of the image | [optional]
-**height** | **int** | height of the image | [optional]
-**previewUrl** | **string** | URL of the preview | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**width** | **int** | Width of the image | [optional]
+**height** | **int** | height of the image | [optional]
+**previewUrl** | **string** | URL of the preview | [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/ConversionSourceMetrics.md b/docs/Model/ConversionSourceMetrics.md
new file mode 100644
index 0000000..5b6973c
--- /dev/null
+++ b/docs/Model/ConversionSourceMetrics.md
@@ -0,0 +1,13 @@
+# # ConversionSourceMetrics
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **float** | |
+**conversionSource** | **string** | |
+**ordersCount** | **float** | |
+**revenue** | **float** | |
+**averageBasket** | **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/ConversionSourceProduct.md b/docs/Model/ConversionSourceProduct.md
new file mode 100644
index 0000000..db74d2a
--- /dev/null
+++ b/docs/Model/ConversionSourceProduct.md
@@ -0,0 +1,16 @@
+# # ConversionSourceProduct
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | |
+**name** | **string** | | [optional]
+**sku** | **string** | | [optional]
+**price** | **float** | | [optional]
+**url** | **string** | | [optional]
+**imageUrl** | **string** | | [optional]
+**ordersCount** | **int** | | [optional]
+**revenue** | **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/CorporateGroupDetailsResponse.md b/docs/Model/CorporateGroupDetailsResponse.md
new file mode 100644
index 0000000..819e84d
--- /dev/null
+++ b/docs/Model/CorporateGroupDetailsResponse.md
@@ -0,0 +1,11 @@
+# # CorporateGroupDetailsResponse
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**group** | [**\Brevo\Client\Models\CorporateGroupDetailsResponseGroup**](CorporateGroupDetailsResponseGroup.md) | | [optional]
+**subAccounts** | [**\Brevo\Client\Models\CorporateGroupDetailsResponseSubAccountsInner[]**](CorporateGroupDetailsResponseSubAccountsInner.md) | | [optional]
+**users** | [**\Brevo\Client\Models\CorporateGroupDetailsResponseUsersInner[]**](CorporateGroupDetailsResponseUsersInner.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/CorporateGroupDetailsResponseGroup.md b/docs/Model/CorporateGroupDetailsResponseGroup.md
new file mode 100644
index 0000000..df650fa
--- /dev/null
+++ b/docs/Model/CorporateGroupDetailsResponseGroup.md
@@ -0,0 +1,11 @@
+# # CorporateGroupDetailsResponseGroup
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | Group id | [optional]
+**groupName** | **string** | Name of the group | [optional]
+**createdAt** | **string** | Group creation date | [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/CorporateGroupDetailsResponseSubAccountsInner.md b/docs/Model/CorporateGroupDetailsResponseSubAccountsInner.md
new file mode 100644
index 0000000..590597d
--- /dev/null
+++ b/docs/Model/CorporateGroupDetailsResponseSubAccountsInner.md
@@ -0,0 +1,11 @@
+# # CorporateGroupDetailsResponseSubAccountsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | Id of the sub-account organzation | [optional]
+**companyName** | **string** | Name of the sub-account organzation | [optional]
+**createdAt** | **string** | Creation date of the sub-account organzation | [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/CorporateGroupDetailsResponseUsersInner.md b/docs/Model/CorporateGroupDetailsResponseUsersInner.md
new file mode 100644
index 0000000..76855f0
--- /dev/null
+++ b/docs/Model/CorporateGroupDetailsResponseUsersInner.md
@@ -0,0 +1,11 @@
+# # CorporateGroupDetailsResponseUsersInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**email** | **string** | Email address of the user | [optional]
+**lastName** | **string** | Last name of the user | [optional]
+**firstName** | **string** | First name of the user | [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/CorporateGroupIdPutRequest.md b/docs/Model/CorporateGroupIdPutRequest.md
new file mode 100644
index 0000000..e87aa78
--- /dev/null
+++ b/docs/Model/CorporateGroupIdPutRequest.md
@@ -0,0 +1,10 @@
+# # CorporateGroupIdPutRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**groupName** | **string** | The name of the group of sub-accounts | [optional]
+**subAccountIds** | **int[]** | Pass the list of sub-account Ids to be included in the group | [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/CorporateGroupPost201Response.md b/docs/Model/CorporateGroupPost201Response.md
new file mode 100644
index 0000000..415ebaf
--- /dev/null
+++ b/docs/Model/CorporateGroupPost201Response.md
@@ -0,0 +1,9 @@
+# # CorporateGroupPost201Response
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**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/CorporateGroupPostRequest.md b/docs/Model/CorporateGroupPostRequest.md
new file mode 100644
index 0000000..1a67b39
--- /dev/null
+++ b/docs/Model/CorporateGroupPostRequest.md
@@ -0,0 +1,10 @@
+# # CorporateGroupPostRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**groupName** | **string** | The name of the group of sub-accounts |
+**subAccountIds** | **int[]** | Pass the list of sub-account Ids to be included in the group | [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/CorporateGroupUnlinkGroupIdSubAccountsPutRequest.md b/docs/Model/CorporateGroupUnlinkGroupIdSubAccountsPutRequest.md
new file mode 100644
index 0000000..acf8907
--- /dev/null
+++ b/docs/Model/CorporateGroupUnlinkGroupIdSubAccountsPutRequest.md
@@ -0,0 +1,9 @@
+# # CorporateGroupUnlinkGroupIdSubAccountsPutRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**subAccountIds** | **int[]** | List of sub-account ids |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/CorporateIpGet200ResponseInner.md b/docs/Model/CorporateIpGet200ResponseInner.md
new file mode 100644
index 0000000..d937fb3
--- /dev/null
+++ b/docs/Model/CorporateIpGet200ResponseInner.md
@@ -0,0 +1,11 @@
+# # CorporateIpGet200ResponseInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**ip** | **string** | | [optional]
+**domain** | **string** | | [optional]
+**transactional** | **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/CorporateSsoTokenPostRequest.md b/docs/Model/CorporateSsoTokenPostRequest.md
new file mode 100644
index 0000000..7bb5785
--- /dev/null
+++ b/docs/Model/CorporateSsoTokenPostRequest.md
@@ -0,0 +1,9 @@
+# # CorporateSsoTokenPostRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**email** | **string** | User email of admin account |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/CorporateSubAccountIpAssociatePostRequest.md b/docs/Model/CorporateSubAccountIpAssociatePostRequest.md
new file mode 100644
index 0000000..0c29319
--- /dev/null
+++ b/docs/Model/CorporateSubAccountIpAssociatePostRequest.md
@@ -0,0 +1,10 @@
+# # CorporateSubAccountIpAssociatePostRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**ip** | **string** | IP address |
+**ids** | **int[]** | Pass the list of sub-account Ids to be associated with the IP address |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/CorporateSubAccountIpDissociatePutRequest.md b/docs/Model/CorporateSubAccountIpDissociatePutRequest.md
new file mode 100644
index 0000000..2d4e613
--- /dev/null
+++ b/docs/Model/CorporateSubAccountIpDissociatePutRequest.md
@@ -0,0 +1,10 @@
+# # CorporateSubAccountIpDissociatePutRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**ip** | **string** | IP address |
+**ids** | **int[]** | Pass the list of sub-account Ids to be dissociated from the IP address |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/CorporateSubAccountKeyPostRequest.md b/docs/Model/CorporateSubAccountKeyPostRequest.md
new file mode 100644
index 0000000..bc52aa6
--- /dev/null
+++ b/docs/Model/CorporateSubAccountKeyPostRequest.md
@@ -0,0 +1,10 @@
+# # CorporateSubAccountKeyPostRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | Id of the sub-account organization |
+**name** | **string** | Name of the API key |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/CorporateSubAccountSsoTokenPostRequest.md b/docs/Model/CorporateSubAccountSsoTokenPostRequest.md
new file mode 100644
index 0000000..28a4d1d
--- /dev/null
+++ b/docs/Model/CorporateSubAccountSsoTokenPostRequest.md
@@ -0,0 +1,12 @@
+# # CorporateSubAccountSsoTokenPostRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | Id of the sub-account organization |
+**email** | **string** | User email of sub-account organization | [optional]
+**target** | **string** | **Set target after login success** * **automation** - Redirect to Automation after login * **email_campaign** - Redirect to Email Campaign after login * **contacts** - Redirect to Contacts after login * **landing_pages** - Redirect to Landing Pages after login * **email_transactional** - Redirect to Email Transactional after login * **senders** - Redirect to Senders after login * **sms_campaign** - Redirect to Sms Campaign after login * **sms_transactional** - Redirect to Sms Transactional after login | [optional]
+**url** | **string** | Set the full target URL after login success. The user will land directly on this target URL after login | [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/CorporateUserEmailPermissionsPutRequest.md b/docs/Model/CorporateUserEmailPermissionsPutRequest.md
new file mode 100644
index 0000000..761631b
--- /dev/null
+++ b/docs/Model/CorporateUserEmailPermissionsPutRequest.md
@@ -0,0 +1,10 @@
+# # CorporateUserEmailPermissionsPutRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**allFeaturesAccess** | **bool** | All access to the features |
+**privileges** | [**\Brevo\Client\Models\CorporateUserEmailPermissionsPutRequestPrivilegesInner[]**](CorporateUserEmailPermissionsPutRequestPrivilegesInner.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/CorporateUserEmailPermissionsPutRequestPrivilegesInner.md b/docs/Model/CorporateUserEmailPermissionsPutRequestPrivilegesInner.md
new file mode 100644
index 0000000..2c52eda
--- /dev/null
+++ b/docs/Model/CorporateUserEmailPermissionsPutRequestPrivilegesInner.md
@@ -0,0 +1,10 @@
+# # CorporateUserEmailPermissionsPutRequestPrivilegesInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**feature** | **string** | feature name | [optional]
+**permissions** | **string[]** | Permission for the feature | [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/CorporateUserInvitationActionEmailPut200Response.md b/docs/Model/CorporateUserInvitationActionEmailPut200Response.md
new file mode 100644
index 0000000..f19795f
--- /dev/null
+++ b/docs/Model/CorporateUserInvitationActionEmailPut200Response.md
@@ -0,0 +1,9 @@
+# # CorporateUserInvitationActionEmailPut200Response
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**message** | **string** | Action success message | [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/CreateApiKeyRequest.md b/docs/Model/CreateApiKeyRequest.md
deleted file mode 100644
index 252d23e..0000000
--- a/docs/Model/CreateApiKeyRequest.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# CreateApiKeyRequest
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**id** | **int** | Id of the sub-account organization |
-**name** | **string** | Name of the API key | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/CreateApiKeyResponse.md b/docs/Model/CreateApiKeyResponse.md
index 3f3e3ea..59b0265 100644
--- a/docs/Model/CreateApiKeyResponse.md
+++ b/docs/Model/CreateApiKeyResponse.md
@@ -1,11 +1,10 @@
-# CreateApiKeyResponse
+# # CreateApiKeyResponse
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**status** | **string** | Status of the API operation. | [optional]
-**key** | **string** | API Key | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**status** | **string** | Status of the API operation. |
+**key** | **string** | API key |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/CreateAttribute.md b/docs/Model/CreateAttribute.md
index 357be1f..4873191 100644
--- a/docs/Model/CreateAttribute.md
+++ b/docs/Model/CreateAttribute.md
@@ -1,13 +1,13 @@
-# CreateAttribute
+# # CreateAttribute
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**value** | **string** | Value of the attribute. Use only if the attribute's category is 'calculated' or 'global' | [optional]
-**isRecurring** | **bool** | Type of the attribute. Use only if the attribute's category is 'calculated' or 'global' | [optional]
-**enumeration** | [**\Brevo\Client\Model\CreateAttributeEnumeration[]**](CreateAttributeEnumeration.md) | List of values and labels that the attribute can take. Use only if the attribute's category is \"category\". For example, [{\"value\":1, \"label\":\"male\"}, {\"value\":2, \"label\":\"female\"}] | [optional]
-**type** | **string** | Type of the attribute. Use only if the attribute's category is 'normal', 'category' or 'transactional' ( type 'boolean' is only available if the category is 'normal' attribute, type 'id' is only available if the category is 'transactional' attribute & type 'category' is only available if the category is 'category' attribute ) | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**value** | **string** | Value of the attribute. **Use only if the attribute's category is 'calculated' or 'global'** | [optional]
+**isRecurring** | **bool** | Type of the attribute. **Use only if the attribute's category is 'calculated' or 'global'** | [optional]
+**enumeration** | [**\Brevo\Client\Models\CreateAttributeEnumerationInner[]**](CreateAttributeEnumerationInner.md) | List of values and labels that the attribute can take. **Use only if the attribute's category is \"category\"**. For example: **[{\"value\":1, \"label\":\"male\"}, {\"value\":2, \"label\":\"female\"}]** | [optional]
+**multiCategoryOptions** | **string[]** | List of options you want to add for multiple-choice attribute. **Use only if the attribute's category is \"normal\" and attribute's type is \"multiple-choice\".** For example: **[\"USA\",\"INDIA\"]** | [optional]
+**type** | **string** | Type of the attribute. **Use only if the attribute's category is 'normal', 'category' or 'transactional'** Type **boolean and multiple-choice** is only available if the category is **normal** attribute Type **id** is only available if the category is **transactional** attribute Type **category** is only available if the category is **category** attribute | [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/CreateAttributeEnumeration.md b/docs/Model/CreateAttributeEnumeration.md
deleted file mode 100644
index a88a8af..0000000
--- a/docs/Model/CreateAttributeEnumeration.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# CreateAttributeEnumeration
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**value** | **int** | Id of the value |
-**label** | **string** | Label of the value |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/CreateAttributeEnumerationInner.md b/docs/Model/CreateAttributeEnumerationInner.md
new file mode 100644
index 0000000..a931b43
--- /dev/null
+++ b/docs/Model/CreateAttributeEnumerationInner.md
@@ -0,0 +1,10 @@
+# # CreateAttributeEnumerationInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**value** | **int** | Id of the value |
+**label** | **string** | Label of the value |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/CreateBalanceDefinitionPayload.md b/docs/Model/CreateBalanceDefinitionPayload.md
new file mode 100644
index 0000000..3b74ec6
--- /dev/null
+++ b/docs/Model/CreateBalanceDefinitionPayload.md
@@ -0,0 +1,23 @@
+# # CreateBalanceDefinitionPayload
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | Name for the balance |
+**unit** | **string** | The unit for this balance definition. |
+**description** | **string** | Description for the balance | [optional]
+**meta** | **object** | Additional metadata related to the balance definition. | [optional]
+**minAmount** | **float** | Minimum possible amount for balance | [optional]
+**maxAmount** | **float** | Maximum possible amount for balance | [optional]
+**maxCreditAmountLimit** | **float** | Maximum credit amount limit per operation | [optional]
+**maxDebitAmountLimit** | **float** | Maximum debit amount limit per operation | [optional]
+**balanceOptionAmountOvertakingStrategy** | **string** | Select partial to enable partial credit of balance if maximum balance limit is reaching. Select strict to reject the transaction if it will breach the max credit amount limit. | [optional] [default to 'strict']
+**balanceOptionCreditRounding** | **string** | Select natural to round to nearest integer. Select upper to round up . Select lower to round down | [optional] [default to 'natural']
+**balanceOptionDebitRounding** | **string** | Select natural to round to nearest integer. Select upper to round up . Select lower to round down | [optional] [default to 'natural']
+**balanceAvailabilityDurationValue** | **float** | Number of days/weeks/month/year for balance expiry | [optional]
+**balanceAvailabilityDurationUnit** | **string** | Unit for balance expiry (e.g., day/week/month/year). | [optional] [default to 'day']
+**balanceAvailabilityDurationModifier** | **string** | Select startOfPeriod to configure balance expiry on start of day/week/month/year. Select endOfPeriod to configure balance expiry on end of day/week/month/year, else select noModification | [optional] [default to 'noModification']
+**balanceExpirationDate** | **string** | Date when the balance expires and can no longer be used, in dd/mm format. The balance will be expired when this date appears next in the calendar and only one of balanceExpirationDate or balance availability fields can be used. | [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/CreateCategoryModel.md b/docs/Model/CreateCategoryModel.md
index b159bae..01049f7 100644
--- a/docs/Model/CreateCategoryModel.md
+++ b/docs/Model/CreateCategoryModel.md
@@ -1,10 +1,9 @@
-# CreateCategoryModel
+# # CreateCategoryModel
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **int** | ID of the category when a new category is created | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**id** | **int** | ID of the category when a new category is created | [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/CreateChild.md b/docs/Model/CreateChild.md
deleted file mode 100644
index cc18ace..0000000
--- a/docs/Model/CreateChild.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# CreateChild
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**email** | **string** | Email address to create the child account |
-**firstName** | **string** | First name to use to create the child account |
-**lastName** | **string** | Last name to use to create the child account |
-**companyName** | **string** | Company name to use to create the child account |
-**password** | **string** | Password for the child account to login |
-**language** | **string** | Language of the child account | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/CreateContact.md b/docs/Model/CreateContact.md
index 84fe8f4..68649fd 100644
--- a/docs/Model/CreateContact.md
+++ b/docs/Model/CreateContact.md
@@ -1,17 +1,16 @@
-# CreateContact
+# # CreateContact
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**email** | **string** | Email address of the user. Mandatory if \"SMS\" field is not passed in \"attributes\" parameter. Mobile Number in \"SMS\" field should be passed with proper country code. For example {'SMS':'+91xxxxxxxxxx'} or {'SMS':'0091xxxxxxxxxx'} | [optional]
-**extId** | **string** | Pass your own Id to create a contact. | [optional]
-**attributes** | **object** | Pass the set of attributes and their values. The attribute's parameter should be passed in capital letter while creating a contact. Values that don't match the attribute type (e.g. text or string in a date attribute) will be ignored.These attributes must be present in your Brevo account. For eg. {\"FNAME\":\"Elly\", \"LNAME\":\"Roger\"} | [optional]
-**emailBlacklisted** | **bool** | Set this field to blacklist the contact for emails (emailBlacklisted = true) | [optional]
-**smsBlacklisted** | **bool** | Set this field to blacklist the contact for SMS (smsBlacklisted = true) | [optional]
-**listIds** | **int[]** | Ids of the lists to add the contact to | [optional]
+**email** | **string** | Email address of the user. **Mandatory if \"ext_id\" & \"SMS\" field is not passed.** | [optional]
+**extId** | **string** | Pass your own Id to create a contact. | [optional]
+**attributes** | [**array**](CreateDoiContactAttributesValue.md) | Pass the set of attributes and their values. The attribute's parameter should be passed in capital letter while creating a contact. Values that don't match the attribute type (e.g. text or string in a date attribute) will be ignored. **These attributes must be present in your Brevo account.**. For eg: **{\"FNAME\":\"Elly\", \"LNAME\":\"Roger\", \"COUNTRIES\":[\"India\",\"China\"]}** | [optional]
+**emailBlacklisted** | **bool** | Set this field to blacklist the contact for emails (emailBlacklisted = true) | [optional]
+**smsBlacklisted** | **bool** | Set this field to blacklist the contact for SMS (smsBlacklisted = true) | [optional]
+**listIds** | **int[]** | Ids of the lists to add the contact to | [optional]
**updateEnabled** | **bool** | Facilitate to update the existing contact in the same request (updateEnabled = true) | [optional] [default to false]
-**smtpBlacklistSender** | **string[]** | transactional email forbidden sender for contact. Use only for email Contact ( only available if updateEnabled = true ) | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**smtpBlacklistSender** | **string[]** | transactional email forbidden sender for contact. Use only for email Contact ( only available if updateEnabled = true ) | [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/CreateCouponCollection.md b/docs/Model/CreateCouponCollection.md
deleted file mode 100644
index 343ba37..0000000
--- a/docs/Model/CreateCouponCollection.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# CreateCouponCollection
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**name** | **object** | Name of the collection with no white spaces between words |
-**defaultCoupon** | **object** | A default coupon to be used in case there are no coupons left |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/CreateCouponCollection201Response.md b/docs/Model/CreateCouponCollection201Response.md
new file mode 100644
index 0000000..55b5429
--- /dev/null
+++ b/docs/Model/CreateCouponCollection201Response.md
@@ -0,0 +1,9 @@
+# # CreateCouponCollection201Response
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | The id of the created collection |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/CreateCouponCollectionRequest.md b/docs/Model/CreateCouponCollectionRequest.md
new file mode 100644
index 0000000..988d035
--- /dev/null
+++ b/docs/Model/CreateCouponCollectionRequest.md
@@ -0,0 +1,13 @@
+# # CreateCouponCollectionRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | Name of the coupons collection |
+**defaultCoupon** | **string** | Default coupons collection name |
+**expirationDate** | **\DateTime** | Specify an expiration date for the coupon collection in RFC3339 format. Use null to remove the expiration date. | [optional]
+**remainingDaysAlert** | **int** | Send a notification alert (email) when the remaining days until the expiration date are equal or fall bellow this number. Use null to disable alerts. | [optional]
+**remainingCouponsAlert** | **int** | Send a notification alert (email) when the remaining coupons count is equal or fall bellow this number. Use null to disable alerts. | [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/CreateCoupons.md b/docs/Model/CreateCoupons.md
deleted file mode 100644
index 10b5195..0000000
--- a/docs/Model/CreateCoupons.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# CreateCoupons
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**collectionId** | **string** | The id of the coupon collection for which the coupons will be created |
-**coupons** | **string[]** | |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/CreateCouponsRequest.md b/docs/Model/CreateCouponsRequest.md
new file mode 100644
index 0000000..39523f2
--- /dev/null
+++ b/docs/Model/CreateCouponsRequest.md
@@ -0,0 +1,10 @@
+# # CreateCouponsRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**collectionId** | **string** | The id of the coupon collection for which the coupons will be created |
+**coupons** | **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/CreateDoiContact.md b/docs/Model/CreateDoiContact.md
index 8ec195d..7c8691f 100644
--- a/docs/Model/CreateDoiContact.md
+++ b/docs/Model/CreateDoiContact.md
@@ -1,15 +1,14 @@
-# CreateDoiContact
+# # CreateDoiContact
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**email** | **string** | Email address where the confirmation email will be sent. This email address will be the identifier for all other contact attributes. |
-**attributes** | **object** | Pass the set of attributes and their values. These attributes must be present in your Brevo account. For eg. {'FNAME':'Elly', 'LNAME':'Roger'} | [optional]
-**includeListIds** | **int[]** | Lists under user account where contact should be added |
-**excludeListIds** | **int[]** | Lists under user account where contact should not be added | [optional]
-**templateId** | **int** | Id of the Double opt-in (DOI) template |
-**redirectionUrl** | **string** | URL of the web page that user will be redirected to after clicking on the double opt in URL. When editing your DOI template you can reference this URL by using the tag {{ params.DOIurl }}. |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
+**email** | **string** | Email address where the confirmation email will be sent. This email address will be the identifier for all other contact attributes. |
+**includeListIds** | **int[]** | Lists under user account where contact should be added |
+**templateId** | **int** | Id of the Double opt-in (DOI) template |
+**redirectionUrl** | **string** | URL of the web page that user will be redirected to after clicking on the double opt in URL. When editing your DOI template you can reference this URL by using the tag **{{ params.DOIurl }}**. |
+**attributes** | [**array**](CreateDoiContactAttributesValue.md) | Pass the set of attributes and their values. **These attributes must be present in your Brevo account**. For eg. **{'FNAME':'Elly', 'LNAME':'Roger', 'COUNTRIES':['India','China']}** | [optional]
+**excludeListIds** | **int[]** | Lists under user account where contact should not be added | [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/CreateDoiContactAttributesValue.md b/docs/Model/CreateDoiContactAttributesValue.md
new file mode 100644
index 0000000..cf66bdc
--- /dev/null
+++ b/docs/Model/CreateDoiContactAttributesValue.md
@@ -0,0 +1,8 @@
+# # CreateDoiContactAttributesValue
+
+## 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/CreateDomain.md b/docs/Model/CreateDomain.md
index bffba78..fe3ed36 100644
--- a/docs/Model/CreateDomain.md
+++ b/docs/Model/CreateDomain.md
@@ -1,10 +1,9 @@
-# CreateDomain
+# # CreateDomain
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**name** | **string** | Domain name |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**name** | **string** | Domain name |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/CreateDomainModel.md b/docs/Model/CreateDomainModel.md
index 34b5901..a28621e 100644
--- a/docs/Model/CreateDomainModel.md
+++ b/docs/Model/CreateDomainModel.md
@@ -1,13 +1,13 @@
-# CreateDomainModel
+# # CreateDomainModel
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **int** | ID of the Domain created |
-**domainName** | **string** | Domain | [optional]
-**message** | **string** | Success message | [optional]
-**dnsRecords** | [**\Brevo\Client\Model\CreateDomainModelDnsRecords**](CreateDomainModelDnsRecords.md) | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**id** | **int** | ID of the Domain created |
+**domainName** | **string** | Domain | [optional]
+**domainProvider** | **string** | Domain Provider | [optional]
+**message** | **string** | Success message | [optional]
+**dnsRecords** | [**\Brevo\Client\Models\CreateDomainModelDnsRecords**](CreateDomainModelDnsRecords.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/CreateDomainModelDnsRecords.md b/docs/Model/CreateDomainModelDnsRecords.md
index c697281..f40d643 100644
--- a/docs/Model/CreateDomainModelDnsRecords.md
+++ b/docs/Model/CreateDomainModelDnsRecords.md
@@ -1,11 +1,11 @@
-# CreateDomainModelDnsRecords
+# # CreateDomainModelDnsRecords
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**dkimRecord** | [**\Brevo\Client\Model\CreateDomainModelDnsRecordsDkimRecord**](CreateDomainModelDnsRecordsDkimRecord.md) | | [optional]
-**brevoCode** | [**\Brevo\Client\Model\CreateDomainModelDnsRecordsDkimRecord**](CreateDomainModelDnsRecordsDkimRecord.md) | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**dkimRecord** | [**\Brevo\Client\Models\CreateDomainModelDnsRecordsDkimRecord**](CreateDomainModelDnsRecordsDkimRecord.md) | | [optional]
+**brevoCode** | [**\Brevo\Client\Models\CreateDomainModelDnsRecordsDkimRecord**](CreateDomainModelDnsRecordsDkimRecord.md) | | [optional]
+**dmarcRecord** | [**\Brevo\Client\Models\CreateDomainModelDnsRecordsDkimRecord**](CreateDomainModelDnsRecordsDkimRecord.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/CreateDomainModelDnsRecordsDkimRecord.md b/docs/Model/CreateDomainModelDnsRecordsDkimRecord.md
index b45d54c..2c8fabd 100644
--- a/docs/Model/CreateDomainModelDnsRecordsDkimRecord.md
+++ b/docs/Model/CreateDomainModelDnsRecordsDkimRecord.md
@@ -1,13 +1,12 @@
-# CreateDomainModelDnsRecordsDkimRecord
+# # CreateDomainModelDnsRecordsDkimRecord
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**type** | **string** | | [optional]
-**value** | **string** | | [optional]
-**hostName** | **string** | | [optional]
-**status** | **bool** | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**type** | **string** | | [optional]
+**value** | **string** | | [optional]
+**hostName** | **string** | | [optional]
+**status** | **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/CreateEmailCampaign.md b/docs/Model/CreateEmailCampaign.md
index 85dd214..7adf09a 100644
--- a/docs/Model/CreateEmailCampaign.md
+++ b/docs/Model/CreateEmailCampaign.md
@@ -1,40 +1,40 @@
-# CreateEmailCampaign
+# # CreateEmailCampaign
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**tag** | **string** | Tag of the campaign | [optional]
-**sender** | [**\Brevo\Client\Model\CreateEmailCampaignSender**](CreateEmailCampaignSender.md) | |
-**name** | **string** | Name of the campaign |
-**htmlContent** | **string** | Mandatory if htmlUrl and templateId are empty. Body of the message (HTML) | [optional]
-**htmlUrl** | **string** | Mandatory if htmlContent and templateId are empty. Url to the message (HTML) | [optional]
-**templateId** | **int** | Mandatory if htmlContent and htmlUrl are empty. Id of the transactional email template with status 'active'. Used to copy only its content fetched from htmlContent/htmlUrl to an email campaign for RSS feature. | [optional]
-**scheduledAt** | **string** | Sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part). | [optional]
-**subject** | **string** | Subject of the campaign. Mandatory if abTesting is false. Ignored if abTesting is true. | [optional]
-**previewText** | **string** | Preview text or preheader of the email campaign | [optional]
-**replyTo** | **string** | Email on which the campaign recipients will be able to reply to | [optional]
-**toField** | **string** | To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your Brevo account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization | [optional]
-**recipients** | [**\Brevo\Client\Model\CreateEmailCampaignRecipients**](CreateEmailCampaignRecipients.md) | | [optional]
-**attachmentUrl** | **string** | Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps | [optional]
-**inlineImageActivation** | **bool** | Use true to embedded the images in your email. Final size of the email should be less than 4MB. Campaigns with embedded images can not be sent to more than 5000 contacts | [optional] [default to false]
-**mirrorActive** | **bool** | Use true to enable the mirror link | [optional]
-**footer** | **string** | Footer of the email campaign | [optional]
-**header** | **string** | Header of the email campaign | [optional]
-**utmCampaign** | **string** | Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed | [optional]
-**params** | **object** | Pass the set of attributes to customize the type classic campaign. For example, `{\"FNAME\":\"Joe\", \"LNAME:\"Doe\"}`. Only available if 'type' is 'classic'. It's considered only if campaign is in New Template Language format. The New Template Language is dependent on the values of 'subject', 'htmlContent/htmlUrl', 'sender.name' & 'toField' | [optional]
+**sender** | [**\Brevo\Client\Models\CreateEmailCampaignSender**](CreateEmailCampaignSender.md) | |
+**name** | **string** | Name of the campaign |
+**tag** | **string** | Tag of the campaign | [optional]
+**htmlContent** | **string** | Mandatory if htmlUrl and templateId are empty. Body of the message (HTML). | [optional]
+**htmlUrl** | **string** | **Mandatory if htmlContent and templateId are empty**. Url to the message (HTML). For example: **https://html.domain.com** | [optional]
+**templateId** | **int** | **Mandatory if htmlContent and htmlUrl are empty**. Id of the transactional email template with status _active_. Used to copy only its content fetched from htmlContent/htmlUrl to an email campaign for RSS feature. | [optional]
+**scheduledAt** | **string** | Sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result**. If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part). For example: **2017-06-01T12:30:00+02:00** | [optional]
+**subject** | **string** | Subject of the campaign. **Mandatory if abTesting is false**. Ignored if abTesting is true. | [optional]
+**previewText** | **string** | Preview text or preheader of the email campaign | [optional]
+**replyTo** | **string** | Email on which the campaign recipients will be able to reply to | [optional]
+**toField** | **string** | To personalize the **To** Field. If you want to include the first name and last name of your recipient, add **{FNAME} {LNAME}**. These contact attributes must already exist in your Brevo account. If input parameter **params** used please use **{{contact.FNAME}} {{contact.LNAME}}** for personalization | [optional]
+**recipients** | [**\Brevo\Client\Models\CreateEmailCampaignRecipients**](CreateEmailCampaignRecipients.md) | | [optional]
+**attachmentUrl** | **string** | Absolute url of the attachment (no local file). Extension allowed: #### xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps | [optional]
+**inlineImageActivation** | **bool** | Use true to embedded the images in your email. Final size of the email should be less than **4MB**. Campaigns with embedded images can _not be sent to more than 5000 contacts_ | [optional] [default to false]
+**mirrorActive** | **bool** | Use true to enable the mirror link | [optional]
+**footer** | **string** | Footer of the email campaign | [optional]
+**header** | **string** | Header of the email campaign | [optional]
+**utmCampaign** | **string** | Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed | [optional]
+**params** | **array** | Pass the set of attributes to customize the type classic campaign. For example: **{\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}**. Only available if **type** is **classic**. It's considered only if campaign is in _New Template Language format_. The New Template Language is dependent on the values of **subject, htmlContent/htmlUrl, sender.name & toField** | [optional]
**sendAtBestTime** | **bool** | Set this to true if you want to send your campaign at best time. | [optional] [default to false]
-**abTesting** | **bool** | Status of A/B Test. abTesting = false means it is disabled, & abTesting = true means it is enabled. 'subjectA', 'subjectB', 'splitRule', 'winnerCriteria' & 'winnerDelay' will be considered when abTesting is set to true. 'subjectA' & 'subjectB' are mandatory together & 'subject' if passed is ignored. Can be set to true only if 'sendAtBestTime' is 'false'. You will be able to set up two subject lines for your campaign and send them to a random sample of your total recipients. Half of the test group will receive version A, and the other half will receive version B | [optional] [default to false]
-**subjectA** | **string** | Subject A of the campaign. Mandatory if abTesting = true. subjectA & subjectB should have unique value | [optional]
-**subjectB** | **string** | Subject B of the campaign. Mandatory if abTesting = true. subjectA & subjectB should have unique value | [optional]
-**splitRule** | **int** | Add the size of your test groups. Mandatory if abTesting = true & 'recipients' is passed. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else | [optional]
-**winnerCriteria** | **string** | Choose the metrics that will determinate the winning version. Mandatory if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerCriteria' is ignored if passed | [optional]
-**winnerDelay** | **int** | Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. Mandatory if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerDelay' is ignored if passed | [optional]
-**ipWarmupEnable** | **bool** | Available for dedicated ip clients. Set this to true if you wish to warm up your ip. | [optional] [default to false]
-**initialQuota** | **int** | Mandatory if ipWarmupEnable is set to true. Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000. | [optional]
-**increaseRate** | **int** | Mandatory if ipWarmupEnable is set to true. Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%. | [optional]
-**unsubscriptionPageId** | **string** | Enter an unsubscription page id. The page id is a 24 digit alphanumeric id that can be found in the URL when editing the page. If not entered, then the default unsubscription page will be used. | [optional]
-**updateFormId** | **string** | Mandatory if templateId is used containing the {{ update_profile }} tag. Enter an update profile form id. The form id is a 24 digit alphanumeric id that can be found in the URL when editing the form. If not entered, then the default update profile form will be used. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**abTesting** | **bool** | Status of A/B Test. abTesting = false means it is disabled & abTesting = true means it is enabled. **subjectA, subjectB, splitRule, winnerCriteria & winnerDelay** will be considered when abTesting is set to true. subjectA & subjectB are mandatory together & subject if passed is ignored. **Can be set to true only if sendAtBestTime is false**. You will be able to set up two subject lines for your campaign and send them to a random sample of your total recipients. Half of the test group will receive version A, and the other half will receive version B | [optional] [default to false]
+**subjectA** | **string** | Subject A of the campaign. **Mandatory if abTesting = true**. subjectA & subjectB should have unique value | [optional]
+**subjectB** | **string** | Subject B of the campaign. **Mandatory if abTesting = true**. subjectA & subjectB should have unique value | [optional]
+**splitRule** | **int** | Add the size of your test groups. **Mandatory if abTesting = true & 'recipients' is passed**. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else | [optional]
+**winnerCriteria** | **string** | Choose the metrics that will determinate the winning version. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerCriteria` is ignored if passed | [optional]
+**winnerDelay** | **int** | Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerDelay` is ignored if passed | [optional]
+**ipWarmupEnable** | **bool** | **Available for dedicated ip clients**. Set this to true if you wish to warm up your ip. | [optional] [default to false]
+**initialQuota** | **int** | **Mandatory if ipWarmupEnable is set to true**. Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000. | [optional]
+**increaseRate** | **int** | **Mandatory if ipWarmupEnable is set to true**. Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%. | [optional]
+**unsubscriptionPageId** | **string** | Enter an unsubscription page id. The page id is a 24 digit alphanumeric id that can be found in the URL when editing the page. If not entered, then the default unsubscription page will be used. | [optional]
+**updateFormId** | **string** | **Mandatory if templateId is used containing the {{ update_profile }} tag**. Enter an update profile form id. The form id is a 24 digit alphanumeric id that can be found in the URL when editing the form. If not entered, then the default update profile form will be used. | [optional]
+**emailExpirationDate** | [**\Brevo\Client\Models\CreateEmailCampaignEmailExpirationDate**](CreateEmailCampaignEmailExpirationDate.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/CreateEmailCampaignEmailExpirationDate.md b/docs/Model/CreateEmailCampaignEmailExpirationDate.md
new file mode 100644
index 0000000..29fc1e4
--- /dev/null
+++ b/docs/Model/CreateEmailCampaignEmailExpirationDate.md
@@ -0,0 +1,10 @@
+# # CreateEmailCampaignEmailExpirationDate
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**duration** | **int** | Duration of the email expiry. maximum duration can be 3600 days or 480 weeks or 120 months. | [optional]
+**unit** | **string** | unit of the duration | [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/CreateEmailCampaignRecipients.md b/docs/Model/CreateEmailCampaignRecipients.md
index 3c037ee..f493d5a 100644
--- a/docs/Model/CreateEmailCampaignRecipients.md
+++ b/docs/Model/CreateEmailCampaignRecipients.md
@@ -1,12 +1,11 @@
-# CreateEmailCampaignRecipients
+# # CreateEmailCampaignRecipients
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**exclusionListIds** | **int[]** | List ids to exclude from the campaign | [optional]
-**listIds** | **int[]** | Mandatory if scheduledAt is not empty. List Ids to send the campaign to | [optional]
-**segmentIds** | **int[]** | Mandatory if listIds are not used. Segment ids to send the campaign to. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**exclusionListIds** | **int[]** | List ids to exclude from the campaign | [optional]
+**listIds** | **int[]** | **Mandatory if scheduledAt is not empty**. List Ids to send the campaign to | [optional]
+**segmentIds** | **int[]** | **Mandatory if listIds are not used**. Segment ids to send the campaign to. | [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/CreateEmailCampaignSender.md b/docs/Model/CreateEmailCampaignSender.md
index 2892c2e..704e95e 100644
--- a/docs/Model/CreateEmailCampaignSender.md
+++ b/docs/Model/CreateEmailCampaignSender.md
@@ -1,12 +1,11 @@
-# CreateEmailCampaignSender
+# # CreateEmailCampaignSender
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**name** | **string** | Sender Name | [optional]
-**email** | **string** | Sender email |
-**id** | **int** | Select the sender for the campaign on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**name** | **string** | Sender Name | [optional]
+**email** | **string** | Sender email | [optional]
+**id** | **int** | Select the sender for the campaign on the basis of sender id. _In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email)_. | [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/CreateExternalFeed.md b/docs/Model/CreateExternalFeed.md
index c86ac9e..cb1c5e7 100644
--- a/docs/Model/CreateExternalFeed.md
+++ b/docs/Model/CreateExternalFeed.md
@@ -1,18 +1,17 @@
-# CreateExternalFeed
+# # CreateExternalFeed
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**name** | **string** | Name of the feed |
-**url** | **string** | URL of the feed |
-**authType** | **string** | Auth type of the feed: * `basic` * `token` * `noAuth` | [optional] [default to 'noAuth']
-**username** | **string** | Username for authType `basic` | [optional]
-**password** | **string** | Password for authType `basic` | [optional]
-**token** | **string** | Token for authType `token` | [optional]
-**headers** | [**\Brevo\Client\Model\GetExternalFeedByUUIDHeaders[]**](GetExternalFeedByUUIDHeaders.md) | Custom headers for the feed | [optional]
-**maxRetries** | **int** | Maximum number of retries on the feed url | [optional]
+**name** | **string** | Name of the feed |
+**url** | **string** | URL of the feed |
+**authType** | **string** | Auth type of the feed: * `basic` * `token` * `noAuth` | [optional] [default to 'noAuth']
+**username** | **string** | Username for authType `basic` | [optional]
+**password** | **string** | Password for authType `basic` | [optional]
+**token** | **string** | Token for authType `token` | [optional]
+**headers** | [**\Brevo\Client\Models\GetExternalFeedByUUIDHeadersInner[]**](GetExternalFeedByUUIDHeadersInner.md) | Custom headers for the feed | [optional]
+**maxRetries** | **int** | Maximum number of retries on the feed url | [optional] [default to 5]
**cache** | **bool** | Toggle caching of feed url response | [optional] [default to false]
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.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/CreateExternalFeed201Response.md b/docs/Model/CreateExternalFeed201Response.md
new file mode 100644
index 0000000..90f642a
--- /dev/null
+++ b/docs/Model/CreateExternalFeed201Response.md
@@ -0,0 +1,9 @@
+# # CreateExternalFeed201Response
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | ID of the object created |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/CreateList.md b/docs/Model/CreateList.md
index 78c8344..2eae3da 100644
--- a/docs/Model/CreateList.md
+++ b/docs/Model/CreateList.md
@@ -1,11 +1,10 @@
-# CreateList
+# # CreateList
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**name** | **string** | Name of the list |
-**folderId** | **int** | Id of the parent folder in which this list is to be created |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**name** | **string** | Name of the list |
+**folderId** | **int** | Id of the parent folder in which this list is to be created |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/CreateLoyaltyProgramPayload.md b/docs/Model/CreateLoyaltyProgramPayload.md
new file mode 100644
index 0000000..511289d
--- /dev/null
+++ b/docs/Model/CreateLoyaltyProgramPayload.md
@@ -0,0 +1,11 @@
+# # CreateLoyaltyProgramPayload
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | Loyalty Program name |
+**description** | **string** | Loyalty Program description | [optional]
+**meta** | **object** | Loyalty Program meta data | [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/CreateModel.md b/docs/Model/CreateModel.md
index f660732..2ce51d9 100644
--- a/docs/Model/CreateModel.md
+++ b/docs/Model/CreateModel.md
@@ -1,10 +1,9 @@
-# CreateModel
+# # CreateModel
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **int** | ID of the object created |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**id** | **int** | ID of the object created |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/CreateOrderPayload.md b/docs/Model/CreateOrderPayload.md
new file mode 100644
index 0000000..14feadc
--- /dev/null
+++ b/docs/Model/CreateOrderPayload.md
@@ -0,0 +1,14 @@
+# # CreateOrderPayload
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**amount** | **float** | Amount of the order |
+**dueAt** | **string** | Date and time at which the order needs to be processed |
+**contactId** | **float** | Contact id |
+**balanceDefinitionId** | **string** | Balance definition id |
+**expiresAt** | **string** | Add expiration to the balance credited by the order | [optional]
+**meta** | **object** | Additional metadata related to the order. | [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/CreatePaymentRequest.md b/docs/Model/CreatePaymentRequest.md
new file mode 100644
index 0000000..f51d308
--- /dev/null
+++ b/docs/Model/CreatePaymentRequest.md
@@ -0,0 +1,14 @@
+# # CreatePaymentRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**reference** | **string** | Reference of the payment request, it will appear on the payment page. |
+**cart** | [**\Brevo\Client\Models\Cart**](Cart.md) | |
+**contactId** | **int** | Brevo ID of the contact requested to pay. |
+**description** | **string** | description of payment request | [optional]
+**notification** | [**\Brevo\Client\Models\Notification**](Notification.md) | | [optional]
+**configuration** | [**\Brevo\Client\Models\Configuration**](Configuration.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/CreatePaymentResponse.md b/docs/Model/CreatePaymentResponse.md
new file mode 100644
index 0000000..4c23942
--- /dev/null
+++ b/docs/Model/CreatePaymentResponse.md
@@ -0,0 +1,10 @@
+# # CreatePaymentResponse
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | ID of the object created |
+**url** | **string** | URL of the payment request created | [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/CreateProductModel.md b/docs/Model/CreateProductModel.md
index 38538c5..2b3c3ce 100644
--- a/docs/Model/CreateProductModel.md
+++ b/docs/Model/CreateProductModel.md
@@ -1,10 +1,9 @@
-# CreateProductModel
+# # CreateProductModel
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **int** | ID of the Product when a new product is created | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**id** | **int** | ID of the Product when a new product is created | [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/CreateReseller.md b/docs/Model/CreateReseller.md
deleted file mode 100644
index c2a7e84..0000000
--- a/docs/Model/CreateReseller.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# CreateReseller
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**authKey** | **string** | AuthKey of Reseller child created |
-**id** | **int** | Id of Reseller child created | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/CreateSender.md b/docs/Model/CreateSender.md
index d862758..ab5a9af 100644
--- a/docs/Model/CreateSender.md
+++ b/docs/Model/CreateSender.md
@@ -1,12 +1,11 @@
-# CreateSender
+# # CreateSender
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**name** | **string** | From Name to use for the sender |
-**email** | **string** | From email to use for the sender. A verification email will be sent to this address. |
-**ips** | [**\Brevo\Client\Model\CreateSenderIps[]**](CreateSenderIps.md) | Mandatory in case of dedicated IP, IPs to associate to the sender | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**name** | **string** | From Name to use for the sender |
+**email** | **string** | From email to use for the sender. A verification email will be sent to this address. |
+**ips** | [**\Brevo\Client\Models\CreateSenderIpsInner[]**](CreateSenderIpsInner.md) | **Mandatory in case of dedicated IP**. IPs to associate to the sender | [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/CreateSenderIps.md b/docs/Model/CreateSenderIps.md
deleted file mode 100644
index 18c602d..0000000
--- a/docs/Model/CreateSenderIps.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# CreateSenderIps
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**ip** | **string** | Dedicated IP available in your account |
-**domain** | **string** | Domain of the IP |
-**weight** | **int** | Weight to apply to the IP. Sum of all IP weights must be 100. Should be passed for either ALL or NONE of the IPs. If it's not passed, the sending will be equally balanced on all IPs. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/CreateSenderIpsInner.md b/docs/Model/CreateSenderIpsInner.md
new file mode 100644
index 0000000..d5a9b93
--- /dev/null
+++ b/docs/Model/CreateSenderIpsInner.md
@@ -0,0 +1,11 @@
+# # CreateSenderIpsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**ip** | **string** | Dedicated IP available in your account |
+**domain** | **string** | Domain of the IP |
+**weight** | **int** | Weight to apply to the IP. Sum of all IP weights must be 100. Should be passed for either ALL or NONE of the IPs. If it's not passed, the sending will be equally balanced on all IPs. | [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/CreateSenderModel.md b/docs/Model/CreateSenderModel.md
index ae4b381..12537be 100644
--- a/docs/Model/CreateSenderModel.md
+++ b/docs/Model/CreateSenderModel.md
@@ -1,12 +1,11 @@
-# CreateSenderModel
+# # CreateSenderModel
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **int** | ID of the Sender created |
-**spfError** | **bool** | Status of SPF configuration for the sender (true = SPF not well configured, false = SPF well configured) | [optional]
-**dkimError** | **bool** | Status of DKIM configuration for the sender (true = DKIM not well configured, false = DKIM well configured) | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**id** | **int** | ID of the Sender created |
+**spfError** | **bool** | Status of SPF configuration for the sender (true = SPF not well configured, false = SPF well configured) | [optional]
+**dkimError** | **bool** | Status of DKIM configuration for the sender (true = DKIM not well configured, false = DKIM well configured) | [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/CreateSmsCampaign.md b/docs/Model/CreateSmsCampaign.md
index 769bfa1..2b84054 100644
--- a/docs/Model/CreateSmsCampaign.md
+++ b/docs/Model/CreateSmsCampaign.md
@@ -1,17 +1,16 @@
-# CreateSmsCampaign
+# # CreateSmsCampaign
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**name** | **string** | Name of the campaign |
-**sender** | **string** | Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** |
-**content** | **string** | Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS |
-**recipients** | [**\Brevo\Client\Model\CreateSmsCampaignRecipients**](CreateSmsCampaignRecipients.md) | | [optional]
-**scheduledAt** | **string** | UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. | [optional]
+**name** | **string** | Name of the campaign |
+**sender** | **string** | Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** |
+**content** | **string** | Content of the message. The **maximum characters used per SMS is 160**, if used more than that, it will be counted as more than one SMS |
+**recipients** | [**\Brevo\Client\Models\CreateSmsCampaignRecipients**](CreateSmsCampaignRecipients.md) | | [optional]
+**scheduledAt** | **string** | UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** | [optional]
**unicodeEnabled** | **bool** | Format of the message. It indicates whether the content should be treated as unicode or not. | [optional] [default to false]
-**organisationPrefix** | **string** | A recognizable prefix will ensure your audience knows who you are. Recommended by U.S. carriers. This will be added as your Brand Name before the message content. **Prefer verifying maximum length of 160 characters including this prefix in message content to avoid multiple sending of same sms.** | [optional]
-**unsubscribeInstruction** | **string** | Instructions to unsubscribe from future communications. Recommended by U.S. carriers. Must include **STOP** keyword. This will be added as instructions after the end of message content. **Prefer verifying maximum length of 160 characters including this instructions in message content to avoid multiple sending of same sms.** | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**organisationPrefix** | **string** | A recognizable prefix will ensure your audience knows who you are. Recommended by U.S. carriers. This will be added as your Brand Name before the message content. **Prefer verifying maximum length of 160 characters including this prefix in message content to avoid multiple sending of same sms.** | [optional]
+**unsubscribeInstruction** | **string** | Instructions to unsubscribe from future communications. Recommended by U.S. carriers. Must include **STOP** keyword. This will be added as instructions after the end of message content. **Prefer verifying maximum length of 160 characters including this instructions in message content to avoid multiple sending of same sms.** | [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/CreateSmsCampaignRecipients.md b/docs/Model/CreateSmsCampaignRecipients.md
index fb8799d..863574b 100644
--- a/docs/Model/CreateSmsCampaignRecipients.md
+++ b/docs/Model/CreateSmsCampaignRecipients.md
@@ -1,11 +1,10 @@
-# CreateSmsCampaignRecipients
+# # CreateSmsCampaignRecipients
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**listIds** | **int[]** | Lists Ids to send the campaign to. REQUIRED if scheduledAt is not empty |
-**exclusionListIds** | **int[]** | List ids which have to be excluded from a campaign | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**listIds** | **int[]** | Lists Ids to send the campaign to. **REQUIRED if scheduledAt is not empty** |
+**exclusionListIds** | **int[]** | List ids which have to be excluded from a campaign | [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/CreateSmtpEmail.md b/docs/Model/CreateSmtpEmail.md
index 64940e9..2ccf536 100644
--- a/docs/Model/CreateSmtpEmail.md
+++ b/docs/Model/CreateSmtpEmail.md
@@ -1,11 +1,10 @@
-# CreateSmtpEmail
+# # CreateSmtpEmail
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**messageId** | **string** | Message ID of the transactional email sent | [optional]
-**messageIds** | **string[]** | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**messageId** | **string** | Message ID of the transactional email sent | [optional]
+**messageIds** | **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/CreateSmtpTemplate.md b/docs/Model/CreateSmtpTemplate.md
index 847908f..99a5024 100644
--- a/docs/Model/CreateSmtpTemplate.md
+++ b/docs/Model/CreateSmtpTemplate.md
@@ -1,19 +1,18 @@
-# CreateSmtpTemplate
+# # CreateSmtpTemplate
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**tag** | **string** | Tag of the template | [optional]
-**sender** | [**\Brevo\Client\Model\CreateSmtpTemplateSender**](CreateSmtpTemplateSender.md) | |
-**templateName** | **string** | Name of the template |
-**htmlContent** | **string** | Body of the message (HTML version). The field must have more than 10 characters. REQUIRED if htmlUrl is empty | [optional]
-**htmlUrl** | **string** | Url which contents the body of the email message. REQUIRED if htmlContent is empty | [optional]
-**subject** | **string** | Subject of the template |
-**replyTo** | **string** | Email on which campaign recipients will be able to reply to | [optional]
-**toField** | **string** | To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your Brevo account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization | [optional]
-**attachmentUrl** | **string** | Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps | [optional]
-**isActive** | **bool** | Status of template. isActive = true means template is active and isActive = false means template is inactive | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**sender** | [**\Brevo\Client\Models\CreateSmtpTemplateSender**](CreateSmtpTemplateSender.md) | |
+**templateName** | **string** | Name of the template |
+**subject** | **string** | Subject of the template |
+**tag** | **string** | Tag of the template | [optional]
+**htmlContent** | **string** | Body of the message (HTML version). The field must have more than 10 characters. **REQUIRED if htmlUrl is empty** | [optional]
+**htmlUrl** | **string** | Url which contents the body of the email message. REQUIRED if htmlContent is empty | [optional]
+**replyTo** | **string** | Email on which campaign recipients will be able to reply to | [optional]
+**toField** | **string** | To personalize the **To** Field. If you want to include the first name and last name of your recipient, add **{FNAME} {LNAME}**. These contact attributes must already exist in your Brevo account. If input parameter **params** used please use **{{contact.FNAME}} {{contact.LNAME}}** for personalization | [optional]
+**attachmentUrl** | **string** | Absolute url of the attachment (**no local file**). Extension allowed: #### xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps' | [optional]
+**isActive** | **bool** | Status of template. isActive = true means template is active and isActive = false means template is inactive | [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/CreateSmtpTemplateSender.md b/docs/Model/CreateSmtpTemplateSender.md
index 474ffc3..612eea7 100644
--- a/docs/Model/CreateSmtpTemplateSender.md
+++ b/docs/Model/CreateSmtpTemplateSender.md
@@ -1,12 +1,11 @@
-# CreateSmtpTemplateSender
+# # CreateSmtpTemplateSender
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**name** | **string** | Name of the sender. If not passed, will be set to default | [optional]
-**email** | **string** | Email of the sender | [optional]
-**id** | **int** | Select the sender for the template on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**name** | **string** | Name of the sender. **If not passed, will be set to default** | [optional]
+**email** | **string** | Email of the sender | [optional]
+**id** | **int** | Select the sender for the template on the basis of sender id. _In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email)_. | [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/CreateSubAccount.md b/docs/Model/CreateSubAccount.md
index ae80e64..5030b35 100644
--- a/docs/Model/CreateSubAccount.md
+++ b/docs/Model/CreateSubAccount.md
@@ -1,13 +1,13 @@
-# CreateSubAccount
+# # CreateSubAccount
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**companyName** | **string** | Set the name of the sub-account company |
-**email** | **string** | Email address for the organization |
-**language** | **string** | Set the language of the sub-account | [optional]
-**timezone** | **string** | Set the timezone of the sub-account | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**companyName** | **string** | Set the name of the sub-account company |
+**email** | **string** | Email address for the organization |
+**language** | **string** | Set the language of the sub-account | [optional]
+**timezone** | **string** | Set the timezone of the sub-account | [optional]
+**groupIds** | **string[]** | Set the group(s) for the sub-account | [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/CreateSubAccountResponse.md b/docs/Model/CreateSubAccountResponse.md
index db5fd6b..d8f7356 100644
--- a/docs/Model/CreateSubAccountResponse.md
+++ b/docs/Model/CreateSubAccountResponse.md
@@ -1,10 +1,9 @@
-# CreateSubAccountResponse
+# # CreateSubAccountResponse
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **int** | ID of the sub-account created |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**id** | **int** | ID of the sub-account created |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/CreateSubscriptionMemberPayload.md b/docs/Model/CreateSubscriptionMemberPayload.md
new file mode 100644
index 0000000..713e5e9
--- /dev/null
+++ b/docs/Model/CreateSubscriptionMemberPayload.md
@@ -0,0 +1,11 @@
+# # CreateSubscriptionMemberPayload
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**memberContactIds** | **int[]** | Member Contact Ids |
+**contactId** | **int** | One of contact id or loyalty subscription id is required | [optional]
+**loyaltySubscriptionId** | **string** | Client Reference | [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/CreateSubscriptionMemberResponse.md b/docs/Model/CreateSubscriptionMemberResponse.md
new file mode 100644
index 0000000..69f4f19
--- /dev/null
+++ b/docs/Model/CreateSubscriptionMemberResponse.md
@@ -0,0 +1,13 @@
+# # CreateSubscriptionMemberResponse
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**organizationId** | **int** | Organization Id | [optional]
+**ownerContactId** | **int** | Owner Contact Id | [optional]
+**memberContactIds** | **int[]** | Member Contact Ids | [optional]
+**createdAt** | **\DateTime** | Subscription creation date | [optional]
+**updatedAt** | **\DateTime** | Subscription last modification date | [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/CreateSubscriptionPayload.md b/docs/Model/CreateSubscriptionPayload.md
new file mode 100644
index 0000000..4ceb912
--- /dev/null
+++ b/docs/Model/CreateSubscriptionPayload.md
@@ -0,0 +1,10 @@
+# # CreateSubscriptionPayload
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**contactId** | **int** | Contact ID |
+**loyaltySubscriptionId** | **string** | Loyalty Subscription ID | [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/CreateSubscriptionResponse.md b/docs/Model/CreateSubscriptionResponse.md
new file mode 100644
index 0000000..eb6c3b4
--- /dev/null
+++ b/docs/Model/CreateSubscriptionResponse.md
@@ -0,0 +1,15 @@
+# # CreateSubscriptionResponse
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**organizationId** | **int** | Organization ID | [optional]
+**loyaltyProgramId** | **string** | Loyalty Program ID | [optional]
+**versionId** | **int** | Version ID | [optional]
+**contactId** | **int** | Contact ID | [optional]
+**loyaltySubscriptionId** | **string** | Loyalty Subscription ID | [optional]
+**createdAt** | **\DateTime** | Subscription creation date | [optional]
+**updatedAt** | **\DateTime** | Subscription last modification date | [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/CreateTierGroupRequest.md b/docs/Model/CreateTierGroupRequest.md
new file mode 100644
index 0000000..b470729
--- /dev/null
+++ b/docs/Model/CreateTierGroupRequest.md
@@ -0,0 +1,11 @@
+# # CreateTierGroupRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | Name of the tier group | [optional]
+**upgradeStrategy** | **string** | Select real_time to upgrade tier on real time balance updates. Select anniversary to upgrade tier on subscription anniversary. | [optional] [default to 'real_time']
+**downgradeStrategy** | **string** | Select real_time to downgrade tier on real time balance updates. Select anniversary to downgrade tier on subscription anniversary. | [optional] [default to 'real_time']
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/CreateTransactionPayload.md b/docs/Model/CreateTransactionPayload.md
new file mode 100644
index 0000000..f3c6dc8
--- /dev/null
+++ b/docs/Model/CreateTransactionPayload.md
@@ -0,0 +1,13 @@
+# # CreateTransactionPayload
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**amount** | **float** | Enter positive value for credit transaction and negative value for debit transaction |
+**balanceDefinitionId** | **string** | Balance definition id for which the transaction is made |
+**contactId** | **float** | Contact id |
+**meta** | **object** | Additional metadata related to the transaction. | [optional]
+**ttl** | **int** | Time to live for the transaction in seconds. This defines how long the transaction remains valid before it expires. | [optional] [default to 300]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/CreateUpdateBatchCategory.md b/docs/Model/CreateUpdateBatchCategory.md
index 1549710..b538ecb 100644
--- a/docs/Model/CreateUpdateBatchCategory.md
+++ b/docs/Model/CreateUpdateBatchCategory.md
@@ -1,11 +1,10 @@
-# CreateUpdateBatchCategory
+# # CreateUpdateBatchCategory
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**categories** | [**\Brevo\Client\Model\CreateUpdateCategories[]**](CreateUpdateCategories.md) | array of categories objects |
-**updateEnabled** | **bool** | Facilitate to update the existing categories in the same request (updateEnabled = true) | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**categories** | [**\Brevo\Client\Models\CreateUpdateCategories[]**](CreateUpdateCategories.md) | array of categories objects |
+**updateEnabled** | **bool** | Facilitate to update the existing categories in the same request (updateEnabled = true) | [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/CreateUpdateBatchCategoryModel.md b/docs/Model/CreateUpdateBatchCategoryModel.md
index 1934ae9..96957e5 100644
--- a/docs/Model/CreateUpdateBatchCategoryModel.md
+++ b/docs/Model/CreateUpdateBatchCategoryModel.md
@@ -1,11 +1,10 @@
-# CreateUpdateBatchCategoryModel
+# # CreateUpdateBatchCategoryModel
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**createdCount** | **int** | Number of the new created categories | [optional]
-**updatedCount** | **int** | Number of the existing categories updated | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**createdCount** | **int** | Number of the new created categories | [optional]
+**updatedCount** | **int** | Number of the existing categories updated | [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/CreateUpdateBatchProducts.md b/docs/Model/CreateUpdateBatchProducts.md
index 19d9cae..8dda31f 100644
--- a/docs/Model/CreateUpdateBatchProducts.md
+++ b/docs/Model/CreateUpdateBatchProducts.md
@@ -1,11 +1,10 @@
-# CreateUpdateBatchProducts
+# # CreateUpdateBatchProducts
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**products** | [**\Brevo\Client\Model\CreateUpdateProducts[]**](CreateUpdateProducts.md) | array of products objects |
-**updateEnabled** | **bool** | Facilitate to update the existing categories in the same request (updateEnabled = true) | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**products** | [**\Brevo\Client\Models\CreateUpdateProducts[]**](CreateUpdateProducts.md) | array of products objects |
+**updateEnabled** | **bool** | Facilitate to update the existing categories in the same request (updateEnabled = true) | [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/CreateUpdateBatchProductsModel.md b/docs/Model/CreateUpdateBatchProductsModel.md
index 7b9821c..bf0cffd 100644
--- a/docs/Model/CreateUpdateBatchProductsModel.md
+++ b/docs/Model/CreateUpdateBatchProductsModel.md
@@ -1,11 +1,10 @@
-# CreateUpdateBatchProductsModel
+# # CreateUpdateBatchProductsModel
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**createdCount** | **int** | Number of the new created products | [optional]
-**updatedCount** | **int** | Number of the existing products updated | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**createdCount** | **int** | Number of the new created products | [optional]
+**updatedCount** | **int** | Number of the existing products updated | [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/CreateUpdateCategories.md b/docs/Model/CreateUpdateCategories.md
index b08d1be..494bce4 100644
--- a/docs/Model/CreateUpdateCategories.md
+++ b/docs/Model/CreateUpdateCategories.md
@@ -1,13 +1,13 @@
-# CreateUpdateCategories
+# # CreateUpdateCategories
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **string** | Unique Category ID as saved in the shop |
-**name** | **string** | **Mandatory in case of creation**. Name of the Category, as displayed in the shop | [optional]
-**url** | **string** | URL to the category | [optional]
-**deletedAt** | **string** | UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the category deleted from the shop's database | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**id** | **string** | Unique Category ID as saved in the shop |
+**name** | **string** | **Mandatory in case of creation**. Name of the Category, as displayed in the shop | [optional]
+**url** | **string** | URL to the category | [optional]
+**deletedAt** | **string** | UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the category deleted from the shop's database | [optional]
+**isDeleted** | **bool** | category deleted from the shop's database | [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/CreateUpdateCategory.md b/docs/Model/CreateUpdateCategory.md
index 244ba34..d59bbbf 100644
--- a/docs/Model/CreateUpdateCategory.md
+++ b/docs/Model/CreateUpdateCategory.md
@@ -1,14 +1,14 @@
-# CreateUpdateCategory
+# # CreateUpdateCategory
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **string** | Unique Category ID as saved in the shop |
-**name** | **string** | **Mandatory in case of creation**. Name of the Category, as displayed in the shop | [optional]
-**url** | **string** | URL to the category | [optional]
+**id** | **string** | Unique Category ID as saved in the shop |
+**name** | **string** | **Mandatory in case of creation**. Name of the Category, as displayed in the shop | [optional]
+**url** | **string** | URL to the category | [optional]
**updateEnabled** | **bool** | Facilitate to update the existing category in the same request (updateEnabled = true) | [optional] [default to false]
-**deletedAt** | **string** | UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the category deleted from the shop's database | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**deletedAt** | **string** | UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the category deleted from the shop's database | [optional]
+**isDeleted** | **bool** | category deleted from the shop's database | [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/CreateUpdateContactModel.md b/docs/Model/CreateUpdateContactModel.md
index 1fbb07c..8f5c10a 100644
--- a/docs/Model/CreateUpdateContactModel.md
+++ b/docs/Model/CreateUpdateContactModel.md
@@ -1,10 +1,9 @@
-# CreateUpdateContactModel
+# # CreateUpdateContactModel
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **int** | ID of the contact when a new contact is created | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**id** | **int** | ID of the contact when a new contact is created | [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/CreateUpdateFolder.md b/docs/Model/CreateUpdateFolder.md
index 0a4d2e0..781e6c8 100644
--- a/docs/Model/CreateUpdateFolder.md
+++ b/docs/Model/CreateUpdateFolder.md
@@ -1,10 +1,9 @@
-# CreateUpdateFolder
+# # CreateUpdateFolder
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**name** | **string** | Name of the folder | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**name** | **string** | Name of the folder | [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/CreateUpdateProducts.md b/docs/Model/CreateUpdateProducts.md
index 49b848b..1b69e01 100644
--- a/docs/Model/CreateUpdateProducts.md
+++ b/docs/Model/CreateUpdateProducts.md
@@ -1,19 +1,19 @@
-# CreateUpdateProducts
+# # CreateUpdateProducts
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **string** | Product ID for which you requested the details |
-**name** | **string** | Mandatory in case of creation**. Name of the product for which you requested the details |
-**url** | **string** | URL to the product | [optional]
-**imageUrl** | **string** | Absolute URL to the cover image of the product | [optional]
-**sku** | **string** | Product identifier from the shop | [optional]
-**price** | **float** | Price of the product | [optional]
-**categories** | **string[]** | Category ID-s of the product | [optional]
-**parentId** | **string** | Parent product id of the product | [optional]
-**metaInfo** | **map[string,string]** | Meta data of product such as description, vendor, producer, stock level. The size of cumulative metaInfo shall not exceed **1000 KB**. Maximum length of metaInfo object can be 10. | [optional]
-**deletedAt** | **string** | UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the product deleted from the shop's database | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**id** | **string** | Product ID for which you requested the details |
+**name** | **string** | Mandatory in case of creation**. Name of the product for which you requested the details |
+**url** | **string** | URL to the product | [optional]
+**imageUrl** | **string** | Absolute URL to the cover image of the product | [optional]
+**sku** | **string** | Product identifier from the shop | [optional]
+**price** | **float** | Price of the product | [optional]
+**categories** | **string[]** | Category ID-s of the product | [optional]
+**parentId** | **string** | Parent product id of the product | [optional]
+**metaInfo** | [**array**](GetContactInfoIdentifierParameter.md) | Meta data of product such as description, vendor, producer, stock level. The size of cumulative metaInfo shall not exceed **1000 KB**. Maximum length of metaInfo object can be 10. | [optional]
+**deletedAt** | **string** | UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the product deleted from the shop's database | [optional]
+**isDeleted** | **bool** | product deleted from the shop's database | [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/CreateUpdateproduct.md b/docs/Model/CreateUpdateproduct.md
index 8890bf3..83937a3 100644
--- a/docs/Model/CreateUpdateproduct.md
+++ b/docs/Model/CreateUpdateproduct.md
@@ -1,20 +1,20 @@
-# CreateUpdateProduct
+# # CreateUpdateProduct
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **string** | Product ID for which you requested the details |
-**name** | **string** | Mandatory in case of creation**. Name of the product for which you requested the details |
-**url** | **string** | URL to the product | [optional]
-**imageUrl** | **string** | Absolute URL to the cover image of the product | [optional]
-**sku** | **string** | Product identifier from the shop | [optional]
-**price** | **float** | Price of the product | [optional]
-**categories** | **string[]** | Category ID-s of the product | [optional]
-**parentId** | **string** | Parent product id of the product | [optional]
-**metaInfo** | **map[string,string]** | Meta data of product such as description, vendor, producer, stock level. The size of cumulative metaInfo shall not exceed **1000 KB**. Maximum length of metaInfo object can be 10. | [optional]
+**id** | **string** | Product ID for which you requested the details |
+**name** | **string** | Mandatory in case of creation**. Name of the product for which you requested the details |
+**url** | **string** | URL to the product | [optional]
+**imageUrl** | **string** | Absolute URL to the cover image of the product | [optional]
+**sku** | **string** | Product identifier from the shop | [optional]
+**price** | **float** | Price of the product | [optional]
+**categories** | **string[]** | Category ID-s of the product | [optional]
+**parentId** | **string** | Parent product id of the product | [optional]
+**metaInfo** | [**array**](GetContactInfoIdentifierParameter.md) | Meta data of product such as description, vendor, producer, stock level. The size of cumulative metaInfo shall not exceed **1000 KB**. Maximum length of metaInfo object can be 10. | [optional]
**updateEnabled** | **bool** | Facilitate to update the existing category in the same request (updateEnabled = true) | [optional] [default to false]
-**deletedAt** | **string** | UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the product deleted from the shop's database | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**deletedAt** | **string** | UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the product deleted from the shop's database | [optional]
+**isDeleted** | **bool** | product deleted from the shop's database | [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/CreateWebhook.md b/docs/Model/CreateWebhook.md
index e2d77b9..2f86f2e 100644
--- a/docs/Model/CreateWebhook.md
+++ b/docs/Model/CreateWebhook.md
@@ -1,17 +1,16 @@
-# CreateWebhook
+# # CreateWebhook
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**url** | **string** | URL of the webhook |
-**description** | **string** | Description of the webhook | [optional]
-**events** | **string[]** | - Events triggering the webhook. Possible values for **Transactional** type webhook: #### `sent` OR `request`, `delivered`, `hardBounce`, `softBounce`, `blocked`, `spam`, `invalid`, `deferred`, `click`, `opened`, `uniqueOpened` and `unsubscribed` - Possible values for **Marketing** type webhook: #### `spam`, `opened`, `click`, `hardBounce`, `softBounce`, `unsubscribed`, `listAddition` & `delivered` - Possible values for **Inbound** type webhook: #### `inboundEmailProcessed` |
+**url** | **string** | URL of the webhook |
+**events** | **string[]** | - Events triggering the webhook. Possible values for **Transactional** type webhook: #### `sent` OR `request`, `delivered`, `hardBounce`, `softBounce`, `blocked`, `spam`, `invalid`, `deferred`, `click`, `opened`, `uniqueOpened` and `unsubscribed` - Possible values for **Marketing** type webhook: #### `spam`, `opened`, `click`, `hardBounce`, `softBounce`, `unsubscribed`, `listAddition` & `delivered` - Possible values for **Inbound** type webhook: #### `inboundEmailProcessed` |
+**description** | **string** | Description of the webhook | [optional]
**type** | **string** | Type of the webhook | [optional] [default to 'transactional']
-**domain** | **string** | Inbound domain of webhook, required in case of event type `inbound` | [optional]
-**batched** | **bool** | To send batched webhooks | [optional]
-**auth** | [**\Brevo\Client\Model\GetWebhookAuth**](GetWebhookAuth.md) | | [optional]
-**headers** | [**\Brevo\Client\Model\GetWebhookHeaders[]**](GetWebhookHeaders.md) | Custom headers to be send with webhooks | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**domain** | **string** | Inbound domain of webhook, required in case of event type `inbound` | [optional]
+**batched** | **bool** | Batching configuration of the webhook, we send batched webhooks if its true | [optional]
+**auth** | **object** | Authentication header to be send with the webhook requests | [optional]
+**headers** | **object[]** | | [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/CreateWhatsAppCampaign.md b/docs/Model/CreateWhatsAppCampaign.md
index 75ea401..9a489d5 100644
--- a/docs/Model/CreateWhatsAppCampaign.md
+++ b/docs/Model/CreateWhatsAppCampaign.md
@@ -1,13 +1,12 @@
-# CreateWhatsAppCampaign
+# # CreateWhatsAppCampaign
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**name** | **string** | Name of the WhatsApp campaign creation |
-**templateId** | **int** | Id of the WhatsApp template in **approved** state |
-**scheduledAt** | **string** | Sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.For example: **2017-06-01T12:30:00+02:00** |
-**recipients** | [**\Brevo\Client\Model\CreateWhatsAppCampaignRecipients**](CreateWhatsAppCampaignRecipients.md) | |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**name** | **string** | Name of the WhatsApp campaign creation |
+**templateId** | **int** | Id of the WhatsApp template in **approved** state |
+**scheduledAt** | **string** | Sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.For example: **2017-06-01T12:30:00+02:00** |
+**recipients** | [**\Brevo\Client\Models\CreateWhatsAppCampaignRecipients**](CreateWhatsAppCampaignRecipients.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/CreateWhatsAppCampaignRecipients.md b/docs/Model/CreateWhatsAppCampaignRecipients.md
index 95d274f..51e859c 100644
--- a/docs/Model/CreateWhatsAppCampaignRecipients.md
+++ b/docs/Model/CreateWhatsAppCampaignRecipients.md
@@ -1,12 +1,11 @@
-# CreateWhatsAppCampaignRecipients
+# # CreateWhatsAppCampaignRecipients
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**excludedListIds** | **int[]** | List ids to exclude from the campaign | [optional]
-**listIds** | **int[]** | **Mandatory if scheduledAt is not empty**. List Ids to send the campaign to | [optional]
-**segments** | **int[]** | **Mandatory if listIds are not used**. Segment ids to send the campaign to. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**excludedListIds** | **int[]** | List ids to exclude from the campaign | [optional]
+**listIds** | **int[]** | **Mandatory if scheduledAt is not empty**. List Ids to send the campaign to | [optional]
+**segments** | **int[]** | **Mandatory if listIds are not used**. Segment ids to send the campaign to. | [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/CreateWhatsAppTemplate.md b/docs/Model/CreateWhatsAppTemplate.md
index 5b14eae..b69397d 100644
--- a/docs/Model/CreateWhatsAppTemplate.md
+++ b/docs/Model/CreateWhatsAppTemplate.md
@@ -1,16 +1,15 @@
-# CreateWhatsAppTemplate
+# # CreateWhatsAppTemplate
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**name** | **string** | Name of the template |
-**language** | **string** | Language of the template. For Example : **en** for English |
-**category** | **string** | Category of the template |
-**mediaUrl** | **string** | Absolute url of the media file **(no local file)** for the header. **Use this field in you want to add media in Template header and headerText is empty.** Allowed extensions for media files are: #### jpeg | png | mp4 | pdf | [optional]
-**bodyText** | **string** | Body of the template. **Maximum allowed characters are 1024** |
-**headerText** | **string** | Text content of the header in the template. **Maximum allowed characters are 45** **Use this field to add text content in template header and if mediaUrl is empty** | [optional]
-**source** | **string** | source of the template | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
+**name** | **string** | Name of the template |
+**language** | **string** | Language of the template. For Example : **en** for English |
+**category** | **string** | Category of the template |
+**bodyText** | **string** | Body of the template. **Maximum allowed characters are 1024** |
+**mediaUrl** | **string** | Absolute url of the media file **(no local file)** for the header. **Use this field in you want to add media in Template header and headerText is empty**. Allowed extensions for media files are: #### jpeg | png | mp4 | pdf | [optional]
+**headerText** | **string** | Text content of the header in the template. **Maximum allowed characters are 45** **Use this field to add text content in template header and if mediaUrl is empty** | [optional]
+**source** | **string** | source of the template | [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/CreatedBatchId.md b/docs/Model/CreatedBatchId.md
index 6007b70..4758aeb 100644
--- a/docs/Model/CreatedBatchId.md
+++ b/docs/Model/CreatedBatchId.md
@@ -1,10 +1,10 @@
-# CreatedBatchId
+# # CreatedBatchId
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**batchId** | **float** | Batch ID of the request |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**batchId** | **float** | Batch ID of the request |
+**count** | **int** | Number of orders | [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/CreatedProcessId.md b/docs/Model/CreatedProcessId.md
index 06151d3..c51b0f2 100644
--- a/docs/Model/CreatedProcessId.md
+++ b/docs/Model/CreatedProcessId.md
@@ -1,10 +1,9 @@
-# CreatedProcessId
+# # CreatedProcessId
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**processId** | **int** | Id of the process created |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**processId** | **int** | Id of the process created |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/CrmDealsIdPatchRequest.md b/docs/Model/CrmDealsIdPatchRequest.md
new file mode 100644
index 0000000..3b94f7d
--- /dev/null
+++ b/docs/Model/CrmDealsIdPatchRequest.md
@@ -0,0 +1,10 @@
+# # CrmDealsIdPatchRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | Name of deal | [optional]
+**attributes** | **object** | Attributes for deal update To assign owner of a Deal you can send attributes.deal_owner and utilize the account email or ID. If you wish to update the pipeline of a deal you need to provide the `pipeline` and the `deal_stage` Pipeline and deal_stage are ids you can fetch using this endpoint `/crm/pipeline/details/{pipelineID}` | [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/CrmDealsLinkUnlinkIdPatchRequest.md b/docs/Model/CrmDealsLinkUnlinkIdPatchRequest.md
new file mode 100644
index 0000000..2f3ac7f
--- /dev/null
+++ b/docs/Model/CrmDealsLinkUnlinkIdPatchRequest.md
@@ -0,0 +1,12 @@
+# # CrmDealsLinkUnlinkIdPatchRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**linkContactIds** | **int[]** | Contact ids for contacts to be linked with deal | [optional]
+**unlinkContactIds** | **int[]** | Contact ids for contacts to be unlinked from deal | [optional]
+**linkCompanyIds** | **string[]** | Company ids to be linked with deal | [optional]
+**unlinkCompanyIds** | **string[]** | Company ids to be unlinked from deal | [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/CrmDealsPost201Response.md b/docs/Model/CrmDealsPost201Response.md
new file mode 100644
index 0000000..343bf85
--- /dev/null
+++ b/docs/Model/CrmDealsPost201Response.md
@@ -0,0 +1,9 @@
+# # CrmDealsPost201Response
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | Unique deal id |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/CrmDealsPostRequest.md b/docs/Model/CrmDealsPostRequest.md
new file mode 100644
index 0000000..09020e2
--- /dev/null
+++ b/docs/Model/CrmDealsPostRequest.md
@@ -0,0 +1,12 @@
+# # CrmDealsPostRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | Name of deal |
+**attributes** | **object** | Attributes for deal creation To assign owner of a Deal you can send attributes.deal_owner and utilize the account email or ID. If you want to create a deal on a specific pipeline and stage you can use the following attributes `pipeline` and `deal_stage`. Pipeline and deal_stage are ids you can fetch using this endpoint `/crm/pipeline/details/{pipelineID}` | [optional]
+**linkedContactsIds** | **int[]** | Contact ids to be linked with deal | [optional]
+**linkedCompaniesIds** | **string[]** | Company ids to be linked with deal | [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/CrmTasksIdPatchRequest.md b/docs/Model/CrmTasksIdPatchRequest.md
new file mode 100644
index 0000000..22385a7
--- /dev/null
+++ b/docs/Model/CrmTasksIdPatchRequest.md
@@ -0,0 +1,19 @@
+# # CrmTasksIdPatchRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | Name of task | [optional]
+**duration** | **int** | Duration of task in milliseconds [1 minute = 60000 ms] | [optional]
+**taskTypeId** | **string** | Id for type of task e.g Call / Email / Meeting etc. | [optional]
+**date** | **\DateTime** | Task date/time | [optional]
+**notes** | **string** | Notes added to a task | [optional]
+**done** | **bool** | Task marked as done | [optional]
+**assignToId** | **string** | To assign a task to a user you can use either the account email or ID. | [optional]
+**contactsIds** | **int[]** | Contact ids for contacts linked to this task | [optional]
+**dealsIds** | **string[]** | Deal ids for deals a task is linked to | [optional]
+**companiesIds** | **string[]** | Companies ids for companies a task is linked to | [optional]
+**reminder** | [**\Brevo\Client\Models\TaskReminder**](TaskReminder.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/CrmTasksPost201Response.md b/docs/Model/CrmTasksPost201Response.md
new file mode 100644
index 0000000..203ffc4
--- /dev/null
+++ b/docs/Model/CrmTasksPost201Response.md
@@ -0,0 +1,9 @@
+# # CrmTasksPost201Response
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | Unique task id |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/CrmTasksPostRequest.md b/docs/Model/CrmTasksPostRequest.md
new file mode 100644
index 0000000..3522ebc
--- /dev/null
+++ b/docs/Model/CrmTasksPostRequest.md
@@ -0,0 +1,19 @@
+# # CrmTasksPostRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | Name of task |
+**taskTypeId** | **string** | Id for type of task e.g Call / Email / Meeting etc. |
+**date** | **\DateTime** | Task due date and time |
+**duration** | **int** | Duration of task in milliseconds [1 minute = 60000 ms] | [optional]
+**notes** | **string** | Notes added to a task | [optional]
+**done** | **bool** | Task marked as done | [optional]
+**assignToId** | **string** | To assign a task to a user you can use either the account email or ID. | [optional]
+**contactsIds** | **int[]** | Contact ids for contacts linked to this task | [optional]
+**dealsIds** | **string[]** | Deal ids for deals a task is linked to | [optional]
+**companiesIds** | **string[]** | Companies ids for companies a task is linked to | [optional]
+**reminder** | [**\Brevo\Client\Models\TaskReminder**](TaskReminder.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/Deal.md b/docs/Model/Deal.md
index 7900025..7d8428a 100644
--- a/docs/Model/Deal.md
+++ b/docs/Model/Deal.md
@@ -1,13 +1,12 @@
-# Deal
+# # Deal
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **string** | Unique deal id | [optional]
-**attributes** | **object** | Deal attributes with values | [optional]
-**linkedContactsIds** | **int[]** | Contact ids for contacts linked to this deal | [optional]
-**linkedCompaniesIds** | **string[]** | Companies ids for companies linked to this deal | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**id** | **string** | Unique deal id | [optional]
+**attributes** | **object** | Deal attributes with values | [optional]
+**linkedContactsIds** | **int[]** | Contact ids for contacts linked to this deal | [optional]
+**linkedCompaniesIds** | **string[]** | Companies ids for companies linked to this deal | [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/DealAttributes.md b/docs/Model/DealAttributes.md
deleted file mode 100644
index f8ee78d..0000000
--- a/docs/Model/DealAttributes.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# DealAttributes
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/DealAttributesInner.md b/docs/Model/DealAttributesInner.md
index 5e8e2cb..eec6fa8 100644
--- a/docs/Model/DealAttributesInner.md
+++ b/docs/Model/DealAttributesInner.md
@@ -1,14 +1,13 @@
-# DealAttributesInner
+# # DealAttributesInner
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**internalName** | **string** | | [optional]
-**label** | **string** | | [optional]
-**attributeTypeName** | **string** | | [optional]
-**attributeOptions** | **object[]** | | [optional]
-**isRequired** | **bool** | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**internalName** | **string** | | [optional]
+**label** | **string** | | [optional]
+**attributeTypeName** | **string** | | [optional]
+**attributeOptions** | **object[]** | | [optional]
+**isRequired** | **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/DealsList.md b/docs/Model/DealsList.md
index f76bcc1..49ada78 100644
--- a/docs/Model/DealsList.md
+++ b/docs/Model/DealsList.md
@@ -1,10 +1,9 @@
-# DealsList
+# # DealsList
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**items** | [**\Brevo\Client\Model\Deal[]**](Deal.md) | List of deals | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**items** | [**\Brevo\Client\Models\Deal[]**](Deal.md) | List of deals | [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/DeleteHardbounces.md b/docs/Model/DeleteHardbounces.md
index e726299..13ade4c 100644
--- a/docs/Model/DeleteHardbounces.md
+++ b/docs/Model/DeleteHardbounces.md
@@ -1,12 +1,11 @@
-# DeleteHardbounces
+# # DeleteHardbounces
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**startDate** | **string** | Starting date (YYYY-MM-DD) of the time period for deletion. The hardbounces occurred after this date will be deleted. Must be less than or equal to the endDate | [optional]
-**endDate** | **string** | Ending date (YYYY-MM-DD) of the time period for deletion. The hardbounces until this date will be deleted. Must be greater than or equal to the startDate | [optional]
-**contactEmail** | **string** | Target a specific email address | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**startDate** | **string** | Starting date (YYYY-MM-DD) of the time period for deletion. The hardbounces occurred after this date will be deleted. Must be less than or equal to the endDate | [optional]
+**endDate** | **string** | Ending date (YYYY-MM-DD) of the time period for deletion. The hardbounces until this date will be deleted. Must be greater than or equal to the startDate | [optional]
+**contactEmail** | **string** | Target a specific email address | [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/DeleteSubscriptionMemberPayload.md b/docs/Model/DeleteSubscriptionMemberPayload.md
new file mode 100644
index 0000000..587ecc1
--- /dev/null
+++ b/docs/Model/DeleteSubscriptionMemberPayload.md
@@ -0,0 +1,10 @@
+# # DeleteSubscriptionMemberPayload
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**contactId** | **int** | Contact Id | [default to 1]
+**memberContactIds** | **int[]** | Member Contact Ids | [default to [2]]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response.md b/docs/Model/EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response.md
new file mode 100644
index 0000000..d6c7c8e
--- /dev/null
+++ b/docs/Model/EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response.md
@@ -0,0 +1,14 @@
+# # EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **float** | |
+**conversionSource** | **string** | |
+**ordersCount** | **float** | |
+**revenue** | **float** | |
+**averageBasket** | **float** | |
+**newCustomersCount** | **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/EcommerceAttributionMetricsGet200Response.md b/docs/Model/EcommerceAttributionMetricsGet200Response.md
new file mode 100644
index 0000000..67c1c54
--- /dev/null
+++ b/docs/Model/EcommerceAttributionMetricsGet200Response.md
@@ -0,0 +1,10 @@
+# # EcommerceAttributionMetricsGet200Response
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**results** | [**\Brevo\Client\Models\ConversionSourceMetrics[]**](ConversionSourceMetrics.md) | List of conversion attribution metrics |
+**totals** | [**\Brevo\Client\Models\EcommerceAttributionMetricsGet200ResponseTotals**](EcommerceAttributionMetricsGet200ResponseTotals.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/EcommerceAttributionMetricsGet200ResponseTotals.md b/docs/Model/EcommerceAttributionMetricsGet200ResponseTotals.md
new file mode 100644
index 0000000..70bd8e6
--- /dev/null
+++ b/docs/Model/EcommerceAttributionMetricsGet200ResponseTotals.md
@@ -0,0 +1,11 @@
+# # EcommerceAttributionMetricsGet200ResponseTotals
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**ordersCount** | **float** | |
+**revenue** | **float** | |
+**averageBasket** | **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/EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response.md b/docs/Model/EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response.md
new file mode 100644
index 0000000..1b72ceb
--- /dev/null
+++ b/docs/Model/EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response.md
@@ -0,0 +1,9 @@
+# # EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**products** | [**\Brevo\Client\Models\ConversionSourceProduct[]**](ConversionSourceProduct.md) | List of attributed products |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EcommerceConfigDisplayCurrencyGet200Response.md b/docs/Model/EcommerceConfigDisplayCurrencyGet200Response.md
new file mode 100644
index 0000000..80ec672
--- /dev/null
+++ b/docs/Model/EcommerceConfigDisplayCurrencyGet200Response.md
@@ -0,0 +1,9 @@
+# # EcommerceConfigDisplayCurrencyGet200Response
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**code** | **string** | ISO 4217 compliant display currency code |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EmailExportRecipients.md b/docs/Model/EmailExportRecipients.md
index c039748..b60cdd8 100644
--- a/docs/Model/EmailExportRecipients.md
+++ b/docs/Model/EmailExportRecipients.md
@@ -1,11 +1,10 @@
-# EmailExportRecipients
+# # EmailExportRecipients
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**notifyURL** | **string** | Webhook called once the export process is finished. For reference, https://help.brevo.com/hc/en-us/articles/360007666479 | [optional]
-**recipientsType** | **string** | Type of recipients to export for a campaign |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**recipientsType** | **string** | Type of recipients to export for a campaign |
+**notifyURL** | **string** | Webhook called once the export process is finished. For reference, https://help.brevo.com/hc/en-us/articles/360007666479 | [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/ErrorModel.md b/docs/Model/ErrorModel.md
index 697c3ca..7f3da11 100644
--- a/docs/Model/ErrorModel.md
+++ b/docs/Model/ErrorModel.md
@@ -1,11 +1,10 @@
-# ErrorModel
+# # ErrorModel
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**code** | **string** | Error code displayed in case of a failure |
-**message** | **string** | Readable message associated to the failure |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**code** | **string** | Error code displayed in case of a failure |
+**message** | **string** | Readable message associated to the failure |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/ErrorResponse.md b/docs/Model/ErrorResponse.md
new file mode 100644
index 0000000..1febd47
--- /dev/null
+++ b/docs/Model/ErrorResponse.md
@@ -0,0 +1,9 @@
+# # ErrorResponse
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**error** | **string** | Error message indicating what went wrong | [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/Event.md b/docs/Model/Event.md
index 959614d..c428d58 100644
--- a/docs/Model/Event.md
+++ b/docs/Model/Event.md
@@ -1,14 +1,13 @@
-# Event
+# # Event
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**eventName** | **string** | The name of the event that occurred. This is how you will find your event in Brevo. Limited to 255 characters, alphanumerical characters and - _ only. |
-**eventDate** | **string** | Timestamp of when the event occurred (e.g. \"2024-01-24T17:39:57+01:00\"). If no value is passed, the timestamp of the event creation is used. | [optional]
-**identifiers** | [**\Brevo\Client\Model\EventIdentifiers**](EventIdentifiers.md) | |
-**contactProperties** | **object** | Properties defining the state of the contact associated to this event. Useful to update contact attributes defined in your contacts database while passing the event. For example: **\"FIRSTNAME\": \"Jane\" , \"AGE\": 37** | [optional]
-**eventProperties** | **object** | Properties of the event. Top level properties and nested properties can be used to better segment contacts and personalise workflow conditions. The following field type are supported: string, number, boolean (true/false), date (Timestamp e.g. \"2024-01-24T17:39:57+01:00\"). Keys are limited to 255 characters, alphanumerical characters and - _ only. Size is limited to 50Kb. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**eventName** | **string** | The name of the event that occurred. This is how you will find your event in Brevo. Limited to 255 characters, alphanumerical characters and - _ only. |
+**identifiers** | [**\Brevo\Client\Models\EventIdentifiers**](EventIdentifiers.md) | |
+**eventDate** | **string** | Timestamp of when the event occurred (e.g. \"2024-01-24T17:39:57+01:00\"). If no value is passed, the timestamp of the event creation is used. | [optional]
+**contactProperties** | [**array**](EventContactPropertiesValue.md) | Properties defining the state of the contact associated to this event. Useful to update contact attributes defined in your contacts database while passing the event. For example: **\"FIRSTNAME\": \"Jane\" , \"AGE\": 37** | [optional]
+**eventProperties** | [**array**](EventEventPropertiesValue.md) | Properties of the event. Top level properties and nested properties can be used to better segment contacts and personalise workflow conditions. The following field type are supported: string, number, boolean (true/false), date (Timestamp e.g. \"2024-01-24T17:39:57+01:00\"). Keys are limited to 255 characters, alphanumerical characters and - _ only. Size is limited to 50Kb. | [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/EventContactPropertiesValue.md b/docs/Model/EventContactPropertiesValue.md
new file mode 100644
index 0000000..0e9ca93
--- /dev/null
+++ b/docs/Model/EventContactPropertiesValue.md
@@ -0,0 +1,8 @@
+# # EventContactPropertiesValue
+
+## 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/EventEventPropertiesValue.md b/docs/Model/EventEventPropertiesValue.md
new file mode 100644
index 0000000..64be187
--- /dev/null
+++ b/docs/Model/EventEventPropertiesValue.md
@@ -0,0 +1,8 @@
+# # EventEventPropertiesValue
+
+## 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/EventIdentifiers.md b/docs/Model/EventIdentifiers.md
index f515fb9..6beb5c7 100644
--- a/docs/Model/EventIdentifiers.md
+++ b/docs/Model/EventIdentifiers.md
@@ -1,14 +1,13 @@
-# EventIdentifiers
+# # EventIdentifiers
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**emailId** | **string** | Email Id associated with the event | [optional]
-**phoneId** | **string** | SMS associated with the event | [optional]
-**whatsappId** | **string** | whatsapp associated with the event | [optional]
-**landlineNumberId** | **string** | landline_number associated with the event | [optional]
-**extId** | **string** | ext_id associated with the event | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**emailId** | **string** | Email Id associated with the event | [optional]
+**phoneId** | **string** | SMS associated with the event | [optional]
+**whatsappId** | **string** | whatsapp associated with the event | [optional]
+**landlineNumberId** | **string** | landline_number associated with the event | [optional]
+**extId** | **string** | ext_id associated with the event | [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/ExportWebhooksHistory.md b/docs/Model/ExportWebhooksHistory.md
index c9b81fa..e5b7cbb 100644
--- a/docs/Model/ExportWebhooksHistory.md
+++ b/docs/Model/ExportWebhooksHistory.md
@@ -1,19 +1,18 @@
-# ExportWebhooksHistory
+# # ExportWebhooksHistory
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**days** | **int** | Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ | [optional]
-**startDate** | **string** | Mandatory if endDate is used. Starting date of the history (YYYY-MM-DD). Must be lower than equal to endDate | [optional]
-**endDate** | **string** | Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate | [optional]
-**sort** | **string** | Sorting order of records (asc or desc) | [optional]
-**type** | **string** | Filter the history based on webhook type |
-**event** | **string** | Filter the history for a specific event type |
-**notifyURL** | **string** | Webhook URL to receive CSV file link |
-**webhookId** | **int** | Filter the history for a specific webhook id | [optional]
-**email** | **string** | Filter the history for a specific email | [optional]
-**messageId** | **int** | Filter the history for a specific message id. Applicable only for transactional webhooks. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**type** | **string** | Filter the history based on webhook type |
+**event** | **string** | Filter the history for a specific event type |
+**notifyURL** | **string** | Webhook URL to receive CSV file link |
+**days** | **int** | Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ | [optional]
+**startDate** | **string** | Mandatory if endDate is used. Starting date of the history (YYYY-MM-DD). Must be lower than equal to endDate | [optional]
+**endDate** | **string** | Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate | [optional]
+**sort** | **string** | Sorting order of records (asc or desc) | [optional]
+**webhookId** | **int** | Filter the history for a specific webhook id | [optional]
+**email** | **string** | Filter the history for a specific email | [optional]
+**messageId** | **int** | Filter the history for a specific message id. Applicable only for transactional webhooks. | [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/ExportWebhooksHistoryRequest.md b/docs/Model/ExportWebhooksHistoryRequest.md
new file mode 100644
index 0000000..e0cc02c
--- /dev/null
+++ b/docs/Model/ExportWebhooksHistoryRequest.md
@@ -0,0 +1,18 @@
+# # ExportWebhooksHistoryRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**type** | **string** | Filter the history based on webhook type |
+**event** | **string** | Filter the history for a specific event type |
+**notifyURL** | **string** | Webhook URL to receive CSV file link |
+**days** | **int** | Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ | [optional]
+**startDate** | **string** | Mandatory if endDate is used. Starting date of the history (YYYY-MM-DD). Must be lower than equal to endDate | [optional]
+**endDate** | **string** | Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate | [optional]
+**sort** | **string** | Sorting order of records (asc or desc) | [optional]
+**webhookId** | **int** | Filter the history for a specific webhook id | [optional]
+**email** | **string** | Filter the history for a specific email | [optional]
+**messageId** | **int** | Filter the history for a specific message id. Applicable only for transactional webhooks. | [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/FileData.md b/docs/Model/FileData.md
index 8e87a73..a36c3c0 100644
--- a/docs/Model/FileData.md
+++ b/docs/Model/FileData.md
@@ -1,19 +1,15 @@
-# FileData
+# # FileData
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**url** | **string** | Url of uploaded file | [optional]
-**id** | **string** | Id of uploaded file | [optional]
-**name** | **string** | Name of uploaded file | [optional]
-**authorId** | **string** | Account id of user which created the file | [optional]
-**author** | **object** | Account details of user which created the file | [optional]
-**contactId** | **int** | Contact id of contact on which file is uploaded | [optional]
-**dealId** | **string** | Deal id linked to a file | [optional]
-**companyId** | **string** | Company id linked to a file | [optional]
-**size** | **int** | Size of file in bytes | [optional]
-**createdAt** | [**\DateTime**] | File created date/time | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
+**name** | **string** | Name of uploaded file | [optional]
+**authorId** | **string** | Account id of user which created the file | [optional]
+**contactId** | **int** | Contact id of contact on which file is uploaded | [optional]
+**dealId** | **string** | Deal id linked to a file | [optional]
+**companyId** | **string** | Company id linked to a file | [optional]
+**size** | **int** | Size of file in bytes | [optional]
+**createdAt** | **\DateTime** | File created date/time | [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/FileDownloadableLink.md b/docs/Model/FileDownloadableLink.md
index 5e30ce3..6e674d8 100644
--- a/docs/Model/FileDownloadableLink.md
+++ b/docs/Model/FileDownloadableLink.md
@@ -1,10 +1,9 @@
-# FileDownloadableLink
+# # FileDownloadableLink
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**fileUrl** | **string** | A unique link to download the requested file. |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**fileUrl** | **string** | A unique link to download the requested file. | [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/FileList.md b/docs/Model/FileList.md
deleted file mode 100644
index beb2b81..0000000
--- a/docs/Model/FileList.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# FileList
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetAccount.md b/docs/Model/GetAccount.md
index 7ab8a70..2873277 100644
--- a/docs/Model/GetAccount.md
+++ b/docs/Model/GetAccount.md
@@ -1,12 +1,16 @@
-# GetAccount
+# # GetAccount
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**plan** | [**\Brevo\Client\Model\GetAccountPlan[]**](GetAccountPlan.md) | Information about your plans and credits |
-**relay** | [**\Brevo\Client\Model\GetAccountRelay**](GetAccountRelay.md) | |
-**marketingAutomation** | [**\Brevo\Client\Model\GetAccountMarketingAutomation**](GetAccountMarketingAutomation.md) | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**email** | **string** | Login Email |
+**firstName** | **string** | First Name |
+**lastName** | **string** | Last Name |
+**companyName** | **string** | Name of the company |
+**address** | [**\Brevo\Client\Models\GetExtendedClientAllOfAddress**](GetExtendedClientAllOfAddress.md) | |
+**plan** | [**\Brevo\Client\Models\GetAccountAllOfPlan[]**](GetAccountAllOfPlan.md) | Information about your plans and credits |
+**relay** | [**\Brevo\Client\Models\GetAccountAllOfRelay**](GetAccountAllOfRelay.md) | |
+**marketingAutomation** | [**\Brevo\Client\Models\GetAccountAllOfMarketingAutomation**](GetAccountAllOfMarketingAutomation.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/GetAccountActivity.md b/docs/Model/GetAccountActivity.md
index 67b5955..7c82b8d 100644
--- a/docs/Model/GetAccountActivity.md
+++ b/docs/Model/GetAccountActivity.md
@@ -1,10 +1,9 @@
-# GetAccountActivity
+# # GetAccountActivity
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**logs** | [**\Brevo\Client\Model\GetAccountActivityLogs[]**](GetAccountActivityLogs.md) | Get user activity logs | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**logs** | [**\Brevo\Client\Models\GetAccountActivityLogsInner[]**](GetAccountActivityLogsInner.md) | Get user activity logs | [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/GetAccountActivityLogs.md b/docs/Model/GetAccountActivityLogs.md
deleted file mode 100644
index 061aac8..0000000
--- a/docs/Model/GetAccountActivityLogs.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# GetAccountActivityLogs
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**action** | **string** | Type of activity in the account. |
-**date** | **string** | Time of the activity. |
-**userEmail** | **string** | Email address of the user who performed activity in the account. |
-**userIp** | **string** | IP address of the user who performed activity in the account. |
-**userAgent** | **string** | Browser details of the user who performed the activity. |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetAccountActivityLogsInner.md b/docs/Model/GetAccountActivityLogsInner.md
new file mode 100644
index 0000000..1bdd670
--- /dev/null
+++ b/docs/Model/GetAccountActivityLogsInner.md
@@ -0,0 +1,13 @@
+# # GetAccountActivityLogsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**action** | **string** | Type of activity in the account. |
+**date** | **string** | Time of the activity. |
+**userEmail** | **string** | Email address of the user who performed activity in the account. |
+**userIp** | **string** | IP address of the user who performed activity in the account. |
+**userAgent** | **string** | Browser details of the user who performed the activity. |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetAccountAllOfMarketingAutomation.md b/docs/Model/GetAccountAllOfMarketingAutomation.md
new file mode 100644
index 0000000..6053f4a
--- /dev/null
+++ b/docs/Model/GetAccountAllOfMarketingAutomation.md
@@ -0,0 +1,10 @@
+# # GetAccountAllOfMarketingAutomation
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**enabled** | **bool** | Status of Marketing Automation Plateform activation for your account (true=enabled, false=disabled) |
+**key** | **string** | Marketing Automation Tracker ID | [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/GetAccountAllOfPlan.md b/docs/Model/GetAccountAllOfPlan.md
new file mode 100644
index 0000000..04ce274
--- /dev/null
+++ b/docs/Model/GetAccountAllOfPlan.md
@@ -0,0 +1,13 @@
+# # GetAccountAllOfPlan
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**type** | **string** | Displays the plan type of the user |
+**creditsType** | **string** | This is the type of the credit, \"Send Limit\" is one of the possible types of credit of a user. \"Send Limit\" implies the total number of emails you can send to the subscribers in your account. |
+**credits** | **float** | Remaining credits of the user |
+**startDate** | **\DateTime** | Date of the period from which the plan will start (only available for \"subscription\" plan type) | [optional]
+**endDate** | **\DateTime** | Date of the period from which the plan will end (only available for \"subscription\" plan type) | [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/GetAccountAllOfRelay.md b/docs/Model/GetAccountAllOfRelay.md
new file mode 100644
index 0000000..f9ab417
--- /dev/null
+++ b/docs/Model/GetAccountAllOfRelay.md
@@ -0,0 +1,10 @@
+# # GetAccountAllOfRelay
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**enabled** | **bool** | Status of your transactional email Account (true=Enabled, false=Disabled) |
+**data** | [**\Brevo\Client\Models\GetAccountAllOfRelayData**](GetAccountAllOfRelayData.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/GetAccountAllOfRelayData.md b/docs/Model/GetAccountAllOfRelayData.md
new file mode 100644
index 0000000..fec934a
--- /dev/null
+++ b/docs/Model/GetAccountAllOfRelayData.md
@@ -0,0 +1,11 @@
+# # GetAccountAllOfRelayData
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**userName** | **string** | Email to use as login on transactional platform |
+**relay** | **string** | URL of the SMTP Relay |
+**port** | **int** | Port used for SMTP Relay |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetAccountMarketingAutomation.md b/docs/Model/GetAccountMarketingAutomation.md
deleted file mode 100644
index 7fc91c8..0000000
--- a/docs/Model/GetAccountMarketingAutomation.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# GetAccountMarketingAutomation
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**key** | **string** | Marketing Automation Tracker ID | [optional]
-**enabled** | **bool** | Status of Marketing Automation Plateform activation for your account (true=enabled, false=disabled) |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetAccountPlan.md b/docs/Model/GetAccountPlan.md
deleted file mode 100644
index 1ea58ad..0000000
--- a/docs/Model/GetAccountPlan.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# GetAccountPlan
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**type** | **string** | Displays the plan type of the user |
-**creditsType** | **string** | This is the type of the credit, \"Send Limit\" is one of the possible types of credit of a user. \"Send Limit\" implies the total number of emails you can send to the subscribers in your account. |
-**credits** | **float** | Remaining credits of the user |
-**startDate** | [**\DateTime**] | Date of the period from which the plan will start (only available for \"subscription\" and \"reseller\" plan type) | [optional]
-**endDate** | [**\DateTime**] | Date of the period from which the plan will end (only available for \"subscription\" and \"reseller\" plan type) | [optional]
-**userLimit** | **int** | Only in case of reseller account. It implies the total number of child accounts you can add to your account. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetAccountRelay.md b/docs/Model/GetAccountRelay.md
deleted file mode 100644
index 5824073..0000000
--- a/docs/Model/GetAccountRelay.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# GetAccountRelay
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**enabled** | **bool** | Status of your transactional email Account (true=Enabled, false=Disabled) |
-**data** | [**\Brevo\Client\Model\GetAccountRelayData**](GetAccountRelayData.md) | |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetAccountRelayData.md b/docs/Model/GetAccountRelayData.md
deleted file mode 100644
index ff92c00..0000000
--- a/docs/Model/GetAccountRelayData.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# GetAccountRelayData
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**userName** | **string** | Email to use as login on transactional platform |
-**relay** | **string** | URL of the SMTP Relay |
-**port** | **int** | Port used for SMTP Relay |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetAggregatedReport.md b/docs/Model/GetAggregatedReport.md
index e02ad03..28b9119 100644
--- a/docs/Model/GetAggregatedReport.md
+++ b/docs/Model/GetAggregatedReport.md
@@ -1,22 +1,21 @@
-# GetAggregatedReport
+# # GetAggregatedReport
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**range** | **string** | Time frame of the report | [optional]
-**requests** | **int** | Number of requests for the timeframe | [optional]
-**delivered** | **int** | Number of delivered emails for the timeframe | [optional]
-**hardBounces** | **int** | Number of hardbounces for the timeframe | [optional]
-**softBounces** | **int** | Number of softbounces for the timeframe | [optional]
-**clicks** | **int** | Number of clicks for the timeframe | [optional]
-**uniqueClicks** | **int** | Number of unique clicks for the timeframe | [optional]
-**opens** | **int** | Number of openings for the timeframe | [optional]
-**uniqueOpens** | **int** | Number of unique openings for the timeframe | [optional]
-**spamReports** | **int** | Number of complaint (spam report) for the timeframe | [optional]
-**blocked** | **int** | Number of blocked contact emails for the timeframe | [optional]
-**invalid** | **int** | Number of invalid emails for the timeframe | [optional]
-**unsubscribed** | **int** | Number of unsubscribed emails for the timeframe | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**range** | **string** | Time frame of the report | [optional]
+**requests** | **int** | Number of requests for the timeframe | [optional]
+**delivered** | **int** | Number of delivered emails for the timeframe | [optional]
+**hardBounces** | **int** | Number of hardbounces for the timeframe | [optional]
+**softBounces** | **int** | Number of softbounces for the timeframe | [optional]
+**clicks** | **int** | Number of clicks for the timeframe | [optional]
+**uniqueClicks** | **int** | Number of unique clicks for the timeframe | [optional]
+**opens** | **int** | Number of openings for the timeframe | [optional]
+**uniqueOpens** | **int** | Number of unique openings for the timeframe | [optional]
+**spamReports** | **int** | Number of complaint (spam report) for the timeframe | [optional]
+**blocked** | **int** | Number of blocked contact emails for the timeframe | [optional]
+**invalid** | **int** | Number of invalid emails for the timeframe | [optional]
+**unsubscribed** | **int** | Number of unsubscribed emails for the timeframe | [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/GetAllExternalFeeds.md b/docs/Model/GetAllExternalFeeds.md
index 5e68eca..cd73f52 100644
--- a/docs/Model/GetAllExternalFeeds.md
+++ b/docs/Model/GetAllExternalFeeds.md
@@ -1,11 +1,10 @@
-# GetAllExternalFeeds
+# # GetAllExternalFeeds
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**count** | **int** | Total number of batches | [optional]
-**feeds** | [**\Brevo\Client\Model\GetAllExternalFeedsFeeds[]**](GetAllExternalFeedsFeeds.md) | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**count** | **int** | Total number of batches | [optional]
+**feeds** | [**\Brevo\Client\Models\GetAllExternalFeedsFeedsInner[]**](GetAllExternalFeedsFeedsInner.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/GetAllExternalFeedsFeeds.md b/docs/Model/GetAllExternalFeedsFeeds.md
deleted file mode 100644
index a4302b3..0000000
--- a/docs/Model/GetAllExternalFeedsFeeds.md
+++ /dev/null
@@ -1,21 +0,0 @@
-# GetAllExternalFeedsFeeds
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**id** | **string** | ID of the feed |
-**name** | **string** | Name of the feed |
-**url** | **string** | URL of the feed |
-**authType** | **string** | Auth type of the feed: * `basic` * `token` * `noAuth` |
-**username** | **string** | Username for authType `basic` | [optional]
-**password** | **string** | Password for authType `basic` | [optional]
-**token** | **string** | Token for authType `token` | [optional]
-**headers** | [**\Brevo\Client\Model\GetExternalFeedByUUIDHeaders[]**](GetExternalFeedByUUIDHeaders.md) | Custom headers for the feed |
-**maxRetries** | **int** | Maximum number of retries on the feed url |
-**cache** | **bool** | Toggle caching of feed url response |
-**createdAt** | [**\DateTime**] | Datetime on which the feed was created |
-**modifiedAt** | [**\DateTime**] | Datetime on which the feed was modified |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetAllExternalFeedsFeedsInner.md b/docs/Model/GetAllExternalFeedsFeedsInner.md
new file mode 100644
index 0000000..d678435
--- /dev/null
+++ b/docs/Model/GetAllExternalFeedsFeedsInner.md
@@ -0,0 +1,20 @@
+# # GetAllExternalFeedsFeedsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | ID of the feed |
+**name** | **string** | Name of the feed |
+**url** | **string** | URL of the feed |
+**authType** | **string** | Auth type of the feed: * `basic` * `token` * `noAuth` |
+**headers** | [**\Brevo\Client\Models\GetExternalFeedByUUIDHeadersInner[]**](GetExternalFeedByUUIDHeadersInner.md) | Custom headers for the feed |
+**maxRetries** | **int** | Maximum number of retries on the feed url | [default to 5]
+**cache** | **bool** | Toggle caching of feed url response |
+**createdAt** | **\DateTime** | Datetime on which the feed was created |
+**modifiedAt** | **\DateTime** | Datetime on which the feed was modified |
+**username** | **string** | Username for authType `basic` | [optional]
+**password** | **string** | Password for authType `basic` | [optional]
+**token** | **string** | Token for authType `token` | [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/GetAttributes.md b/docs/Model/GetAttributes.md
index 5c068df..54829d0 100644
--- a/docs/Model/GetAttributes.md
+++ b/docs/Model/GetAttributes.md
@@ -1,10 +1,9 @@
-# GetAttributes
+# # GetAttributes
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**attributes** | [**\Brevo\Client\Model\GetAttributesAttributes[]**](GetAttributesAttributes.md) | Listing of available contact attributes in your account |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**attributes** | [**\Brevo\Client\Models\GetAttributesAttributesInner[]**](GetAttributesAttributesInner.md) | Listing of available contact attributes in your account |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetAttributesAttributes.md b/docs/Model/GetAttributesAttributes.md
deleted file mode 100644
index 97d3e59..0000000
--- a/docs/Model/GetAttributesAttributes.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# GetAttributesAttributes
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**name** | **string** | Name of the attribute |
-**category** | **string** | Category of the attribute |
-**type** | **string** | Type of the attribute | [optional]
-**enumeration** | [**\Brevo\Client\Model\GetAttributesEnumeration[]**](GetAttributesEnumeration.md) | Parameter only available for \"category\" type attributes. | [optional]
-**calculatedValue** | **string** | Calculated value formula | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetAttributesAttributesInner.md b/docs/Model/GetAttributesAttributesInner.md
new file mode 100644
index 0000000..0063767
--- /dev/null
+++ b/docs/Model/GetAttributesAttributesInner.md
@@ -0,0 +1,13 @@
+# # GetAttributesAttributesInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | Name of the attribute |
+**category** | **string** | Category of the attribute |
+**type** | **string** | Type of the attribute | [optional]
+**enumeration** | [**\Brevo\Client\Models\GetAttributesAttributesInnerEnumerationInner[]**](GetAttributesAttributesInnerEnumerationInner.md) | Parameter only available for \"category\" type attributes. | [optional]
+**calculatedValue** | **string** | Calculated value formula | [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/GetAttributesAttributesInnerEnumerationInner.md b/docs/Model/GetAttributesAttributesInnerEnumerationInner.md
new file mode 100644
index 0000000..fb57e37
--- /dev/null
+++ b/docs/Model/GetAttributesAttributesInnerEnumerationInner.md
@@ -0,0 +1,10 @@
+# # GetAttributesAttributesInnerEnumerationInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**value** | **int** | ID of Value of the \"category\" type attribute |
+**label** | **string** | Label of the \"category\" type attribute |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetAttributesEnumeration.md b/docs/Model/GetAttributesEnumeration.md
deleted file mode 100644
index 6407aab..0000000
--- a/docs/Model/GetAttributesEnumeration.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# GetAttributesEnumeration
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**value** | **int** | ID of Value of the \"category\" type attribute |
-**label** | **string** | Label of the \"category\" type attribute |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetBlockedDomains.md b/docs/Model/GetBlockedDomains.md
index 3098d0b..f3ed8b8 100644
--- a/docs/Model/GetBlockedDomains.md
+++ b/docs/Model/GetBlockedDomains.md
@@ -1,10 +1,9 @@
-# GetBlockedDomains
+# # GetBlockedDomains
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**domains** | **string[]** | List of all blocked domains |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**domains** | **string[]** | List of all blocked domains |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetCampaignOverview.md b/docs/Model/GetCampaignOverview.md
index 9e9d9e8..6381a86 100644
--- a/docs/Model/GetCampaignOverview.md
+++ b/docs/Model/GetCampaignOverview.md
@@ -1,23 +1,22 @@
-# GetCampaignOverview
+# # GetCampaignOverview
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **int** | ID of the campaign |
-**name** | **string** | Name of the campaign |
-**subject** | **string** | Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` | [optional]
-**previewText** | **string** | Preview text or preheader of the email campaign | [optional]
-**type** | **string** | Type of campaign |
-**status** | **string** | Status of the campaign |
-**scheduledAt** | **string** | UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) | [optional]
-**abTesting** | **bool** | Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. | [optional]
-**subjectA** | **string** | Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional]
-**subjectB** | **string** | Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional]
-**splitRule** | **int** | The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` | [optional]
-**winnerCriteria** | **string** | Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` | [optional]
-**winnerDelay** | **int** | The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` | [optional]
-**sendAtBestTime** | **bool** | It is true if you have chosen to send your campaign at best time, otherwise it is false | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**id** | **int** | ID of the campaign |
+**name** | **string** | Name of the campaign |
+**type** | **string** | Type of campaign |
+**status** | **string** | Status of the campaign |
+**subject** | **string** | Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` | [optional]
+**previewText** | **string** | Preview text or preheader of the email campaign | [optional]
+**scheduledAt** | **string** | UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) | [optional]
+**abTesting** | **bool** | Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. | [optional]
+**subjectA** | **string** | Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional]
+**subjectB** | **string** | Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional]
+**splitRule** | **int** | The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` | [optional]
+**winnerCriteria** | **string** | Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` | [optional]
+**winnerDelay** | **int** | The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` | [optional]
+**sendAtBestTime** | **bool** | It is true if you have chosen to send your campaign at best time, otherwise it is false | [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/GetCampaignRecipients.md b/docs/Model/GetCampaignRecipients.md
index 4dc68b4..70f4697 100644
--- a/docs/Model/GetCampaignRecipients.md
+++ b/docs/Model/GetCampaignRecipients.md
@@ -1,11 +1,10 @@
-# GetCampaignRecipients
+# # GetCampaignRecipients
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**lists** | **int[]** | |
-**exclusionLists** | **int[]** | |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**lists** | **int[]** | |
+**exclusionLists** | **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/GetCampaignStats.md b/docs/Model/GetCampaignStats.md
index 79c3a63..8dc94fd 100644
--- a/docs/Model/GetCampaignStats.md
+++ b/docs/Model/GetCampaignStats.md
@@ -1,25 +1,24 @@
-# GetCampaignStats
+# # GetCampaignStats
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**listId** | **int** | List Id of email campaign (only in case of get email campaign(s)(not for global stats)) | [optional]
-**uniqueClicks** | **int** | Number of unique clicks for the campaign |
-**clickers** | **int** | Number of total clicks for the campaign |
-**complaints** | **int** | Number of complaints (Spam reports) for the campaign |
-**delivered** | **int** | Number of delivered emails for the campaign |
-**sent** | **int** | Number of sent emails for the campaign |
-**softBounces** | **int** | Number of softbounce for the campaign |
-**hardBounces** | **int** | Number of harbounce for the campaign |
-**uniqueViews** | **int** | Number of unique openings for the campaign |
-**trackableViews** | **int** | Recipients without any privacy protection option enabled in their email client |
-**trackableViewsRate** | **float** | Rate of recipients without any privacy protection option enabled in their email client | [optional]
-**estimatedViews** | **int** | Rate of recipients without any privacy protection option enabled in their email client, applied to all delivered emails | [optional]
-**unsubscriptions** | **int** | Number of unsubscription for the campaign |
-**viewed** | **int** | Number of openings for the campaign |
-**deferred** | **int** | Number of deferred emails for the campaign | [optional]
-**returnBounce** | **int** | Total number of non-delivered campaigns for a particular campaign id. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**uniqueClicks** | **int** | Number of unique clicks for the campaign |
+**clickers** | **int** | Number of total clicks for the campaign |
+**complaints** | **int** | Number of complaints (Spam reports) for the campaign |
+**delivered** | **int** | Number of delivered emails for the campaign |
+**sent** | **int** | Number of sent emails for the campaign |
+**softBounces** | **int** | Number of softbounce for the campaign |
+**hardBounces** | **int** | Number of harbounce for the campaign |
+**uniqueViews** | **int** | Number of unique openings for the campaign |
+**trackableViews** | **int** | Recipients without any privacy protection option enabled in their email client |
+**unsubscriptions** | **int** | Number of unsubscription for the campaign |
+**viewed** | **int** | Number of openings for the campaign |
+**listId** | **int** | List Id of email campaign (only in case of get email campaign(s)(not for global stats)) | [optional]
+**trackableViewsRate** | **float** | Rate of recipients without any privacy protection option enabled in their email client | [optional]
+**estimatedViews** | **int** | Rate of recipients without any privacy protection option enabled in their email client, applied to all delivered emails | [optional]
+**deferred** | **int** | Number of deferred emails for the campaign | [optional]
+**returnBounce** | **int** | Total number of non-delivered campaigns for a particular campaign id. | [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/GetCategories.md b/docs/Model/GetCategories.md
index 3479e5b..153527c 100644
--- a/docs/Model/GetCategories.md
+++ b/docs/Model/GetCategories.md
@@ -1,11 +1,10 @@
-# GetCategories
+# # GetCategories
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**categories** | **object[]** | |
-**count** | **int** | Number of categories |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**categories** | [**GetCategoryDetails[]**](GetCategoryDetails.md) | |
+**count** | **int** | Number of categories |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetCategoryDetails.md b/docs/Model/GetCategoryDetails.md
index c9f2607..8229c4c 100644
--- a/docs/Model/GetCategoryDetails.md
+++ b/docs/Model/GetCategoryDetails.md
@@ -1,15 +1,14 @@
-# GetCategoryDetails
+# # GetCategoryDetails
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **string** | Category ID for which you requested the details |
-**name** | **string** | Name of the category for which you requested the details |
-**createdAt** | **string** | Creation UTC date-time of the category (YYYY-MM-DDTHH:mm:ss.SSSZ) |
-**modifiedAt** | **string** | Last modification UTC date-time of the category (YYYY-MM-DDTHH:mm:ss.SSSZ) |
-**url** | **string** | URL to the category | [optional]
-**isDeleted** | **bool** | category deleted from the shop's database | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
+**id** | **string** | Category ID for which you requested the details |
+**name** | **string** | Name of the category for which you requested the details |
+**createdAt** | **string** | Creation UTC date-time of the category (YYYY-MM-DDTHH:mm:ss.SSSZ) |
+**modifiedAt** | **string** | Last modification UTC date-time of the category (YYYY-MM-DDTHH:mm:ss.SSSZ) |
+**url** | **string** | URL to the category | [optional]
+**isDeleted** | **bool** | category deleted from the shop's database | [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/GetChildAccountCreationStatus.md b/docs/Model/GetChildAccountCreationStatus.md
deleted file mode 100644
index e8c6ca9..0000000
--- a/docs/Model/GetChildAccountCreationStatus.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# GetChildAccountCreationStatus
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**childAccountCreated** | **bool** | Status of child account creation whether it is successfully created (exists) or not. |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetChildDomain.md b/docs/Model/GetChildDomain.md
deleted file mode 100644
index 8cede17..0000000
--- a/docs/Model/GetChildDomain.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# GetChildDomain
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**domain** | **string** | Sender domain | [optional]
-**active** | **bool** | indicates whether a domain is verified or not | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetChildDomains.md b/docs/Model/GetChildDomains.md
deleted file mode 100644
index 1021351..0000000
--- a/docs/Model/GetChildDomains.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# GetChildDomains
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetChildInfo.md b/docs/Model/GetChildInfo.md
deleted file mode 100644
index cb381ae..0000000
--- a/docs/Model/GetChildInfo.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# GetChildInfo
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**credits** | [**\Brevo\Client\Model\GetChildInfoCredits**](GetChildInfoCredits.md) | | [optional]
-**statistics** | [**\Brevo\Client\Model\GetChildInfoStatistics**](GetChildInfoStatistics.md) | | [optional]
-**password** | **string** | The encrypted password of child account |
-**ips** | **string[]** | IP(s) associated to a child account user | [optional]
-**apiKeys** | [**\Brevo\Client\Model\GetChildInfoApiKeys**](GetChildInfoApiKeys.md) | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetChildInfoApiKeys.md b/docs/Model/GetChildInfoApiKeys.md
deleted file mode 100644
index d5537c8..0000000
--- a/docs/Model/GetChildInfoApiKeys.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# GetChildInfoApiKeys
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**v2** | [**\Brevo\Client\Model\GetChildInfoApiKeysV2[]**](GetChildInfoApiKeysV2.md) | |
-**v3** | [**\Brevo\Client\Model\GetChildInfoApiKeysV3[]**](GetChildInfoApiKeysV3.md) | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetChildInfoApiKeysV2.md b/docs/Model/GetChildInfoApiKeysV2.md
deleted file mode 100644
index 0034d6f..0000000
--- a/docs/Model/GetChildInfoApiKeysV2.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# GetChildInfoApiKeysV2
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**name** | **string** | Name of the key for version 2 |
-**key** | **string** | API Key for version 2 |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetChildInfoApiKeysV3.md b/docs/Model/GetChildInfoApiKeysV3.md
deleted file mode 100644
index 1efa20f..0000000
--- a/docs/Model/GetChildInfoApiKeysV3.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# GetChildInfoApiKeysV3
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**name** | **string** | Name of the key for version 3 |
-**key** | **string** | API Key for version 3 |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetChildInfoCredits.md b/docs/Model/GetChildInfoCredits.md
deleted file mode 100644
index 5d6cc5a..0000000
--- a/docs/Model/GetChildInfoCredits.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# GetChildInfoCredits
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**emailCredits** | **int** | Email credits available for your child | [optional]
-**smsCredits** | **int** | SMS credits available for your child | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetChildInfoStatistics.md b/docs/Model/GetChildInfoStatistics.md
deleted file mode 100644
index b4e3e37..0000000
--- a/docs/Model/GetChildInfoStatistics.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# GetChildInfoStatistics
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**previousMonthTotalSent** | **int** | Overall emails sent for the previous month | [optional]
-**currentMonthTotalSent** | **int** | Overall emails sent for current month | [optional]
-**totalSent** | **int** | Overall emails sent for since the account exists | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetChildrenList.md b/docs/Model/GetChildrenList.md
deleted file mode 100644
index f6ff2d6..0000000
--- a/docs/Model/GetChildrenList.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# GetChildrenList
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**children** | **object[]** | Your children's account information | [optional]
-**count** | **int** | Number of child accounts | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetClient.md b/docs/Model/GetClient.md
index 0b99349..98ef9d4 100644
--- a/docs/Model/GetClient.md
+++ b/docs/Model/GetClient.md
@@ -1,13 +1,12 @@
-# GetClient
+# # GetClient
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**email** | **string** | Login Email |
-**firstName** | **string** | First Name |
-**lastName** | **string** | Last Name |
-**companyName** | **string** | Name of the company |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**email** | **string** | Login Email |
+**firstName** | **string** | First Name |
+**lastName** | **string** | Last Name |
+**companyName** | **string** | Name of the company |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetContactCampaignStats.md b/docs/Model/GetContactCampaignStats.md
index a79fab9..fb156a0 100644
--- a/docs/Model/GetContactCampaignStats.md
+++ b/docs/Model/GetContactCampaignStats.md
@@ -1,18 +1,17 @@
-# GetContactCampaignStats
+# # GetContactCampaignStats
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**messagesSent** | [**\Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]**](GetExtendedContactDetailsStatisticsMessagesSent.md) | | [optional]
-**hardBounces** | [**\Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]**](GetExtendedContactDetailsStatisticsMessagesSent.md) | | [optional]
-**softBounces** | [**\Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]**](GetExtendedContactDetailsStatisticsMessagesSent.md) | | [optional]
-**complaints** | [**\Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]**](GetExtendedContactDetailsStatisticsMessagesSent.md) | | [optional]
-**unsubscriptions** | [**\Brevo\Client\Model\GetContactCampaignStatsUnsubscriptions**](GetContactCampaignStatsUnsubscriptions.md) | | [optional]
-**opened** | [**\Brevo\Client\Model\GetContactCampaignStatsOpened[]**](GetContactCampaignStatsOpened.md) | | [optional]
-**clicked** | [**\Brevo\Client\Model\GetContactCampaignStatsClicked[]**](GetContactCampaignStatsClicked.md) | | [optional]
-**transacAttributes** | [**\Brevo\Client\Model\GetContactCampaignStatsTransacAttributes[]**](GetContactCampaignStatsTransacAttributes.md) | | [optional]
-**delivered** | [**\Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]**](GetExtendedContactDetailsStatisticsMessagesSent.md) | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**messagesSent** | [**\Brevo\Client\Models\GetExtendedContactDetailsAllOfStatisticsMessagesSent[]**](GetExtendedContactDetailsAllOfStatisticsMessagesSent.md) | | [optional]
+**hardBounces** | [**\Brevo\Client\Models\GetExtendedContactDetailsAllOfStatisticsMessagesSent[]**](GetExtendedContactDetailsAllOfStatisticsMessagesSent.md) | | [optional]
+**softBounces** | [**\Brevo\Client\Models\GetExtendedContactDetailsAllOfStatisticsMessagesSent[]**](GetExtendedContactDetailsAllOfStatisticsMessagesSent.md) | | [optional]
+**complaints** | [**\Brevo\Client\Models\GetExtendedContactDetailsAllOfStatisticsMessagesSent[]**](GetExtendedContactDetailsAllOfStatisticsMessagesSent.md) | | [optional]
+**unsubscriptions** | [**\Brevo\Client\Models\GetContactCampaignStatsUnsubscriptions**](GetContactCampaignStatsUnsubscriptions.md) | | [optional]
+**opened** | [**\Brevo\Client\Models\GetContactCampaignStatsOpenedInner[]**](GetContactCampaignStatsOpenedInner.md) | | [optional]
+**clicked** | [**\Brevo\Client\Models\GetContactCampaignStatsClickedInner[]**](GetContactCampaignStatsClickedInner.md) | | [optional]
+**transacAttributes** | [**\Brevo\Client\Models\GetContactCampaignStatsTransacAttributesInner[]**](GetContactCampaignStatsTransacAttributesInner.md) | | [optional]
+**delivered** | [**\Brevo\Client\Models\GetExtendedContactDetailsAllOfStatisticsMessagesSent[]**](GetExtendedContactDetailsAllOfStatisticsMessagesSent.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/GetContactCampaignStatsClicked.md b/docs/Model/GetContactCampaignStatsClicked.md
deleted file mode 100644
index 06edf1f..0000000
--- a/docs/Model/GetContactCampaignStatsClicked.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# GetContactCampaignStatsClicked
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**campaignId** | **int** | ID of the campaign which generated the event |
-**links** | [**\Brevo\Client\Model\GetExtendedContactDetailsStatisticsLinks[]**](GetExtendedContactDetailsStatisticsLinks.md) | |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetContactCampaignStatsClickedInner.md b/docs/Model/GetContactCampaignStatsClickedInner.md
new file mode 100644
index 0000000..e67aca9
--- /dev/null
+++ b/docs/Model/GetContactCampaignStatsClickedInner.md
@@ -0,0 +1,10 @@
+# # GetContactCampaignStatsClickedInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**campaignId** | **int** | ID of the campaign which generated the event |
+**links** | [**\Brevo\Client\Models\GetExtendedContactDetailsAllOfStatisticsLinks[]**](GetExtendedContactDetailsAllOfStatisticsLinks.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/GetContactCampaignStatsOpened.md b/docs/Model/GetContactCampaignStatsOpened.md
deleted file mode 100644
index f34053f..0000000
--- a/docs/Model/GetContactCampaignStatsOpened.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# GetContactCampaignStatsOpened
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**campaignId** | **int** | ID of the campaign which generated the event |
-**count** | **int** | Number of openings of the campaign |
-**eventTime** | **string** | UTC date-time of the event |
-**ip** | **string** | IP from which the user has opened the campaign |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetContactCampaignStatsOpenedInner.md b/docs/Model/GetContactCampaignStatsOpenedInner.md
new file mode 100644
index 0000000..f769403
--- /dev/null
+++ b/docs/Model/GetContactCampaignStatsOpenedInner.md
@@ -0,0 +1,12 @@
+# # GetContactCampaignStatsOpenedInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**campaignId** | **int** | ID of the campaign which generated the event |
+**count** | **int** | Number of openings of the campaign |
+**eventTime** | **string** | UTC date-time of the event |
+**ip** | **string** | IP from which the user has opened the campaign |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetContactCampaignStatsTransacAttributes.md b/docs/Model/GetContactCampaignStatsTransacAttributes.md
deleted file mode 100644
index a23e752..0000000
--- a/docs/Model/GetContactCampaignStatsTransacAttributes.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# GetContactCampaignStatsTransacAttributes
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**orderDate** | [**\DateTime**] | Date of the order |
-**orderPrice** | **float** | Price of the order |
-**orderId** | **int** | ID of the order |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetContactCampaignStatsTransacAttributesInner.md b/docs/Model/GetContactCampaignStatsTransacAttributesInner.md
new file mode 100644
index 0000000..79045ec
--- /dev/null
+++ b/docs/Model/GetContactCampaignStatsTransacAttributesInner.md
@@ -0,0 +1,11 @@
+# # GetContactCampaignStatsTransacAttributesInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**orderDate** | **\DateTime** | Date of the order |
+**orderPrice** | **float** | Price of the order |
+**orderId** | **int** | ID of the order |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetContactCampaignStatsUnsubscriptions.md b/docs/Model/GetContactCampaignStatsUnsubscriptions.md
index 97a8f16..8b191cc 100644
--- a/docs/Model/GetContactCampaignStatsUnsubscriptions.md
+++ b/docs/Model/GetContactCampaignStatsUnsubscriptions.md
@@ -1,11 +1,10 @@
-# GetContactCampaignStatsUnsubscriptions
+# # GetContactCampaignStatsUnsubscriptions
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**userUnsubscription** | [**\Brevo\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription[]**](GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription.md) | Contact has unsubscribed via the unsubscription link in the email |
-**adminUnsubscription** | [**\Brevo\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription[]**](GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription.md) | Contact has been unsubscribed from the administrator |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**userUnsubscription** | [**\Brevo\Client\Models\GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription[]**](GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.md) | Contact has unsubscribed via the unsubscription link in the email |
+**adminUnsubscription** | [**\Brevo\Client\Models\GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription[]**](GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription.md) | Contact has been unsubscribed from the administrator |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetContactDetails.md b/docs/Model/GetContactDetails.md
index 044d618..3d01433 100644
--- a/docs/Model/GetContactDetails.md
+++ b/docs/Model/GetContactDetails.md
@@ -1,18 +1,17 @@
-# GetContactDetails
+# # GetContactDetails
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**email** | **string** | Email address of the contact for which you requested the details | [optional]
-**id** | **int** | ID of the contact for which you requested the details |
-**emailBlacklisted** | **bool** | Blacklist status for email campaigns (true=blacklisted, false=not blacklisted) |
-**smsBlacklisted** | **bool** | Blacklist status for SMS campaigns (true=blacklisted, false=not blacklisted) |
-**createdAt** | **string** | Creation UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) |
-**modifiedAt** | **string** | Last modification UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) |
-**listIds** | **int[]** | |
-**listUnsubscribed** | **int[]** | | [optional]
-**attributes** | **object** | Set of attributes of the contact |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**id** | **int** | ID of the contact for which you requested the details |
+**emailBlacklisted** | **bool** | Blacklist status for email campaigns (true=blacklisted, false=not blacklisted) |
+**smsBlacklisted** | **bool** | Blacklist status for SMS campaigns (true=blacklisted, false=not blacklisted) |
+**createdAt** | **string** | Creation UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) |
+**modifiedAt** | **string** | Last modification UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) |
+**listIds** | **int[]** | |
+**attributes** | **object** | Set of attributes of the contact |
+**email** | **string** | Email address of the contact for which you requested the details | [optional]
+**listUnsubscribed** | **int[]** | | [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/GetContactInfoIdentifierParameter.md b/docs/Model/GetContactInfoIdentifierParameter.md
new file mode 100644
index 0000000..4a59f84
--- /dev/null
+++ b/docs/Model/GetContactInfoIdentifierParameter.md
@@ -0,0 +1,8 @@
+# # GetContactInfoIdentifierParameter
+
+## 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/GetContacts.md b/docs/Model/GetContacts.md
index 1411462..f5e1e6c 100644
--- a/docs/Model/GetContacts.md
+++ b/docs/Model/GetContacts.md
@@ -1,11 +1,10 @@
-# GetContacts
+# # GetContacts
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**contacts** | **object[]** | |
-**count** | **int** | Number of contacts |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**contacts** | [**GetContactDetails[]**](GetContactDetails.md) | |
+**count** | **int** | Number of contacts |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetCorporateInvitedUsersList.md b/docs/Model/GetCorporateInvitedUsersList.md
index d6c1cb0..afb4f95 100644
--- a/docs/Model/GetCorporateInvitedUsersList.md
+++ b/docs/Model/GetCorporateInvitedUsersList.md
@@ -1,10 +1,9 @@
-# GetCorporateInvitedUsersList
+# # GetCorporateInvitedUsersList
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**users** | [**\Brevo\Client\Model\GetCorporateInvitedUsersListUsers[]**](GetCorporateInvitedUsersListUsers.md) | Get invited users list | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**users** | [**\Brevo\Client\Models\GetCorporateInvitedUsersListUsersInner[]**](GetCorporateInvitedUsersListUsersInner.md) | Get invited users list | [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/GetCorporateInvitedUsersListFeatureAccess.md b/docs/Model/GetCorporateInvitedUsersListFeatureAccess.md
deleted file mode 100644
index 80b0321..0000000
--- a/docs/Model/GetCorporateInvitedUsersListFeatureAccess.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# GetCorporateInvitedUsersListFeatureAccess
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**userManagement** | **string[]** | User management accessiblity. | [optional]
-**apiKeys** | **string[]** | Api keys accessiblity. | [optional]
-**myPlan** | **string[]** | My plan accessiblity. | [optional]
-**appsManagement** | **string[]** | Apps management accessiblity | Not available in ENTv2 | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetCorporateInvitedUsersListGroups.md b/docs/Model/GetCorporateInvitedUsersListGroups.md
deleted file mode 100644
index b28382b..0000000
--- a/docs/Model/GetCorporateInvitedUsersListGroups.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# GetCorporateInvitedUsersListGroups
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**id** | **string** | group id | [optional]
-**name** | **string** | group name | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetCorporateInvitedUsersListUsers.md b/docs/Model/GetCorporateInvitedUsersListUsers.md
deleted file mode 100644
index 6268f26..0000000
--- a/docs/Model/GetCorporateInvitedUsersListUsers.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# GetCorporateInvitedUsersListUsers
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**groups** | [**\Brevo\Client\Model\GetCorporateInvitedUsersListGroups**](GetCorporateInvitedUsersListGroups.md) | |
-**email** | **string** | Email address of the user. |
-**isOwner** | **string** | Flag for indicating is user owner of the organization. |
-**status** | **string** | Status of the invited user. |
-**featureAccess** | [**\Brevo\Client\Model\GetCorporateInvitedUsersListFeatureAccess**](GetCorporateInvitedUsersListFeatureAccess.md) | |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetCorporateInvitedUsersListUsersInner.md b/docs/Model/GetCorporateInvitedUsersListUsersInner.md
new file mode 100644
index 0000000..7503d8c
--- /dev/null
+++ b/docs/Model/GetCorporateInvitedUsersListUsersInner.md
@@ -0,0 +1,13 @@
+# # GetCorporateInvitedUsersListUsersInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**email** | **string** | Email address of the user. |
+**isOwner** | **string** | Flag for indicating is user owner of the organization. |
+**status** | **string** | Status of the invited user. |
+**featureAccess** | [**\Brevo\Client\Models\GetCorporateInvitedUsersListUsersInnerFeatureAccess**](GetCorporateInvitedUsersListUsersInnerFeatureAccess.md) | |
+**groups** | [**\Brevo\Client\Models\GetCorporateInvitedUsersListUsersInnerGroups**](GetCorporateInvitedUsersListUsersInnerGroups.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/GetCorporateInvitedUsersListUsersInnerFeatureAccess.md b/docs/Model/GetCorporateInvitedUsersListUsersInnerFeatureAccess.md
new file mode 100644
index 0000000..9ab9a42
--- /dev/null
+++ b/docs/Model/GetCorporateInvitedUsersListUsersInnerFeatureAccess.md
@@ -0,0 +1,17 @@
+# # GetCorporateInvitedUsersListUsersInnerFeatureAccess
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**userManagement** | **string[]** | User management accessiblity. | [optional]
+**apiKeys** | **string[]** | Api keys accessiblity. | [optional]
+**myPlan** | **string[]** | My plan accessiblity. | [optional]
+**appsManagement** | **string[]** | Apps management accessiblity | Not available in ENTv2 | [optional]
+**subOrganizationGroups** | **string[]** | Group creation, modification or deletion accessibility | [optional]
+**createSubOrganizations** | **string[]** | Authorization to create sub-organization in the admin account. If the user creating the sub-organization, belongs to a group, the user must choose a group at the sub-organization creation. | [optional]
+**manageSubOrganizations** | **string[]** | Authorization to manage and access sub-organizations in the admin account. | [optional]
+**analytics** | **string[]** | Analytics dashboard accessibility | [optional]
+**security** | **string[]** | Security page accessibility | [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/GetCorporateInvitedUsersListUsersInnerGroups.md b/docs/Model/GetCorporateInvitedUsersListUsersInnerGroups.md
new file mode 100644
index 0000000..3f4f914
--- /dev/null
+++ b/docs/Model/GetCorporateInvitedUsersListUsersInnerGroups.md
@@ -0,0 +1,10 @@
+# # GetCorporateInvitedUsersListUsersInnerGroups
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | group id | [optional]
+**name** | **string** | group name | [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/GetCorporateUserPermission.md b/docs/Model/GetCorporateUserPermission.md
new file mode 100644
index 0000000..93ed495
--- /dev/null
+++ b/docs/Model/GetCorporateUserPermission.md
@@ -0,0 +1,12 @@
+# # GetCorporateUserPermission
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**email** | **string** | Email address of the user. |
+**status** | **string** | Status of the invited user. |
+**groups** | [**\Brevo\Client\Models\GetCorporateUserPermissionGroupsInner[]**](GetCorporateUserPermissionGroupsInner.md) | |
+**featureAccess** | [**\Brevo\Client\Models\GetCorporateUserPermissionFeatureAccess**](GetCorporateUserPermissionFeatureAccess.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/GetCorporateUserPermissionFeatureAccess.md b/docs/Model/GetCorporateUserPermissionFeatureAccess.md
new file mode 100644
index 0000000..000c07d
--- /dev/null
+++ b/docs/Model/GetCorporateUserPermissionFeatureAccess.md
@@ -0,0 +1,17 @@
+# # GetCorporateUserPermissionFeatureAccess
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**apiKeys** | **string[]** | Permission on api keys | [optional]
+**myPlan** | **string[]** | Permission on my plan | [optional]
+**userManagement** | **string[]** | Permission on user management | [optional]
+**appsManagement** | **string[]** | Permission on apps management | [optional]
+**subOrganizationGroups** | **string[]** | Permission on groups | [optional]
+**createSubOrganizations** | **string[]** | Permission on create sub-accounts | [optional]
+**manageSubOrganizations** | **string[]** | Permission on manage sub-accounts | [optional]
+**analytics** | **string[]** | Permission on analytics | [optional]
+**security** | **string[]** | Permission on security | [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/GetCorporateUserPermissionGroupsInner.md b/docs/Model/GetCorporateUserPermissionGroupsInner.md
new file mode 100644
index 0000000..0eac3d8
--- /dev/null
+++ b/docs/Model/GetCorporateUserPermissionGroupsInner.md
@@ -0,0 +1,10 @@
+# # GetCorporateUserPermissionGroupsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | group identifier | [optional]
+**name** | **string** | Group name | [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/GetCouponCollection.md b/docs/Model/GetCouponCollection.md
index 9828cb1..75866cc 100644
--- a/docs/Model/GetCouponCollection.md
+++ b/docs/Model/GetCouponCollection.md
@@ -1,15 +1,17 @@
-# GetCouponCollection
+# # GetCouponCollection
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **string** | The id of the collection |
-**name** | **string** | The name of the collection |
-**defaultCoupon** | **string** | The default coupon of the collection |
-**createdAt** | [**\DateTime**] | Datetime on which the collection was created |
-**totalCoupons** | **int** | Total coupons in the collection |
-**remainingCoupons** | **int** | Not sent coupons in the collection |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**id** | **string** | The id of the collection. |
+**name** | **string** | The name of the collection. |
+**defaultCoupon** | **string** | The default coupon of the collection. |
+**createdAt** | **\DateTime** | Datetime on which the collection was created. |
+**totalCoupons** | **int** | Total number of coupons in the collection. |
+**remainingCoupons** | **int** | Number of coupons that have not been sent yet. |
+**expirationDate** | **\DateTime** | Expiration date for the coupon collection in RFC3339 format. | [optional]
+**remainingDaysAlert** | **int** | If present, an email notification is going to be sent the defined amount of days before to the expiration date. | [optional]
+**remainingCouponsAlert** | **int** | If present, an email notification is going to be sent when the total number of available coupons falls below the defined threshold. | [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/GetDeviceBrowserStats.md b/docs/Model/GetDeviceBrowserStats.md
index 630fd54..00f443e 100644
--- a/docs/Model/GetDeviceBrowserStats.md
+++ b/docs/Model/GetDeviceBrowserStats.md
@@ -1,13 +1,12 @@
-# GetDeviceBrowserStats
+# # GetDeviceBrowserStats
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**clickers** | **int** | Number of total clicks for the campaign using the particular browser |
-**uniqueClicks** | **int** | Number of unique clicks for the campaign using the particular browser |
-**viewed** | **int** | Number of openings for the campaign using the particular browser |
-**uniqueViews** | **int** | Number of unique openings for the campaign using the particular browser |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**clickers** | **int** | Number of total clicks for the campaign using the particular browser |
+**uniqueClicks** | **int** | Number of unique clicks for the campaign using the particular browser |
+**viewed** | **int** | Number of openings for the campaign using the particular browser |
+**uniqueViews** | **int** | Number of unique openings for the campaign using the particular browser |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetDomainConfigurationModel.md b/docs/Model/GetDomainConfigurationModel.md
index f3a1410..7382d22 100644
--- a/docs/Model/GetDomainConfigurationModel.md
+++ b/docs/Model/GetDomainConfigurationModel.md
@@ -1,13 +1,12 @@
-# GetDomainConfigurationModel
+# # GetDomainConfigurationModel
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**domain** | **string** | Domain |
-**verified** | **bool** | Status of domain verification (true=verified, false=non verified) |
-**authenticated** | **bool** | Status of domain authentication (true=authenticated, false=non authenticated) |
-**dnsRecords** | [**\Brevo\Client\Model\CreateDomainModelDnsRecords**](CreateDomainModelDnsRecords.md) | |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**domain** | **string** | Domain |
+**verified** | **bool** | Status of domain verification (true=verified, false=non verified) |
+**authenticated** | **bool** | Status of domain authentication (true=authenticated, false=non authenticated) |
+**dnsRecords** | [**\Brevo\Client\Models\CreateDomainModelDnsRecords**](CreateDomainModelDnsRecords.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/GetDomainsList.md b/docs/Model/GetDomainsList.md
index ebaa190..9e9968b 100644
--- a/docs/Model/GetDomainsList.md
+++ b/docs/Model/GetDomainsList.md
@@ -1,10 +1,9 @@
-# GetDomainsList
+# # GetDomainsList
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**domains** | [**\Brevo\Client\Model\GetDomainsListDomains[]**](GetDomainsListDomains.md) | List of the domains available in your account | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**domains** | [**\Brevo\Client\Models\GetDomainsListDomainsInner[]**](GetDomainsListDomainsInner.md) | List of the domains available in your account | [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/GetDomainsListDomains.md b/docs/Model/GetDomainsListDomains.md
deleted file mode 100644
index 925ea14..0000000
--- a/docs/Model/GetDomainsListDomains.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# GetDomainsListDomains
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**id** | **int** | Id of the domain |
-**domainName** | **string** | Domain name |
-**authenticated** | **bool** | Status of domain authentication (true=authenticated, false=non authenticated) |
-**verified** | **bool** | Status of domain verification (true=verified, false=non verified) |
-**ip** | **string** | Dedicated IP associated with domain | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetDomainsListDomainsInner.md b/docs/Model/GetDomainsListDomainsInner.md
new file mode 100644
index 0000000..c2b4cae
--- /dev/null
+++ b/docs/Model/GetDomainsListDomainsInner.md
@@ -0,0 +1,13 @@
+# # GetDomainsListDomainsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | Id of the domain |
+**domainName** | **string** | Domain name |
+**authenticated** | **bool** | Status of domain authentication (true=authenticated, false=non authenticated) |
+**verified** | **bool** | Status of domain verification (true=verified, false=non verified) |
+**ip** | **string** | Dedicated IP associated with domain | [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/GetEmailCampaign.md b/docs/Model/GetEmailCampaign.md
index afb9f8b..49fdf35 100644
--- a/docs/Model/GetEmailCampaign.md
+++ b/docs/Model/GetEmailCampaign.md
@@ -1,40 +1,44 @@
-# GetEmailCampaign
+# # GetEmailCampaign
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **int** | ID of the campaign |
-**name** | **string** | Name of the campaign |
-**subject** | **string** | Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` | [optional]
-**type** | **string** | Type of campaign |
-**status** | **string** | Status of the campaign |
-**scheduledAt** | **string** | UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) | [optional]
-**abTesting** | **bool** | Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. | [optional]
-**subjectA** | **string** | Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional]
-**subjectB** | **string** | Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional]
-**splitRule** | **int** | The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` | [optional]
-**winnerCriteria** | **string** | Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` | [optional]
-**winnerDelay** | **int** | The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` | [optional]
-**sendAtBestTime** | **bool** | It is true if you have chosen to send your campaign at best time, otherwise it is false | [optional]
-**testSent** | **bool** | Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) |
-**header** | **string** | Header of the campaign |
-**footer** | **string** | Footer of the campaign |
-**sender** | [**\Brevo\Client\Model\GetExtendedCampaignOverviewSender**](GetExtendedCampaignOverviewSender.md) | |
-**replyTo** | **string** | Email defined as the \"Reply to\" of the campaign |
-**toField** | **string** | Customisation of the \"to\" field of the campaign | [optional]
-**htmlContent** | **string** | HTML content of the campaign |
-**shareLink** | **string** | Link to share the campaign on social medias | [optional]
-**tag** | **string** | Tag of the campaign | [optional]
-**createdAt** | **string** | Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) |
-**modifiedAt** | **string** | UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) |
-**inlineImageActivation** | **bool** | Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. | [optional]
-**mirrorActive** | **bool** | Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign | [optional]
-**recurring** | **bool** | FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times | [optional]
-**sentDate** | **string** | Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' | [optional]
-**returnBounce** | **int** | Total number of non-delivered campaigns for a particular campaign id. | [optional]
-**recipients** | **object** | |
-**statistics** | **object** | |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**id** | **int** | ID of the campaign |
+**name** | **string** | Name of the campaign |
+**type** | **string** | Type of campaign |
+**status** | **string** | Status of the campaign |
+**testSent** | **bool** | Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) |
+**header** | **string** | Header of the campaign |
+**footer** | **string** | Footer of the campaign |
+**sender** | [**\Brevo\Client\Models\GetExtendedCampaignOverviewAllOfSender**](GetExtendedCampaignOverviewAllOfSender.md) | |
+**replyTo** | **string** | Email defined as the \"Reply to\" of the campaign |
+**htmlContent** | **string** | HTML content of the campaign |
+**createdAt** | **string** | Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) |
+**modifiedAt** | **string** | UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) |
+**recipients** | **object** | |
+**statistics** | **object** | |
+**subject** | **string** | Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` | [optional]
+**previewText** | **string** | Preview text or preheader of the email campaign | [optional]
+**scheduledAt** | **string** | UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) | [optional]
+**abTesting** | **bool** | Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. | [optional]
+**subjectA** | **string** | Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional]
+**subjectB** | **string** | Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional]
+**splitRule** | **int** | The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` | [optional]
+**winnerCriteria** | **string** | Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` | [optional]
+**winnerDelay** | **int** | The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` | [optional]
+**sendAtBestTime** | **bool** | It is true if you have chosen to send your campaign at best time, otherwise it is false | [optional]
+**utmCampaignValue** | **string** | utm parameter associated with campaign | [optional]
+**utmSource** | **string** | | [optional]
+**utmMedium** | **string** | | [optional]
+**utmIDActive** | **bool** | utm id activate | [optional]
+**toField** | **string** | Customisation of the \"to\" field of the campaign | [optional]
+**shareLink** | **string** | Link to share the campaign on social medias | [optional]
+**tag** | **string** | Tag of the campaign | [optional]
+**inlineImageActivation** | **bool** | Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. | [optional]
+**mirrorActive** | **bool** | Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign | [optional]
+**recurring** | **bool** | FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times | [optional]
+**sentDate** | **string** | Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' | [optional]
+**returnBounce** | **int** | Total number of non-delivered campaigns for a particular campaign id. | [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/GetEmailCampaigns.md b/docs/Model/GetEmailCampaigns.md
index 945dd56..7c91a42 100644
--- a/docs/Model/GetEmailCampaigns.md
+++ b/docs/Model/GetEmailCampaigns.md
@@ -1,11 +1,10 @@
-# GetEmailCampaigns
+# # GetEmailCampaigns
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**campaigns** | **object[]** | | [optional]
-**count** | **int** | Number of Email campaigns retrieved | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**campaigns** | [**\Brevo\Client\Models\GetEmailCampaignsCampaignsInner[]**](GetEmailCampaignsCampaignsInner.md) | | [optional]
+**count** | **int** | Number of Email campaigns retrieved | [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/GetEmailCampaignsCampaignsInner.md b/docs/Model/GetEmailCampaignsCampaignsInner.md
new file mode 100644
index 0000000..4298a0f
--- /dev/null
+++ b/docs/Model/GetEmailCampaignsCampaignsInner.md
@@ -0,0 +1,44 @@
+# # GetEmailCampaignsCampaignsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | ID of the campaign |
+**name** | **string** | Name of the campaign |
+**type** | **string** | Type of campaign |
+**status** | **string** | Status of the campaign |
+**testSent** | **bool** | Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) |
+**header** | **string** | Header of the campaign |
+**footer** | **string** | Footer of the campaign |
+**sender** | [**\Brevo\Client\Models\GetExtendedCampaignOverviewAllOfSender**](GetExtendedCampaignOverviewAllOfSender.md) | |
+**replyTo** | **string** | Email defined as the \"Reply to\" of the campaign |
+**htmlContent** | **string** | HTML content of the campaign |
+**createdAt** | **string** | Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) |
+**modifiedAt** | **string** | UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) |
+**recipients** | [**\Brevo\Client\Models\GetCampaignRecipients**](GetCampaignRecipients.md) | |
+**statistics** | [**\Brevo\Client\Models\GetExtendedCampaignStats**](GetExtendedCampaignStats.md) | |
+**subject** | **string** | Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` | [optional]
+**previewText** | **string** | Preview text or preheader of the email campaign | [optional]
+**scheduledAt** | **string** | UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) | [optional]
+**abTesting** | **bool** | Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. | [optional]
+**subjectA** | **string** | Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional]
+**subjectB** | **string** | Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional]
+**splitRule** | **int** | The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` | [optional]
+**winnerCriteria** | **string** | Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` | [optional]
+**winnerDelay** | **int** | The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` | [optional]
+**sendAtBestTime** | **bool** | It is true if you have chosen to send your campaign at best time, otherwise it is false | [optional]
+**utmCampaignValue** | **string** | utm parameter associated with campaign | [optional]
+**utmSource** | **string** | | [optional]
+**utmMedium** | **string** | | [optional]
+**utmIDActive** | **bool** | utm id activate | [optional]
+**toField** | **string** | Customisation of the \"to\" field of the campaign | [optional]
+**shareLink** | **string** | Link to share the campaign on social medias | [optional]
+**tag** | **string** | Tag of the campaign | [optional]
+**inlineImageActivation** | **bool** | Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. | [optional]
+**mirrorActive** | **bool** | Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign | [optional]
+**recurring** | **bool** | FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times | [optional]
+**sentDate** | **string** | Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' | [optional]
+**returnBounce** | **int** | Total number of non-delivered campaigns for a particular campaign id. | [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/GetEmailEventReport.md b/docs/Model/GetEmailEventReport.md
index f3a2a49..90671f1 100644
--- a/docs/Model/GetEmailEventReport.md
+++ b/docs/Model/GetEmailEventReport.md
@@ -1,10 +1,9 @@
-# GetEmailEventReport
+# # GetEmailEventReport
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**events** | [**\Brevo\Client\Model\GetEmailEventReportEvents[]**](GetEmailEventReportEvents.md) | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**events** | [**\Brevo\Client\Models\GetEmailEventReportEventsInner[]**](GetEmailEventReportEventsInner.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/GetEmailEventReportEvents.md b/docs/Model/GetEmailEventReportEvents.md
deleted file mode 100644
index 260e26b..0000000
--- a/docs/Model/GetEmailEventReportEvents.md
+++ /dev/null
@@ -1,20 +0,0 @@
-# GetEmailEventReportEvents
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**email** | **string** | Email address which generates the event |
-**date** | **string** | UTC date-time on which the event has been generated |
-**subject** | **string** | Subject of the event | [optional]
-**messageId** | **string** | Message ID which generated the event |
-**event** | **string** | Event which occurred |
-**reason** | **string** | Reason of bounce (only available if the event is hardbounce or softbounce) | [optional]
-**tag** | **string** | Tag of the email which generated the event | [optional]
-**ip** | **string** | IP from which the user has opened the email or clicked on the link (only available if the event is opened or clicks) | [optional]
-**link** | **string** | The link which is sent to the user (only available if the event is requests or opened or clicks) | [optional]
-**from** | **string** | Sender email from which the emails are sent | [optional]
-**templateId** | **int** | ID of the template (only available if the email is template based) | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetEmailEventReportEventsInner.md b/docs/Model/GetEmailEventReportEventsInner.md
new file mode 100644
index 0000000..8575b3b
--- /dev/null
+++ b/docs/Model/GetEmailEventReportEventsInner.md
@@ -0,0 +1,19 @@
+# # GetEmailEventReportEventsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**email** | **string** | Email address which generates the event |
+**date** | **string** | UTC date-time on which the event has been generated |
+**messageId** | **string** | Message ID which generated the event |
+**event** | **string** | Event which occurred |
+**subject** | **string** | Subject of the event | [optional]
+**reason** | **string** | Reason of bounce (only available if the event is hardbounce or softbounce) | [optional]
+**tag** | **string** | Tag of the email which generated the event | [optional]
+**ip** | **string** | IP from which the user has opened the email or clicked on the link (only available if the event is opened or clicks) | [optional]
+**link** | **string** | The link which is sent to the user (only available if the event is requests or opened or clicks) | [optional]
+**from** | **string** | Sender email from which the emails are sent | [optional]
+**templateId** | **int** | ID of the template (only available if the email is template based) | [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/GetExtendedCampaignOverview.md b/docs/Model/GetExtendedCampaignOverview.md
index 4a14d09..77b0318 100644
--- a/docs/Model/GetExtendedCampaignOverview.md
+++ b/docs/Model/GetExtendedCampaignOverview.md
@@ -1,35 +1,42 @@
-# GetExtendedCampaignOverview
+# # GetExtendedCampaignOverview
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **int** | ID of the campaign |
-**name** | **string** | Name of the campaign |
-**subject** | **string** | Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` | [optional]
-**type** | **string** | Type of campaign |
-**status** | **string** | Status of the campaign |
-**scheduledAt** | **string** | UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) | [optional]
-**abTesting** | **bool** | Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. | [optional]
-**subjectA** | **string** | Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional]
-**subjectB** | **string** | Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional]
-**splitRule** | **int** | The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` | [optional]
-**winnerCriteria** | **string** | Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` | [optional]
-**winnerDelay** | **int** | The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` | [optional]
-**sendAtBestTime** | **bool** | It is true if you have chosen to send your campaign at best time, otherwise it is false | [optional]
-**testSent** | **bool** | Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) |
-**header** | **string** | Header of the campaign |
-**footer** | **string** | Footer of the campaign |
-**sender** | [**\Brevo\Client\Model\GetExtendedCampaignOverviewSender**](GetExtendedCampaignOverviewSender.md) | |
-**replyTo** | **string** | Email defined as the \"Reply to\" of the campaign |
-**toField** | **string** | Customisation of the \"to\" field of the campaign | [optional]
-**htmlContent** | **string** | HTML content of the campaign |
-**shareLink** | **string** | Link to share the campaign on social medias | [optional]
-**tag** | **string** | Tag of the campaign | [optional]
-**createdAt** | **string** | Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) |
-**modifiedAt** | **string** | UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) |
-**inlineImageActivation** | **bool** | Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. | [optional]
-**mirrorActive** | **bool** | Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign | [optional]
-**recurring** | **bool** | FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times | [optional]
-**sentDate** | **string** | Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' | [optional]
-**returnBounce** | **int** | Total number of non-delivered campaigns for a particular campaign id. | [optional]
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
+**id** | **int** | ID of the campaign |
+**name** | **string** | Name of the campaign |
+**type** | **string** | Type of campaign |
+**status** | **string** | Status of the campaign |
+**testSent** | **bool** | Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) |
+**header** | **string** | Header of the campaign |
+**footer** | **string** | Footer of the campaign |
+**sender** | [**\Brevo\Client\Models\GetExtendedCampaignOverviewAllOfSender**](GetExtendedCampaignOverviewAllOfSender.md) | |
+**replyTo** | **string** | Email defined as the \"Reply to\" of the campaign |
+**htmlContent** | **string** | HTML content of the campaign |
+**createdAt** | **string** | Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) |
+**modifiedAt** | **string** | UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) |
+**subject** | **string** | Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` | [optional]
+**previewText** | **string** | Preview text or preheader of the email campaign | [optional]
+**scheduledAt** | **string** | UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) | [optional]
+**abTesting** | **bool** | Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. | [optional]
+**subjectA** | **string** | Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional]
+**subjectB** | **string** | Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional]
+**splitRule** | **int** | The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` | [optional]
+**winnerCriteria** | **string** | Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` | [optional]
+**winnerDelay** | **int** | The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` | [optional]
+**sendAtBestTime** | **bool** | It is true if you have chosen to send your campaign at best time, otherwise it is false | [optional]
+**utmCampaignValue** | **string** | utm parameter associated with campaign | [optional]
+**utmSource** | **string** | | [optional]
+**utmMedium** | **string** | | [optional]
+**utmIDActive** | **bool** | utm id activate | [optional]
+**toField** | **string** | Customisation of the \"to\" field of the campaign | [optional]
+**shareLink** | **string** | Link to share the campaign on social medias | [optional]
+**tag** | **string** | Tag of the campaign | [optional]
+**inlineImageActivation** | **bool** | Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. | [optional]
+**mirrorActive** | **bool** | Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign | [optional]
+**recurring** | **bool** | FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times | [optional]
+**sentDate** | **string** | Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' | [optional]
+**returnBounce** | **int** | Total number of non-delivered campaigns for a particular campaign id. | [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/GetExtendedCampaignOverviewAllOfSender.md b/docs/Model/GetExtendedCampaignOverviewAllOfSender.md
new file mode 100644
index 0000000..4f79987
--- /dev/null
+++ b/docs/Model/GetExtendedCampaignOverviewAllOfSender.md
@@ -0,0 +1,11 @@
+# # GetExtendedCampaignOverviewAllOfSender
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | Sender name of the campaign | [optional]
+**email** | **string** | Sender email of the campaign | [optional]
+**id** | **int** | Sender id of the campaign | [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/GetExtendedCampaignOverviewSender.md b/docs/Model/GetExtendedCampaignOverviewSender.md
deleted file mode 100644
index 7ca0634..0000000
--- a/docs/Model/GetExtendedCampaignOverviewSender.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# GetExtendedCampaignOverviewSender
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**name** | **string** | Sender name of the campaign | [optional]
-**email** | **string** | Sender email of the campaign | [optional]
-**id** | **int** | Sender id of the campaign | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetExtendedCampaignStats.md b/docs/Model/GetExtendedCampaignStats.md
index a3cf455..d67c90d 100644
--- a/docs/Model/GetExtendedCampaignStats.md
+++ b/docs/Model/GetExtendedCampaignStats.md
@@ -1,17 +1,16 @@
-# GetExtendedCampaignStats
+# # GetExtendedCampaignStats
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**globalStats** | [**\Brevo\Client\Model\GetExtendedCampaignStatsGlobalStats**](GetExtendedCampaignStatsGlobalStats.md) | |
-**campaignStats** | **object[]** | List-wise statistics of the campaign. |
-**mirrorClick** | **int** | Number of clicks on mirror link |
-**remaining** | **int** | Number of remaning emails to send |
-**linksStats** | **object** | Statistics about the number of clicks for the links |
-**statsByDomain** | [**\Brevo\Client\Model\GetStatsByDomain**](GetStatsByDomain.md) | |
-**statsByDevice** | [**\Brevo\Client\Model\GetStatsByDevice**](GetStatsByDevice.md) | Statistics about the campaign on the basis of various devices |
-**statsByBrowser** | [**\Brevo\Client\Model\GetStatsByBrowser**](GetStatsByBrowser.md) | Statistics about the campaign on the basis of various browsers |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**globalStats** | [**\Brevo\Client\Models\GetCampaignStats**](GetCampaignStats.md) | Overall statistics of the campaign |
+**campaignStats** | [**GetCampaignStats[]**](GetCampaignStats.md) | List-wise statistics of the campaign. |
+**mirrorClick** | **int** | Number of clicks on mirror link |
+**remaining** | **int** | Number of remaning emails to send |
+**linksStats** | **object** | Statistics about the number of clicks for the links |
+**statsByDomain** | [**array**](GetCampaignStats.md) | |
+**statsByDevice** | [**\Brevo\Client\Models\GetStatsByDevice**](GetStatsByDevice.md) | |
+**statsByBrowser** | [**array**](GetDeviceBrowserStats.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/GetExtendedCampaignStatsGlobalStats.md b/docs/Model/GetExtendedCampaignStatsGlobalStats.md
deleted file mode 100644
index 47c4255..0000000
--- a/docs/Model/GetExtendedCampaignStatsGlobalStats.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# GetExtendedCampaignStatsGlobalStats
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetExtendedClient.md b/docs/Model/GetExtendedClient.md
index d779061..5c068cc 100644
--- a/docs/Model/GetExtendedClient.md
+++ b/docs/Model/GetExtendedClient.md
@@ -1,10 +1,13 @@
-# GetExtendedClient
+# # GetExtendedClient
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**address** | [**\Brevo\Client\Model\GetExtendedClientAddress**](GetExtendedClientAddress.md) | |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**email** | **string** | Login Email |
+**firstName** | **string** | First Name |
+**lastName** | **string** | Last Name |
+**companyName** | **string** | Name of the company |
+**address** | [**\Brevo\Client\Models\GetExtendedClientAllOfAddress**](GetExtendedClientAllOfAddress.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/GetExtendedClientAddress.md b/docs/Model/GetExtendedClientAddress.md
deleted file mode 100644
index 15c9b1b..0000000
--- a/docs/Model/GetExtendedClientAddress.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# GetExtendedClientAddress
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**street** | **string** | Street information |
-**city** | **string** | City information |
-**zipCode** | **string** | Zip Code information |
-**country** | **string** | Country information |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetExtendedClientAllOfAddress.md b/docs/Model/GetExtendedClientAllOfAddress.md
new file mode 100644
index 0000000..9f7b7c7
--- /dev/null
+++ b/docs/Model/GetExtendedClientAllOfAddress.md
@@ -0,0 +1,12 @@
+# # GetExtendedClientAllOfAddress
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**street** | **string** | Street information |
+**city** | **string** | City information |
+**zipCode** | **string** | Zip Code information |
+**country** | **string** | Country information |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetExtendedContactDetails.md b/docs/Model/GetExtendedContactDetails.md
index 1200c78..948e66a 100644
--- a/docs/Model/GetExtendedContactDetails.md
+++ b/docs/Model/GetExtendedContactDetails.md
@@ -1,17 +1,18 @@
-# GetExtendedContactDetails
+# # GetExtendedContactDetails
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**email** | **string** | Email address of the contact for which you requested the details |
-**id** | **int** | ID of the contact for which you requested the details |
-**emailBlacklisted** | **bool** | Blacklist status for email campaigns (true=blacklisted, false=not blacklisted) |
-**smsBlacklisted** | **bool** | Blacklist status for SMS campaigns (true=blacklisted, false=not blacklisted) |
-**createdAt** | **string** | Creation UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) |
-**modifiedAt** | **string** | Last modification UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) |
-**listIds** | **int[]** | |
-**listUnsubscribed** | **int[]** | | [optional]
-**attributes** | **object** | Set of attributes of the contact |
-**statistics** | [**\Brevo\Client\Model\GetExtendedContactDetailsStatistics**](GetExtendedContactDetailsStatistics.md) | |
+**id** | **int** | ID of the contact for which you requested the details |
+**emailBlacklisted** | **bool** | Blacklist status for email campaigns (true=blacklisted, false=not blacklisted) |
+**smsBlacklisted** | **bool** | Blacklist status for SMS campaigns (true=blacklisted, false=not blacklisted) |
+**createdAt** | **string** | Creation UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) |
+**modifiedAt** | **string** | Last modification UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) |
+**listIds** | **int[]** | |
+**attributes** | **object** | Set of attributes of the contact |
+**statistics** | [**\Brevo\Client\Models\GetExtendedContactDetailsAllOfStatistics**](GetExtendedContactDetailsAllOfStatistics.md) | |
+**email** | **string** | Email address of the contact for which you requested the details | [optional]
+**listUnsubscribed** | **int[]** | | [optional]
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.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/GetExtendedContactDetailsAllOfStatistics.md b/docs/Model/GetExtendedContactDetailsAllOfStatistics.md
new file mode 100644
index 0000000..8014562
--- /dev/null
+++ b/docs/Model/GetExtendedContactDetailsAllOfStatistics.md
@@ -0,0 +1,17 @@
+# # GetExtendedContactDetailsAllOfStatistics
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**messagesSent** | [**\Brevo\Client\Models\GetExtendedContactDetailsAllOfStatisticsMessagesSent[]**](GetExtendedContactDetailsAllOfStatisticsMessagesSent.md) | Listing of the sent campaign for the contact | [optional]
+**hardBounces** | [**\Brevo\Client\Models\GetExtendedContactDetailsAllOfStatisticsMessagesSent[]**](GetExtendedContactDetailsAllOfStatisticsMessagesSent.md) | Listing of the hardbounes generated by the contact | [optional]
+**softBounces** | [**\Brevo\Client\Models\GetExtendedContactDetailsAllOfStatisticsMessagesSent[]**](GetExtendedContactDetailsAllOfStatisticsMessagesSent.md) | Listing of the softbounes generated by the contact | [optional]
+**complaints** | [**\Brevo\Client\Models\GetExtendedContactDetailsAllOfStatisticsMessagesSent[]**](GetExtendedContactDetailsAllOfStatisticsMessagesSent.md) | Listing of the complaints generated by the contact | [optional]
+**unsubscriptions** | [**\Brevo\Client\Models\GetExtendedContactDetailsAllOfStatisticsUnsubscriptions**](GetExtendedContactDetailsAllOfStatisticsUnsubscriptions.md) | | [optional]
+**opened** | [**\Brevo\Client\Models\GetExtendedContactDetailsAllOfStatisticsOpened[]**](GetExtendedContactDetailsAllOfStatisticsOpened.md) | Listing of the openings generated by the contact | [optional]
+**clicked** | [**\Brevo\Client\Models\GetExtendedContactDetailsAllOfStatisticsClicked[]**](GetExtendedContactDetailsAllOfStatisticsClicked.md) | Listing of the clicks generated by the contact | [optional]
+**transacAttributes** | **object[]** | Listing of the transactional attributes for the contact | [optional]
+**delivered** | [**\Brevo\Client\Models\GetExtendedContactDetailsAllOfStatisticsMessagesSent[]**](GetExtendedContactDetailsAllOfStatisticsMessagesSent.md) | Listing of the delivered campaign for the contact | [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/GetExtendedContactDetailsAllOfStatisticsClicked.md b/docs/Model/GetExtendedContactDetailsAllOfStatisticsClicked.md
new file mode 100644
index 0000000..1eb20c1
--- /dev/null
+++ b/docs/Model/GetExtendedContactDetailsAllOfStatisticsClicked.md
@@ -0,0 +1,10 @@
+# # GetExtendedContactDetailsAllOfStatisticsClicked
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**campaignId** | **int** | ID of the campaign which generated the event |
+**links** | [**\Brevo\Client\Models\GetExtendedContactDetailsAllOfStatisticsLinks[]**](GetExtendedContactDetailsAllOfStatisticsLinks.md) | Listing of the clicked links for the campaign |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetExtendedContactDetailsAllOfStatisticsLinks.md b/docs/Model/GetExtendedContactDetailsAllOfStatisticsLinks.md
new file mode 100644
index 0000000..6c9f904
--- /dev/null
+++ b/docs/Model/GetExtendedContactDetailsAllOfStatisticsLinks.md
@@ -0,0 +1,12 @@
+# # GetExtendedContactDetailsAllOfStatisticsLinks
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**count** | **int** | Number of clicks on this link for the campaign |
+**eventTime** | **string** | UTC date-time of the event |
+**ip** | **string** | IP from which the user has clicked on the link |
+**url** | **string** | URL of the clicked link |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetExtendedContactDetailsAllOfStatisticsMessagesSent.md b/docs/Model/GetExtendedContactDetailsAllOfStatisticsMessagesSent.md
new file mode 100644
index 0000000..0972f03
--- /dev/null
+++ b/docs/Model/GetExtendedContactDetailsAllOfStatisticsMessagesSent.md
@@ -0,0 +1,10 @@
+# # GetExtendedContactDetailsAllOfStatisticsMessagesSent
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**campaignId** | **int** | ID of the campaign which generated the event |
+**eventTime** | **string** | UTC date-time of the event |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetExtendedContactDetailsAllOfStatisticsOpened.md b/docs/Model/GetExtendedContactDetailsAllOfStatisticsOpened.md
new file mode 100644
index 0000000..714ea94
--- /dev/null
+++ b/docs/Model/GetExtendedContactDetailsAllOfStatisticsOpened.md
@@ -0,0 +1,12 @@
+# # GetExtendedContactDetailsAllOfStatisticsOpened
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**campaignId** | **int** | ID of the campaign which generated the event |
+**count** | **int** | Number of openings for the campaign |
+**eventTime** | **string** | UTC date-time of the event |
+**ip** | **string** | IP from which the user has opened the email |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetExtendedContactDetailsAllOfStatisticsUnsubscriptions.md b/docs/Model/GetExtendedContactDetailsAllOfStatisticsUnsubscriptions.md
new file mode 100644
index 0000000..6dd095c
--- /dev/null
+++ b/docs/Model/GetExtendedContactDetailsAllOfStatisticsUnsubscriptions.md
@@ -0,0 +1,10 @@
+# # GetExtendedContactDetailsAllOfStatisticsUnsubscriptions
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**userUnsubscription** | [**\Brevo\Client\Models\GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription[]**](GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.md) | Contact unsubscribe via unsubscription link in a campaign |
+**adminUnsubscription** | [**\Brevo\Client\Models\GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription[]**](GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription.md) | Contact has been unsubscribed from the administrator |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription.md b/docs/Model/GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription.md
new file mode 100644
index 0000000..dbb0272
--- /dev/null
+++ b/docs/Model/GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription.md
@@ -0,0 +1,10 @@
+# # GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**eventTime** | **string** | UTC date-time of the event |
+**ip** | **string** | IP from which the user has been unsubscribed | [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/GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.md b/docs/Model/GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.md
new file mode 100644
index 0000000..dee3f1f
--- /dev/null
+++ b/docs/Model/GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.md
@@ -0,0 +1,11 @@
+# # GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**campaignId** | **int** | ID of the campaign which generated the event |
+**eventTime** | **string** | UTC date-time of the event |
+**ip** | **string** | IP from which the user has unsubscribed | [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/GetExtendedContactDetailsStatistics.md b/docs/Model/GetExtendedContactDetailsStatistics.md
deleted file mode 100644
index a8b7977..0000000
--- a/docs/Model/GetExtendedContactDetailsStatistics.md
+++ /dev/null
@@ -1,18 +0,0 @@
-# GetExtendedContactDetailsStatistics
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**messagesSent** | [**\Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]**](GetExtendedContactDetailsStatisticsMessagesSent.md) | Listing of the sent campaign for the contact | [optional]
-**hardBounces** | [**\Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]**](GetExtendedContactDetailsStatisticsMessagesSent.md) | Listing of the hardbounes generated by the contact | [optional]
-**softBounces** | [**\Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]**](GetExtendedContactDetailsStatisticsMessagesSent.md) | Listing of the softbounes generated by the contact | [optional]
-**complaints** | [**\Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]**](GetExtendedContactDetailsStatisticsMessagesSent.md) | Listing of the complaints generated by the contact | [optional]
-**unsubscriptions** | [**\Brevo\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptions**](GetExtendedContactDetailsStatisticsUnsubscriptions.md) | | [optional]
-**opened** | [**\Brevo\Client\Model\GetExtendedContactDetailsStatisticsOpened[]**](GetExtendedContactDetailsStatisticsOpened.md) | Listing of the openings generated by the contact | [optional]
-**clicked** | [**\Brevo\Client\Model\GetExtendedContactDetailsStatisticsClicked[]**](GetExtendedContactDetailsStatisticsClicked.md) | Listing of the clicks generated by the contact | [optional]
-**transacAttributes** | **object[]** | Listing of the transactional attributes for the contact | [optional]
-**delivered** | [**\Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]**](GetExtendedContactDetailsStatisticsMessagesSent.md) | Listing of the delivered campaign for the contact | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetExtendedContactDetailsStatisticsClicked.md b/docs/Model/GetExtendedContactDetailsStatisticsClicked.md
deleted file mode 100644
index 9316f75..0000000
--- a/docs/Model/GetExtendedContactDetailsStatisticsClicked.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# GetExtendedContactDetailsStatisticsClicked
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**campaignId** | **int** | ID of the campaign which generated the event |
-**links** | [**\Brevo\Client\Model\GetExtendedContactDetailsStatisticsLinks[]**](GetExtendedContactDetailsStatisticsLinks.md) | Listing of the clicked links for the campaign |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetExtendedContactDetailsStatisticsDelivered.md b/docs/Model/GetExtendedContactDetailsStatisticsDelivered.md
deleted file mode 100644
index bab4f11..0000000
--- a/docs/Model/GetExtendedContactDetailsStatisticsDelivered.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# GetExtendedContactDetailsStatisticsDelivered
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**campaignId** | **int** | ID of the campaign which generated the event |
-**eventTime** | **string** | UTC date-time of the event |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetExtendedContactDetailsStatisticsLinks.md b/docs/Model/GetExtendedContactDetailsStatisticsLinks.md
deleted file mode 100644
index 3baf33a..0000000
--- a/docs/Model/GetExtendedContactDetailsStatisticsLinks.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# GetExtendedContactDetailsStatisticsLinks
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**count** | **int** | Number of clicks on this link for the campaign |
-**eventTime** | **string** | UTC date-time of the event |
-**ip** | **string** | IP from which the user has clicked on the link |
-**url** | **string** | URL of the clicked link |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetExtendedContactDetailsStatisticsMessagesSent.md b/docs/Model/GetExtendedContactDetailsStatisticsMessagesSent.md
deleted file mode 100644
index b7b14c0..0000000
--- a/docs/Model/GetExtendedContactDetailsStatisticsMessagesSent.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# GetExtendedContactDetailsStatisticsMessagesSent
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**campaignId** | **int** | ID of the campaign which generated the event |
-**eventTime** | **string** | UTC date-time of the event |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetExtendedContactDetailsStatisticsOpened.md b/docs/Model/GetExtendedContactDetailsStatisticsOpened.md
deleted file mode 100644
index 9931b77..0000000
--- a/docs/Model/GetExtendedContactDetailsStatisticsOpened.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# GetExtendedContactDetailsStatisticsOpened
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**campaignId** | **int** | ID of the campaign which generated the event |
-**count** | **int** | Number of openings for the campaign |
-**eventTime** | **string** | UTC date-time of the event |
-**ip** | **string** | IP from which the user has opened the email |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetExtendedContactDetailsStatisticsUnsubscriptions.md b/docs/Model/GetExtendedContactDetailsStatisticsUnsubscriptions.md
deleted file mode 100644
index 86c348f..0000000
--- a/docs/Model/GetExtendedContactDetailsStatisticsUnsubscriptions.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# GetExtendedContactDetailsStatisticsUnsubscriptions
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**userUnsubscription** | [**\Brevo\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription[]**](GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription.md) | Contact unsubscribe via unsubscription link in a campaign |
-**adminUnsubscription** | [**\Brevo\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription[]**](GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription.md) | Contact has been unsubscribed from the administrator |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription.md b/docs/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription.md
deleted file mode 100644
index 898c563..0000000
--- a/docs/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**eventTime** | **string** | UTC date-time of the event |
-**ip** | **string** | IP from which the user has been unsubscribed | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription.md b/docs/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription.md
deleted file mode 100644
index 1167e0a..0000000
--- a/docs/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**campaignId** | **int** | ID of the campaign which generated the event |
-**eventTime** | **string** | UTC date-time of the event |
-**ip** | **string** | IP from which the user has unsubscribed | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetExtendedList.md b/docs/Model/GetExtendedList.md
index 05cae4e..1196b7a 100644
--- a/docs/Model/GetExtendedList.md
+++ b/docs/Model/GetExtendedList.md
@@ -1,13 +1,17 @@
-# GetExtendedList
+# # GetExtendedList
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**folderId** | **int** | ID of the folder |
-**createdAt** | **string** | Creation UTC date-time of the list (YYYY-MM-DDTHH:mm:ss.SSSZ) |
-**campaignStats** | [**\Brevo\Client\Model\GetExtendedListCampaignStats[]**](GetExtendedListCampaignStats.md) | | [optional]
-**dynamicList** | **bool** | Status telling if the list is dynamic or not (true=dynamic, false=not dynamic) | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**id** | **int** | ID of the list |
+**name** | **string** | Name of the list |
+**totalBlacklisted** | **int** | Number of blacklisted contacts in the list |
+**totalSubscribers** | **int** | Number of contacts in the list |
+**uniqueSubscribers** | **int** | Number of unique contacts in the list |
+**folderId** | **int** | ID of the folder |
+**createdAt** | **string** | Creation UTC date-time of the list (YYYY-MM-DDTHH:mm:ss.SSSZ) |
+**campaignStats** | [**\Brevo\Client\Models\GetExtendedListAllOfCampaignStats[]**](GetExtendedListAllOfCampaignStats.md) | | [optional]
+**dynamicList** | **bool** | Status telling if the list is dynamic or not (true=dynamic, false=not dynamic) | [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/GetExtendedListAllOfCampaignStats.md b/docs/Model/GetExtendedListAllOfCampaignStats.md
new file mode 100644
index 0000000..977eaca
--- /dev/null
+++ b/docs/Model/GetExtendedListAllOfCampaignStats.md
@@ -0,0 +1,10 @@
+# # GetExtendedListAllOfCampaignStats
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**campaignId** | **int** | ID of the campaign |
+**stats** | [**\Brevo\Client\Models\GetCampaignStats**](GetCampaignStats.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/GetExtendedListCampaignStats.md b/docs/Model/GetExtendedListCampaignStats.md
deleted file mode 100644
index 5ea98e2..0000000
--- a/docs/Model/GetExtendedListCampaignStats.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# GetExtendedListCampaignStats
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**campaignId** | **int** | ID of the campaign |
-**stats** | [**\Brevo\Client\Model\GetCampaignStats**](GetCampaignStats.md) | |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetExternalFeedByUUID.md b/docs/Model/GetExternalFeedByUUID.md
index ecd3ca4..d4c2058 100644
--- a/docs/Model/GetExternalFeedByUUID.md
+++ b/docs/Model/GetExternalFeedByUUID.md
@@ -1,21 +1,20 @@
-# GetExternalFeedByUUID
+# # GetExternalFeedByUUID
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **string** | ID of the feed |
-**name** | **string** | Name of the feed |
-**url** | **string** | URL of the feed |
-**authType** | **string** | Auth type of the feed: * `basic` * `token` * `noAuth` |
-**username** | **string** | Username for authType `basic` | [optional]
-**password** | **string** | Password for authType `basic` | [optional]
-**token** | **string** | Token for authType `token` | [optional]
-**headers** | [**\Brevo\Client\Model\GetExternalFeedByUUIDHeaders[]**](GetExternalFeedByUUIDHeaders.md) | Custom headers for the feed |
-**maxRetries** | **int** | Maximum number of retries on the feed url |
-**cache** | **bool** | Toggle caching of feed url response |
-**createdAt** | [**\DateTime**] | Datetime on which the feed was created |
-**modifiedAt** | [**\DateTime**] | Datetime on which the feed was modified |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**id** | **string** | ID of the feed |
+**name** | **string** | Name of the feed |
+**url** | **string** | URL of the feed |
+**authType** | **string** | Auth type of the feed: * `basic` * `token` * `noAuth` |
+**headers** | [**\Brevo\Client\Models\GetExternalFeedByUUIDHeadersInner[]**](GetExternalFeedByUUIDHeadersInner.md) | Custom headers for the feed |
+**maxRetries** | **int** | Maximum number of retries on the feed url | [default to 5]
+**cache** | **bool** | Toggle caching of feed url response |
+**createdAt** | **\DateTime** | Datetime on which the feed was created |
+**modifiedAt** | **\DateTime** | Datetime on which the feed was modified |
+**username** | **string** | Username for authType `basic` | [optional]
+**password** | **string** | Password for authType `basic` | [optional]
+**token** | **string** | Token for authType `token` | [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/GetExternalFeedByUUIDHeaders.md b/docs/Model/GetExternalFeedByUUIDHeaders.md
deleted file mode 100644
index 2b01f98..0000000
--- a/docs/Model/GetExternalFeedByUUIDHeaders.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# GetExternalFeedByUUIDHeaders
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**name** | **string** | Name of the header | [optional]
-**value** | **string** | Value of the header | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetExternalFeedByUUIDHeadersInner.md b/docs/Model/GetExternalFeedByUUIDHeadersInner.md
new file mode 100644
index 0000000..fe99cc1
--- /dev/null
+++ b/docs/Model/GetExternalFeedByUUIDHeadersInner.md
@@ -0,0 +1,10 @@
+# # GetExternalFeedByUUIDHeadersInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | Name of the header | [optional]
+**value** | **string** | Value of the header | [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/GetFolder.md b/docs/Model/GetFolder.md
index 2043959..701927f 100644
--- a/docs/Model/GetFolder.md
+++ b/docs/Model/GetFolder.md
@@ -1,14 +1,13 @@
-# GetFolder
+# # GetFolder
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **int** | ID of the folder |
-**name** | **string** | Name of the folder |
-**totalBlacklisted** | **int** | Number of blacklisted contacts in the folder |
-**totalSubscribers** | **int** | Number of contacts in the folder |
-**uniqueSubscribers** | **int** | Number of unique contacts in the folder |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**id** | **int** | ID of the folder |
+**name** | **string** | Name of the folder |
+**totalBlacklisted** | **int** | Number of blacklisted contacts in the folder |
+**totalSubscribers** | **int** | Number of contacts in the folder |
+**uniqueSubscribers** | **int** | Number of unique contacts in the folder |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetFolderLists.md b/docs/Model/GetFolderLists.md
index fcc8e7e..de30b4c 100644
--- a/docs/Model/GetFolderLists.md
+++ b/docs/Model/GetFolderLists.md
@@ -1,11 +1,10 @@
-# GetFolderLists
+# # GetFolderLists
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**lists** | **object[]** | | [optional]
-**count** | **int** | Number of lists in the folder | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**lists** | [**GetList[]**](GetList.md) | | [optional]
+**count** | **int** | Number of lists in the folder | [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/GetFolders.md b/docs/Model/GetFolders.md
index efdfe2f..ca1f24d 100644
--- a/docs/Model/GetFolders.md
+++ b/docs/Model/GetFolders.md
@@ -1,11 +1,10 @@
-# GetFolders
+# # GetFolders
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**folders** | **object[]** | | [optional]
-**count** | **int** | Number of folders available in your account | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**folders** | [**GetFolder[]**](GetFolder.md) | | [optional]
+**count** | **int** | Number of folders available in your account | [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/GetInboundEmailEvents.md b/docs/Model/GetInboundEmailEvents.md
index f2628e1..921b413 100644
--- a/docs/Model/GetInboundEmailEvents.md
+++ b/docs/Model/GetInboundEmailEvents.md
@@ -1,10 +1,9 @@
-# GetInboundEmailEvents
+# # GetInboundEmailEvents
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**events** | [**\Brevo\Client\Model\GetInboundEmailEventsEvents[]**](GetInboundEmailEventsEvents.md) | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**events** | [**\Brevo\Client\Models\GetInboundEmailEventsEventsInner[]**](GetInboundEmailEventsEventsInner.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/GetInboundEmailEventsByUuid.md b/docs/Model/GetInboundEmailEventsByUuid.md
index 6b4640b..a8fff0b 100644
--- a/docs/Model/GetInboundEmailEventsByUuid.md
+++ b/docs/Model/GetInboundEmailEventsByUuid.md
@@ -1,17 +1,16 @@
-# GetInboundEmailEventsByUuid
+# # GetInboundEmailEventsByUuid
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**receivedAt** | [**\DateTime**] | Date when email was received on SMTP relay | [optional]
-**deliveredAt** | [**\DateTime**] | Date when email was delivered successfully to client’s webhook | [optional]
-**recipient** | **string** | Recipient’s email address | [optional]
-**sender** | **string** | Sender’s email address | [optional]
-**messageId** | **string** | Value of the Message-ID header. This will be present only after the processing is done. | [optional]
-**subject** | **string** | Value of the Subject header. This will be present only after the processing is done. | [optional]
-**attachments** | [**\Brevo\Client\Model\GetInboundEmailEventsByUuidAttachments[]**](GetInboundEmailEventsByUuidAttachments.md) | List of attachments of the email. This will be present only after the processing is done. | [optional]
-**logs** | [**\Brevo\Client\Model\GetInboundEmailEventsByUuidLogs[]**](GetInboundEmailEventsByUuidLogs.md) | List of events/logs that describe the lifecycle of the email on SIB platform | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**receivedAt** | **\DateTime** | Date when email was received on SMTP relay | [optional]
+**deliveredAt** | **\DateTime** | Date when email was delivered successfully to client’s webhook | [optional]
+**recipient** | **string** | Recipient’s email address | [optional]
+**sender** | **string** | Sender’s email address | [optional]
+**messageId** | **string** | Value of the Message-ID header. This will be present only after the processing is done. | [optional]
+**subject** | **string** | Value of the Subject header. This will be present only after the processing is done. | [optional]
+**attachments** | [**\Brevo\Client\Models\GetInboundEmailEventsByUuidAttachmentsInner[]**](GetInboundEmailEventsByUuidAttachmentsInner.md) | List of attachments of the email. This will be present only after the processing is done. | [optional]
+**logs** | [**\Brevo\Client\Models\GetInboundEmailEventsByUuidLogsInner[]**](GetInboundEmailEventsByUuidLogsInner.md) | List of events/logs that describe the lifecycle of the email on SIB platform | [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/GetInboundEmailEventsByUuidAttachments.md b/docs/Model/GetInboundEmailEventsByUuidAttachments.md
deleted file mode 100644
index f1af599..0000000
--- a/docs/Model/GetInboundEmailEventsByUuidAttachments.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# GetInboundEmailEventsByUuidAttachments
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**name** | **string** | filename specified in the Content-Disposition header of the attachment | [optional]
-**contentType** | **string** | value of the Content-Type header of the attachment | [optional]
-**contentId** | **string** | value of the Content-ID header of the attachment. | [optional]
-**contentLength** | **int** | size of the attachment in bytes | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetInboundEmailEventsByUuidAttachmentsInner.md b/docs/Model/GetInboundEmailEventsByUuidAttachmentsInner.md
new file mode 100644
index 0000000..fc06f96
--- /dev/null
+++ b/docs/Model/GetInboundEmailEventsByUuidAttachmentsInner.md
@@ -0,0 +1,12 @@
+# # GetInboundEmailEventsByUuidAttachmentsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | filename specified in the Content-Disposition header of the attachment | [optional]
+**contentType** | **string** | value of the Content-Type header of the attachment | [optional]
+**contentId** | **string** | value of the Content-ID header of the attachment. | [optional]
+**contentLength** | **int** | size of the attachment in bytes | [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/GetInboundEmailEventsByUuidLogs.md b/docs/Model/GetInboundEmailEventsByUuidLogs.md
deleted file mode 100644
index 6325cc7..0000000
--- a/docs/Model/GetInboundEmailEventsByUuidLogs.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# GetInboundEmailEventsByUuidLogs
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**date** | [**\DateTime**] | Date of the event | [optional]
-**type** | **string** | Type of the event | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetInboundEmailEventsByUuidLogsInner.md b/docs/Model/GetInboundEmailEventsByUuidLogsInner.md
new file mode 100644
index 0000000..cc000cd
--- /dev/null
+++ b/docs/Model/GetInboundEmailEventsByUuidLogsInner.md
@@ -0,0 +1,10 @@
+# # GetInboundEmailEventsByUuidLogsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**date** | **\DateTime** | Date of the event | [optional]
+**type** | **string** | Type of the event | [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/GetInboundEmailEventsEvents.md b/docs/Model/GetInboundEmailEventsEvents.md
deleted file mode 100644
index 4804fc4..0000000
--- a/docs/Model/GetInboundEmailEventsEvents.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# GetInboundEmailEventsEvents
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**uuid** | **string** | UUID that can be used to fetch additional data |
-**date** | [**\DateTime**] | Date when email was received on SMTP relay |
-**sender** | **string** | Sender’s email address |
-**recipient** | **string** | Recipient’s email address |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetInboundEmailEventsEventsInner.md b/docs/Model/GetInboundEmailEventsEventsInner.md
new file mode 100644
index 0000000..7807a9c
--- /dev/null
+++ b/docs/Model/GetInboundEmailEventsEventsInner.md
@@ -0,0 +1,12 @@
+# # GetInboundEmailEventsEventsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**uuid** | **string** | UUID that can be used to fetch additional data |
+**date** | **\DateTime** | Date when email was received on SMTP relay |
+**sender** | **string** | Sender’s email address |
+**recipient** | **string** | Recipient’s email address |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetInvitedUsersList.md b/docs/Model/GetInvitedUsersList.md
index 0766463..d6e1582 100644
--- a/docs/Model/GetInvitedUsersList.md
+++ b/docs/Model/GetInvitedUsersList.md
@@ -1,10 +1,9 @@
-# GetInvitedUsersList
+# # GetInvitedUsersList
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**users** | [**\Brevo\Client\Model\GetInvitedUsersListUsers[]**](GetInvitedUsersListUsers.md) | Get invited users list | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**users** | [**\Brevo\Client\Models\GetInvitedUsersListUsersInner[]**](GetInvitedUsersListUsersInner.md) | Get invited users list | [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/GetInvitedUsersListFeatureAccess.md b/docs/Model/GetInvitedUsersListFeatureAccess.md
deleted file mode 100644
index f1f28e9..0000000
--- a/docs/Model/GetInvitedUsersListFeatureAccess.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# GetInvitedUsersListFeatureAccess
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**marketing** | **object** | Marketing features accessiblity. | [optional]
-**conversations** | **object** | Conversations features accessiblity. | [optional]
-**crm** | **object** | CRM features accessiblity. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetInvitedUsersListUsers.md b/docs/Model/GetInvitedUsersListUsers.md
deleted file mode 100644
index a965bb2..0000000
--- a/docs/Model/GetInvitedUsersListUsers.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# GetInvitedUsersListUsers
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**email** | **string** | Email address of the user. |
-**isOwner** | **string** | Flag for indicating is user owner of the organization. |
-**status** | **string** | Status of the invited user. |
-**featureAccess** | [**\Brevo\Client\Model\GetInvitedUsersListFeatureAccess**](GetInvitedUsersListFeatureAccess.md) | |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetInvitedUsersListUsersInner.md b/docs/Model/GetInvitedUsersListUsersInner.md
new file mode 100644
index 0000000..4ea3b7c
--- /dev/null
+++ b/docs/Model/GetInvitedUsersListUsersInner.md
@@ -0,0 +1,12 @@
+# # GetInvitedUsersListUsersInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**email** | **string** | Email address of the user. |
+**isOwner** | **string** | Flag for indicating is user owner of the organization. |
+**status** | **string** | Status of the invited user. |
+**featureAccess** | [**\Brevo\Client\Models\GetInvitedUsersListUsersInnerFeatureAccess**](GetInvitedUsersListUsersInnerFeatureAccess.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/GetInvitedUsersListUsersInnerFeatureAccess.md b/docs/Model/GetInvitedUsersListUsersInnerFeatureAccess.md
new file mode 100644
index 0000000..a2505ab
--- /dev/null
+++ b/docs/Model/GetInvitedUsersListUsersInnerFeatureAccess.md
@@ -0,0 +1,11 @@
+# # GetInvitedUsersListUsersInnerFeatureAccess
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**marketing** | **string** | Marketing features accessiblity. | [optional]
+**conversations** | **string** | Conversations features accessiblity. | [optional]
+**crm** | **string** | CRM features accessiblity. | [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/GetIp.md b/docs/Model/GetIp.md
index efc77a8..2d00651 100644
--- a/docs/Model/GetIp.md
+++ b/docs/Model/GetIp.md
@@ -1,13 +1,12 @@
-# GetIp
+# # GetIp
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **int** | ID of the dedicated IP |
-**ip** | **string** | Dedicated IP |
-**active** | **bool** | Status of the IP (true=active, false=inactive) |
-**domain** | **string** | Domain associated to the IP |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**id** | **int** | ID of the dedicated IP |
+**ip** | **string** | Dedicated IP |
+**active** | **bool** | Status of the IP (true=active, false=inactive) |
+**domain** | **string** | Domain associated to the IP |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetIpFromSender.md b/docs/Model/GetIpFromSender.md
index d9fc9cc..656f8f5 100644
--- a/docs/Model/GetIpFromSender.md
+++ b/docs/Model/GetIpFromSender.md
@@ -1,13 +1,12 @@
-# GetIpFromSender
+# # GetIpFromSender
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **int** | ID of the dedicated IP |
-**ip** | **string** | Dedicated IP |
-**domain** | **string** | Domain associated to the IP |
-**weight** | **int** | Weight of the IP |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**id** | **int** | ID of the dedicated IP |
+**ip** | **string** | Dedicated IP |
+**domain** | **string** | Domain associated to the IP |
+**weight** | **int** | Weight of the IP |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetIps.md b/docs/Model/GetIps.md
index 0dfd783..babf29b 100644
--- a/docs/Model/GetIps.md
+++ b/docs/Model/GetIps.md
@@ -1,10 +1,9 @@
-# GetIps
+# # GetIps
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**ips** | [**\Brevo\Client\Model\GetIp[]**](GetIp.md) | Dedicated IP(s) available on your account |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**ips** | [**\Brevo\Client\Models\GetIp[]**](GetIp.md) | Dedicated IP(s) available on your account |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetIpsFromSender.md b/docs/Model/GetIpsFromSender.md
index 4aa592f..22944b9 100644
--- a/docs/Model/GetIpsFromSender.md
+++ b/docs/Model/GetIpsFromSender.md
@@ -1,10 +1,9 @@
-# GetIpsFromSender
+# # GetIpsFromSender
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**ips** | [**\Brevo\Client\Model\GetIpFromSender[]**](GetIpFromSender.md) | Dedicated IP(s) linked to a sender |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**ips** | [**\Brevo\Client\Models\GetIpFromSender[]**](GetIpFromSender.md) | Dedicated IP(s) linked to a sender |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetList.md b/docs/Model/GetList.md
index 483db1f..939d4da 100644
--- a/docs/Model/GetList.md
+++ b/docs/Model/GetList.md
@@ -1,14 +1,13 @@
-# GetList
+# # GetList
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **int** | ID of the list |
-**name** | **string** | Name of the list |
-**totalBlacklisted** | **int** | Number of blacklisted contacts in the list |
-**totalSubscribers** | **int** | Number of contacts in the list |
-**uniqueSubscribers** | **int** | Number of unique contacts in the list |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**id** | **int** | ID of the list |
+**name** | **string** | Name of the list |
+**totalBlacklisted** | **int** | Number of blacklisted contacts in the list |
+**totalSubscribers** | **int** | Number of contacts in the list |
+**uniqueSubscribers** | **int** | Number of unique contacts in the list |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetLists.md b/docs/Model/GetLists.md
index c46253b..ca4cccb 100644
--- a/docs/Model/GetLists.md
+++ b/docs/Model/GetLists.md
@@ -1,11 +1,10 @@
-# GetLists
+# # GetLists
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**lists** | **object[]** | Listing of all the lists available in your account | [optional]
-**count** | **int** | Number of lists in your account | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**lists** | [**\Brevo\Client\Models\GetListsListsInner[]**](GetListsListsInner.md) | Listing of all the lists available in your account | [optional]
+**count** | **int** | Number of lists in your account | [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/GetListsListsInner.md b/docs/Model/GetListsListsInner.md
new file mode 100644
index 0000000..b6a1d24
--- /dev/null
+++ b/docs/Model/GetListsListsInner.md
@@ -0,0 +1,14 @@
+# # GetListsListsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | ID of the list |
+**name** | **string** | Name of the list |
+**totalBlacklisted** | **int** | Number of blacklisted contacts in the list |
+**totalSubscribers** | **int** | Number of contacts in the list |
+**uniqueSubscribers** | **int** | Number of unique contacts in the list |
+**folderId** | **int** | ID of the folder |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetOrders.md b/docs/Model/GetOrders.md
deleted file mode 100644
index d84c1ea..0000000
--- a/docs/Model/GetOrders.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# GetOrders
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**orders** | **object[]** | | [optional]
-**count** | **int** | Number of orders | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetPaymentRequest.md b/docs/Model/GetPaymentRequest.md
new file mode 100644
index 0000000..d555234
--- /dev/null
+++ b/docs/Model/GetPaymentRequest.md
@@ -0,0 +1,15 @@
+# # GetPaymentRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**reference** | **string** | Reference of the payment request, it will appear on the payment page. |
+**status** | **string** | Status of the payment request. |
+**cart** | [**\Brevo\Client\Models\Cart**](Cart.md) | |
+**notification** | [**\Brevo\Client\Models\Notification**](Notification.md) | |
+**configuration** | [**\Brevo\Client\Models\Configuration**](Configuration.md) | | [optional]
+**contactId** | **int** | Brevo ID of the contact requested to pay. | [optional]
+**numberOfRemindersSent** | **int** | number of reminders sent. | [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/GetProcess.md b/docs/Model/GetProcess.md
index 860892a..c3784b9 100644
--- a/docs/Model/GetProcess.md
+++ b/docs/Model/GetProcess.md
@@ -1,13 +1,12 @@
-# GetProcess
+# # GetProcess
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **int** | Id of the process |
-**status** | **string** | Status of the process |
-**name** | **string** | Process name |
-**exportUrl** | **string** | URL on which send export the of contacts once the process is completed | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**id** | **int** | Id of the process |
+**status** | **string** | Status of the process |
+**name** | **string** | Process name |
+**exportUrl** | **string** | URL on which send export the of contacts once the process is completed | [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/GetProcesses.md b/docs/Model/GetProcesses.md
index af62f02..edfdd87 100644
--- a/docs/Model/GetProcesses.md
+++ b/docs/Model/GetProcesses.md
@@ -1,11 +1,10 @@
-# GetProcesses
+# # GetProcesses
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**processes** | [**\Brevo\Client\Model\GetProcess[]**](GetProcess.md) | List of processes available on your account | [optional]
-**count** | **int** | Number of processes available on your account | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**processes** | [**\Brevo\Client\Models\GetProcess[]**](GetProcess.md) | List of processes available on your account | [optional]
+**count** | **int** | Number of processes available on your account | [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/GetProductDetails.md b/docs/Model/GetProductDetails.md
index 16e5654..e1362d3 100644
--- a/docs/Model/GetProductDetails.md
+++ b/docs/Model/GetProductDetails.md
@@ -1,24 +1,23 @@
-# GetProductDetails
+# # GetProductDetails
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **string** | Product ID for which you requested the details |
-**name** | **string** | Name of the product for which you requested the details |
-**createdAt** | **string** | Creation UTC date-time of the product (YYYY-MM-DDTHH:mm:ss.SSSZ) |
-**modifiedAt** | **string** | Last modification UTC date-time of the product (YYYY-MM-DDTHH:mm:ss.SSSZ) |
-**url** | **string** | URL to the product | [optional]
-**imageUrl** | **string** | Absolute URL to the cover image of the product | [optional]
-**sku** | **string** | Product identifier from the shop | [optional]
-**price** | **float** | Price of the product | [optional]
-**categories** | **string[]** | Category ID-s of the product | [optional]
-**parentId** | **string** | Parent product id of the product | [optional]
-**s3Original** | **string** | S3 url of original image | [optional]
-**s3ThumbAnalytics** | **string** | S3 thumbnail url of original image in 120x120 dimension for analytics section |
-**metaInfo** | **object** | Meta data of product such as description, vendor, producer, stock level, etc. | [optional]
-**s3ThumbEditor** | **string** | S3 thumbnail url of original image in 600x400 dimension for editor section |
-**isDeleted** | **bool** | product deleted from the shop's database | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**id** | **string** | Product ID for which you requested the details |
+**name** | **string** | Name of the product for which you requested the details |
+**createdAt** | **string** | Creation UTC date-time of the product (YYYY-MM-DDTHH:mm:ss.SSSZ) |
+**modifiedAt** | **string** | Last modification UTC date-time of the product (YYYY-MM-DDTHH:mm:ss.SSSZ) |
+**s3ThumbAnalytics** | **string** | S3 thumbnail url of original image in 120x120 dimension for analytics section |
+**s3ThumbEditor** | **string** | S3 thumbnail url of original image in 600x400 dimension for editor section |
+**url** | **string** | URL to the product | [optional]
+**imageUrl** | **string** | Absolute URL to the cover image of the product | [optional]
+**sku** | **string** | Product identifier from the shop | [optional]
+**price** | **float** | Price of the product | [optional]
+**categories** | **string[]** | Category ID-s of the product | [optional]
+**parentId** | **string** | Parent product id of the product | [optional]
+**s3Original** | **string** | S3 url of original image | [optional]
+**metaInfo** | **object** | Meta data of product such as description, vendor, producer, stock level, etc. | [optional]
+**isDeleted** | **bool** | product deleted from the shop's database | [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/GetProducts.md b/docs/Model/GetProducts.md
index 48512f0..3818b0d 100644
--- a/docs/Model/GetProducts.md
+++ b/docs/Model/GetProducts.md
@@ -1,11 +1,10 @@
-# GetProducts
+# # GetProducts
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**products** | **object[]** | |
-**count** | **int** | Number of products |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**products** | [**GetProductDetails[]**](GetProductDetails.md) | |
+**count** | **int** | Number of products |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetReports.md b/docs/Model/GetReports.md
index 9e44db8..31b1dfc 100644
--- a/docs/Model/GetReports.md
+++ b/docs/Model/GetReports.md
@@ -1,10 +1,9 @@
-# GetReports
+# # GetReports
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**reports** | [**\Brevo\Client\Model\GetReportsReports[]**](GetReportsReports.md) | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**reports** | [**\Brevo\Client\Models\GetReportsReportsInner[]**](GetReportsReportsInner.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/GetReportsReports.md b/docs/Model/GetReportsReports.md
deleted file mode 100644
index 015ddca..0000000
--- a/docs/Model/GetReportsReports.md
+++ /dev/null
@@ -1,22 +0,0 @@
-# GetReportsReports
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**date** | [**\DateTime**] | Date of the statistics |
-**requests** | **int** | Number of requests for the date |
-**delivered** | **int** | Number of delivered emails for the date |
-**hardBounces** | **int** | Number of hardbounces for the date |
-**softBounces** | **int** | Number of softbounces for the date |
-**clicks** | **int** | Number of clicks for the date |
-**uniqueClicks** | **int** | Number of unique clicks for the date |
-**opens** | **int** | Number of openings for the date |
-**uniqueOpens** | **int** | Number of unique openings for the date |
-**spamReports** | **int** | Number of complaints (spam reports) for the date |
-**blocked** | **int** | Number of blocked emails for the date |
-**invalid** | **int** | Number of invalid emails for the date |
-**unsubscribed** | **int** | Number of unsubscribed emails for the date |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetReportsReportsInner.md b/docs/Model/GetReportsReportsInner.md
new file mode 100644
index 0000000..7779b5f
--- /dev/null
+++ b/docs/Model/GetReportsReportsInner.md
@@ -0,0 +1,21 @@
+# # GetReportsReportsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**date** | **\DateTime** | Date of the statistics |
+**requests** | **int** | Number of requests for the date |
+**delivered** | **int** | Number of delivered emails for the date |
+**hardBounces** | **int** | Number of hardbounces for the date |
+**softBounces** | **int** | Number of softbounces for the date |
+**clicks** | **int** | Number of clicks for the date |
+**uniqueClicks** | **int** | Number of unique clicks for the date |
+**opens** | **int** | Number of openings for the date |
+**uniqueOpens** | **int** | Number of unique openings for the date |
+**spamReports** | **int** | Number of complaints (spam reports) for the date |
+**blocked** | **int** | Number of blocked emails for the date |
+**invalid** | **int** | Number of invalid emails for the date |
+**unsubscribed** | **int** | Number of unsubscribed emails for the date |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetScheduledEmailByBatchId.md b/docs/Model/GetScheduledEmailByBatchId.md
index 72bc67a..85ac34d 100644
--- a/docs/Model/GetScheduledEmailByBatchId.md
+++ b/docs/Model/GetScheduledEmailByBatchId.md
@@ -1,10 +1,10 @@
-# GetScheduledEmailByBatchId
+# # GetScheduledEmailByBatchId
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**count** | **int** | Total number of batches | [optional]
-**batches** | [**\Brevo\Client\Model\GetScheduledEmailByBatchIdBatches[]**](GetScheduledEmailByBatchIdBatches.md) | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
+**count** | **int** | Total number of batches | [optional]
+**batches** | [**\Brevo\Client\Models\GetScheduledEmailByBatchIdBatchesInner[]**](GetScheduledEmailByBatchIdBatchesInner.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/GetScheduledEmailByBatchIdBatches.md b/docs/Model/GetScheduledEmailByBatchIdBatches.md
deleted file mode 100644
index 2859003..0000000
--- a/docs/Model/GetScheduledEmailByBatchIdBatches.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# GetScheduledEmailByBatchIdBatches
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**scheduledAt** | [**\DateTime**] | Datetime for which the batch was scheduled |
-**createdAt** | [**\DateTime**] | Datetime on which the batch was scheduled |
-**status** | **string** | Current status of the scheduled batch |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
diff --git a/docs/Model/GetScheduledEmailByBatchIdBatchesInner.md b/docs/Model/GetScheduledEmailByBatchIdBatchesInner.md
new file mode 100644
index 0000000..10f0150
--- /dev/null
+++ b/docs/Model/GetScheduledEmailByBatchIdBatchesInner.md
@@ -0,0 +1,11 @@
+# # GetScheduledEmailByBatchIdBatchesInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**scheduledAt** | **\DateTime** | Datetime for which the batch was scheduled |
+**createdAt** | **\DateTime** | Datetime on which the batch was scheduled |
+**status** | **string** | Current status of the scheduled batch |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetScheduledEmailById200Response.md b/docs/Model/GetScheduledEmailById200Response.md
new file mode 100644
index 0000000..8d02677
--- /dev/null
+++ b/docs/Model/GetScheduledEmailById200Response.md
@@ -0,0 +1,13 @@
+# # GetScheduledEmailById200Response
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**scheduledAt** | **\DateTime** | Datetime for which the email was scheduled |
+**createdAt** | **\DateTime** | Datetime on which the email was scheduled |
+**status** | **string** | Current status of the scheduled email |
+**count** | **int** | Total number of batches | [optional]
+**batches** | [**\Brevo\Client\Models\GetScheduledEmailByBatchIdBatchesInner[]**](GetScheduledEmailByBatchIdBatchesInner.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/GetScheduledEmailByMessageId.md b/docs/Model/GetScheduledEmailByMessageId.md
index c81749c..f9e2b55 100644
--- a/docs/Model/GetScheduledEmailByMessageId.md
+++ b/docs/Model/GetScheduledEmailByMessageId.md
@@ -1,11 +1,11 @@
-# GetScheduledEmailByMessageId
+# # GetScheduledEmailByMessageId
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**scheduledAt** | [**\DateTime**] | Datetime for which the email was scheduled |
-**createdAt** | [**\DateTime**] | Datetime on which the email was scheduled |
-**status** | **string** | Current status of the scheduled email |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
+**scheduledAt** | **\DateTime** | Datetime for which the email was scheduled |
+**createdAt** | **\DateTime** | Datetime on which the email was scheduled |
+**status** | **string** | Current status of the scheduled email |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetSegments.md b/docs/Model/GetSegments.md
index 4292fd5..2c9c3fa 100644
--- a/docs/Model/GetSegments.md
+++ b/docs/Model/GetSegments.md
@@ -1,11 +1,10 @@
-# GetSegments
+# # GetSegments
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**segments** | [**\Brevo\Client\Model\GetSegmentsSegments**](GetSegmentsSegments.md) | | [optional]
-**count** | **int** | Number of Segments available in your account | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**segments** | [**Segment[]**](Segment.md) | Listing of all the segments available in your account | [optional]
+**count** | **int** | Number of Segments in your account | [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/GetSegmentsSegments.md b/docs/Model/GetSegmentsSegments.md
deleted file mode 100644
index 97bea65..0000000
--- a/docs/Model/GetSegmentsSegments.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# GetSegmentsSegments
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**id** | **int** | ID of the list | [optional]
-**segmentName** | **string** | Name of the Segment | [optional]
-**categoryName** | **string** | Name of the Segment Category | [optional]
-**updatedAt** | **string** | Updation UTC date-time of the segment (YYYY-MM-DDTHH:mm:ss.SSSZ) | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetSendersList.md b/docs/Model/GetSendersList.md
index 497cb2c..0b78551 100644
--- a/docs/Model/GetSendersList.md
+++ b/docs/Model/GetSendersList.md
@@ -1,10 +1,9 @@
-# GetSendersList
+# # GetSendersList
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**senders** | [**\Brevo\Client\Model\GetSendersListSenders[]**](GetSendersListSenders.md) | List of the senders available in your account | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**senders** | [**\Brevo\Client\Models\GetSendersListSendersInner[]**](GetSendersListSendersInner.md) | List of the senders available in your account | [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/GetSendersListIps.md b/docs/Model/GetSendersListIps.md
deleted file mode 100644
index 54b586d..0000000
--- a/docs/Model/GetSendersListIps.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# GetSendersListIps
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**ip** | **string** | Dedicated IP available in your account |
-**domain** | **string** | Domain of the IP |
-**weight** | **int** | Weight of the IP for this sender |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetSendersListSenders.md b/docs/Model/GetSendersListSenders.md
deleted file mode 100644
index 87c7bc1..0000000
--- a/docs/Model/GetSendersListSenders.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# GetSendersListSenders
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**id** | **int** | Id of the sender |
-**name** | **string** | From Name associated to the sender |
-**email** | **string** | From Email associated to the sender |
-**active** | **bool** | Status of sender (true=activated, false=deactivated) |
-**ips** | [**\Brevo\Client\Model\GetSendersListIps[]**](GetSendersListIps.md) | List of dedicated IP(s) available in the account. This data is displayed only for dedicated IPs | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetSendersListSendersInner.md b/docs/Model/GetSendersListSendersInner.md
new file mode 100644
index 0000000..03014f0
--- /dev/null
+++ b/docs/Model/GetSendersListSendersInner.md
@@ -0,0 +1,13 @@
+# # GetSendersListSendersInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | Id of the sender |
+**name** | **string** | From Name associated to the sender |
+**email** | **string** | From Email associated to the sender |
+**active** | **bool** | Status of sender (true=activated, false=deactivated) |
+**ips** | [**\Brevo\Client\Models\GetSendersListSendersInnerIpsInner[]**](GetSendersListSendersInnerIpsInner.md) | List of dedicated IP(s) available in the account. This data is displayed only for dedicated IPs | [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/GetSendersListSendersInnerIpsInner.md b/docs/Model/GetSendersListSendersInnerIpsInner.md
new file mode 100644
index 0000000..27071a4
--- /dev/null
+++ b/docs/Model/GetSendersListSendersInnerIpsInner.md
@@ -0,0 +1,11 @@
+# # GetSendersListSendersInnerIpsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**ip** | **string** | Dedicated IP available in your account |
+**domain** | **string** | Domain of the IP |
+**weight** | **int** | Weight of the IP for this sender |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetSharedTemplateUrl.md b/docs/Model/GetSharedTemplateUrl.md
index 5c2fba7..93c12f0 100644
--- a/docs/Model/GetSharedTemplateUrl.md
+++ b/docs/Model/GetSharedTemplateUrl.md
@@ -1,10 +1,9 @@
-# GetSharedTemplateUrl
+# # GetSharedTemplateUrl
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**sharedUrl** | **string** | A unique URL for the email campaign or transactional template. This URL can be shared with other Brevo users. |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**sharedUrl** | **string** | A unique URL for the email campaign or transactional template. This URL can be shared with other Brevo users. |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetSmsCampaign.md b/docs/Model/GetSmsCampaign.md
index 0564562..ddff123 100644
--- a/docs/Model/GetSmsCampaign.md
+++ b/docs/Model/GetSmsCampaign.md
@@ -1,17 +1,18 @@
-# GetSmsCampaign
+# # GetSmsCampaign
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **int** | ID of the SMS Campaign |
-**name** | **string** | Name of the SMS Campaign |
-**status** | **string** | Status of the SMS Campaign |
-**content** | **string** | Content of the SMS Campaign |
-**scheduledAt** | **string** | UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format | [optional]
-**sender** | **string** | Sender of the SMS Campaign |
-**createdAt** | **string** | Creation UTC date-time of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) |
-**modifiedAt** | **string** | UTC date-time of last modification of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) |
-**recipients** | **object** | |
-**statistics** | **object** | |
+**id** | **int** | ID of the SMS Campaign |
+**name** | **string** | Name of the SMS Campaign |
+**status** | **string** | Status of the SMS Campaign |
+**content** | **string** | Content of the SMS Campaign |
+**sender** | **string** | Sender of the SMS Campaign |
+**createdAt** | **string** | Creation UTC date-time of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) |
+**modifiedAt** | **string** | UTC date-time of last modification of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) |
+**recipients** | **object** | |
+**statistics** | **object** | |
+**scheduledAt** | **string** | UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format | [optional]
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.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/GetSmsCampaignOverview.md b/docs/Model/GetSmsCampaignOverview.md
index 7ad98cd..5cc5d55 100644
--- a/docs/Model/GetSmsCampaignOverview.md
+++ b/docs/Model/GetSmsCampaignOverview.md
@@ -1,17 +1,16 @@
-# GetSmsCampaignOverview
+# # GetSmsCampaignOverview
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **int** | ID of the SMS Campaign |
-**name** | **string** | Name of the SMS Campaign |
-**status** | **string** | Status of the SMS Campaign |
-**content** | **string** | Content of the SMS Campaign |
-**scheduledAt** | **string** | UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format | [optional]
-**sender** | **string** | Sender of the SMS Campaign |
-**createdAt** | **string** | Creation UTC date-time of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) |
-**modifiedAt** | **string** | UTC date-time of last modification of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**id** | **int** | ID of the SMS Campaign |
+**name** | **string** | Name of the SMS Campaign |
+**status** | **string** | Status of the SMS Campaign |
+**content** | **string** | Content of the SMS Campaign |
+**sender** | **string** | Sender of the SMS Campaign |
+**createdAt** | **string** | Creation UTC date-time of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) |
+**modifiedAt** | **string** | UTC date-time of last modification of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) |
+**scheduledAt** | **string** | UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format | [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/GetSmsCampaignRecipients.md b/docs/Model/GetSmsCampaignRecipients.md
deleted file mode 100644
index e7b5984..0000000
--- a/docs/Model/GetSmsCampaignRecipients.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# GetSmsCampaignRecipients
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetSmsCampaignStats.md b/docs/Model/GetSmsCampaignStats.md
index 9eac775..708d80e 100644
--- a/docs/Model/GetSmsCampaignStats.md
+++ b/docs/Model/GetSmsCampaignStats.md
@@ -1,16 +1,15 @@
-# GetSmsCampaignStats
+# # GetSmsCampaignStats
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**delivered** | **int** | Number of delivered SMS |
-**sent** | **int** | Number of sent SMS |
-**processing** | **int** | Number of processing SMS |
-**softBounces** | **int** | Number of softbounced SMS |
-**hardBounces** | **int** | Number of hardbounced SMS |
-**unsubscriptions** | **int** | Number of unsubscription SMS |
-**answered** | **int** | Number of replies to the SMS |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
+**delivered** | **int** | Number of delivered SMS |
+**sent** | **int** | Number of sent SMS |
+**processing** | **int** | Number of processing SMS |
+**softBounces** | **int** | Number of softbounced SMS |
+**hardBounces** | **int** | Number of hardbounced SMS |
+**unsubscriptions** | **int** | Number of unsubscription SMS |
+**answered** | **int** | Number of replies to the SMS |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetSmsCampaigns.md b/docs/Model/GetSmsCampaigns.md
index 4c7fe83..f49cfff 100644
--- a/docs/Model/GetSmsCampaigns.md
+++ b/docs/Model/GetSmsCampaigns.md
@@ -1,11 +1,10 @@
-# GetSmsCampaigns
+# # GetSmsCampaigns
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**campaigns** | **object[]** | | [optional]
-**count** | **int** | Number of SMS campaigns retrieved | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**campaigns** | [**\Brevo\Client\Models\GetSmsCampaignsCampaignsInner[]**](GetSmsCampaignsCampaignsInner.md) | | [optional]
+**count** | **int** | Number of SMS campaigns retrieved | [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/GetSmsCampaignsCampaignsInner.md b/docs/Model/GetSmsCampaignsCampaignsInner.md
new file mode 100644
index 0000000..0cd8448
--- /dev/null
+++ b/docs/Model/GetSmsCampaignsCampaignsInner.md
@@ -0,0 +1,18 @@
+# # GetSmsCampaignsCampaignsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | ID of the SMS Campaign |
+**name** | **string** | Name of the SMS Campaign |
+**status** | **string** | Status of the SMS Campaign |
+**content** | **string** | Content of the SMS Campaign |
+**sender** | **string** | Sender of the SMS Campaign |
+**createdAt** | **string** | Creation UTC date-time of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) |
+**modifiedAt** | **string** | UTC date-time of last modification of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) |
+**recipients** | [**\Brevo\Client\Models\GetCampaignRecipients**](GetCampaignRecipients.md) | |
+**statistics** | [**\Brevo\Client\Models\GetSmsCampaignStats**](GetSmsCampaignStats.md) | |
+**scheduledAt** | **string** | UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format | [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/GetSmsEventReport.md b/docs/Model/GetSmsEventReport.md
index 22ed510..1d71c70 100644
--- a/docs/Model/GetSmsEventReport.md
+++ b/docs/Model/GetSmsEventReport.md
@@ -1,10 +1,9 @@
-# GetSmsEventReport
+# # GetSmsEventReport
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**events** | [**\Brevo\Client\Model\GetSmsEventReportEvents[]**](GetSmsEventReportEvents.md) | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**events** | [**\Brevo\Client\Models\GetSmsEventReportEventsInner[]**](GetSmsEventReportEventsInner.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/GetSmsEventReportEvents.md b/docs/Model/GetSmsEventReportEvents.md
deleted file mode 100644
index 7f39afe..0000000
--- a/docs/Model/GetSmsEventReportEvents.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# GetSmsEventReportEvents
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**phoneNumber** | **string** | Phone number which has generated the event | [optional]
-**date** | **string** | UTC date-time on which the event has been generated | [optional]
-**messageId** | **string** | Message ID which generated the event | [optional]
-**event** | **string** | Event which occurred | [optional]
-**reason** | **string** | Reason of bounce (only available if the event is hardbounce or softbounce) | [optional]
-**reply** | **string** | | [optional]
-**tag** | **string** | Tag of the SMS which generated the event | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetSmsEventReportEventsInner.md b/docs/Model/GetSmsEventReportEventsInner.md
new file mode 100644
index 0000000..62e6025
--- /dev/null
+++ b/docs/Model/GetSmsEventReportEventsInner.md
@@ -0,0 +1,15 @@
+# # GetSmsEventReportEventsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**phoneNumber** | **string** | Phone number which has generated the event | [optional]
+**date** | **string** | UTC date-time on which the event has been generated | [optional]
+**messageId** | **string** | Message ID which generated the event | [optional]
+**event** | **string** | Event which occurred | [optional]
+**reason** | **string** | Reason of bounce (only available if the event is hardbounce or softbounce) | [optional]
+**reply** | **string** | | [optional]
+**tag** | **string** | Tag of the SMS which generated the event | [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/GetSmtpTemplateOverview.md b/docs/Model/GetSmtpTemplateOverview.md
index c36df71..66560e6 100644
--- a/docs/Model/GetSmtpTemplateOverview.md
+++ b/docs/Model/GetSmtpTemplateOverview.md
@@ -1,22 +1,21 @@
-# GetSmtpTemplateOverview
+# # GetSmtpTemplateOverview
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **int** | ID of the template |
-**name** | **string** | Name of the template |
-**subject** | **string** | Subject of the template |
-**isActive** | **bool** | Status of template (true=active, false=inactive) |
-**testSent** | **bool** | Status of test sending for the template (true=test email has been sent, false=test email has not been sent) |
-**sender** | [**\Brevo\Client\Model\GetSmtpTemplateOverviewSender**](GetSmtpTemplateOverviewSender.md) | |
-**replyTo** | **string** | Email defined as the \"Reply to\" for the template |
-**toField** | **string** | Customisation of the \"to\" field for the template |
-**tag** | **string** | Tag of the template |
-**htmlContent** | **string** | HTML content of the template |
-**createdAt** | **string** | Creation UTC date-time of the template (YYYY-MM-DDTHH:mm:ss.SSSZ) |
-**modifiedAt** | **string** | Last modification UTC date-time of the template (YYYY-MM-DDTHH:mm:ss.SSSZ) |
-**doiTemplate** | **bool** | It is true if template is a valid Double opt-in (DOI) template, otherwise it is false. This field will be available only in case of single template detail call. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**id** | **int** | ID of the template |
+**name** | **string** | Name of the template |
+**subject** | **string** | Subject of the template |
+**isActive** | **bool** | Status of template (true=active, false=inactive) |
+**testSent** | **bool** | Status of test sending for the template (true=test email has been sent, false=test email has not been sent) |
+**sender** | [**\Brevo\Client\Models\GetSmtpTemplateOverviewSender**](GetSmtpTemplateOverviewSender.md) | |
+**replyTo** | **string** | Email defined as the \"Reply to\" for the template |
+**toField** | **string** | Customisation of the \"to\" field for the template |
+**tag** | **string** | Tag of the template |
+**htmlContent** | **string** | HTML content of the template |
+**createdAt** | **string** | Creation UTC date-time of the template (YYYY-MM-DDTHH:mm:ss.SSSZ) |
+**modifiedAt** | **string** | Last modification UTC date-time of the template (YYYY-MM-DDTHH:mm:ss.SSSZ) |
+**doiTemplate** | **bool** | It is true if template is a valid Double opt-in (DOI) template, otherwise it is false. This field will be available only in case of single template detail call. | [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/GetSmtpTemplateOverviewSender.md b/docs/Model/GetSmtpTemplateOverviewSender.md
index 0697d2d..04f1b93 100644
--- a/docs/Model/GetSmtpTemplateOverviewSender.md
+++ b/docs/Model/GetSmtpTemplateOverviewSender.md
@@ -1,12 +1,11 @@
-# GetSmtpTemplateOverviewSender
+# # GetSmtpTemplateOverviewSender
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**name** | **string** | From email for the template | [optional]
-**email** | **string** | From email for the template | [optional]
-**id** | **string** | Sender id of the template | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**name** | **string** | From email for the template | [optional]
+**email** | **string** | From email for the template | [optional]
+**id** | **string** | Sender id of the template | [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/GetSmtpTemplates.md b/docs/Model/GetSmtpTemplates.md
index 2e0768f..3217aa1 100644
--- a/docs/Model/GetSmtpTemplates.md
+++ b/docs/Model/GetSmtpTemplates.md
@@ -1,11 +1,10 @@
-# GetSmtpTemplates
+# # GetSmtpTemplates
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**count** | **int** | Count of transactional email templates | [optional]
-**templates** | [**\Brevo\Client\Model\GetSmtpTemplateOverview[]**](GetSmtpTemplateOverview.md) | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**count** | **int** | Count of transactional email templates | [optional]
+**templates** | [**\Brevo\Client\Models\GetSmtpTemplateOverview[]**](GetSmtpTemplateOverview.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/GetSsoToken.md b/docs/Model/GetSsoToken.md
index fba745a..3b6e9e9 100644
--- a/docs/Model/GetSsoToken.md
+++ b/docs/Model/GetSsoToken.md
@@ -1,10 +1,9 @@
-# GetSsoToken
+# # GetSsoToken
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**token** | **string** | Session token, it will remain valid for 15 days. |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**token** | **string** | Session token, it will remain valid for 15 days. |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetStatsByBrowser.md b/docs/Model/GetStatsByBrowser.md
deleted file mode 100644
index 0a34adc..0000000
--- a/docs/Model/GetStatsByBrowser.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# GetStatsByBrowser
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetStatsByDevice.md b/docs/Model/GetStatsByDevice.md
index d773be8..d3d447d 100644
--- a/docs/Model/GetStatsByDevice.md
+++ b/docs/Model/GetStatsByDevice.md
@@ -1,13 +1,12 @@
-# GetStatsByDevice
+# # GetStatsByDevice
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**desktop** | [**map[string,\Brevo\Client\Model\GetDeviceBrowserStats]**](GetDeviceBrowserStats.md) | Statistics of the campaign on the basis of desktop devices | [optional]
-**mobile** | [**map[string,\Brevo\Client\Model\GetDeviceBrowserStats]**](GetDeviceBrowserStats.md) | Statistics of the campaign on the basis of mobile devices | [optional]
-**tablet** | [**map[string,\Brevo\Client\Model\GetDeviceBrowserStats]**](GetDeviceBrowserStats.md) | Statistics of the campaign on the basis of tablet devices | [optional]
-**unknown** | [**map[string,\Brevo\Client\Model\GetDeviceBrowserStats]**](GetDeviceBrowserStats.md) | Statistics of the campaign on the basis of unknown devices | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**desktop** | [**array**](GetDeviceBrowserStats.md) | Statistics of the campaign on the basis of desktop devices | [optional]
+**mobile** | [**array**](GetDeviceBrowserStats.md) | Statistics of the campaign on the basis of mobile devices | [optional]
+**tablet** | [**array**](GetDeviceBrowserStats.md) | Statistics of the campaign on the basis of tablet devices | [optional]
+**unknown** | [**array**](GetDeviceBrowserStats.md) | Statistics of the campaign on the basis of unknown devices | [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/GetStatsByDomain.md b/docs/Model/GetStatsByDomain.md
deleted file mode 100644
index e43475a..0000000
--- a/docs/Model/GetStatsByDomain.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# GetStatsByDomain
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetSubAccountGroups200ResponseInner.md b/docs/Model/GetSubAccountGroups200ResponseInner.md
new file mode 100644
index 0000000..9ecb1a5
--- /dev/null
+++ b/docs/Model/GetSubAccountGroups200ResponseInner.md
@@ -0,0 +1,10 @@
+# # GetSubAccountGroups200ResponseInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | Unique id of the group | [optional]
+**groupName** | **string** | The name of the group of sub-accounts | [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/GetSubscriptionInfoResponse.md b/docs/Model/GetSubscriptionInfoResponse.md
new file mode 100644
index 0000000..7afaaba
--- /dev/null
+++ b/docs/Model/GetSubscriptionInfoResponse.md
@@ -0,0 +1,12 @@
+# # GetSubscriptionInfoResponse
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**balance** | [**\Brevo\Client\Models\GetSubscriptionInfoResponseBalance**](GetSubscriptionInfoResponseBalance.md) | | [optional]
+**tier** | [**\Brevo\Client\Models\GetSubscriptionInfoResponseTierInner[]**](GetSubscriptionInfoResponseTierInner.md) | Tier Information | [optional]
+**members** | [**\Brevo\Client\Models\GetSubscriptionInfoResponseMembersInner[]**](GetSubscriptionInfoResponseMembersInner.md) | Subscription Member Information | [optional]
+**reward** | [**\Brevo\Client\Models\GetSubscriptionInfoResponseRewardInner[]**](GetSubscriptionInfoResponseRewardInner.md) | Reward Information | [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/GetSubscriptionInfoResponseBalance.md b/docs/Model/GetSubscriptionInfoResponseBalance.md
new file mode 100644
index 0000000..2e02f38
--- /dev/null
+++ b/docs/Model/GetSubscriptionInfoResponseBalance.md
@@ -0,0 +1,11 @@
+# # GetSubscriptionInfoResponseBalance
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**loyaltyProgramId** | **string** | Loyalty Program Id | [optional]
+**contactId** | **int** | one of contact id or loyalty subscription id is required | [optional]
+**balances** | [**\Brevo\Client\Models\GetSubscriptionInfoResponseBalanceBalancesInner[]**](GetSubscriptionInfoResponseBalanceBalancesInner.md) | Balances | [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/GetSubscriptionInfoResponseBalanceBalancesInner.md b/docs/Model/GetSubscriptionInfoResponseBalanceBalancesInner.md
new file mode 100644
index 0000000..89241e4
--- /dev/null
+++ b/docs/Model/GetSubscriptionInfoResponseBalanceBalancesInner.md
@@ -0,0 +1,10 @@
+# # GetSubscriptionInfoResponseBalanceBalancesInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**balanceDefinitionId** | **string** | Balance Definition Id | [optional]
+**value** | **int** | Value | [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/GetSubscriptionInfoResponseMembersInner.md b/docs/Model/GetSubscriptionInfoResponseMembersInner.md
new file mode 100644
index 0000000..22f1037
--- /dev/null
+++ b/docs/Model/GetSubscriptionInfoResponseMembersInner.md
@@ -0,0 +1,11 @@
+# # GetSubscriptionInfoResponseMembersInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**memberContactId** | **int** | Member Contact Id | [optional]
+**createdAt** | **\DateTime** | Member creation date | [optional]
+**updatedAt** | **\DateTime** | Member last modification date | [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/GetSubscriptionInfoResponseRewardInner.md b/docs/Model/GetSubscriptionInfoResponseRewardInner.md
new file mode 100644
index 0000000..31e13b3
--- /dev/null
+++ b/docs/Model/GetSubscriptionInfoResponseRewardInner.md
@@ -0,0 +1,14 @@
+# # GetSubscriptionInfoResponseRewardInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | Reward Id | [optional]
+**rewardId** | **string** | Reward Id | [optional]
+**loyaltyProgramId** | **string** | Loyalty Program Id | [optional]
+**contactId** | **int** | Contact Id | [optional]
+**code** | **string** | Reward Code | [optional]
+**expirationDate** | **\DateTime** | Reward expiration date | [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/GetSubscriptionInfoResponseTierInner.md b/docs/Model/GetSubscriptionInfoResponseTierInner.md
new file mode 100644
index 0000000..3edb0ab
--- /dev/null
+++ b/docs/Model/GetSubscriptionInfoResponseTierInner.md
@@ -0,0 +1,14 @@
+# # GetSubscriptionInfoResponseTierInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**tierId** | **string** | Tier Id | [optional]
+**loyaltyProgramId** | **string** | Loyalty Program Id | [optional]
+**contactId** | **int** | Contact Id | [optional]
+**groupId** | **string** | Group Id | [optional]
+**createdAt** | **\DateTime** | Tier creation date | [optional]
+**updatedAt** | **\DateTime** | Tier last modification date | [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/GetSubscriptionMemberResponse.md b/docs/Model/GetSubscriptionMemberResponse.md
new file mode 100644
index 0000000..55c8703
--- /dev/null
+++ b/docs/Model/GetSubscriptionMemberResponse.md
@@ -0,0 +1,15 @@
+# # GetSubscriptionMemberResponse
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**organizationId** | **int** | Organization Id | [optional]
+**loyaltyProgramId** | **string** | Loyalty Program Id | [optional]
+**versionId** | **int** | Version Id | [optional]
+**memberContactId** | [**\Brevo\Client\Models\GetSubscriptionMemberResponseMemberContactIdInner[]**](GetSubscriptionMemberResponseMemberContactIdInner.md) | | [optional]
+**loyaltySubscriptionId** | **string** | Client Reference | [optional]
+**createdAt** | **\DateTime** | Subscription creation date | [optional]
+**updatedAt** | **\DateTime** | Subscription last modification date | [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/GetSubscriptionMemberResponseMemberContactIdInner.md b/docs/Model/GetSubscriptionMemberResponseMemberContactIdInner.md
new file mode 100644
index 0000000..54426b3
--- /dev/null
+++ b/docs/Model/GetSubscriptionMemberResponseMemberContactIdInner.md
@@ -0,0 +1,11 @@
+# # GetSubscriptionMemberResponseMemberContactIdInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**memberContactId** | **string[]** | | [optional]
+**createdAt** | **\DateTime** | | [optional]
+**updatedAt** | **\DateTime** | | [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/GetTransacAggregatedSmsReport.md b/docs/Model/GetTransacAggregatedSmsReport.md
index 6340c97..5c949de 100644
--- a/docs/Model/GetTransacAggregatedSmsReport.md
+++ b/docs/Model/GetTransacAggregatedSmsReport.md
@@ -1,19 +1,19 @@
-# GetTransacAggregatedSmsReport
+# # GetTransacAggregatedSmsReport
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**range** | **string** | Time frame of the report | [optional]
-**requests** | **int** | Number of requests for the timeframe | [optional]
-**delivered** | **int** | Number of delivered SMS for the timeframe | [optional]
-**hardBounces** | **int** | Number of hardbounces for the timeframe | [optional]
-**softBounces** | **int** | Number of softbounces for the timeframe | [optional]
-**blocked** | **int** | Number of blocked contact for the timeframe | [optional]
-**unsubscribed** | **int** | Number of unsubscription for the timeframe | [optional]
-**replied** | **int** | Number of answered SMS for the timeframe | [optional]
-**accepted** | **int** | Number of accepted for the timeframe | [optional]
-**rejected** | **int** | Number of rejected for the timeframe | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**range** | **string** | Time frame of the report | [optional]
+**requests** | **int** | Number of requests for the timeframe | [optional]
+**delivered** | **int** | Number of delivered SMS for the timeframe | [optional]
+**hardBounces** | **int** | Number of hardbounces for the timeframe | [optional]
+**softBounces** | **int** | Number of softbounces for the timeframe | [optional]
+**blocked** | **int** | Number of blocked contact for the timeframe | [optional]
+**unsubscribed** | **int** | Number of unsubscription for the timeframe | [optional]
+**replied** | **int** | Number of answered SMS for the timeframe | [optional]
+**accepted** | **int** | Number of accepted SMS for the timeframe | [optional]
+**rejected** | **int** | Number of rejected SMS for the timeframe | [optional]
+**skipped** | **int** | Number of skipped SMS for the timeframe | [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/GetTransacBlockedContacts.md b/docs/Model/GetTransacBlockedContacts.md
index 6992b2e..138f084 100644
--- a/docs/Model/GetTransacBlockedContacts.md
+++ b/docs/Model/GetTransacBlockedContacts.md
@@ -1,11 +1,10 @@
-# GetTransacBlockedContacts
+# # GetTransacBlockedContacts
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**count** | **int** | Count of blocked or unsubscribed contact | [optional]
-**contacts** | [**\Brevo\Client\Model\GetTransacBlockedContactsContacts[]**](GetTransacBlockedContactsContacts.md) | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**count** | **int** | Count of blocked or unsubscribed contact | [optional]
+**contacts** | [**\Brevo\Client\Models\GetTransacBlockedContactsContactsInner[]**](GetTransacBlockedContactsContactsInner.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/GetTransacBlockedContactsContacts.md b/docs/Model/GetTransacBlockedContactsContacts.md
deleted file mode 100644
index 7973ffd..0000000
--- a/docs/Model/GetTransacBlockedContactsContacts.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# GetTransacBlockedContactsContacts
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**email** | **string** | Email address of the blocked or unsubscribed contact |
-**senderEmail** | **string** | Sender email address of the blocked or unsubscribed contact |
-**reason** | [**\Brevo\Client\Model\GetTransacBlockedContactsReason**](GetTransacBlockedContactsReason.md) | |
-**blockedAt** | **string** | Date when the contact was blocked or unsubscribed on |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetTransacBlockedContactsContactsInner.md b/docs/Model/GetTransacBlockedContactsContactsInner.md
new file mode 100644
index 0000000..1dd4dfc
--- /dev/null
+++ b/docs/Model/GetTransacBlockedContactsContactsInner.md
@@ -0,0 +1,12 @@
+# # GetTransacBlockedContactsContactsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**email** | **string** | Email address of the blocked or unsubscribed contact |
+**senderEmail** | **string** | Sender email address of the blocked or unsubscribed contact |
+**reason** | [**\Brevo\Client\Models\GetTransacBlockedContactsContactsInnerReason**](GetTransacBlockedContactsContactsInnerReason.md) | |
+**blockedAt** | **string** | Date when the contact was blocked or unsubscribed on |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetTransacBlockedContactsContactsInnerReason.md b/docs/Model/GetTransacBlockedContactsContactsInnerReason.md
new file mode 100644
index 0000000..71c5336
--- /dev/null
+++ b/docs/Model/GetTransacBlockedContactsContactsInnerReason.md
@@ -0,0 +1,10 @@
+# # GetTransacBlockedContactsContactsInnerReason
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**code** | **string** | Reason code for blocking / unsubscribing (This code is safe for comparison) | [optional]
+**message** | **string** | Reason for blocking / unsubscribing (This string is not safe for comparison) | [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/GetTransacBlockedContactsReason.md b/docs/Model/GetTransacBlockedContactsReason.md
deleted file mode 100644
index c525de4..0000000
--- a/docs/Model/GetTransacBlockedContactsReason.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# GetTransacBlockedContactsReason
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**code** | **string** | Reason code for blocking / unsubscribing (This code is safe for comparison) | [optional]
-**message** | **string** | Reason for blocking / unsubscribing (This string is not safe for comparison) | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetTransacEmailContent.md b/docs/Model/GetTransacEmailContent.md
index 1a8e032..9041dbe 100644
--- a/docs/Model/GetTransacEmailContent.md
+++ b/docs/Model/GetTransacEmailContent.md
@@ -1,16 +1,15 @@
-# GetTransacEmailContent
+# # GetTransacEmailContent
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**email** | **string** | Email address to which transactional email has been sent |
-**subject** | **string** | Subject of the sent email |
-**templateId** | **int** | Id of the template | [optional]
-**date** | **string** | Date on which transactional email was sent |
-**events** | [**\Brevo\Client\Model\GetTransacEmailContentEvents[]**](GetTransacEmailContentEvents.md) | Series of events which occurred on the transactional email |
-**body** | **string** | Actual content of the transactional email that has been sent |
-**attachmentCount** | **int** | Count of the attachments that were sent in the email |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
+**email** | **string** | Email address to which transactional email has been sent |
+**subject** | **string** | Subject of the sent email |
+**date** | **string** | Date on which transactional email was sent |
+**events** | [**\Brevo\Client\Models\GetTransacEmailContentEventsInner[]**](GetTransacEmailContentEventsInner.md) | Series of events which occurred on the transactional email |
+**body** | **string** | Actual content of the transactional email that has been sent |
+**attachmentCount** | **int** | Count of the attachments that were sent in the email |
+**templateId** | **int** | Id of the template | [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/GetTransacEmailContentEvents.md b/docs/Model/GetTransacEmailContentEvents.md
deleted file mode 100644
index 482ee09..0000000
--- a/docs/Model/GetTransacEmailContentEvents.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# GetTransacEmailContentEvents
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**name** | **string** | Name of the event that occurred on the sent email |
-**time** | **string** | Time at which the event occurred |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetTransacEmailContentEventsInner.md b/docs/Model/GetTransacEmailContentEventsInner.md
new file mode 100644
index 0000000..f31ffe5
--- /dev/null
+++ b/docs/Model/GetTransacEmailContentEventsInner.md
@@ -0,0 +1,10 @@
+# # GetTransacEmailContentEventsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | Name of the event that occurred on the sent email |
+**time** | **string** | Time at which the event occurred |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetTransacEmailsList.md b/docs/Model/GetTransacEmailsList.md
index d84f4c5..9092ceb 100644
--- a/docs/Model/GetTransacEmailsList.md
+++ b/docs/Model/GetTransacEmailsList.md
@@ -1,11 +1,10 @@
-# GetTransacEmailsList
+# # GetTransacEmailsList
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**count** | **int** | Total number of transactional emails available on your account according to the passed filter | [optional]
-**transactionalEmails** | [**\Brevo\Client\Model\GetTransacEmailsListTransactionalEmails[]**](GetTransacEmailsListTransactionalEmails.md) | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**count** | **int** | Total number of transactional emails available on your account according to the passed filter | [optional]
+**transactionalEmails** | [**\Brevo\Client\Models\GetTransacEmailsListTransactionalEmailsInner[]**](GetTransacEmailsListTransactionalEmailsInner.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/GetTransacEmailsListTransactionalEmails.md b/docs/Model/GetTransacEmailsListTransactionalEmails.md
deleted file mode 100644
index e6c736a..0000000
--- a/docs/Model/GetTransacEmailsListTransactionalEmails.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# GetTransacEmailsListTransactionalEmails
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**email** | **string** | Email address to which transactional email has been sent |
-**subject** | **string** | Subject of the sent email |
-**templateId** | **int** | Id of the template | [optional]
-**messageId** | **string** | Message Id of the sent email |
-**uuid** | **string** | Unique id of the email sent to a particular contact |
-**date** | **string** | Date on which transactional email was sent |
-**from** | **string** | Email address of the sender from which the email was sent | [optional]
-**tags** | **string[]** | Tags used for your email | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetTransacEmailsListTransactionalEmailsInner.md b/docs/Model/GetTransacEmailsListTransactionalEmailsInner.md
new file mode 100644
index 0000000..9fdff11
--- /dev/null
+++ b/docs/Model/GetTransacEmailsListTransactionalEmailsInner.md
@@ -0,0 +1,16 @@
+# # GetTransacEmailsListTransactionalEmailsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**email** | **string** | Email address to which transactional email has been sent |
+**subject** | **string** | Subject of the sent email |
+**messageId** | **string** | Message Id of the sent email |
+**uuid** | **string** | Unique id of the email sent to a particular contact |
+**date** | **string** | Date on which transactional email was sent |
+**templateId** | **int** | Id of the template | [optional]
+**from** | **string** | Email address of the sender from which the email was sent | [optional]
+**tags** | **string[]** | Tags used for your email | [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/GetTransacSmsReport.md b/docs/Model/GetTransacSmsReport.md
index 4d183ef..610e195 100644
--- a/docs/Model/GetTransacSmsReport.md
+++ b/docs/Model/GetTransacSmsReport.md
@@ -1,10 +1,9 @@
-# GetTransacSmsReport
+# # GetTransacSmsReport
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**reports** | [**\Brevo\Client\Model\GetTransacSmsReportReports[]**](GetTransacSmsReportReports.md) | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**reports** | [**\Brevo\Client\Models\GetTransacSmsReportReportsInner[]**](GetTransacSmsReportReportsInner.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/GetTransacSmsReportReports.md b/docs/Model/GetTransacSmsReportReports.md
deleted file mode 100644
index 2dc03a5..0000000
--- a/docs/Model/GetTransacSmsReportReports.md
+++ /dev/null
@@ -1,19 +0,0 @@
-# GetTransacSmsReportReports
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**date** | [**\DateTime**] | Date for which statistics are retrieved | [optional]
-**requests** | **int** | Number of requests for the date | [optional]
-**delivered** | **int** | Number of delivered SMS for the date | [optional]
-**hardBounces** | **int** | Number of hardbounces for the date | [optional]
-**softBounces** | **int** | Number of softbounces for the date | [optional]
-**blocked** | **int** | Number of blocked contact for the date | [optional]
-**unsubscribed** | **int** | Number of unsubscription for the date | [optional]
-**replied** | **int** | Number of answered SMS for the date | [optional]
-**accepted** | **int** | Number of accepted for the date | [optional]
-**rejected** | **int** | Number of rejected for the date | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetTransacSmsReportReportsInner.md b/docs/Model/GetTransacSmsReportReportsInner.md
new file mode 100644
index 0000000..17c0691
--- /dev/null
+++ b/docs/Model/GetTransacSmsReportReportsInner.md
@@ -0,0 +1,19 @@
+# # GetTransacSmsReportReportsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**date** | **\DateTime** | Date for which statistics are retrieved | [optional]
+**requests** | **int** | Number of requests for the date | [optional]
+**delivered** | **int** | Number of delivered SMS for the date | [optional]
+**hardBounces** | **int** | Number of hardbounces for the date | [optional]
+**softBounces** | **int** | Number of softbounces for the date | [optional]
+**blocked** | **int** | Number of blocked contact for the date | [optional]
+**unsubscribed** | **int** | Number of unsubscription for the date | [optional]
+**replied** | **int** | Number of answered SMS for the date | [optional]
+**accepted** | **int** | Number of accepted SMS for the date | [optional]
+**rejected** | **int** | Number of rejected SMS for the date | [optional]
+**skipped** | **int** | Number of skipped SMS for the date | [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/GetUserPermission.md b/docs/Model/GetUserPermission.md
index 1c12c00..4f7fce1 100644
--- a/docs/Model/GetUserPermission.md
+++ b/docs/Model/GetUserPermission.md
@@ -1,12 +1,11 @@
-# GetUserPermission
+# # GetUserPermission
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**email** | **string** | Email address of the user. |
-**status** | **string** | Status of the invited user. |
-**privileges** | [**\Brevo\Client\Model\GetUserPermissionPrivileges[]**](GetUserPermissionPrivileges.md) | Granular feature permissions given to the user. |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**email** | **string** | Email address of the user. |
+**status** | **string** | Status of the invited user. |
+**privileges** | [**\Brevo\Client\Models\GetUserPermissionPrivilegesInner[]**](GetUserPermissionPrivilegesInner.md) | Granular feature permissions given to the user. |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/GetUserPermissionPrivileges.md b/docs/Model/GetUserPermissionPrivileges.md
deleted file mode 100644
index fec8fa9..0000000
--- a/docs/Model/GetUserPermissionPrivileges.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# GetUserPermissionPrivileges
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**feature** | **string** | |
-**permissions** | **string[]** | |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetUserPermissionPrivilegesInner.md b/docs/Model/GetUserPermissionPrivilegesInner.md
new file mode 100644
index 0000000..f98fb41
--- /dev/null
+++ b/docs/Model/GetUserPermissionPrivilegesInner.md
@@ -0,0 +1,10 @@
+# # GetUserPermissionPrivilegesInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**feature** | **string** | |
+**permissions** | **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/GetVersionInfoResponse.md b/docs/Model/GetVersionInfoResponse.md
new file mode 100644
index 0000000..fc14eed
--- /dev/null
+++ b/docs/Model/GetVersionInfoResponse.md
@@ -0,0 +1,11 @@
+# # GetVersionInfoResponse
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**active** | [**\Brevo\Client\Models\VersionInfo[]**](VersionInfo.md) | Active Version Information | [optional]
+**draft** | [**\Brevo\Client\Models\VersionInfo[]**](VersionInfo.md) | Draft Version Information | [optional]
+**inactive** | [**\Brevo\Client\Models\VersionInfo[]**](VersionInfo.md) | Inactive Version Information | [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/GetWATemplates.md b/docs/Model/GetWATemplates.md
deleted file mode 100644
index 4bca939..0000000
--- a/docs/Model/GetWATemplates.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# GetWATemplates
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**templates** | [**\Brevo\Client\Model\GetWATemplatesTemplates[]**](GetWATemplatesTemplates.md) | |
-**count** | **int** | Number of whatsApp templates retrived |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetWATemplatesTemplates.md b/docs/Model/GetWATemplatesTemplates.md
deleted file mode 100644
index c088064..0000000
--- a/docs/Model/GetWATemplatesTemplates.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# GetWATemplatesTemplates
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**id** | **string** | id of the template |
-**name** | **string** | Name of the WhatsApp template |
-**status** | **string** | Status of the WhatsApp template |
-**language** | **string** | Language in which template exists |
-**category** | **string** | category of the template |
-**errorReason** | **string** | Error reason in the template creation | [optional]
-**createdAt** | **string** | Creation UTC date-time of the whatsApp template (YYYY-MM-DDTHH:mm:ss.SSSZ) |
-**modifiedAt** | **string** | UTC date-time of last modification of the whatsApp template (YYYY-MM-DDTHH:mm:ss.SSSZ) |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetWebhook.md b/docs/Model/GetWebhook.md
index 883bc89..1eda5b9 100644
--- a/docs/Model/GetWebhook.md
+++ b/docs/Model/GetWebhook.md
@@ -1,19 +1,18 @@
-# GetWebhook
+# # GetWebhook
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**url** | **string** | URL of the webhook |
-**id** | **int** | ID of the webhook |
-**description** | **string** | Description of the webhook |
-**events** | **string[]** | |
-**type** | **string** | Type of webhook (marketing or transactional) |
-**createdAt** | **string** | Creation UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ) |
-**modifiedAt** | **string** | Last modification UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ) |
-**batched** | **bool** | To send batched webhooks | [optional]
-**auth** | [**\Brevo\Client\Model\GetWebhookAuth**](GetWebhookAuth.md) | | [optional]
-**headers** | [**\Brevo\Client\Model\GetWebhookHeaders[]**](GetWebhookHeaders.md) | Custom headers to be send with webhooks | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**url** | **string** | URL of the webhook |
+**id** | **int** | ID of the webhook |
+**description** | **string** | Description of the webhook |
+**events** | **string[]** | |
+**type** | **string** | Type of webhook (marketing or transactional) |
+**createdAt** | **string** | Creation UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ) |
+**modifiedAt** | **string** | Last modification UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ) |
+**batched** | **bool** | Batching configuration of the webhook, we send batched webhooks if its true | [optional]
+**auth** | **object** | Authentication header to be send with the webhook requests | [optional]
+**headers** | **object[]** | | [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/GetWebhookAuth.md b/docs/Model/GetWebhookAuth.md
deleted file mode 100644
index e7d208e..0000000
--- a/docs/Model/GetWebhookAuth.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# GetWebhookAuth
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**type** | **string** | Type of authentication | [optional]
-**token** | **string** | Webhook authentication token | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetWebhookHeaders.md b/docs/Model/GetWebhookHeaders.md
deleted file mode 100644
index 29a524c..0000000
--- a/docs/Model/GetWebhookHeaders.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# GetWebhookHeaders
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**key** | **string** | Header key name | [optional]
-**value** | **string** | Header value | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetWebhooks.md b/docs/Model/GetWebhooks.md
index e5d8eb5..b94abe7 100644
--- a/docs/Model/GetWebhooks.md
+++ b/docs/Model/GetWebhooks.md
@@ -1,10 +1,9 @@
-# GetWebhooks
+# # GetWebhooks
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**webhooks** | **object[]** | |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**webhooks** | [**GetWebhook[]**](GetWebhook.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/GetWhatsAppConfig.md b/docs/Model/GetWhatsAppConfig.md
index af90628..14a9e7f 100644
--- a/docs/Model/GetWhatsAppConfig.md
+++ b/docs/Model/GetWhatsAppConfig.md
@@ -1,15 +1,14 @@
-# GetWhatsAppConfig
+# # GetWhatsAppConfig
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**whatsappBusinessAccountId** | **string** | Id of the WhatsApp business account | [optional]
-**sendingLimit** | **string** | Sending limit Information of the WhatsApp API account | [optional]
-**phoneNumberQuality** | **string** | Quality status of phone number associated with WhatsApp account. There are three quality ratings. example - **High (GREEN) , Medium (YELLOW) and Low(RED)** | [optional]
-**whatsappBusinessAccountStatus** | **string** | Status information related to WhatsApp Api account | [optional]
-**businessStatus** | **string** | Verification status information of the Business account | [optional]
-**phoneNumberNameStatus** | **string** | Status of the name associated with WhatsApp Phone number | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
+**whatsappBusinessAccountId** | **string** | Id of the WhatsApp business account | [optional]
+**sendingLimit** | **string** | Sending limit Information of the WhatsApp API account | [optional]
+**phoneNumberQuality** | **string** | Quality status of phone number associated with WhatsApp account. There are three quality ratings. example - **High (GREEN) , Medium (YELLOW) and Low(RED)** | [optional]
+**whatsappBusinessAccountStatus** | **string** | Status information related to WhatsApp API account | [optional]
+**businessStatus** | **string** | Verification status information of the Business account | [optional]
+**phoneNumberNameStatus** | **string** | Status of the name associated with WhatsApp Phone number | [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/GetWhatsappCampaignOverview.md b/docs/Model/GetWhatsappCampaignOverview.md
index 9251b7d..86be2ca 100644
--- a/docs/Model/GetWhatsappCampaignOverview.md
+++ b/docs/Model/GetWhatsappCampaignOverview.md
@@ -1,18 +1,17 @@
-# GetWhatsappCampaignOverview
+# # GetWhatsappCampaignOverview
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **int** | ID of the WhatsApp Campaign |
-**campaignName** | **string** | Name of the WhatsApp Campaign |
-**campaignStatus** | **string** | Status of the WhatsApp Campaign |
-**scheduledAt** | **string** | UTC date-time on which WhatsApp campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format | [optional]
-**senderNumber** | **string** | Sender of the WhatsApp Campaign |
-**stats** | [**\Brevo\Client\Model\WhatsappCampStats**](WhatsappCampStats.md) | | [optional]
-**template** | [**\Brevo\Client\Model\WhatsappCampTemplate**](WhatsappCampTemplate.md) | |
-**createdAt** | **string** | Creation UTC date-time of the WhatsApp campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) |
-**modifiedAt** | **string** | UTC date-time of last modification of the WhatsApp campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**id** | **int** | ID of the WhatsApp Campaign |
+**campaignName** | **string** | Name of the WhatsApp Campaign |
+**campaignStatus** | **string** | Status of the WhatsApp Campaign |
+**senderNumber** | **string** | Sender of the WhatsApp Campaign |
+**template** | [**\Brevo\Client\Models\WhatsappCampTemplate**](WhatsappCampTemplate.md) | |
+**createdAt** | **string** | Creation UTC date-time of the WhatsApp campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) |
+**modifiedAt** | **string** | UTC date-time of last modification of the WhatsApp campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) |
+**scheduledAt** | **string** | UTC date-time on which WhatsApp campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format | [optional]
+**stats** | [**\Brevo\Client\Models\WhatsappCampStats**](WhatsappCampStats.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/GetWhatsappCampaigns.md b/docs/Model/GetWhatsappCampaigns.md
index b9cf310..9f84cce 100644
--- a/docs/Model/GetWhatsappCampaigns.md
+++ b/docs/Model/GetWhatsappCampaigns.md
@@ -1,11 +1,10 @@
-# GetWhatsappCampaigns
+# # GetWhatsappCampaigns
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**campaigns** | [**\Brevo\Client\Model\GetWhatsappCampaignsCampaigns[]**](GetWhatsappCampaignsCampaigns.md) | | [optional]
-**count** | **int** | Number of WhatsApp campaigns retrived | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**campaigns** | [**\Brevo\Client\Models\GetWhatsappCampaignsCampaignsInner[]**](GetWhatsappCampaignsCampaignsInner.md) | | [optional]
+**count** | **int** | Number of WhatsApp campaigns retrieved | [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/GetWhatsappCampaignsCampaigns.md b/docs/Model/GetWhatsappCampaignsCampaigns.md
deleted file mode 100644
index c1a7421..0000000
--- a/docs/Model/GetWhatsappCampaignsCampaigns.md
+++ /dev/null
@@ -1,20 +0,0 @@
-# GetWhatsappCampaignsCampaigns
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**id** | **int** | ID of the WhatsApp Campaign |
-**campaignName** | **string** | Name of the WhatsApp Campaign |
-**templateId** | **string** | Id of the WhatsApp template |
-**campaignStatus** | **string** | Status of the WhatsApp Campaign |
-**scheduledAt** | **string** | UTC date-time on which WhatsApp campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format |
-**errorReason** | **string** | Error reason in the campaign creation | [optional]
-**invalidatedContacts** | **int** | Count of invalidated contacts | [optional]
-**readPercentage** | **float** | Read percentage of the the WhatsApp campaign created | [optional]
-**stats** | [**\Brevo\Client\Model\WhatsappCampStats**](WhatsappCampStats.md) | | [optional]
-**createdAt** | **string** | Creation UTC date-time of the WhatsApp campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) |
-**modifiedAt** | **string** | UTC date-time of last modification of the whatsapp template (YYYY-MM-DDTHH:mm:ss.SSSZ) |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetWhatsappCampaignsCampaignsInner.md b/docs/Model/GetWhatsappCampaignsCampaignsInner.md
new file mode 100644
index 0000000..ae8e5a7
--- /dev/null
+++ b/docs/Model/GetWhatsappCampaignsCampaignsInner.md
@@ -0,0 +1,19 @@
+# # GetWhatsappCampaignsCampaignsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | ID of the WhatsApp Campaign |
+**campaignName** | **string** | Name of the WhatsApp Campaign |
+**templateId** | **string** | Id of the WhatsApp template |
+**campaignStatus** | **string** | Status of the WhatsApp Campaign |
+**scheduledAt** | **string** | UTC date-time on which WhatsApp campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format |
+**createdAt** | **string** | Creation UTC date-time of the WhatsApp template (YYYY-MM-DDTHH:mm:ss.SSSZ) |
+**modifiedAt** | **string** | UTC date-time of last modification of the WhatsApp template (YYYY-MM-DDTHH:mm:ss.SSSZ) |
+**errorReason** | **string** | Error Reason associated with the WhatsApp campaign sending | [optional]
+**invalidatedContacts** | **int** | Count of invalidated contacts | [optional]
+**readPercentage** | **float** | Read percentage of the the WhatsApp campaign created | [optional]
+**stats** | [**\Brevo\Client\Models\WhatsappCampStats**](WhatsappCampStats.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/GetWhatsappEventReport.md b/docs/Model/GetWhatsappEventReport.md
index f99423c..27c081b 100644
--- a/docs/Model/GetWhatsappEventReport.md
+++ b/docs/Model/GetWhatsappEventReport.md
@@ -1,10 +1,9 @@
-# GetWhatsappEventReport
+# # GetWhatsappEventReport
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**events** | [**\Brevo\Client\Model\GetWhatsappEventReportEvents[]**](GetWhatsappEventReportEvents.md) | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**events** | [**\Brevo\Client\Models\GetWhatsappEventReportEventsInner[]**](GetWhatsappEventReportEventsInner.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/GetWhatsappEventReportEvents.md b/docs/Model/GetWhatsappEventReportEvents.md
deleted file mode 100644
index 5474772..0000000
--- a/docs/Model/GetWhatsappEventReportEvents.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# GetWhatsappEventReportEvents
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**contactNumber** | **string** | WhatsApp Number with country code. Example, 85264318721 |
-**date** | **string** | UTC date-time on which the event has been generated |
-**messageId** | **string** | Message ID which generated the event |
-**event** | **string** | Event which occurred |
-**reason** | **string** | Reason for the event (will be there in case of `error` and `soft-bounce` events) | [optional]
-**body** | **string** | Text of the reply (will be there only in case of `reply` event with text) | [optional]
-**mediaUrl** | **string** | Url of the media reply (will be there only in case of `reply` event with media) | [optional]
-**senderNumber** | **string** | WhatsApp Number with country code. Example, 85264318721 |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/GetWhatsappEventReportEventsInner.md b/docs/Model/GetWhatsappEventReportEventsInner.md
new file mode 100644
index 0000000..d8a481e
--- /dev/null
+++ b/docs/Model/GetWhatsappEventReportEventsInner.md
@@ -0,0 +1,16 @@
+# # GetWhatsappEventReportEventsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**contactNumber** | **string** | WhatsApp Number with country code. Example, 85264318721 |
+**date** | **string** | UTC date-time on which the event has been generated |
+**messageId** | **string** | Message ID which generated the event |
+**event** | **string** | Event which occurred |
+**senderNumber** | **string** | WhatsApp Number with country code. Example, 85264318721 |
+**reason** | **string** | Reason for the event (will be there in case of `error` and `soft-bounce` events) | [optional]
+**body** | **string** | Text of the reply (will be there only in case of `reply` event with text) | [optional]
+**mediaUrl** | **string** | Url of the media reply (will be there only in case of `reply` event with media) | [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/GetWhatsappTemplates.md b/docs/Model/GetWhatsappTemplates.md
new file mode 100644
index 0000000..54388d3
--- /dev/null
+++ b/docs/Model/GetWhatsappTemplates.md
@@ -0,0 +1,10 @@
+# # GetWhatsappTemplates
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**templates** | [**\Brevo\Client\Models\GetWhatsappTemplatesTemplatesInner[]**](GetWhatsappTemplatesTemplatesInner.md) | | [optional]
+**count** | **int** | Number of WhatsApp templates retrieved | [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/GetWhatsappTemplatesTemplatesInner.md b/docs/Model/GetWhatsappTemplatesTemplatesInner.md
new file mode 100644
index 0000000..634d199
--- /dev/null
+++ b/docs/Model/GetWhatsappTemplatesTemplatesInner.md
@@ -0,0 +1,16 @@
+# # GetWhatsappTemplatesTemplatesInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | ID of the WhatsApp template |
+**name** | **string** | Name of the WhatsApp template |
+**status** | **string** | Status of the WhatsApp template |
+**language** | **string** | Language in which template exists |
+**category** | **string** | category of the template |
+**createdAt** | **string** | Creation UTC date-time of the WhatsApp template (YYYY-MM-DDTHH:mm:ss.SSSZ) |
+**modifiedAt** | **string** | UTC date-time of last modification of the WhatsApp template (YYYY-MM-DDTHH:mm:ss.SSSZ) |
+**errorReason** | **string** | Error reason in the template creation | [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/InlineResponse200.md b/docs/Model/InlineResponse200.md
deleted file mode 100644
index 5990843..0000000
--- a/docs/Model/InlineResponse200.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# InlineResponse200
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**id** | **string** | Unique id of the group | [optional]
-**groupName** | **string** | The name of the group of sub-accounts | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/InlineResponse2001.md b/docs/Model/InlineResponse2001.md
deleted file mode 100644
index 47f3681..0000000
--- a/docs/Model/InlineResponse2001.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# InlineResponse2001
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**id** | **string** | Unique company id |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/InlineResponse2002.md b/docs/Model/InlineResponse2002.md
deleted file mode 100644
index c9b0393..0000000
--- a/docs/Model/InlineResponse2002.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# InlineResponse2002
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**id** | **string** | The id of the collection |
-**name** | **string** | The name of the collection |
-**defaultCoupon** | **string** | The default coupon of the collection |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/InlineResponse201.md b/docs/Model/InlineResponse201.md
deleted file mode 100644
index f9e19de..0000000
--- a/docs/Model/InlineResponse201.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# InlineResponse201
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**id** | **string** | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/InlineResponse2011.md b/docs/Model/InlineResponse2011.md
deleted file mode 100644
index b3ac15c..0000000
--- a/docs/Model/InlineResponse2011.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# InlineResponse2011
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**id** | **string** | Unique deal id |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/InlineResponse2012.md b/docs/Model/InlineResponse2012.md
deleted file mode 100644
index d62c7f5..0000000
--- a/docs/Model/InlineResponse2012.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# InlineResponse2012
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**id** | **string** | Unique task id |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/InlineResponse2013.md b/docs/Model/InlineResponse2013.md
deleted file mode 100644
index 699a3d9..0000000
--- a/docs/Model/InlineResponse2013.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# InlineResponse2013
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**id** | **string** | The id of the created collection |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/InlineResponse2014.md b/docs/Model/InlineResponse2014.md
deleted file mode 100644
index 173807b..0000000
--- a/docs/Model/InlineResponse2014.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# InlineResponse2014
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**messageId** | **string** | messageId of sent message |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/InlineResponse2015.md b/docs/Model/InlineResponse2015.md
deleted file mode 100644
index 4cdec9f..0000000
--- a/docs/Model/InlineResponse2015.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# InlineResponse2015
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**id** | **string** | ID of the object created |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/InviteAdminUser.md b/docs/Model/InviteAdminUser.md
index cbcf531..0845eb2 100644
--- a/docs/Model/InviteAdminUser.md
+++ b/docs/Model/InviteAdminUser.md
@@ -1,13 +1,12 @@
-# InviteAdminUser
+# # InviteAdminUser
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**email** | **string** | Email address for the organization |
-**allFeaturesAccess** | **bool** | All access to the features |
-**groupIds** | **string[]** | Ids of Group | [optional]
-**privileges** | [**\Brevo\Client\Model\InviteAdminUserPrivileges[]**](InviteAdminUserPrivileges.md) | |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**email** | **string** | Email address for the organization |
+**allFeaturesAccess** | **bool** | All access to the features |
+**privileges** | [**\Brevo\Client\Models\InviteAdminUserPrivilegesInner[]**](InviteAdminUserPrivilegesInner.md) | |
+**groupIds** | **string[]** | Ids of Group | [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/InviteAdminUserPrivileges.md b/docs/Model/InviteAdminUserPrivileges.md
deleted file mode 100644
index 9d87b19..0000000
--- a/docs/Model/InviteAdminUserPrivileges.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# InviteAdminUserPrivileges
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**feature** | **string** | Feature name | [optional]
-**permissions** | **string[]** | Permissions for a given feature | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/InviteAdminUserPrivilegesInner.md b/docs/Model/InviteAdminUserPrivilegesInner.md
new file mode 100644
index 0000000..94f3b45
--- /dev/null
+++ b/docs/Model/InviteAdminUserPrivilegesInner.md
@@ -0,0 +1,10 @@
+# # InviteAdminUserPrivilegesInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**feature** | **string** | Feature name | [optional]
+**permissions** | **string[]** | Permissions for a given feature | [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/Inviteuser.md b/docs/Model/Inviteuser.md
index 4589434..776de85 100644
--- a/docs/Model/Inviteuser.md
+++ b/docs/Model/Inviteuser.md
@@ -1,12 +1,11 @@
-# Inviteuser
+# # Inviteuser
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**email** | **string** | Email address for the organization |
-**allFeaturesAccess** | **bool** | All access to the features |
-**privileges** | [**\Brevo\Client\Model\InviteuserPrivileges[]**](InviteuserPrivileges.md) | |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**email** | **string** | Email address for the organization |
+**allFeaturesAccess** | **bool** | All access to the features |
+**privileges** | [**\Brevo\Client\Models\InviteuserPrivilegesInner[]**](InviteuserPrivilegesInner.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/InviteuserPrivileges.md b/docs/Model/InviteuserPrivileges.md
deleted file mode 100644
index 5d3a38a..0000000
--- a/docs/Model/InviteuserPrivileges.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# InviteuserPrivileges
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**feature** | **string** | Feature name | [optional]
-**permissions** | **string[]** | Permissions for a given feature | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/InviteuserPrivilegesInner.md b/docs/Model/InviteuserPrivilegesInner.md
new file mode 100644
index 0000000..96a8580
--- /dev/null
+++ b/docs/Model/InviteuserPrivilegesInner.md
@@ -0,0 +1,10 @@
+# # InviteuserPrivilegesInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**feature** | **string** | Feature name | [optional]
+**permissions** | **string[]** | Permissions for a given feature | [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/InviteuserResponse.md b/docs/Model/InviteuserResponse.md
new file mode 100644
index 0000000..e9ea6cf
--- /dev/null
+++ b/docs/Model/InviteuserResponse.md
@@ -0,0 +1,10 @@
+# # InviteuserResponse
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**status** | **string** | Status of the API operation. |
+**invoiceId** | **string[]** | Invoice id | [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/LoyaltyProgram.md b/docs/Model/LoyaltyProgram.md
new file mode 100644
index 0000000..697ce7b
--- /dev/null
+++ b/docs/Model/LoyaltyProgram.md
@@ -0,0 +1,15 @@
+# # LoyaltyProgram
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | Loyalty Program ID | [optional]
+**name** | **string** | Loyalty Program name | [optional]
+**description** | **string** | Loyalty Program description | [optional]
+**meta** | **object** | Loyalty Program meta data | [optional]
+**createdAt** | **\DateTime** | Loyalty Program creation date | [optional]
+**updatedAt** | **\DateTime** | Loyalty Program last modification date | [optional]
+**state** | **string** | Loyalty Program state | [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/LoyaltyProgramPage.md b/docs/Model/LoyaltyProgramPage.md
new file mode 100644
index 0000000..54f7707
--- /dev/null
+++ b/docs/Model/LoyaltyProgramPage.md
@@ -0,0 +1,9 @@
+# # LoyaltyProgramPage
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**items** | [**\Brevo\Client\Models\LoyaltyProgram[]**](LoyaltyProgram.md) | Loyalty Program list | [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/LoyaltyProgramValidationError.md b/docs/Model/LoyaltyProgramValidationError.md
new file mode 100644
index 0000000..2aa47cc
--- /dev/null
+++ b/docs/Model/LoyaltyProgramValidationError.md
@@ -0,0 +1,11 @@
+# # LoyaltyProgramValidationError
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**path** | **string** | Path of data that failed validation | [optional]
+**rule** | **string** | Rule that failed validation | [optional]
+**error** | **string** | Validation error message | [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/LoyaltyTierPage.md b/docs/Model/LoyaltyTierPage.md
new file mode 100644
index 0000000..4b5d3cf
--- /dev/null
+++ b/docs/Model/LoyaltyTierPage.md
@@ -0,0 +1,9 @@
+# # LoyaltyTierPage
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**items** | [**\Brevo\Client\Models\Tier[]**](Tier.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/ManageIp.md b/docs/Model/ManageIp.md
deleted file mode 100644
index 797f01c..0000000
--- a/docs/Model/ManageIp.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# ManageIp
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**ip** | **string** | Dedicated ID | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/MasterDetailsResponse.md b/docs/Model/MasterDetailsResponse.md
index 69f0cdf..9e705be 100644
--- a/docs/Model/MasterDetailsResponse.md
+++ b/docs/Model/MasterDetailsResponse.md
@@ -1,16 +1,15 @@
-# MasterDetailsResponse
+# # MasterDetailsResponse
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**email** | **string** | Email id of master account | [optional]
-**companyName** | **string** | Company name of master account organization | [optional]
-**id** | **int** | Unique identifier of the master account organization | [optional]
-**currencyCode** | **string** | Currency code of the master account organization | [optional]
-**timezone** | **string** | Timezone of the master account organization | [optional]
-**billingInfo** | [**\Brevo\Client\Model\MasterDetailsResponseBillingInfo**](MasterDetailsResponseBillingInfo.md) | | [optional]
-**planInfo** | [**\Brevo\Client\Model\MasterDetailsResponsePlanInfo**](MasterDetailsResponsePlanInfo.md) | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
+**email** | **string** | Email id of master account | [optional]
+**companyName** | **string** | Company name of master account organization | [optional]
+**id** | **int** | Unique identifier of the master account organization | [optional]
+**currencyCode** | **string** | Currency code of the master account organization | [optional]
+**timezone** | **string** | Timezone of the master account organization | [optional]
+**billingInfo** | [**\Brevo\Client\Models\MasterDetailsResponseBillingInfo**](MasterDetailsResponseBillingInfo.md) | | [optional]
+**planInfo** | [**\Brevo\Client\Models\MasterDetailsResponsePlanInfo**](MasterDetailsResponsePlanInfo.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/MasterDetailsResponseBillingInfo.md b/docs/Model/MasterDetailsResponseBillingInfo.md
index a131c7a..454fabe 100644
--- a/docs/Model/MasterDetailsResponseBillingInfo.md
+++ b/docs/Model/MasterDetailsResponseBillingInfo.md
@@ -1,13 +1,12 @@
-# MasterDetailsResponseBillingInfo
+# # MasterDetailsResponseBillingInfo
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**email** | **string** | Billing email id of master account | [optional]
-**companyName** | **string** | Company name of master account | [optional]
-**name** | [**\Brevo\Client\Model\MasterDetailsResponseBillingInfoName**](MasterDetailsResponseBillingInfoName.md) | | [optional]
-**address** | [**\Brevo\Client\Model\MasterDetailsResponseBillingInfoAddress**](MasterDetailsResponseBillingInfoAddress.md) | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**email** | **string** | Billing email id of master account | [optional]
+**companyName** | **string** | Company name of master account | [optional]
+**name** | [**\Brevo\Client\Models\MasterDetailsResponseBillingInfoName**](MasterDetailsResponseBillingInfoName.md) | | [optional]
+**address** | [**\Brevo\Client\Models\MasterDetailsResponseBillingInfoAddress**](MasterDetailsResponseBillingInfoAddress.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/MasterDetailsResponseBillingInfoAddress.md b/docs/Model/MasterDetailsResponseBillingInfoAddress.md
index 3c8cc31..a82747d 100644
--- a/docs/Model/MasterDetailsResponseBillingInfoAddress.md
+++ b/docs/Model/MasterDetailsResponseBillingInfoAddress.md
@@ -1,14 +1,13 @@
-# MasterDetailsResponseBillingInfoAddress
+# # MasterDetailsResponseBillingInfoAddress
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**streetAddress** | **string** | Street address | [optional]
-**locality** | **string** | Locality | [optional]
-**postalCode** | **string** | Postal code | [optional]
-**stateCode** | **string** | State code | [optional]
-**countryCode** | **string** | Country code | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**streetAddress** | **string** | Street address | [optional]
+**locality** | **string** | Locality | [optional]
+**postalCode** | **string** | Postal code | [optional]
+**stateCode** | **string** | State code | [optional]
+**countryCode** | **string** | Country code | [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/MasterDetailsResponseBillingInfoName.md b/docs/Model/MasterDetailsResponseBillingInfoName.md
index 0e038fc..7e2a701 100644
--- a/docs/Model/MasterDetailsResponseBillingInfoName.md
+++ b/docs/Model/MasterDetailsResponseBillingInfoName.md
@@ -1,11 +1,10 @@
-# MasterDetailsResponseBillingInfoName
+# # MasterDetailsResponseBillingInfoName
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**givenName** | **string** | First name for billing | [optional]
-**familyName** | **string** | Last name for billing | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**givenName** | **string** | First name for billing | [optional]
+**familyName** | **string** | Last name for billing | [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/MasterDetailsResponsePlanInfo.md b/docs/Model/MasterDetailsResponsePlanInfo.md
index 3131ad9..e00bdd9 100644
--- a/docs/Model/MasterDetailsResponsePlanInfo.md
+++ b/docs/Model/MasterDetailsResponsePlanInfo.md
@@ -1,15 +1,14 @@
-# MasterDetailsResponsePlanInfo
+# # MasterDetailsResponsePlanInfo
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**currencyCode** | **string** | Plan currency | [optional]
-**nextBillingAt** | **int** | Timestamp of next billing date | [optional]
-**price** | **float** | Plan amount | [optional]
-**planPeriod** | **string** | Plan period type | [optional]
-**subAccounts** | **int** | Number of sub-accounts | [optional]
-**features** | [**\Brevo\Client\Model\MasterDetailsResponsePlanInfoFeatures[]**](MasterDetailsResponsePlanInfoFeatures.md) | List of provided features in the plan | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
+**currencyCode** | **string** | Plan currency | [optional]
+**nextBillingAt** | **int** | Timestamp of next billing date | [optional]
+**price** | **float** | Plan amount | [optional]
+**planPeriod** | **string** | Plan period type | [optional]
+**subAccounts** | **int** | Number of sub-accounts | [optional]
+**features** | [**\Brevo\Client\Models\MasterDetailsResponsePlanInfoFeaturesInner[]**](MasterDetailsResponsePlanInfoFeaturesInner.md) | List of provided features in the plan | [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/MasterDetailsResponsePlanInfoFeatures.md b/docs/Model/MasterDetailsResponsePlanInfoFeatures.md
deleted file mode 100644
index c39d52b..0000000
--- a/docs/Model/MasterDetailsResponsePlanInfoFeatures.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# MasterDetailsResponsePlanInfoFeatures
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**name** | **string** | Name of the feature | [optional]
-**unitValue** | **string** | Unit value of the feature | [optional]
-**quantity** | **int** | Quantity provided in the plan | [optional]
-**quantityWithOverages** | **int** | Quantity with overages provided in the plan (only applicable on ENTv2) | [optional]
-**used** | **int** | Quantity consumed by master | [optional]
-**usedOverages** | **int** | Quantity consumed by sub-organizations over the admin plan limit (only applicable on ENTv2) | [optional]
-**remaining** | **int** | Quantity remaining in the plan | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/MasterDetailsResponsePlanInfoFeaturesInner.md b/docs/Model/MasterDetailsResponsePlanInfoFeaturesInner.md
new file mode 100644
index 0000000..154c82e
--- /dev/null
+++ b/docs/Model/MasterDetailsResponsePlanInfoFeaturesInner.md
@@ -0,0 +1,15 @@
+# # MasterDetailsResponsePlanInfoFeaturesInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | Name of the feature | [optional]
+**unitValue** | **string** | Unit value of the feature | [optional]
+**quantity** | **int** | Quantity provided in the plan | [optional]
+**quantityWithOverages** | **int** | Quantity with overages provided in the plan (only applicable on ENTv2) | [optional]
+**used** | **int** | Quantity consumed by master | [optional]
+**usedOverages** | **int** | Quantity consumed by sub-organizations over the admin plan limit (only applicable on ENTv2) | [optional]
+**remaining** | **int** | Quantity remaining in the plan | [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/Note.md b/docs/Model/Note.md
index 1269471..4af8d10 100644
--- a/docs/Model/Note.md
+++ b/docs/Model/Note.md
@@ -1,16 +1,15 @@
-# Note
+# # Note
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **string** | Unique note Id | [optional]
-**text** | **string** | Text content of a note |
-**contactIds** | **int[]** | Contact ids linked to a note | [optional]
-**dealIds** | **string[]** | Deal ids linked to a note | [optional]
-**authorId** | **object** | Account details of user which created the note | [optional]
-**createdAt** | [**\DateTime**] | Note created date/time | [optional]
-**updatedAt** | [**\DateTime**] | Note updated date/time | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
+**text** | **string** | Text content of a note |
+**id** | **string** | Unique note Id | [optional]
+**contactIds** | **int[]** | Contact ids linked to a note | [optional]
+**dealIds** | **string[]** | Deal ids linked to a note | [optional]
+**authorId** | **object** | Account details of user which created the note | [optional]
+**createdAt** | **\DateTime** | Note created date/time | [optional]
+**updatedAt** | **\DateTime** | Note updated date/time | [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/NoteData.md b/docs/Model/NoteData.md
index e70cbc7..602cebe 100644
--- a/docs/Model/NoteData.md
+++ b/docs/Model/NoteData.md
@@ -1,13 +1,12 @@
-# NoteData
+# # NoteData
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**text** | **string** | Text content of a note |
-**contactIds** | **int[]** | Contact Ids linked to a note | [optional]
-**dealIds** | **string[]** | Deal Ids linked to a note | [optional]
-**companyIds** | **string[]** | Company Ids linked to a note | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**text** | **string** | Text content of a note |
+**contactIds** | **int[]** | Contact Ids linked to a note | [optional]
+**dealIds** | **string[]** | Deal Ids linked to a note | [optional]
+**companyIds** | **string[]** | Company Ids linked to a note | [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/NoteId.md b/docs/Model/NoteId.md
index 84ee593..5e1097a 100644
--- a/docs/Model/NoteId.md
+++ b/docs/Model/NoteId.md
@@ -1,10 +1,9 @@
-# NoteId
+# # NoteId
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **string** | Unique note Id | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**id** | **string** | Unique note Id | [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/NoteList.md b/docs/Model/NoteList.md
deleted file mode 100644
index 81fc0fa..0000000
--- a/docs/Model/NoteList.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# NoteList
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/Notification.md b/docs/Model/Notification.md
new file mode 100644
index 0000000..38a7b95
--- /dev/null
+++ b/docs/Model/Notification.md
@@ -0,0 +1,10 @@
+# # Notification
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**channel** | **string** | Channel used to send the notifications. |
+**text** | **string** | Use this field if you want to give more context to your contact about the payment request. |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/Offer.md b/docs/Model/Offer.md
new file mode 100644
index 0000000..227dbc5
--- /dev/null
+++ b/docs/Model/Offer.md
@@ -0,0 +1,15 @@
+# # Offer
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | Offer id | [optional]
+**loyaltyProgramId** | **string** | Loyalty program id | [optional]
+**name** | **string** | Offer name | [optional]
+**state** | **string** | Offer state | [optional]
+**publicImageUrl** | **string** | Offer image url | [optional]
+**createdAt** | **\DateTime** | Offer creation date | [optional]
+**updatedAt** | **\DateTime** | Offer update date | [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/OfferList.md b/docs/Model/OfferList.md
new file mode 100644
index 0000000..efb40a3
--- /dev/null
+++ b/docs/Model/OfferList.md
@@ -0,0 +1,9 @@
+# # OfferList
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**items** | [**\Brevo\Client\Models\Offer[]**](Offer.md) | List of offers | [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/OffersListResponse.md b/docs/Model/OffersListResponse.md
new file mode 100644
index 0000000..8865292
--- /dev/null
+++ b/docs/Model/OffersListResponse.md
@@ -0,0 +1,10 @@
+# # OffersListResponse
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**totalCount** | **int** | Total count of offers | [optional]
+**items** | [**\Brevo\Client\Models\Offer[]**](Offer.md) | List of offers | [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/Order.md b/docs/Model/Order.md
index fb444ce..dff0ad4 100644
--- a/docs/Model/Order.md
+++ b/docs/Model/Order.md
@@ -1,18 +1,18 @@
-# Order
+# # Order
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **string** | Unique ID of the order. |
-**createdAt** | **string** | Event occurrence UTC date-time (YYYY-MM-DDTHH:mm:ssZ), when order is actually created. |
-**updatedAt** | **string** | Event updated UTC date-time (YYYY-MM-DDTHH:mm:ssZ), when the status of the order is actually changed/updated. |
-**status** | **string** | State of the order. |
-**amount** | **float** | Total amount of the order, including all shipping expenses, tax and the price of items. |
-**products** | [**\Brevo\Client\Model\OrderProducts[]**](OrderProducts.md) | |
-**email** | **string** | Email of the contact, Mandatory if \"phone\" field is not passed in \"billing\" parameter. | [optional]
-**billing** | [**\Brevo\Client\Model\OrderBilling**](OrderBilling.md) | | [optional]
-**coupons** | **string[]** | Coupons applied to the order. Stored case insensitive. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**id** | **string** | Unique ID of the order. |
+**createdAt** | **string** | Event occurrence UTC date-time (YYYY-MM-DDTHH:mm:ssZ), when order is actually created. |
+**updatedAt** | **string** | Event updated UTC date-time (YYYY-MM-DDTHH:mm:ssZ), when the status of the order is actually changed/updated. |
+**status** | **string** | State of the order. |
+**amount** | **float** | Total amount of the order, including all shipping expenses, tax and the price of items. |
+**products** | [**\Brevo\Client\Models\OrderProductsInner[]**](OrderProductsInner.md) | |
+**storeId** | **string** | ID of store where the order is placed | [optional]
+**identifiers** | [**\Brevo\Client\Models\OrderIdentifiers**](OrderIdentifiers.md) | | [optional]
+**billing** | [**\Brevo\Client\Models\OrderBilling**](OrderBilling.md) | | [optional]
+**coupons** | **string[]** | Coupons applied to the order. Stored case insensitive. | [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/OrderBatch.md b/docs/Model/OrderBatch.md
index e2fe2d1..3e88468 100644
--- a/docs/Model/OrderBatch.md
+++ b/docs/Model/OrderBatch.md
@@ -1,12 +1,11 @@
-# OrderBatch
+# # OrderBatch
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**orders** | [**\Brevo\Client\Model\Order[]**](Order.md) | array of order objects |
-**notifyUrl** | **string** | Notify Url provided by client to get the status of batch request | [optional]
+**orders** | [**\Brevo\Client\Models\Order[]**](Order.md) | array of order objects |
+**notifyUrl** | **string** | Notify Url provided by client to get the status of batch request | [optional]
**historical** | **bool** | Defines wether you want your orders to be considered as live data or as historical data (import of past data, synchronising data). True: orders will not trigger any automation workflows. False: orders will trigger workflows as usual. | [optional] [default to true]
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.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/OrderBilling.md b/docs/Model/OrderBilling.md
index 0abf39e..77bbf9a 100644
--- a/docs/Model/OrderBilling.md
+++ b/docs/Model/OrderBilling.md
@@ -1,16 +1,16 @@
-# OrderBilling
+# # OrderBilling
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**address** | **string** | Full billing address. | [optional]
-**city** | **string** | Exact city of the address. | [optional]
-**countryCode** | **string** | Billing country 2-letter ISO code. | [optional]
-**phone** | **string** | Phone number to contact for further details about the order, Mandatory if \"email\" field is not passed. | [optional]
-**postCode** | **string** | Postcode for delivery and billing. | [optional]
-**paymentMethod** | **string** | How the visitor will pay for the item(s), e.g. paypal, check, etc. | [optional]
-**region** | **string** | Exact region (state/province) for delivery and billing. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**address** | **string** | Full billing address. | [optional]
+**city** | **string** | Exact city of the address. | [optional]
+**countryCode** | **string** | Billing country 2-letter ISO code. | [optional]
+**country** | **string** | Billing country name. | [optional]
+**phone** | **string** | Billing phone number. | [optional]
+**postCode** | **string** | Postcode for delivery and billing. | [optional]
+**paymentMethod** | **string** | How the visitor will pay for the item(s), e.g. paypal, check, etc. | [optional]
+**region** | **string** | Exact region (state/province) for delivery and billing. | [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/OrderIdentifiers.md b/docs/Model/OrderIdentifiers.md
new file mode 100644
index 0000000..59dcd75
--- /dev/null
+++ b/docs/Model/OrderIdentifiers.md
@@ -0,0 +1,12 @@
+# # OrderIdentifiers
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**extId** | **string** | ext_id associated with the order | [optional]
+**loyaltySubscriptionId** | **string** | loyalty_subscription_id associated with the order | [optional]
+**phoneId** | **string** | Phone number of the contact associated with the order | [optional]
+**emailId** | **string** | Email of the contact associated with the order | [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/OrderProducts.md b/docs/Model/OrderProducts.md
deleted file mode 100644
index 9e1b2f0..0000000
--- a/docs/Model/OrderProducts.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# OrderProducts
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**productId** | **string** | ID of the product. |
-**quantity** | **float** | How many pieces of the product the visitor has added to the cart. |
-**variantId** | **string** | Product ID of the red color shirts. | [optional]
-**price** | **float** | The price of a unit of product |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/OrderProductsInner.md b/docs/Model/OrderProductsInner.md
new file mode 100644
index 0000000..614f9fa
--- /dev/null
+++ b/docs/Model/OrderProductsInner.md
@@ -0,0 +1,12 @@
+# # OrderProductsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**productId** | **string** | ID of the product. |
+**quantity** | **float** | How many pieces of the product the visitor has added to the cart. |
+**price** | **float** | The price of a unit of product |
+**variantId** | **string** | Product ID of the red color shirts. | [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/Otp.md b/docs/Model/Otp.md
index d1e6191..c26f5a5 100644
--- a/docs/Model/Otp.md
+++ b/docs/Model/Otp.md
@@ -1,10 +1,9 @@
-# Otp
+# # Otp
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**name** | **int** | 6 digit OTP received on email | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**otp** | **int** | 6 digit OTP received on email |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/PatchLoyaltyProgramPayload.md b/docs/Model/PatchLoyaltyProgramPayload.md
new file mode 100644
index 0000000..5278d28
--- /dev/null
+++ b/docs/Model/PatchLoyaltyProgramPayload.md
@@ -0,0 +1,11 @@
+# # PatchLoyaltyProgramPayload
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | Loyalty Program name | [optional]
+**description** | **string** | Loyalty Program description | [optional]
+**meta** | **object** | Loyalty Program meta data | [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/Pipeline.md b/docs/Model/Pipeline.md
index b7d428b..2271e2e 100644
--- a/docs/Model/Pipeline.md
+++ b/docs/Model/Pipeline.md
@@ -1,12 +1,11 @@
-# Pipeline
+# # Pipeline
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**pipeline** | **string** | Pipeline id | [optional]
-**pipelineName** | **string** | Pipeline Name | [optional]
-**stages** | [**\Brevo\Client\Model\PipelineStage[]**](PipelineStage.md) | List of stages | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**pipelineName** | **string** | Pipeline name | [optional]
+**pipeline** | **string** | Pipeline id | [optional]
+**stages** | [**\Brevo\Client\Models\PipelineStage[]**](PipelineStage.md) | List of stages | [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/PipelineStage.md b/docs/Model/PipelineStage.md
index 84645f8..cf4ae57 100644
--- a/docs/Model/PipelineStage.md
+++ b/docs/Model/PipelineStage.md
@@ -1,11 +1,10 @@
-# PipelineStage
+# # PipelineStage
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **string** | Stage id | [optional]
-**name** | **string** | Stage name | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**id** | **string** | Stage id | [optional]
+**name** | **string** | Stage name | [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/Pipelines.md b/docs/Model/Pipelines.md
deleted file mode 100644
index 948d3d9..0000000
--- a/docs/Model/Pipelines.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# Pipelines
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/PostContactInfo.md b/docs/Model/PostContactInfo.md
index 351fa34..f7ea797 100644
--- a/docs/Model/PostContactInfo.md
+++ b/docs/Model/PostContactInfo.md
@@ -1,10 +1,9 @@
-# PostContactInfo
+# # PostContactInfo
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**contacts** | [**\Brevo\Client\Model\PostContactInfoContacts**](PostContactInfoContacts.md) | |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**contacts** | [**\Brevo\Client\Models\PostContactInfoContacts**](PostContactInfoContacts.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/PostContactInfoContacts.md b/docs/Model/PostContactInfoContacts.md
index 3c28eff..6cca483 100644
--- a/docs/Model/PostContactInfoContacts.md
+++ b/docs/Model/PostContactInfoContacts.md
@@ -1,13 +1,12 @@
-# PostContactInfoContacts
+# # PostContactInfoContacts
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**success** | **string[]** | | [optional]
-**failure** | **string[]** | | [optional]
-**total** | **int** | Displays the count of total number of contacts removed from list when user opts for \"all\" option. | [optional]
-**processId** | **int** | Id of the process created to remove contacts from list when user opts for \"all\" option. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**success** | [**\Brevo\Client\Models\PostContactInfoContactsSuccess**](PostContactInfoContactsSuccess.md) | | [optional]
+**failure** | [**\Brevo\Client\Models\PostContactInfoContactsFailure**](PostContactInfoContactsFailure.md) | | [optional]
+**total** | **int** | Displays the count of total number of contacts removed from list when user opts for \"all\" option. | [optional]
+**processId** | **int** | Id of the process created to remove contacts from list when user opts for \"all\" option. | [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/PostContactInfoContactsFailure.md b/docs/Model/PostContactInfoContactsFailure.md
new file mode 100644
index 0000000..d672faa
--- /dev/null
+++ b/docs/Model/PostContactInfoContactsFailure.md
@@ -0,0 +1,8 @@
+# # PostContactInfoContactsFailure
+
+## 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/PostContactInfoContactsSuccess.md b/docs/Model/PostContactInfoContactsSuccess.md
new file mode 100644
index 0000000..60bb668
--- /dev/null
+++ b/docs/Model/PostContactInfoContactsSuccess.md
@@ -0,0 +1,8 @@
+# # PostContactInfoContactsSuccess
+
+## 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/PostSendFailed.md b/docs/Model/PostSendFailed.md
index a7d6069..df6ab95 100644
--- a/docs/Model/PostSendFailed.md
+++ b/docs/Model/PostSendFailed.md
@@ -1,14 +1,13 @@
-# PostSendFailed
+# # PostSendFailed
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**code** | **int** | Response code |
-**message** | **string** | Response message |
-**unexistingEmails** | **string[]** | | [optional]
-**withoutListEmails** | **string[]** | | [optional]
-**blackListedEmails** | **string[]** | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**code** | **string** | Response code |
+**message** | **string** | Response message |
+**unexistingEmails** | **string[]** | | [optional]
+**withoutListEmails** | **string[]** | | [optional]
+**blackListedEmails** | **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/PostSendSmsTestFailed.md b/docs/Model/PostSendSmsTestFailed.md
index 8d414d6..8bb8a9f 100644
--- a/docs/Model/PostSendSmsTestFailed.md
+++ b/docs/Model/PostSendSmsTestFailed.md
@@ -1,13 +1,12 @@
-# PostSendSmsTestFailed
+# # PostSendSmsTestFailed
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**code** | **int** | Response code |
-**message** | **string** | Response message |
-**unexistingSms** | **string[]** | | [optional]
-**withoutListSms** | **string[]** | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**code** | **string** | Response code |
+**message** | **string** | Response message |
+**unexistingSms** | **string[]** | | [optional]
+**withoutListSms** | **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/PutRevokeUserPermission.md b/docs/Model/PutRevokeUserPermission.md
index 43b7b81..bad55a2 100644
--- a/docs/Model/PutRevokeUserPermission.md
+++ b/docs/Model/PutRevokeUserPermission.md
@@ -1,10 +1,9 @@
-# PutRevokeUserPermission
+# # PutRevokeUserPermission
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**email** | **string** | Email address of the user. |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**email** | **string** | Email address of the user. |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/PutRevokeUserPermissionResponse.md b/docs/Model/PutRevokeUserPermissionResponse.md
new file mode 100644
index 0000000..058fcd4
--- /dev/null
+++ b/docs/Model/PutRevokeUserPermissionResponse.md
@@ -0,0 +1,10 @@
+# # PutRevokeUserPermissionResponse
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**status** | **string** | Status of the API operation. |
+**creditNotes** | **string[]** | Credit note | [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/Putresendcancelinvitation.md b/docs/Model/Putresendcancelinvitation.md
index a35bfff..dcc40db 100644
--- a/docs/Model/Putresendcancelinvitation.md
+++ b/docs/Model/Putresendcancelinvitation.md
@@ -1,10 +1,9 @@
-# Putresendcancelinvitation
+# # Putresendcancelinvitation
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**email** | **string** | Email address of the user. |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**email** | **string** | Email address of the user. |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/PutresendcancelinvitationResponse.md b/docs/Model/PutresendcancelinvitationResponse.md
new file mode 100644
index 0000000..d1b7e94
--- /dev/null
+++ b/docs/Model/PutresendcancelinvitationResponse.md
@@ -0,0 +1,10 @@
+# # PutresendcancelinvitationResponse
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**status** | **string** | Status of the API operation. |
+**creditNotes** | **string[]** | Credit note | [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/RedeemRewardPayload.md b/docs/Model/RedeemRewardPayload.md
new file mode 100644
index 0000000..ae5bdb5
--- /dev/null
+++ b/docs/Model/RedeemRewardPayload.md
@@ -0,0 +1,13 @@
+# # RedeemRewardPayload
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**code** | **string** | Code to validate | [optional]
+**attributedRewardId** | **string** | One of code or attributed reward id is required | [optional]
+**posId** | **string** | Point of sale reward id | [optional]
+**contactId** | **float** | Contact to attribute the reward | [optional]
+**loyaltySubscriptionId** | **string** | One of contactId or loyaltySubscriptionId is required | [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/RedeemedRewardFailedConditionErrorResponse.md b/docs/Model/RedeemedRewardFailedConditionErrorResponse.md
new file mode 100644
index 0000000..fb5a3b3
--- /dev/null
+++ b/docs/Model/RedeemedRewardFailedConditionErrorResponse.md
@@ -0,0 +1,9 @@
+# # RedeemedRewardFailedConditionErrorResponse
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**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/RemainingCreditModel.md b/docs/Model/RemainingCreditModel.md
deleted file mode 100644
index c97c2b8..0000000
--- a/docs/Model/RemainingCreditModel.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# RemainingCreditModel
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**child** | [**\Brevo\Client\Model\RemainingCreditModelChild**](RemainingCreditModelChild.md) | |
-**reseller** | [**\Brevo\Client\Model\RemainingCreditModelReseller**](RemainingCreditModelReseller.md) | |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/RemainingCreditModelChild.md b/docs/Model/RemainingCreditModelChild.md
deleted file mode 100644
index b3c6140..0000000
--- a/docs/Model/RemainingCreditModelChild.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# RemainingCreditModelChild
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**sms** | **double** | SMS Credits remaining for child account |
-**email** | **double** | Email Credits remaining for child account |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/RemainingCreditModelReseller.md b/docs/Model/RemainingCreditModelReseller.md
deleted file mode 100644
index e447a82..0000000
--- a/docs/Model/RemainingCreditModelReseller.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# RemainingCreditModelReseller
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**sms** | **double** | SMS Credits remaining for reseller account |
-**email** | **double** | Email Credits remaining for reseller account |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/RemoveContactFromList.md b/docs/Model/RemoveContactFromList.md
deleted file mode 100644
index 9677d35..0000000
--- a/docs/Model/RemoveContactFromList.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# RemoveContactFromList
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**emails** | **string[]** | Required if 'all' is false. Emails to remove from a list. You can pass a maximum of 150 emails for removal in one request. | [optional]
-**ids** | **int[]** | Mandatory if Emails are not passed, ignored otherwise. Emails to add to a list. You can pass a maximum of 150 emails for addition in one request. If you need to add the emails in bulk, please prefer /contacts/import api. | [optional]
-**all** | **bool** | Required if none of 'emails' or 'ids' are passed. Remove all existing contacts from a list. A process will be created in this scenario. You can fetch the process details to know about the progress | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/RemoveContactFromListByAll.md b/docs/Model/RemoveContactFromListByAll.md
new file mode 100644
index 0000000..3b46cd6
--- /dev/null
+++ b/docs/Model/RemoveContactFromListByAll.md
@@ -0,0 +1,9 @@
+# # RemoveContactFromListByAll
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**all** | **bool** | **Required if 'emails', 'extIds' and 'ids' are empty.** Remove all existing contacts from a list. A process will be created in this scenario. You can fetch the process details to know about the progress | [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/RemoveContactFromListByEmails.md b/docs/Model/RemoveContactFromListByEmails.md
new file mode 100644
index 0000000..1c67c2c
--- /dev/null
+++ b/docs/Model/RemoveContactFromListByEmails.md
@@ -0,0 +1,9 @@
+# # RemoveContactFromListByEmails
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**emails** | **string[]** | **Required if 'all' is false and 'ids', 'extIds' are empty.** Emails to remove from a list. You can pass a **maximum of 150 emails** for removal in one request. | [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/RemoveContactFromListByExtIDs.md b/docs/Model/RemoveContactFromListByExtIDs.md
new file mode 100644
index 0000000..ff3980a
--- /dev/null
+++ b/docs/Model/RemoveContactFromListByExtIDs.md
@@ -0,0 +1,9 @@
+# # RemoveContactFromListByExtIDs
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**extIds** | **string[]** | **Required if 'all' is false, 'ids' and 'emails' are empty.** EXT_ID attributes to remove from a list. You can pass a **maximum of 150 EXT_ID attributes** for removal in one request. | [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/RemoveContactFromListByIDs.md b/docs/Model/RemoveContactFromListByIDs.md
new file mode 100644
index 0000000..16ed460
--- /dev/null
+++ b/docs/Model/RemoveContactFromListByIDs.md
@@ -0,0 +1,9 @@
+# # RemoveContactFromListByIDs
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**ids** | **int[]** | **Required if 'all' is false and 'emails', 'extIds' are empty.** IDs to remove from a list. You can pass a **maximum of 150 IDs** for removal in one request. | [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/RemoveContactFromListRequest.md b/docs/Model/RemoveContactFromListRequest.md
new file mode 100644
index 0000000..0f98549
--- /dev/null
+++ b/docs/Model/RemoveContactFromListRequest.md
@@ -0,0 +1,12 @@
+# # RemoveContactFromListRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**emails** | **string[]** | **Required if 'all' is false and 'ids', 'extIds' are empty.** Emails to remove from a list. You can pass a **maximum of 150 emails** for removal in one request. | [optional]
+**ids** | **int[]** | **Required if 'all' is false and 'emails', 'extIds' are empty.** IDs to remove from a list. You can pass a **maximum of 150 IDs** for removal in one request. | [optional]
+**all** | **bool** | **Required if 'emails', 'extIds' and 'ids' are empty.** Remove all existing contacts from a list. A process will be created in this scenario. You can fetch the process details to know about the progress | [optional]
+**extIds** | **string[]** | **Required if 'all' is false, 'ids' and 'emails' are empty.** EXT_ID attributes to remove from a list. You can pass a **maximum of 150 EXT_ID attributes** for removal in one request. | [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/RemoveCredits.md b/docs/Model/RemoveCredits.md
deleted file mode 100644
index 3cbac52..0000000
--- a/docs/Model/RemoveCredits.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# RemoveCredits
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**sms** | **int** | Required if email credits are empty. SMS credits to be removed from the child account | [optional]
-**email** | **int** | Required if sms credits are empty. Email credits to be removed from the child account | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/RequestContactExport.md b/docs/Model/RequestContactExport.md
index ac02086..1b27882 100644
--- a/docs/Model/RequestContactExport.md
+++ b/docs/Model/RequestContactExport.md
@@ -1,12 +1,11 @@
-# RequestContactExport
+# # RequestContactExport
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**exportAttributes** | **string[]** | List of all the attributes that you want to export. These attributes must be present in your contact database. For example, ['fname', 'lname', 'email']. | [optional]
-**customContactFilter** | [**\Brevo\Client\Model\RequestContactExportCustomContactFilter**](RequestContactExportCustomContactFilter.md) | |
-**notifyUrl** | **string** | Webhook that will be called once the export process is finished. For reference, https://help.brevo.com/hc/en-us/articles/360007666479 | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**customContactFilter** | [**\Brevo\Client\Models\RequestContactExportCustomContactFilter**](RequestContactExportCustomContactFilter.md) | |
+**exportAttributes** | **string[]** | List of all the attributes that you want to export. **These attributes must be present in your contact database.** For example: **['fname', 'lname', 'email']** | [optional]
+**notifyUrl** | **string** | Webhook that will be called once the export process is finished. For reference, https://help.brevo.com/hc/en-us/articles/360007666479 | [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/RequestContactExportCustomContactFilter.md b/docs/Model/RequestContactExportCustomContactFilter.md
index 66079ef..a03807a 100644
--- a/docs/Model/RequestContactExportCustomContactFilter.md
+++ b/docs/Model/RequestContactExportCustomContactFilter.md
@@ -1,15 +1,14 @@
-# RequestContactExportCustomContactFilter
+# # RequestContactExportCustomContactFilter
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**actionForContacts** | **string** | Mandatory if neither actionForEmailCampaigns nor actionForSmsCampaigns is passed. This will export the contacts on the basis of provided action applied on contacts as per the list id. * allContacts - Fetch the list of all contacts for a particular list. * subscribed & unsubscribed - Fetch the list of subscribed / unsubscribed (blacklisted via any means) contacts for a particular list. * unsubscribedPerList - Fetch the list of contacts that are unsubscribed from a particular list only. | [optional]
-**actionForEmailCampaigns** | **string** | Mandatory if neither actionForContacts nor actionForSmsCampaigns is passed. This will export the contacts on the basis of provided action applied on email campaigns. * openers & nonOpeners - emailCampaignId is mandatory. Fetch the list of readers / non-readers for a particular email campaign. * clickers & nonClickers - emailCampaignId is mandatory. Fetch the list of clickers / non-clickers for a particular email campaign. * unsubscribed - emailCampaignId is mandatory. Fetch the list of all unsubscribed (blacklisted via any means) contacts for a particular email campaign. * hardBounces & softBounces - emailCampaignId is optional. Fetch the list of hard bounces / soft bounces for a particular / all email campaign(s). | [optional]
-**actionForSmsCampaigns** | **string** | Mandatory if neither actionForContacts nor actionForEmailCampaigns is passed. This will export the contacts on the basis of provided action applied on sms campaigns. * unsubscribed - Fetch the list of all unsubscribed (blacklisted via any means) contacts for all / particular sms campaigns. * hardBounces & softBounces - Fetch the list of hard bounces / soft bounces for all / particular sms campaigns. | [optional]
-**listId** | **int** | Mandatory if actionForContacts is passed, ignored otherwise. Id of the list for which the corresponding action shall be applied in the filter. | [optional]
-**emailCampaignId** | **int** | Considered only if actionForEmailCampaigns is passed, ignored otherwise. Mandatory if action is one of the following - openers, nonOpeners, clickers, nonClickers, unsubscribed. The id of the email campaign for which the corresponding action shall be applied in the filter. | [optional]
-**smsCampaignId** | **int** | Considered only if actionForSmsCampaigns is passed, ignored otherwise. The id of sms campaign for which the corresponding action shall be applied in the filter. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
+**actionForContacts** | **string** | **Mandatory if neither actionForEmailCampaigns nor actionForSmsCampaigns is passed.** This will export the contacts on the basis of provided action applied on contacts as per the list id. * **allContacts** - Fetch the list of all contacts for a particular list. * **subscribed & unsubscribed** - Fetch the list of subscribed / unsubscribed (blacklisted via any means) contacts for a particular list. * **unsubscribedPerList** - Fetch the list of contacts that are unsubscribed from a particular list only. | [optional]
+**actionForEmailCampaigns** | **string** | **Mandatory if neither actionForContacts nor actionForSmsCampaigns is passed.** This will export the contacts on the basis of provided action applied on email campaigns. * **openers & nonOpeners** - emailCampaignId is mandatory. Fetch the list of readers / non-readers for a particular email campaign. * **clickers & nonClickers** - emailCampaignId is mandatory. Fetch the list of clickers / non-clickers for a particular email campaign. * **unsubscribed** - emailCampaignId is mandatory. Fetch the list of all unsubscribed (blacklisted via any means) contacts for a particular email campaign. * **hardBounces & softBounces** - emailCampaignId is optional. Fetch the list of hard bounces / soft bounces for a particular / all email campaign(s). | [optional]
+**actionForSmsCampaigns** | **string** | **Mandatory if neither actionForContacts nor actionForEmailCampaigns is passed.** This will export the contacts on the basis of provided action applied on sms campaigns. * **unsubscribed** - Fetch the list of all unsubscribed (blacklisted via any means) contacts for all / particular sms campaigns. * **hardBounces & softBounces** - Fetch the list of hard bounces / soft bounces for all / particular sms campaigns. | [optional]
+**listId** | **int** | **Mandatory if actionForContacts is passed, ignored otherwise.** Id of the list for which the corresponding action shall be applied in the filter. | [optional]
+**emailCampaignId** | **int** | Considered only if **actionForEmailCampaigns** is passed, ignored otherwise. **Mandatory if action is one of the following - openers, nonOpeners, clickers, nonClickers, unsubscribed.** The id of the email campaign for which the corresponding action shall be applied in the filter. | [optional]
+**smsCampaignId** | **int** | Considered only if **actionForSmsCampaigns** is passed, ignored otherwise. The id of sms campaign for which the corresponding action shall be applied in the filter. | [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/RequestContactImport.md b/docs/Model/RequestContactImport.md
index d145d9b..1ecd3ef 100644
--- a/docs/Model/RequestContactImport.md
+++ b/docs/Model/RequestContactImport.md
@@ -1,20 +1,19 @@
-# RequestContactImport
+# # RequestContactImport
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**fileUrl** | **string** | Mandatory if fileBody or jsonBody is not defined. URL of the file to be imported (no local file). Possible file formats: .txt, .csv, .json | [optional]
-**fileBody** | **string** | Mandatory if fileUrl and jsonBody is not defined. CSV content to be imported. Use semicolon to separate multiple attributes. Maximum allowed file body size is 10MB . However we recommend a safe limit of around 8 MB to avoid the issues caused due to increase of file body size while parsing. Please use fileUrl instead to import bigger files. | [optional]
-**jsonBody** | [**\Brevo\Client\Model\RequestContactImportJsonBody[]**](RequestContactImportJsonBody.md) | **Mandatory if fileUrl and fileBody is not defined.** JSON content to be imported. **Maximum allowed json body size is 10MB** . However we recommend a safe limit of around 8 MB to avoid the issues caused due to increase of json body size while parsing. Please use fileUrl instead to import bigger files. | [optional]
-**listIds** | **int[]** | Mandatory if newList is not defined. Ids of the lists in which the contacts shall be imported. For example, [2, 4, 7]. | [optional]
-**notifyUrl** | **string** | URL that will be called once the import process is finished. For reference, https://help.brevo.com/hc/en-us/articles/360007666479 | [optional]
-**newList** | [**\Brevo\Client\Model\RequestContactImportNewList**](RequestContactImportNewList.md) | | [optional]
+**fileUrl** | **string** | **Mandatory if fileBody and jsonBody is not defined.** URL of the file to be imported (**no local file**). Possible file formats: #### .txt, .csv, .json | [optional]
+**fileBody** | **string** | **Mandatory if fileUrl and jsonBody is not defined.** CSV content to be imported. Use semicolon to separate multiple attributes. **Maximum allowed file body size is 10MB** . However we recommend a safe limit of around 8 MB to avoid the issues caused due to increase of file body size while parsing. Please use fileUrl instead to import bigger files. | [optional]
+**jsonBody** | [**\Brevo\Client\Models\RequestContactImportJsonBodyInner[]**](RequestContactImportJsonBodyInner.md) | **Mandatory if fileUrl and fileBody is not defined.** JSON content to be imported. **Maximum allowed json body size is 10MB** . However we recommend a safe limit of around 8 MB to avoid the issues caused due to increase of json body size while parsing. Please use fileUrl instead to import bigger files. | [optional]
+**listIds** | **int[]** | **Mandatory if newList is not defined.** Ids of the lists in which the contacts shall be imported. For example, **[2, 4, 7]**. | [optional]
+**notifyUrl** | **string** | URL that will be called once the import process is finished. For reference, https://help.brevo.com/hc/en-us/articles/360007666479 | [optional]
+**newList** | [**\Brevo\Client\Models\RequestContactImportNewList**](RequestContactImportNewList.md) | | [optional]
**emailBlacklist** | **bool** | To blacklist all the contacts for email | [optional] [default to false]
**disableNotification** | **bool** | To disable email notification | [optional] [default to false]
**smsBlacklist** | **bool** | To blacklist all the contacts for sms | [optional] [default to false]
**updateExistingContacts** | **bool** | To facilitate the choice to update the existing contacts | [optional] [default to true]
-**emptyContactsAttributes** | **bool** | To facilitate the choice to erase any attribute of the existing contacts with empty value. emptyContactsAttributes = true means the empty fields in your import will erase any attribute that currently contain data in Brevo, & emptyContactsAttributes = false means the empty fields will not affect your existing data ( only available if `updateExistingContacts` set to true ) | [optional] [default to false]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**emptyContactsAttributes** | **bool** | To facilitate the choice to erase any attribute of the existing contacts with empty value. emptyContactsAttributes = true means the empty fields in your import will erase any attribute that currently contain data in Brevo, & emptyContactsAttributes = false means the empty fields will not affect your existing data ( **only available if `updateExistingContacts` set to true **) | [optional] [default to false]
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/RequestContactImportJsonBody.md b/docs/Model/RequestContactImportJsonBody.md
deleted file mode 100644
index 4dcb144..0000000
--- a/docs/Model/RequestContactImportJsonBody.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# RequestContactImportJsonBody
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**email** | **string** | | [optional]
-**attributes** | **object** | List of attributes to be imported | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/RequestContactImportJsonBodyInner.md b/docs/Model/RequestContactImportJsonBodyInner.md
new file mode 100644
index 0000000..5660128
--- /dev/null
+++ b/docs/Model/RequestContactImportJsonBodyInner.md
@@ -0,0 +1,10 @@
+# # RequestContactImportJsonBodyInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**email** | **string** | | [optional]
+**attributes** | **array** | List of attributes to be imported | [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/RequestContactImportNewList.md b/docs/Model/RequestContactImportNewList.md
index 049ee8f..fa8175d 100644
--- a/docs/Model/RequestContactImportNewList.md
+++ b/docs/Model/RequestContactImportNewList.md
@@ -1,11 +1,10 @@
-# RequestContactImportNewList
+# # RequestContactImportNewList
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**listName** | **string** | List with listName will be created first and users will be imported in it (Mandatory if listIds is empty). | [optional]
-**folderId** | **int** | Id of the folder where this new list shall be created (Mandatory if listName is not empty). | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**listName** | **string** | List with listName will be created first and users will be imported in it. **Mandatory if listIds is empty**. | [optional]
+**folderId** | **int** | Id of the folder where this new list shall be created. **Mandatory if listName is not empty** | [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/RequestSmsRecipientExport.md b/docs/Model/RequestSmsRecipientExport.md
index 5d7d7d2..501ae6b 100644
--- a/docs/Model/RequestSmsRecipientExport.md
+++ b/docs/Model/RequestSmsRecipientExport.md
@@ -1,11 +1,10 @@
-# RequestSmsRecipientExport
+# # RequestSmsRecipientExport
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**notifyURL** | **string** | URL that will be called once the export process is finished. For reference, https://help.brevo.com/hc/en-us/articles/360007666479 | [optional]
-**recipientsType** | **string** | Filter the recipients based on how they interacted with the campaign |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**recipientsType** | **string** | Filter the recipients based on how they interacted with the campaign |
+**notifyURL** | **string** | URL that will be called once the export process is finished. For reference, https://help.brevo.com/hc/en-us/articles/360007666479 | [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/RewardAttributionResponse.md b/docs/Model/RewardAttributionResponse.md
new file mode 100644
index 0000000..294eaac
--- /dev/null
+++ b/docs/Model/RewardAttributionResponse.md
@@ -0,0 +1,17 @@
+# # RewardAttributionResponse
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | Attributed reward Id | [optional]
+**rewardId** | **string** | Reward id which ias attributed | [optional]
+**loyaltyProgramId** | **string** | Loyalty program id | [optional]
+**contactId** | **float** | Contact to which reward is attributed | [optional]
+**code** | **string** | code associated to the attributed reward | [optional]
+**expirationDate** | **\DateTime** | | [optional]
+**consumedAt** | **\DateTime** | | [optional]
+**createdAt** | **\DateTime** | | [optional]
+**updatedAt** | **\DateTime** | | [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/RewardRedeemResponse.md b/docs/Model/RewardRedeemResponse.md
new file mode 100644
index 0000000..5a8611c
--- /dev/null
+++ b/docs/Model/RewardRedeemResponse.md
@@ -0,0 +1,17 @@
+# # RewardRedeemResponse
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | Attributed reward Id | [optional]
+**rewardId** | **string** | Reward id which ias attributed | [optional]
+**loyaltyProgramId** | **string** | Loyalty program id | [optional]
+**contactId** | **float** | Contact to which reward is attributed | [optional]
+**code** | **string** | code associated to the attributed reward | [optional]
+**consumedAt** | **\DateTime** | | [optional]
+**expirationDate** | **\DateTime** | | [optional]
+**createdAt** | **\DateTime** | | [optional]
+**updatedAt** | **\DateTime** | | [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/ScheduleSmtpEmail.md b/docs/Model/ScheduleSmtpEmail.md
index a707441..5360897 100644
--- a/docs/Model/ScheduleSmtpEmail.md
+++ b/docs/Model/ScheduleSmtpEmail.md
@@ -1,12 +1,11 @@
-# ScheduleSmtpEmail
+# # ScheduleSmtpEmail
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**messageId** | **string** | Message ID of the transactional email scheduled | [optional]
-**messageIds** | **string[]** | | [optional]
-**batchId** | **string** | Batch ID of the batch transactional email scheduled | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**messageId** | **string** | Message ID of the transactional email scheduled | [optional]
+**messageIds** | **string[]** | | [optional]
+**batchId** | **string** | Batch ID of the batch transactional email scheduled | [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/Segment.md b/docs/Model/Segment.md
new file mode 100644
index 0000000..1417cad
--- /dev/null
+++ b/docs/Model/Segment.md
@@ -0,0 +1,12 @@
+# # Segment
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | ID of the list |
+**segmentName** | **string** | Name of the Segment |
+**categoryName** | **string** | Name of the Segment Category |
+**updatedAt** | **string** | Updation UTC date-time of the segment (YYYY-MM-DDTHH:mm:ss.SSSZ) | [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/SendReport.md b/docs/Model/SendReport.md
index c16702a..755ea40 100644
--- a/docs/Model/SendReport.md
+++ b/docs/Model/SendReport.md
@@ -1,11 +1,10 @@
-# SendReport
+# # SendReport
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
+**email** | [**\Brevo\Client\Models\SendReportEmail**](SendReportEmail.md) | |
**language** | **string** | Language of email content for campaign report sending. | [optional] [default to 'fr']
-**email** | [**\Brevo\Client\Model\SendReportEmail**](SendReportEmail.md) | |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.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/SendReportEmail.md b/docs/Model/SendReportEmail.md
index 0485128..c182dd6 100644
--- a/docs/Model/SendReportEmail.md
+++ b/docs/Model/SendReportEmail.md
@@ -1,11 +1,10 @@
-# SendReportEmail
+# # SendReportEmail
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**to** | **string[]** | Email addresses of the recipients |
-**body** | **string** | Custom text message to be presented in the report email. |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**to** | **string[]** | Email addresses of the recipients |
+**body** | **string** | Custom text message to be presented in the report email. |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/SendSms.md b/docs/Model/SendSms.md
index dc51cd6..e88c1ea 100644
--- a/docs/Model/SendSms.md
+++ b/docs/Model/SendSms.md
@@ -1,14 +1,13 @@
-# SendSms
+# # SendSms
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**reference** | **string** | |
-**messageId** | **int** | |
-**smsCount** | **int** | Count of SMS's to send multiple text messages | [optional]
-**usedCredits** | **float** | SMS credits used per text message | [optional]
-**remainingCredits** | **float** | Remaining SMS credits of the user | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**reference** | **string** | |
+**messageId** | **int** | |
+**smsCount** | **int** | Count of SMS's to send multiple text messages | [optional]
+**usedCredits** | **float** | SMS credits used per text message | [optional]
+**remainingCredits** | **float** | Remaining SMS credits of the user | [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/SendSmtpEmail.md b/docs/Model/SendSmtpEmail.md
index 8c6d539..3b17447 100644
--- a/docs/Model/SendSmtpEmail.md
+++ b/docs/Model/SendSmtpEmail.md
@@ -1,25 +1,24 @@
-# SendSmtpEmail
+# # SendSmtpEmail
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**sender** | [**\Brevo\Client\Model\SendSmtpEmailSender**](SendSmtpEmailSender.md) | | [optional]
-**to** | [**\Brevo\Client\Model\SendSmtpEmailTo[]**](SendSmtpEmailTo.md) | Mandatory if messageVersions are not passed, ignored if messageVersions are passed. List of email addresses and names (optional) of the recipients. For example, [{\"name\":\"Jimmy\", \"email\":\"jimmy98@example.com\"}, {\"name\":\"Joe\", \"email\":\"joe@example.com\"}] | [optional]
-**bcc** | [**\Brevo\Client\Model\SendSmtpEmailBcc[]**](SendSmtpEmailBcc.md) | List of email addresses and names (optional) of the recipients in bcc | [optional]
-**cc** | [**\Brevo\Client\Model\SendSmtpEmailCc[]**](SendSmtpEmailCc.md) | List of email addresses and names (optional) of the recipients in cc | [optional]
-**htmlContent** | **string** | HTML body of the message ( Mandatory if 'templateId' is not passed, ignored if 'templateId' is passed ) | [optional]
-**textContent** | **string** | Plain Text body of the message ( Ignored if 'templateId' is passed ) | [optional]
-**subject** | **string** | Subject of the message. Mandatory if 'templateId' is not passed | [optional]
-**replyTo** | [**\Brevo\Client\Model\SendSmtpEmailReplyTo**](SendSmtpEmailReplyTo.md) | | [optional]
-**attachment** | [**\Brevo\Client\Model\SendSmtpEmailAttachment[]**](SendSmtpEmailAttachment.md) | Pass the absolute URL (no local file) or the base64 content of the attachment along with the attachment name (Mandatory if attachment content is passed). For example, `[{\"url\":\"https://attachment.domain.com/myAttachmentFromUrl.jpg\", \"name\":\"myAttachmentFromUrl.jpg\"}, {\"content\":\"base64 example content\", \"name\":\"myAttachmentFromBase64.jpg\"}]`. Allowed extensions for attachment file: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub, eps, odt, mp3, m4a, m4v, wma, ogg, flac, wav, aif, aifc, aiff, mp4, mov, avi, mkv, mpeg, mpg, wmv, pkpass and xlsm ( If 'templateId' is passed and is in New Template Language format then both attachment url and content are accepted. If template is in Old template Language format, then 'attachment' is ignored ) | [optional]
-**headers** | **object** | Pass the set of custom headers (not the standard headers) that shall be sent along the mail headers in the original email. 'sender.ip' header can be set (only for dedicated ip users) to mention the IP to be used for sending transactional emails. Headers are allowed in `This-Case-Only` (i.e. words separated by hyphen with first letter of each word in capital letter), they will be converted to such case styling if not in this format in the request payload. For example, `{\"sender.ip\":\"1.2.3.4\", \"X-Mailin-custom\":\"some_custom_header\",\"idempotencyKey\":\"abc-123\"}`. | [optional]
-**templateId** | **int** | Id of the template. | [optional]
-**params** | **object** | Pass the set of attributes to customize the template. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. It's considered only if template is in New Template Language format. | [optional]
-**messageVersions** | [**\Brevo\Client\Model\SendSmtpEmailMessageVersions[]**](SendSmtpEmailMessageVersions.md) | You can customize and send out multiple versions of a mail. templateId can be customized only if global parameter contains templateId. htmlContent and textContent can be customized only if any of the two, htmlContent or textContent, is present in global parameters. Some global parameters such as **to(mandatory), bcc, cc, replyTo, subject** can also be customized specific to each version. Total number of recipients in one API request must not exceed 2000. However, you can still pass upto 99 recipients maximum in one message version. The size of individual params in all the messageVersions shall not exceed 100 KB limit and that of cumulative params shall not exceed 1000 KB. You can follow this **step-by-step guide** on how to use **messageVersions** to batch send emails - https://developers.brevo.com/docs/batch-send-transactional-emails | [optional]
-**tags** | **string[]** | Tag your emails to find them more easily | [optional]
-**scheduledAt** | [**\DateTime**] | UTC date-time on which the email has to schedule (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for scheduling. There can be an expected delay of +5 minutes in scheduled email delivery. **Please note this feature is currently a public beta**. | [optional]
-**batchId** | **string** | Valid UUIDv4 batch id to identify the scheduled batches transactional email. If not passed we will create a valid UUIDv4 batch id at our end. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**sender** | [**\Brevo\Client\Models\SendSmtpEmailSender**](SendSmtpEmailSender.md) | | [optional]
+**to** | [**\Brevo\Client\Models\SendSmtpEmailToInner[]**](SendSmtpEmailToInner.md) | **Mandatory if messageVersions are not passed, ignored if messageVersions are passed** List of email addresses and names (_optional_) of the recipients. For example, **[{\"name\":\"Jimmy\", \"email\":\"jimmy98@example.com\"}, {\"name\":\"Joe\", \"email\":\"joe@example.com\"}]** | [optional]
+**bcc** | [**\Brevo\Client\Models\SendSmtpEmailBccInner[]**](SendSmtpEmailBccInner.md) | List of email addresses and names (_optional_) of the recipients in bcc | [optional]
+**cc** | [**\Brevo\Client\Models\SendSmtpEmailCcInner[]**](SendSmtpEmailCcInner.md) | List of email addresses and names (_optional_) of the recipients in cc | [optional]
+**htmlContent** | **string** | HTML body of the message. **Mandatory if 'templateId' is not passed, ignored if 'templateId' is passed** | [optional]
+**textContent** | **string** | Plain Text body of the message. **Ignored if 'templateId' is passed** | [optional]
+**subject** | **string** | Subject of the message. **Mandatory if 'templateId' is not passed** | [optional]
+**replyTo** | [**\Brevo\Client\Models\SendSmtpEmailReplyTo**](SendSmtpEmailReplyTo.md) | | [optional]
+**attachment** | [**\Brevo\Client\Models\SendSmtpEmailAttachmentInner[]**](SendSmtpEmailAttachmentInner.md) | Pass the _absolute URL_ (**no local file**) or the _base64 content_ of the attachment along with the attachment name. **Mandatory if attachment content is passed**. For example, **[{\"url\":\"https://attachment.domain.com/myAttachmentFromUrl.jpg\", \"name\":\"myAttachmentFromUrl.jpg\"}, {\"content\":\"base64 example content\", \"name\":\"myAttachmentFromBase64.jpg\"}]**. Allowed extensions for attachment file: #### xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub, eps, odt, mp3, m4a, m4v, wma, ogg, flac, wav, aif, aifc, aiff, mp4, mov, avi, mkv, mpeg, mpg, wmv, pkpass and xlsm. If `templateId` is passed and is in New Template Language format then both attachment url and content are accepted. If template is in Old template Language format, then `attachment` is ignored | [optional]
+**headers** | **array** | Pass the set of custom headers (_not the standard headers_) that shall be sent along the mail headers in the original email. **'sender.ip'** header can be set (**only for dedicated ip users**) to mention the IP to be used for sending transactional emails. Headers are allowed in `This-Case-Only` (i.e. words separated by hyphen with first letter of each word in capital letter), they will be converted to such case styling if not in this format in the request payload. For example, **{\"sender.ip\":\"1.2.3.4\", \"X-Mailin-custom\":\"some_custom_header\", \"idempotencyKey\":\"abc-123\"}**. | [optional]
+**templateId** | **int** | Id of the template. | [optional]
+**params** | **array** | Pass the set of attributes to customize the template. For example, **{\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}**. It's **considered only if template is in New Template Language format**. | [optional]
+**messageVersions** | [**\Brevo\Client\Models\SendSmtpEmailMessageVersionsInner[]**](SendSmtpEmailMessageVersionsInner.md) | You can customize and send out multiple versions of a mail. **templateId** can be customized only if global parameter contains templateId. **htmlContent and textContent** can be customized only if any of the two, htmlContent or textContent, is present in global parameters. Some global parameters such as **to(mandatory), bcc, cc, replyTo, subject** can also be customized specific to each version. Total number of recipients in one API request must not exceed 2000. However, you can still pass upto 99 recipients maximum in one message version. The size of individual params in all the messageVersions shall not exceed **100 KB** limit and that of cumulative params shall not exceed **1000 KB**. You can follow this **step-by-step guide** on how to use **messageVersions** to batch send emails - **https://developers.brevo.com/docs/batch-send-transactional-emails** | [optional]
+**tags** | **string[]** | Tag your emails to find them more easily | [optional]
+**scheduledAt** | **\DateTime** | UTC date-time on which the email has to schedule (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for scheduling. There can be an expected delay of +5 minutes in scheduled email delivery. | [optional]
+**batchId** | **string** | Valid UUIDv4 batch id to identify the scheduled batches transactional email. If not passed we will create a valid UUIDv4 batch id at our end. | [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/SendSmtpEmailAttachment.md b/docs/Model/SendSmtpEmailAttachment.md
deleted file mode 100644
index 713d2cf..0000000
--- a/docs/Model/SendSmtpEmailAttachment.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# SendSmtpEmailAttachment
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**url** | **string** | Absolute url of the attachment (no local file). | [optional]
-**content** | **string** | Base64 encoded chunk data of the attachment generated on the fly | [optional]
-**name** | **string** | Required if content is passed. Name of the attachment | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/SendSmtpEmailAttachmentInner.md b/docs/Model/SendSmtpEmailAttachmentInner.md
new file mode 100644
index 0000000..6eb8e0f
--- /dev/null
+++ b/docs/Model/SendSmtpEmailAttachmentInner.md
@@ -0,0 +1,11 @@
+# # SendSmtpEmailAttachmentInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**url** | **string** | Absolute url of the attachment (**no local file**). | [optional]
+**content** | **string** | Base64 encoded chunk data of the attachment generated on the fly | [optional]
+**name** | **string** | **Required if content is passed**. Name of the attachment | [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/SendSmtpEmailBcc.md b/docs/Model/SendSmtpEmailBcc.md
deleted file mode 100644
index 3804644..0000000
--- a/docs/Model/SendSmtpEmailBcc.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# SendSmtpEmailBcc
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**email** | **string** | Email address of the recipient in bcc |
-**name** | **string** | Name of the recipient in bcc. Maximum allowed characters are 70. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/SendSmtpEmailBccInner.md b/docs/Model/SendSmtpEmailBccInner.md
new file mode 100644
index 0000000..e924bd5
--- /dev/null
+++ b/docs/Model/SendSmtpEmailBccInner.md
@@ -0,0 +1,10 @@
+# # SendSmtpEmailBccInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**email** | **string** | Email address of the recipient in bcc |
+**name** | **string** | Name of the recipient in bcc. **Maximum allowed characters are 70**. | [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/SendSmtpEmailCc.md b/docs/Model/SendSmtpEmailCc.md
deleted file mode 100644
index a36ff0d..0000000
--- a/docs/Model/SendSmtpEmailCc.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# SendSmtpEmailCc
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**email** | **string** | Email address of the recipient in cc |
-**name** | **string** | Name of the recipient in cc. Maximum allowed characters are 70. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/SendSmtpEmailCcInner.md b/docs/Model/SendSmtpEmailCcInner.md
new file mode 100644
index 0000000..5546a00
--- /dev/null
+++ b/docs/Model/SendSmtpEmailCcInner.md
@@ -0,0 +1,10 @@
+# # SendSmtpEmailCcInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**email** | **string** | Email address of the recipient in cc |
+**name** | **string** | Name of the recipient in cc. **Maximum allowed characters are 70**. | [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/SendSmtpEmailMessageVersions.md b/docs/Model/SendSmtpEmailMessageVersions.md
deleted file mode 100644
index 7f024e8..0000000
--- a/docs/Model/SendSmtpEmailMessageVersions.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# SendSmtpEmailMessageVersions
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**to** | [**\Brevo\Client\Model\SendSmtpEmailTo1[]**](SendSmtpEmailTo1.md) | List of email addresses and names (_optional_) of the recipients. For example, [{\"name\":\"Jimmy\", \"email\":\"jimmy98@example.com\"}, {\"name\":\"Joe\", \"email\":\"joe@example.com\"}] |
-**params** | **map[string,object]** | Pass the set of attributes to customize the template. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. It's considered only if template is in New Template Language format. | [optional]
-**bcc** | [**\Brevo\Client\Model\SendSmtpEmailBcc[]**](SendSmtpEmailBcc.md) | List of email addresses and names (optional) of the recipients in bcc | [optional]
-**cc** | [**\Brevo\Client\Model\SendSmtpEmailCc[]**](SendSmtpEmailCc.md) | List of email addresses and names (optional) of the recipients in cc | [optional]
-**replyTo** | [**\Brevo\Client\Model\SendSmtpEmailReplyTo1**](SendSmtpEmailReplyTo1.md) | | [optional]
-**subject** | **string** | Custom subject specific to message version | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/SendSmtpEmailMessageVersionsInner.md b/docs/Model/SendSmtpEmailMessageVersionsInner.md
new file mode 100644
index 0000000..7f0fd32
--- /dev/null
+++ b/docs/Model/SendSmtpEmailMessageVersionsInner.md
@@ -0,0 +1,16 @@
+# # SendSmtpEmailMessageVersionsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**to** | [**\Brevo\Client\Models\SendSmtpEmailToInner[]**](SendSmtpEmailToInner.md) | List of email addresses and names (_optional_) of the recipients. For example, **[{\"name\":\"Jimmy\", \"email\":\"jimmy98@example.com\"}, {\"name\":\"Joe\", \"email\":\"joe@example.com\"}]** |
+**params** | **array** | Pass the set of attributes to customize the template. For example, **{\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}**. It's **considered only if template is in New Template Language format**. | [optional]
+**bcc** | [**\Brevo\Client\Models\SendSmtpEmailBccInner[]**](SendSmtpEmailBccInner.md) | List of email addresses and names (_optional_) of the recipients in bcc | [optional]
+**cc** | [**\Brevo\Client\Models\SendSmtpEmailCcInner[]**](SendSmtpEmailCcInner.md) | List of email addresses and names (_optional_) of the recipients in cc | [optional]
+**replyTo** | [**\Brevo\Client\Models\SendSmtpEmailReplyTo**](SendSmtpEmailReplyTo.md) | | [optional]
+**subject** | **string** | Custom subject specific to message version | [optional]
+**htmlContent** | **string** | HTML body of the message. **Mandatory if 'templateId' is not passed, ignored if 'templateId' is passed** | [optional]
+**textContent** | **string** | Plain Text body of the message. **Ignored if 'templateId' is passed** | [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/SendSmtpEmailReplyTo.md b/docs/Model/SendSmtpEmailReplyTo.md
index 1dc896b..72695ce 100644
--- a/docs/Model/SendSmtpEmailReplyTo.md
+++ b/docs/Model/SendSmtpEmailReplyTo.md
@@ -1,11 +1,10 @@
-# SendSmtpEmailReplyTo
+# # SendSmtpEmailReplyTo
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**email** | **string** | Email address in reply to |
-**name** | **string** | Name in reply to. Maximum allowed characters are 70. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**email** | **string** | Email address in reply to |
+**name** | **string** | Name in reply to. **Maximum allowed characters are 70**. | [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/SendSmtpEmailReplyTo1.md b/docs/Model/SendSmtpEmailReplyTo1.md
deleted file mode 100644
index f00cae6..0000000
--- a/docs/Model/SendSmtpEmailReplyTo1.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# SendSmtpEmailReplyTo1
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**email** | **string** | Email address in reply to |
-**name** | **string** | Name in reply to. Maximum allowed characters are 70. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/SendSmtpEmailSender.md b/docs/Model/SendSmtpEmailSender.md
index e719f84..4ba7bb7 100644
--- a/docs/Model/SendSmtpEmailSender.md
+++ b/docs/Model/SendSmtpEmailSender.md
@@ -1,12 +1,11 @@
-# SendSmtpEmailSender
+# # SendSmtpEmailSender
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**name** | **string** | Name of the sender from which the emails will be sent. Maximum allowed characters are 70. Applicable only when email is passed. | [optional]
-**email** | **string** | Email of the sender from which the emails will be sent. Mandatory if sender id is not passed. | [optional]
-**id** | **int** | Id of the sender from which the emails will be sent. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). Mandatory if email is not passed. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**name** | **string** | description: Name of the sender from which the emails will be sent. **Maximum allowed characters are 70**. Applicable only when email is passed. | [optional]
+**email** | **string** | Email of the sender from which the emails will be sent. Mandatory if sender id is not passed. | [optional]
+**id** | **int** | Id of the sender from which the emails will be sent. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). Mandatory if email is not passed. | [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/SendSmtpEmailTo.md b/docs/Model/SendSmtpEmailTo.md
deleted file mode 100644
index bbba303..0000000
--- a/docs/Model/SendSmtpEmailTo.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# SendSmtpEmailTo
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**email** | **string** | Email address of the recipient |
-**name** | **string** | Name of the recipient. Maximum allowed characters are 70. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/SendSmtpEmailTo1.md b/docs/Model/SendSmtpEmailTo1.md
deleted file mode 100644
index 0a90e7d..0000000
--- a/docs/Model/SendSmtpEmailTo1.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# SendSmtpEmailTo1
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**email** | **string** | Email address of the recipient |
-**name** | **string** | Name of the recipient. **Maximum allowed characters are 70**. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/SendSmtpEmailToInner.md b/docs/Model/SendSmtpEmailToInner.md
new file mode 100644
index 0000000..86a56af
--- /dev/null
+++ b/docs/Model/SendSmtpEmailToInner.md
@@ -0,0 +1,10 @@
+# # SendSmtpEmailToInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**email** | **string** | Email address of the recipient |
+**name** | **string** | Name of the recipient. **Maximum allowed characters are 70**. | [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/SendTestEmail.md b/docs/Model/SendTestEmail.md
index ed3e02b..3ed64b7 100644
--- a/docs/Model/SendTestEmail.md
+++ b/docs/Model/SendTestEmail.md
@@ -1,10 +1,9 @@
-# SendTestEmail
+# # SendTestEmail
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**emailTo** | **string[]** | List of the email addresses of the recipients whom you wish to send the test mail. If left empty, the test mail will be sent to your entire test list. You can not send more than 50 test emails per day. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**emailTo** | **string[]** | List of the email addresses of the recipients whom you wish to send the test mail. _If left empty, the test mail will be sent to your entire test list. You can not send more than 50 test emails per day_. | [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/SendTestSms.md b/docs/Model/SendTestSms.md
index 0cd00d7..31c86ba 100644
--- a/docs/Model/SendTestSms.md
+++ b/docs/Model/SendTestSms.md
@@ -1,10 +1,9 @@
-# SendTestSms
+# # SendTestSms
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**phoneNumber** | **string** | Mobile number of the recipient with the country code. This number must belong to one of your contacts in Brevo account and must not be blacklisted | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**phoneNumber** | **string** | Mobile number of the recipient with the country code. This number **must belong to one of your contacts in Brevo account and must not be blacklisted** | [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/SendTransacSms.md b/docs/Model/SendTransacSms.md
index f1bddc2..2bef017 100644
--- a/docs/Model/SendTransacSms.md
+++ b/docs/Model/SendTransacSms.md
@@ -1,17 +1,16 @@
-# SendTransacSms
+# # SendTransacSms
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**sender** | **string** | Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** |
-**recipient** | **string** | Mobile number to send SMS with the country code |
-**content** | **string** | Content of the message. If more than 160 characters long, will be sent as multiple text messages |
+**sender** | **string** | Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** |
+**recipient** | **string** | Mobile number to send SMS with the country code |
+**content** | **string** | Content of the message. If more than **160 characters** long, will be sent as multiple text messages |
**type** | **string** | Type of the SMS. Marketing SMS messages are those sent typically with marketing content. Transactional SMS messages are sent to individuals and are triggered in response to some action, such as a sign-up, purchase, etc. | [optional] [default to 'transactional']
-**tag** | **string** | Tag of the message | [optional]
-**webUrl** | **string** | Webhook to call for each event triggered by the message (delivered etc.) | [optional]
+**tag** | **string** | Tag of the message | [optional]
+**webUrl** | **string** | Webhook to call for each event triggered by the message (delivered etc.) | [optional]
**unicodeEnabled** | **bool** | Format of the message. It indicates whether the content should be treated as unicode or not. | [optional] [default to false]
-**organisationPrefix** | **string** | A recognizable prefix will ensure your audience knows who you are. Recommended by U.S. carriers. This will be added as your Brand Name before the message content. **Prefer verifying maximum length of 160 characters including this prefix in message content to avoid multiple sending of same sms.** | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**organisationPrefix** | **string** | A recognizable prefix will ensure your audience knows who you are. Recommended by U.S. carriers. This will be added as your Brand Name before the message content. **Prefer verifying maximum length of 160 characters including this prefix in message content to avoid multiple sending of same sms.** | [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/SendWhatsappMessage.md b/docs/Model/SendWhatsappMessage.md
deleted file mode 100644
index 3d27a53..0000000
--- a/docs/Model/SendWhatsappMessage.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# SendWhatsappMessage
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**templateId** | **int** | ID of the template to send | [optional]
-**text** | **string** | Text to be sent as message body (will be overridden if templateId is passed in the same request) | [optional]
-**senderNumber** | **string** | WhatsApp Number with country code. Example, 85264318721 |
-**params** | **object** | Pass the set of attributes to customize the template. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. | [optional]
-**contactNumbers** | **string[]** | List of phone numbers of the contacts |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/SendWhatsappMessage201Response.md b/docs/Model/SendWhatsappMessage201Response.md
new file mode 100644
index 0000000..b8d9301
--- /dev/null
+++ b/docs/Model/SendWhatsappMessage201Response.md
@@ -0,0 +1,9 @@
+# # SendWhatsappMessage201Response
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**messageId** | **string** | messageId of sent message |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/SendWhatsappMessageRequest.md b/docs/Model/SendWhatsappMessageRequest.md
new file mode 100644
index 0000000..3c56564
--- /dev/null
+++ b/docs/Model/SendWhatsappMessageRequest.md
@@ -0,0 +1,13 @@
+# # SendWhatsappMessageRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**templateId** | **int** | ID of the template to send |
+**senderNumber** | **string** | WhatsApp Number with country code. Example, 85264318721 |
+**contactNumbers** | **string[]** | List of phone numbers of the contacts |
+**text** | **string** | Text to be sent as message body (will be overridden if templateId is passed in the same request) |
+**params** | **object** | Pass the set of attributes to customize the template. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. | [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/SendWhatsappMessageTemplate.md b/docs/Model/SendWhatsappMessageTemplate.md
new file mode 100644
index 0000000..191156b
--- /dev/null
+++ b/docs/Model/SendWhatsappMessageTemplate.md
@@ -0,0 +1,12 @@
+# # SendWhatsappMessageTemplate
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**templateId** | **int** | ID of the template to send |
+**senderNumber** | **string** | WhatsApp Number with country code. Example, 85264318721 |
+**contactNumbers** | **string[]** | List of phone numbers of the contacts |
+**params** | **object** | Pass the set of attributes to customize the template. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. | [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/SendWhatsappMessageText.md b/docs/Model/SendWhatsappMessageText.md
new file mode 100644
index 0000000..29f429f
--- /dev/null
+++ b/docs/Model/SendWhatsappMessageText.md
@@ -0,0 +1,11 @@
+# # SendWhatsappMessageText
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**senderNumber** | **string** | WhatsApp Number with country code. Example, 85264318721 |
+**text** | **string** | Text to be sent as message body (will be overridden if templateId is passed in the same request) |
+**contactNumbers** | **string[]** | List of phone numbers of the contacts |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/SsoTokenRequest.md b/docs/Model/SsoTokenRequest.md
deleted file mode 100644
index b13114b..0000000
--- a/docs/Model/SsoTokenRequest.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# SsoTokenRequest
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**id** | **int** | Id of the sub-account organization |
-**email** | **string** | User email of sub-account organization | [optional]
-**target** | **string** | Set target after login success * automation - Redirect to Automation after login * email_campaign - Redirect to Email Campaign after login * contacts - Redirect to Contacts after login * landing_pages - Redirect to Landing Pages after login * email_transactional - Redirect to Email Transactional after login * senders - Redirect to Contacts after login * sms_campaign - Redirect to Sms Campaign after login * sms_transactional - Redirect to Sms Transactional after login | [optional]
-**url** | **string** | Set the full target URL after login success. The user will land directly on this target URL after login | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/SubAccountAppsToggleRequest.md b/docs/Model/SubAccountAppsToggleRequest.md
index edff60b..4f44cc7 100644
--- a/docs/Model/SubAccountAppsToggleRequest.md
+++ b/docs/Model/SubAccountAppsToggleRequest.md
@@ -1,22 +1,21 @@
-# SubAccountAppsToggleRequest
+# # SubAccountAppsToggleRequest
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**inbox** | **bool** | Set this field to enable or disable Inbox on the sub-account / Not applicable on ENTv2 | [optional]
-**whatsapp** | **bool** | Set this field to enable or disable Whatsapp campaigns on the sub-account | [optional]
-**automation** | **bool** | Set this field to enable or disable Automation on the sub-account | [optional]
-**emailCampaigns** | **bool** | Set this field to enable or disable Email Campaigns on the sub-account | [optional]
-**smsCampaigns** | **bool** | Set this field to enable or disable SMS Marketing on the sub-account | [optional]
-**landingPages** | **bool** | Set this field to enable or disable Landing pages on the sub-account | [optional]
-**transactionalEmails** | **bool** | Set this field to enable or disable Transactional Email on the sub-account | [optional]
-**transactionalSms** | **bool** | Set this field to enable or disable Transactional SMS on the sub-account | [optional]
-**facebookAds** | **bool** | Set this field to enable or disable Facebook ads on the sub-account | [optional]
-**webPush** | **bool** | Set this field to enable or disable Web Push on the sub-account | [optional]
-**meetings** | **bool** | Set this field to enable or disable Meetings on the sub-account | [optional]
-**conversations** | **bool** | Set this field to enable or disable Conversations on the sub-account | [optional]
-**crm** | **bool** | Set this field to enable or disable Sales CRM on the sub-account | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**inbox** | **bool** | Set this field to enable or disable Inbox on the sub-account / Not applicable on ENTv2 | [optional]
+**whatsapp** | **bool** | Set this field to enable or disable Whatsapp campaigns on the sub-account | [optional]
+**automation** | **bool** | Set this field to enable or disable Automation on the sub-account | [optional]
+**emailCampaigns** | **bool** | Set this field to enable or disable Email Campaigns on the sub-account | [optional]
+**smsCampaigns** | **bool** | Set this field to enable or disable SMS Marketing on the sub-account | [optional]
+**landingPages** | **bool** | Set this field to enable or disable Landing pages on the sub-account | [optional]
+**transactionalEmails** | **bool** | Set this field to enable or disable Transactional Email on the sub-account | [optional]
+**transactionalSms** | **bool** | Set this field to enable or disable Transactional SMS on the sub-account | [optional]
+**facebookAds** | **bool** | Set this field to enable or disable Facebook ads on the sub-account | [optional]
+**webPush** | **bool** | Set this field to enable or disable Web Push on the sub-account | [optional]
+**meetings** | **bool** | Set this field to enable or disable Meetings on the sub-account | [optional]
+**conversations** | **bool** | Set this field to enable or disable Conversations on the sub-account | [optional]
+**crm** | **bool** | Set this field to enable or disable Sales CRM on the sub-account | [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/SubAccountDetailsResponse.md b/docs/Model/SubAccountDetailsResponse.md
index 8f4a48b..5badc06 100644
--- a/docs/Model/SubAccountDetailsResponse.md
+++ b/docs/Model/SubAccountDetailsResponse.md
@@ -1,13 +1,13 @@
-# SubAccountDetailsResponse
+# # SubAccountDetailsResponse
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**name** | **string** | Name of the sub-account user | [optional]
-**email** | **string** | Email id of the sub-account organization | [optional]
-**companyName** | **string** | Sub-account company name | [optional]
-**planInfo** | [**\Brevo\Client\Model\SubAccountDetailsResponsePlanInfo**](SubAccountDetailsResponsePlanInfo.md) | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**name** | **string** | Name of the sub-account user | [optional]
+**email** | **string** | Email id of the sub-account organization | [optional]
+**companyName** | **string** | Sub-account company name | [optional]
+**groups** | [**\Brevo\Client\Models\SubAccountDetailsResponseGroupsInner[]**](SubAccountDetailsResponseGroupsInner.md) | | [optional]
+**planInfo** | [**\Brevo\Client\Models\SubAccountDetailsResponsePlanInfo**](SubAccountDetailsResponsePlanInfo.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/SubAccountDetailsResponseGroupsInner.md b/docs/Model/SubAccountDetailsResponseGroupsInner.md
new file mode 100644
index 0000000..f7a9257
--- /dev/null
+++ b/docs/Model/SubAccountDetailsResponseGroupsInner.md
@@ -0,0 +1,10 @@
+# # SubAccountDetailsResponseGroupsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | Group id | [optional]
+**name** | **string** | Name of the group | [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/SubAccountDetailsResponsePlanInfo.md b/docs/Model/SubAccountDetailsResponsePlanInfo.md
index b869352..35e94f1 100644
--- a/docs/Model/SubAccountDetailsResponsePlanInfo.md
+++ b/docs/Model/SubAccountDetailsResponsePlanInfo.md
@@ -1,12 +1,11 @@
-# SubAccountDetailsResponsePlanInfo
+# # SubAccountDetailsResponsePlanInfo
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**credits** | [**\Brevo\Client\Model\SubAccountDetailsResponsePlanInfoCredits**](SubAccountDetailsResponsePlanInfoCredits.md) | | [optional]
-**features** | [**\Brevo\Client\Model\SubAccountDetailsResponsePlanInfoFeatures**](SubAccountDetailsResponsePlanInfoFeatures.md) | | [optional]
-**planType** | **string** | type of the plan | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**credits** | [**\Brevo\Client\Models\SubAccountDetailsResponsePlanInfoCredits**](SubAccountDetailsResponsePlanInfoCredits.md) | | [optional]
+**features** | [**\Brevo\Client\Models\SubAccountDetailsResponsePlanInfoFeatures**](SubAccountDetailsResponsePlanInfoFeatures.md) | | [optional]
+**planType** | **string** | type of the plan | [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/SubAccountDetailsResponsePlanInfoCredits.md b/docs/Model/SubAccountDetailsResponsePlanInfoCredits.md
index 6104939..587a19e 100644
--- a/docs/Model/SubAccountDetailsResponsePlanInfoCredits.md
+++ b/docs/Model/SubAccountDetailsResponsePlanInfoCredits.md
@@ -1,11 +1,13 @@
-# SubAccountDetailsResponsePlanInfoCredits
+# # SubAccountDetailsResponsePlanInfoCredits
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**sms** | **int** | SMS credits remaining on the sub-account | [optional]
-**emails** | [**\Brevo\Client\Model\SubAccountDetailsResponsePlanInfoCreditsEmails**](SubAccountDetailsResponsePlanInfoCreditsEmails.md) | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**emails** | [**\Brevo\Client\Models\SubAccountDetailsResponsePlanInfoCreditsEmails**](SubAccountDetailsResponsePlanInfoCreditsEmails.md) | | [optional]
+**sms** | [**\Brevo\Client\Models\SubAccountDetailsResponsePlanInfoCreditsSms**](SubAccountDetailsResponsePlanInfoCreditsSms.md) | | [optional]
+**wpSubscribers** | [**\Brevo\Client\Models\SubAccountDetailsResponsePlanInfoCreditsWpSubscribers**](SubAccountDetailsResponsePlanInfoCreditsWpSubscribers.md) | | [optional]
+**whatsapp** | [**\Brevo\Client\Models\SubAccountDetailsResponsePlanInfoCreditsWhatsapp**](SubAccountDetailsResponsePlanInfoCreditsWhatsapp.md) | | [optional]
+**externalFeeds** | [**\Brevo\Client\Models\SubAccountDetailsResponsePlanInfoCreditsExternalFeeds**](SubAccountDetailsResponsePlanInfoCreditsExternalFeeds.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/SubAccountDetailsResponsePlanInfoCreditsEmails.md b/docs/Model/SubAccountDetailsResponsePlanInfoCreditsEmails.md
index 2ce9e82..a6f1224 100644
--- a/docs/Model/SubAccountDetailsResponsePlanInfoCreditsEmails.md
+++ b/docs/Model/SubAccountDetailsResponsePlanInfoCreditsEmails.md
@@ -1,11 +1,10 @@
-# SubAccountDetailsResponsePlanInfoCreditsEmails
+# # SubAccountDetailsResponsePlanInfoCreditsEmails
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**quantity** | **int** | Quantity of email messaging limits provided | [optional]
-**remaining** | **int** | Available email messaging limits for use | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**quantity** | **int** | Quantity of email messaging limits provided | [optional]
+**remaining** | **int** | Available email messaging limits for use | [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/SubAccountDetailsResponsePlanInfoCreditsExternalFeeds.md b/docs/Model/SubAccountDetailsResponsePlanInfoCreditsExternalFeeds.md
new file mode 100644
index 0000000..7086a45
--- /dev/null
+++ b/docs/Model/SubAccountDetailsResponsePlanInfoCreditsExternalFeeds.md
@@ -0,0 +1,10 @@
+# # SubAccountDetailsResponsePlanInfoCreditsExternalFeeds
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**quantity** | **int** | Quantity of externalFeeds messaging limits provided | [optional]
+**remaining** | **int** | Available externalFeeds messaging limits for use | [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/SubAccountDetailsResponsePlanInfoCreditsSms.md b/docs/Model/SubAccountDetailsResponsePlanInfoCreditsSms.md
new file mode 100644
index 0000000..ea1d2c6
--- /dev/null
+++ b/docs/Model/SubAccountDetailsResponsePlanInfoCreditsSms.md
@@ -0,0 +1,10 @@
+# # SubAccountDetailsResponsePlanInfoCreditsSms
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**quantity** | **int** | Quantity of SMS messaging limits provided | [optional]
+**remaining** | **int** | Available SMS messaging limits for use | [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/SubAccountDetailsResponsePlanInfoCreditsWhatsapp.md b/docs/Model/SubAccountDetailsResponsePlanInfoCreditsWhatsapp.md
new file mode 100644
index 0000000..75fe2ec
--- /dev/null
+++ b/docs/Model/SubAccountDetailsResponsePlanInfoCreditsWhatsapp.md
@@ -0,0 +1,10 @@
+# # SubAccountDetailsResponsePlanInfoCreditsWhatsapp
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**quantity** | **int** | Quantity of whatsapp messaging limits provided | [optional]
+**remaining** | **int** | Available whatsapp messaging limits for use | [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/SubAccountDetailsResponsePlanInfoCreditsWpSubscribers.md b/docs/Model/SubAccountDetailsResponsePlanInfoCreditsWpSubscribers.md
new file mode 100644
index 0000000..52b773c
--- /dev/null
+++ b/docs/Model/SubAccountDetailsResponsePlanInfoCreditsWpSubscribers.md
@@ -0,0 +1,10 @@
+# # SubAccountDetailsResponsePlanInfoCreditsWpSubscribers
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**quantity** | **int** | Quantity of Push sending limits provided | [optional]
+**remaining** | **int** | Available Push sending limits for use | [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/SubAccountDetailsResponsePlanInfoFeatures.md b/docs/Model/SubAccountDetailsResponsePlanInfoFeatures.md
index 1fa47e8..54ea8f1 100644
--- a/docs/Model/SubAccountDetailsResponsePlanInfoFeatures.md
+++ b/docs/Model/SubAccountDetailsResponsePlanInfoFeatures.md
@@ -1,12 +1,11 @@
-# SubAccountDetailsResponsePlanInfoFeatures
+# # SubAccountDetailsResponsePlanInfoFeatures
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**inbox** | [**\Brevo\Client\Model\SubAccountDetailsResponsePlanInfoFeaturesInbox**](SubAccountDetailsResponsePlanInfoFeaturesInbox.md) | | [optional]
-**landingPage** | [**\Brevo\Client\Model\SubAccountDetailsResponsePlanInfoFeaturesLandingPage**](SubAccountDetailsResponsePlanInfoFeaturesLandingPage.md) | | [optional]
-**users** | [**\Brevo\Client\Model\SubAccountDetailsResponsePlanInfoFeaturesUsers**](SubAccountDetailsResponsePlanInfoFeaturesUsers.md) | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**inbox** | [**\Brevo\Client\Models\SubAccountDetailsResponsePlanInfoFeaturesInbox**](SubAccountDetailsResponsePlanInfoFeaturesInbox.md) | | [optional]
+**landingPage** | [**\Brevo\Client\Models\SubAccountDetailsResponsePlanInfoFeaturesLandingPage**](SubAccountDetailsResponsePlanInfoFeaturesLandingPage.md) | | [optional]
+**users** | [**\Brevo\Client\Models\SubAccountDetailsResponsePlanInfoFeaturesUsers**](SubAccountDetailsResponsePlanInfoFeaturesUsers.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/SubAccountDetailsResponsePlanInfoFeaturesInbox.md b/docs/Model/SubAccountDetailsResponsePlanInfoFeaturesInbox.md
index be780d5..8c86db2 100644
--- a/docs/Model/SubAccountDetailsResponsePlanInfoFeaturesInbox.md
+++ b/docs/Model/SubAccountDetailsResponsePlanInfoFeaturesInbox.md
@@ -1,11 +1,10 @@
-# SubAccountDetailsResponsePlanInfoFeaturesInbox
+# # SubAccountDetailsResponsePlanInfoFeaturesInbox
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**quantity** | **int** | Quantity of inbox provided | [optional]
-**remaining** | **int** | Available inboxes for use | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**quantity** | **int** | Quantity of inbox provided | [optional]
+**remaining** | **int** | Available inboxes for use | [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/SubAccountDetailsResponsePlanInfoFeaturesLandingPage.md b/docs/Model/SubAccountDetailsResponsePlanInfoFeaturesLandingPage.md
index 1a3cf32..85f14b7 100644
--- a/docs/Model/SubAccountDetailsResponsePlanInfoFeaturesLandingPage.md
+++ b/docs/Model/SubAccountDetailsResponsePlanInfoFeaturesLandingPage.md
@@ -1,11 +1,10 @@
-# SubAccountDetailsResponsePlanInfoFeaturesLandingPage
+# # SubAccountDetailsResponsePlanInfoFeaturesLandingPage
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**quantity** | **int** | Quantity of landing pages provided | [optional]
-**remaining** | **int** | Available landing pages for use | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**quantity** | **int** | Quantity of landing pages provided | [optional]
+**remaining** | **int** | Available landing pages for use | [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/SubAccountDetailsResponsePlanInfoFeaturesUsers.md b/docs/Model/SubAccountDetailsResponsePlanInfoFeaturesUsers.md
index d10857f..a45aa34 100644
--- a/docs/Model/SubAccountDetailsResponsePlanInfoFeaturesUsers.md
+++ b/docs/Model/SubAccountDetailsResponsePlanInfoFeaturesUsers.md
@@ -1,11 +1,10 @@
-# SubAccountDetailsResponsePlanInfoFeaturesUsers
+# # SubAccountDetailsResponsePlanInfoFeaturesUsers
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**quantity** | **int** | Quantity of multi-account's provided | [optional]
-**remaining** | **int** | Available multi-accounts for use | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**quantity** | **int** | Quantity of multi-account's provided | [optional]
+**remaining** | **int** | Available multi-accounts for use | [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/SubAccountUpdatePlanRequest.md b/docs/Model/SubAccountUpdatePlanRequest.md
index 4c31118..cda10a0 100644
--- a/docs/Model/SubAccountUpdatePlanRequest.md
+++ b/docs/Model/SubAccountUpdatePlanRequest.md
@@ -1,11 +1,10 @@
-# SubAccountUpdatePlanRequest
+# # SubAccountUpdatePlanRequest
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**credits** | [**\Brevo\Client\Model\SubAccountUpdatePlanRequestCredits**](SubAccountUpdatePlanRequestCredits.md) | | [optional]
-**features** | [**\Brevo\Client\Model\SubAccountUpdatePlanRequestFeatures**](SubAccountUpdatePlanRequestFeatures.md) | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**credits** | [**\Brevo\Client\Models\SubAccountUpdatePlanRequestCredits**](SubAccountUpdatePlanRequestCredits.md) | | [optional]
+**features** | [**\Brevo\Client\Models\SubAccountUpdatePlanRequestFeatures**](SubAccountUpdatePlanRequestFeatures.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/SubAccountUpdatePlanRequestCredits.md b/docs/Model/SubAccountUpdatePlanRequestCredits.md
index 24423c2..169ed1c 100644
--- a/docs/Model/SubAccountUpdatePlanRequestCredits.md
+++ b/docs/Model/SubAccountUpdatePlanRequestCredits.md
@@ -1,10 +1,13 @@
-# SubAccountUpdatePlanRequestCredits
+# # SubAccountUpdatePlanRequestCredits
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**email** | **int** | Number of email credits | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**email** | **int** | Number of email credits | Pass the value -1 for unlimited emails in ENTv2 only | [optional]
+**sms** | **float** | Number of SMS credits | Pass the value -1 for unlimited SMS in ENTv2 only | [optional]
+**wpSubscribers** | **int** | Number of Push credits, possible value is 0 and -1 | available in ENT-v2 only | [optional]
+**externalFeeds** | **float** | Number of externalFeeds credits, possible values are 0 or 1 |available in ENTv2 only | [optional]
+**whatsapp** | **float** | Number of whatsapp credits | Pass the value -1 for unlimited whatsapp in ENTv2 only | [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/SubAccountUpdatePlanRequestFeatures.md b/docs/Model/SubAccountUpdatePlanRequestFeatures.md
index 41eb9f3..45160b0 100644
--- a/docs/Model/SubAccountUpdatePlanRequestFeatures.md
+++ b/docs/Model/SubAccountUpdatePlanRequestFeatures.md
@@ -1,12 +1,11 @@
-# SubAccountUpdatePlanRequestFeatures
+# # SubAccountUpdatePlanRequestFeatures
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**users** | **int** | Number of multi-users | [optional]
-**landingPage** | **int** | Number of landing pages / Not required on ENTv2 | [optional]
-**inbox** | **int** | Number of inboxes / Not required on ENTv2 | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**users** | **int** | Number of multi-users | [optional]
+**landingPage** | **int** | Number of landing pages | [optional]
+**inbox** | **int** | Number of inboxes / Not required on ENTv2 | [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/SubAccountsResponse.md b/docs/Model/SubAccountsResponse.md
index 81487f8..c26e511 100644
--- a/docs/Model/SubAccountsResponse.md
+++ b/docs/Model/SubAccountsResponse.md
@@ -1,11 +1,10 @@
-# SubAccountsResponse
+# # SubAccountsResponse
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**count** | **int** | Total number of subaccounts | [optional]
-**subAccounts** | [**\Brevo\Client\Model\SubAccountsResponseSubAccounts[]**](SubAccountsResponseSubAccounts.md) | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**count** | **int** | Total number of subaccounts | [optional]
+**subAccounts** | [**\Brevo\Client\Models\SubAccountsResponseSubAccountsInner[]**](SubAccountsResponseSubAccountsInner.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/SubAccountsResponseSubAccounts.md b/docs/Model/SubAccountsResponseSubAccounts.md
deleted file mode 100644
index a801490..0000000
--- a/docs/Model/SubAccountsResponseSubAccounts.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# SubAccountsResponseSubAccounts
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**id** | **int** | id of the sub-account |
-**companyName** | **string** | Name of the sub-account company |
-**active** | **bool** | Whether the sub-account is active or not |
-**createdAt** | **int** | Timestamp when the sub-account was created |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/SubAccountsResponseSubAccountsInner.md b/docs/Model/SubAccountsResponseSubAccountsInner.md
new file mode 100644
index 0000000..505dc67
--- /dev/null
+++ b/docs/Model/SubAccountsResponseSubAccountsInner.md
@@ -0,0 +1,13 @@
+# # SubAccountsResponseSubAccountsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | id of the sub-account |
+**companyName** | **string** | Name of the sub-account company |
+**active** | **bool** | Whether the sub-account is active or not |
+**createdAt** | **int** | Timestamp when the sub-account was created |
+**groups** | [**\Brevo\Client\Models\SubAccountsResponseSubAccountsInnerGroupsInner[]**](SubAccountsResponseSubAccountsInnerGroupsInner.md) | Group details |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/SubAccountsResponseSubAccountsInnerGroupsInner.md b/docs/Model/SubAccountsResponseSubAccountsInnerGroupsInner.md
new file mode 100644
index 0000000..5a3288a
--- /dev/null
+++ b/docs/Model/SubAccountsResponseSubAccountsInnerGroupsInner.md
@@ -0,0 +1,10 @@
+# # SubAccountsResponseSubAccountsInnerGroupsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | Group identifier | [optional]
+**name** | **string** | Name of the group | [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/SubscriptionNotFoundErrorResponse.md b/docs/Model/SubscriptionNotFoundErrorResponse.md
new file mode 100644
index 0000000..bae15c4
--- /dev/null
+++ b/docs/Model/SubscriptionNotFoundErrorResponse.md
@@ -0,0 +1,9 @@
+# # SubscriptionNotFoundErrorResponse
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**error** | **string** | | [optional] [default to 'subscription not found']
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/Task.md b/docs/Model/Task.md
index 5ad779e..35678c2 100644
--- a/docs/Model/Task.md
+++ b/docs/Model/Task.md
@@ -1,15 +1,14 @@
-# Task
+# # Task
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **string** | Unique task id | [optional]
-**taskTypeId** | **string** | Id for type of task e.g Call / Email / Meeting etc. |
-**name** | **string** | Name of task |
-**contactsIds** | **int[]** | Contact ids for contacts linked to this task | [optional]
-**dealsIds** | **string[]** | Deal ids for deals a task is linked to | [optional]
-**companiesIds** | **string[]** | Companies ids for companies a task is linked to | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
+**taskTypeId** | **string** | Id for type of task e.g Call / Email / Meeting etc. |
+**name** | **string** | Name of task |
+**id** | **string** | Unique task id | [optional]
+**contactsIds** | **int[]** | Contact ids for contacts linked to this task | [optional]
+**dealsIds** | **string[]** | Deal ids for deals a task is linked to | [optional]
+**companiesIds** | **string[]** | Companies ids for companies a task is linked to | [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/TaskList.md b/docs/Model/TaskList.md
index 1f94acc..74aef66 100644
--- a/docs/Model/TaskList.md
+++ b/docs/Model/TaskList.md
@@ -1,10 +1,9 @@
-# TaskList
+# # TaskList
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**items** | [**\Brevo\Client\Model\Task[]**](Task.md) | List of tasks | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**items** | [**\Brevo\Client\Models\Task[]**](Task.md) | List of tasks | [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/TaskReminder.md b/docs/Model/TaskReminder.md
index f451c08..cebec5f 100644
--- a/docs/Model/TaskReminder.md
+++ b/docs/Model/TaskReminder.md
@@ -1,12 +1,11 @@
-# TaskReminder
+# # TaskReminder
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**value** | **int** | Value of time unit before reminder is to be sent |
-**unit** | **string** | Unit of time before reminder is to be sent |
-**types** | **string[]** | Type of task reminder e.g email, push |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**value** | **int** | Value of time unit before reminder is to be sent |
+**unit** | **string** | Unit of time before reminder is to be sent |
+**types** | **string[]** | Type of task reminder e.g email, push |
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/TaskTypes.md b/docs/Model/TaskTypes.md
index 2ef046d..ca7e4cb 100644
--- a/docs/Model/TaskTypes.md
+++ b/docs/Model/TaskTypes.md
@@ -1,11 +1,10 @@
-# TaskTypes
+# # TaskTypes
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**id** | **string** | Id of task type | [optional]
-**title** | **string** | Title of task type | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**id** | **string** | Id of task type | [optional]
+**title** | **string** | Title of task type | [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/Tier.md b/docs/Model/Tier.md
new file mode 100644
index 0000000..8b71165
--- /dev/null
+++ b/docs/Model/Tier.md
@@ -0,0 +1,17 @@
+# # Tier
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**tierId** | **string** | Tier id | [optional]
+**name** | **string** | Tier name | [optional]
+**imageRef** | **string** | Tier image reference | [optional]
+**loyaltyProgramId** | **string** | Associated loyalty program Id | [optional]
+**groupId** | **string** | Associated group Id | [optional]
+**createdAt** | **\DateTime** | | [optional]
+**updatedAt** | **\DateTime** | | [optional]
+**accessConditions** | [**\Brevo\Client\Models\TierAccessConditionsInner[]**](TierAccessConditionsInner.md) | Conditions required to access this tier | [optional]
+**tierRewards** | [**\Brevo\Client\Models\TierTierRewardsInner[]**](TierTierRewardsInner.md) | Rewards associated with this tier | [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/TierAccessConditionsInner.md b/docs/Model/TierAccessConditionsInner.md
new file mode 100644
index 0000000..b8d5ea4
--- /dev/null
+++ b/docs/Model/TierAccessConditionsInner.md
@@ -0,0 +1,12 @@
+# # TierAccessConditionsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**balanceDefinitionId** | **string** | Balance definition identifier | [optional]
+**minimumValue** | **int** | Minimum value required to access this tier | [optional]
+**createdAt** | **\DateTime** | | [optional]
+**updatedAt** | **\DateTime** | | [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/TierForContact.md b/docs/Model/TierForContact.md
new file mode 100644
index 0000000..a144c8f
--- /dev/null
+++ b/docs/Model/TierForContact.md
@@ -0,0 +1,14 @@
+# # TierForContact
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**tierId** | **string** | Unique identifier for the assigned tier | [optional]
+**loyaltyProgramId** | **string** | Associated loyalty program Id | [optional]
+**groupId** | **string** | Group Id to which the tier is associated | [optional]
+**contactId** | **int** | Contact to which the tier is assigned | [optional]
+**createdAt** | **\DateTime** | | [optional]
+**updatedAt** | **\DateTime** | | [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/TierGroup.md b/docs/Model/TierGroup.md
new file mode 100644
index 0000000..8fc119f
--- /dev/null
+++ b/docs/Model/TierGroup.md
@@ -0,0 +1,16 @@
+# # TierGroup
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | Tier group unique identifier | [optional]
+**name** | **string** | Tier group name | [optional]
+**tierOrder** | **string[]** | Order of the tiers in the group in ascending order | [optional]
+**loyaltyProgramId** | **string** | Associated loyalty program Id | [optional]
+**upgradeStrategy** | **string** | Select real_time to upgrade tier on real time balance updates. Select anniversary to upgrade tier on subscription anniversary. | [optional] [default to 'real_time']
+**downgradeStrategy** | **string** | Select real_time to downgrade tier on real time balance updates. Select anniversary to downgrade tier on subscription anniversary. | [optional] [default to 'real_time']
+**createdAt** | **\DateTime** | Timestamp when the tier group was created | [optional]
+**updatedAt** | **\DateTime** | Timestamp when the tier group was last updated | [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/TierGroupPage.md b/docs/Model/TierGroupPage.md
new file mode 100644
index 0000000..24031e9
--- /dev/null
+++ b/docs/Model/TierGroupPage.md
@@ -0,0 +1,9 @@
+# # TierGroupPage
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**items** | [**\Brevo\Client\Models\TierGroup[]**](TierGroup.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/TierRequest.md b/docs/Model/TierRequest.md
new file mode 100644
index 0000000..e3ed1f5
--- /dev/null
+++ b/docs/Model/TierRequest.md
@@ -0,0 +1,11 @@
+# # TierRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | Name of the tier to be created |
+**accessConditions** | [**\Brevo\Client\Models\TierRequestAccessConditionsInner[]**](TierRequestAccessConditionsInner.md) | |
+**tierRewards** | [**\Brevo\Client\Models\TierRequestTierRewardsInner[]**](TierRequestTierRewardsInner.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/TierRequestAccessConditionsInner.md b/docs/Model/TierRequestAccessConditionsInner.md
new file mode 100644
index 0000000..5473f08
--- /dev/null
+++ b/docs/Model/TierRequestAccessConditionsInner.md
@@ -0,0 +1,10 @@
+# # TierRequestAccessConditionsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**balanceDefinitionId** | **string** | Balance definition identifier for accessing the tier | [optional]
+**minimumValue** | **int** | Minimum value required to access the tier | [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/TierRequestTierRewardsInner.md b/docs/Model/TierRequestTierRewardsInner.md
new file mode 100644
index 0000000..25dbd66
--- /dev/null
+++ b/docs/Model/TierRequestTierRewardsInner.md
@@ -0,0 +1,9 @@
+# # TierRequestTierRewardsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**rewardId** | **string** | Reward unique identifier | [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/TierTierRewardsInner.md b/docs/Model/TierTierRewardsInner.md
new file mode 100644
index 0000000..cd436a2
--- /dev/null
+++ b/docs/Model/TierTierRewardsInner.md
@@ -0,0 +1,11 @@
+# # TierTierRewardsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**rewardId** | **string** | Reward to be attributed on tier assignment | [optional]
+**createdAt** | **\DateTime** | | [optional]
+**updatedAt** | **\DateTime** | | [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/Transaction.md b/docs/Model/Transaction.md
new file mode 100644
index 0000000..eed01bb
--- /dev/null
+++ b/docs/Model/Transaction.md
@@ -0,0 +1,19 @@
+# # Transaction
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | Unique identifier for the transaction. | [optional]
+**status** | **string** | Current status of the transaction, indicating its state (draft/complete/cancelled/rejected/expired) | [optional]
+**amount** | **float** | The monetary value of the transaction. | [optional]
+**meta** | **object** | Additional metadata related to the transaction. | [optional]
+**rejectedAt** | **\DateTime** | Timestamp indicating when the transaction was rejected | [optional]
+**rejectReason** | **string** | Reason for rejecting the transaction | [optional]
+**expirationDate** | **\DateTime** | Date when the transaction expires if not completed. | [optional]
+**completedAt** | **\DateTime** | | [optional]
+**cancelledAt** | **\DateTime** | | [optional]
+**createdAt** | **\DateTime** | | [optional]
+**updatedAt** | **\DateTime** | | [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/UnauthorizedResponse.md b/docs/Model/UnauthorizedResponse.md
new file mode 100644
index 0000000..fba2a6d
--- /dev/null
+++ b/docs/Model/UnauthorizedResponse.md
@@ -0,0 +1,9 @@
+# # UnauthorizedResponse
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**error** | **string** | Request Authentication Failed | [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/UpdateAttribute.md b/docs/Model/UpdateAttribute.md
index d6b270d..e53a5a5 100644
--- a/docs/Model/UpdateAttribute.md
+++ b/docs/Model/UpdateAttribute.md
@@ -1,11 +1,11 @@
-# UpdateAttribute
+# # UpdateAttribute
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**value** | **string** | Value of the attribute to update. Use only if the attribute's category is 'calculated' or 'global' | [optional]
-**enumeration** | [**\Brevo\Client\Model\UpdateAttributeEnumeration[]**](UpdateAttributeEnumeration.md) | List of the values and labels that the attribute can take. Use only if the attribute's category is \"category\". For example, `[{\"value\":1, \"label\":\"male\"}, {\"value\":2, \"label\":\"female\"}]` | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**value** | **string** | Value of the attribute to update. **Use only if the attribute's category is 'calculated' or 'global'** | [optional]
+**enumeration** | [**\Brevo\Client\Models\UpdateAttributeEnumerationInner[]**](UpdateAttributeEnumerationInner.md) | List of the values and labels that the attribute can take. **Use only if the attribute's category is \"category\"**. For example, **[{\"value\":1, \"label\":\"male\"}, {\"value\":2, \"label\":\"female\"}]** | [optional]
+**multiCategoryOptions** | **string[]** | Use this option to add multiple-choice attributes options only if the attribute's category is \"normal\". **This option is specifically designed for updating multiple-choice attributes**. For example: **[\"USA\",\"INDIA\"]** | [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/UpdateAttributeEnumeration.md b/docs/Model/UpdateAttributeEnumeration.md
deleted file mode 100644
index e5d734d..0000000
--- a/docs/Model/UpdateAttributeEnumeration.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# UpdateAttributeEnumeration
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**value** | **int** | Id of the value |
-**label** | **string** | Label of the value |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/UpdateAttributeEnumerationInner.md b/docs/Model/UpdateAttributeEnumerationInner.md
new file mode 100644
index 0000000..a270d0a
--- /dev/null
+++ b/docs/Model/UpdateAttributeEnumerationInner.md
@@ -0,0 +1,10 @@
+# # UpdateAttributeEnumerationInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**value** | **int** | Id of the value |
+**label** | **string** | Label of the value |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/UpdateBalanceDefinitionPayload.md b/docs/Model/UpdateBalanceDefinitionPayload.md
new file mode 100644
index 0000000..83619f9
--- /dev/null
+++ b/docs/Model/UpdateBalanceDefinitionPayload.md
@@ -0,0 +1,23 @@
+# # UpdateBalanceDefinitionPayload
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | Name for the balance definition |
+**unit** | **string** | The unit for this balance definition. |
+**description** | **string** | Description for the balance definition | [optional]
+**meta** | **object** | Additional metadata related to the balance definition. | [optional]
+**minAmount** | **float** | Minimum possible amount for balance | [optional]
+**maxAmount** | **float** | Maximum possible amount for balance | [optional]
+**maxCreditAmountLimit** | **float** | Maximum credit amount limit per operation | [optional]
+**maxDebitAmountLimit** | **float** | Maximum debit amount limit per operation | [optional]
+**balanceOptionAmountOvertakingStrategy** | **string** | Select partial to enable partial credit of balance if maximum balance limit is reaching. Select strict to reject the transaction if it will breach the max credit amount limit. | [optional] [default to 'strict']
+**balanceOptionCreditRounding** | **string** | Select natural to round to nearest integer. Select upper to round up . Select lower to round down | [optional] [default to 'natural']
+**balanceOptionDebitRounding** | **string** | Select natural to round to nearest integer. Select upper to round up . Select lower to round down | [optional] [default to 'natural']
+**balanceAvailabilityDurationValue** | **float** | Number of days/weeks/month/year for balance expiry | [optional]
+**balanceAvailabilityDurationUnit** | **string** | Unit of time for the balance's availability (e.g., day/week/month/year). | [optional] [default to 'day']
+**balanceAvailabilityDurationModifier** | **string** | Select startOfPeriod to configure balance expiry on start of day/week/month/year. Select endOfPeriod to configure balance expiry on end of day/week/month/year, else select noModification | [optional] [default to 'noModification']
+**balanceExpirationDate** | **string** | Date when the balance expires and can no longer be used, in dd/mm format. The balance will be expired when this date appears next in the calendar and only one of balanceExpirationDate or balance availability fields can be used. | [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/UpdateBatchContacts.md b/docs/Model/UpdateBatchContacts.md
index 68cac97..b42530f 100644
--- a/docs/Model/UpdateBatchContacts.md
+++ b/docs/Model/UpdateBatchContacts.md
@@ -1,10 +1,9 @@
-# UpdateBatchContacts
+# # UpdateBatchContacts
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**contacts** | [**\Brevo\Client\Model\UpdateBatchContactsContacts[]**](UpdateBatchContactsContacts.md) | List of contacts to be updated | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**contacts** | [**\Brevo\Client\Models\UpdateBatchContactsContactsInner[]**](UpdateBatchContactsContactsInner.md) | List of contacts to be updated | [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/UpdateBatchContactsContacts.md b/docs/Model/UpdateBatchContactsContacts.md
deleted file mode 100644
index 303cf09..0000000
--- a/docs/Model/UpdateBatchContactsContacts.md
+++ /dev/null
@@ -1,19 +0,0 @@
-# UpdateBatchContactsContacts
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**email** | **string** | Email address of the user to be updated (For each operation only pass one of the supported contact identifiers. Email, id or sms) | [optional]
-**id** | **int** | id of the user to be updated (For each operation only pass one of the supported contact identifiers. Email, id or sms) | [optional]
-**sms** | **string** | SMS of the user to be updated (For each operation only pass one of the supported contact identifiers. Email, id or sms) | [optional]
-**extId** | **string** | Pass your own Id to update ext_id of a contact. | [optional]
-**attributes** | **map[string,object]** | Pass the set of attributes to be updated. **These attributes must be present in your account**. To update existing email address of a contact with the new one please pass EMAIL in attribtes. For example, **{ \"EMAIL\":\"newemail@domain.com\", \"FNAME\":\"Ellie\", \"LNAME\":\"Roger\"}**. Keep in mind transactional attributes can be updated the same way as normal attributes. Mobile Number in **SMS** field should be passed with proper country code. For example: **{\"SMS\":\"+91xxxxxxxxxx\"} or {\"SMS\":\"0091xxxxxxxxxx\"}** | [optional]
-**emailBlacklisted** | **bool** | Set/unset this field to blacklist/allow the contact for emails (emailBlacklisted = true) | [optional]
-**smsBlacklisted** | **bool** | Set/unset this field to blacklist/allow the contact for SMS (smsBlacklisted = true) | [optional]
-**listIds** | **int[]** | Ids of the lists to add the contact to | [optional]
-**unlinkListIds** | **int[]** | Ids of the lists to remove the contact from | [optional]
-**smtpBlacklistSender** | **string[]** | transactional email forbidden sender for contact. Use only for email Contact | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/UpdateBatchContactsContactsInner.md b/docs/Model/UpdateBatchContactsContactsInner.md
new file mode 100644
index 0000000..36d79f0
--- /dev/null
+++ b/docs/Model/UpdateBatchContactsContactsInner.md
@@ -0,0 +1,18 @@
+# # UpdateBatchContactsContactsInner
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**email** | **string** | Email address of the user to be updated (For each operation only pass one of the supported contact identifiers. Email, id or sms) | [optional]
+**id** | **int** | id of the user to be updated (For each operation only pass one of the supported contact identifiers. Email, id or sms) | [optional]
+**sms** | **string** | SMS of the user to be updated (For each operation only pass one of the supported contact identifiers. Email, id or sms) | [optional]
+**extId** | **string** | Pass your own Id to update ext_id of a contact. | [optional]
+**attributes** | **array** | Pass the set of attributes to be updated. **These attributes must be present in your account**. To update existing email address of a contact with the new one please pass EMAIL in attribtes. For example, **{ \"EMAIL\":\"newemail@domain.com\", \"FNAME\":\"Ellie\", \"LNAME\":\"Roger\"}**. Keep in mind transactional attributes can be updated the same way as normal attributes. Mobile Number in **SMS** field should be passed with proper country code. For example: **{\"SMS\":\"+91xxxxxxxxxx\"} or {\"SMS\":\"0091xxxxxxxxxx\"}** | [optional]
+**emailBlacklisted** | **bool** | Set/unset this field to blacklist/allow the contact for emails (emailBlacklisted = true) | [optional]
+**smsBlacklisted** | **bool** | Set/unset this field to blacklist/allow the contact for SMS (smsBlacklisted = true) | [optional]
+**listIds** | **int[]** | Ids of the lists to add the contact to | [optional]
+**unlinkListIds** | **int[]** | Ids of the lists to remove the contact from | [optional]
+**smtpBlacklistSender** | **string[]** | transactional email forbidden sender for contact. Use only for email Contact | [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/UpdateBatchContactsModel.md b/docs/Model/UpdateBatchContactsModel.md
index 08c30c1..0e81b1e 100644
--- a/docs/Model/UpdateBatchContactsModel.md
+++ b/docs/Model/UpdateBatchContactsModel.md
@@ -1,11 +1,10 @@
-# UpdateBatchContactsModel
+# # UpdateBatchContactsModel
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**successIds** | **int[]** | | [optional]
-**failureIds** | **int[]** | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**successIds** | **int[]** | | [optional]
+**failureIds** | **int[]** | | [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/UpdateCampaignStatus.md b/docs/Model/UpdateCampaignStatus.md
index a571f47..a1235ab 100644
--- a/docs/Model/UpdateCampaignStatus.md
+++ b/docs/Model/UpdateCampaignStatus.md
@@ -1,10 +1,9 @@
-# UpdateCampaignStatus
+# # UpdateCampaignStatus
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**status** | **string** | Note:- replicateTemplate status will be available only for template type campaigns. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**status** | **string** | Note:- **replicateTemplate** status will be available **only for template type campaigns.** | [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/UpdateChild.md b/docs/Model/UpdateChild.md
deleted file mode 100644
index ef478b5..0000000
--- a/docs/Model/UpdateChild.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# UpdateChild
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**email** | **string** | New Email address to update the child account | [optional]
-**firstName** | **string** | New First name to use to update the child account | [optional]
-**lastName** | **string** | New Last name to use to update the child account | [optional]
-**companyName** | **string** | New Company name to use to update the child account | [optional]
-**password** | **string** | New password for the child account to login | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/UpdateChildAccountStatus.md b/docs/Model/UpdateChildAccountStatus.md
deleted file mode 100644
index 76b3156..0000000
--- a/docs/Model/UpdateChildAccountStatus.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# UpdateChildAccountStatus
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**transactionalEmail** | **bool** | Status of Transactional Email Platform activation for your account (true=enabled, false=disabled) | [optional]
-**transactionalSms** | **bool** | Status of Transactional SMS Platform activation for your account (true=enabled, false=disabled) | [optional]
-**marketingAutomation** | **bool** | Status of Marketing Automation Platform activation for your account (true=enabled, false=disabled) | [optional]
-**smsCampaign** | **bool** | Status of SMS Campaign Platform activation for your account (true=enabled, false=disabled) | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/UpdateChildDomain.md b/docs/Model/UpdateChildDomain.md
deleted file mode 100644
index a22b5d2..0000000
--- a/docs/Model/UpdateChildDomain.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# UpdateChildDomain
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**domain** | **string** | Value for the sender domain that will replace the existing domain | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/UpdateContact.md b/docs/Model/UpdateContact.md
index 6bdbe30..fbc135d 100644
--- a/docs/Model/UpdateContact.md
+++ b/docs/Model/UpdateContact.md
@@ -1,16 +1,15 @@
-# UpdateContact
+# # UpdateContact
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**attributes** | **object** | Pass the set of attributes to be updated. These attributes must be present in your account. Values that don't match the attribute type (e.g. text or string in a date attribute) will be ignored.To update existing email address of a contact with the new one please pass EMAIL in attributes. For example, `{ \"EMAIL\":\"newemail@domain.com\", \"FNAME\":\"Ellie\", \"LNAME\":\"Roger\"}`. The attribute's parameter should be passed in capital letter while updating a contact. Keep in mind transactional attributes can be updated the same way as normal attributes. Mobile Number in \"SMS\" field should be passed with proper country code. For example {\"SMS\":\"+91xxxxxxxxxx\"} or {\"SMS\":\"0091xxxxxxxxxx\"} | [optional]
-**extId** | **string** | Pass your own Id to update ext_id of a contact. | [optional]
-**emailBlacklisted** | **bool** | Set/unset this field to blacklist/allow the contact for emails (emailBlacklisted = true) | [optional]
-**smsBlacklisted** | **bool** | Set/unset this field to blacklist/allow the contact for SMS (smsBlacklisted = true) | [optional]
-**listIds** | **int[]** | Ids of the lists to add the contact to | [optional]
-**unlinkListIds** | **int[]** | Ids of the lists to remove the contact from | [optional]
-**smtpBlacklistSender** | **string[]** | transactional email forbidden sender for contact. Use only for email Contact | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
+**attributes** | [**array**](CreateDoiContactAttributesValue.md) | Pass the set of attributes to be updated. **These attributes must be present in your account**. To update existing email address of a contact with the new one please pass EMAIL in attributes. For example, **{ \"EMAIL\":\"newemail@domain.com\", \"FNAME\":\"Ellie\", \"LNAME\":\"Roger\", \"COUNTRIES\":[\"India\",\"China\"]}**. The attribute's parameter should be passed in capital letter while updating a contact. Values that don't match the attribute type (e.g. text or string in a date attribute) will be ignored. Keep in mind transactional attributes can be updated the same way as normal attributes. Mobile Number in **SMS** field should be passed with proper country code. For example: **{\"SMS\":\"+91xxxxxxxxxx\"} or {\"SMS\":\"0091xxxxxxxxxx\"}** | [optional]
+**extId** | **string** | Pass your own Id to update ext_id of a contact. | [optional]
+**emailBlacklisted** | **bool** | Set/unset this field to blacklist/allow the contact for emails (emailBlacklisted = true) | [optional]
+**smsBlacklisted** | **bool** | Set/unset this field to blacklist/allow the contact for SMS (smsBlacklisted = true) | [optional]
+**listIds** | **int[]** | Ids of the lists to add the contact to | [optional]
+**unlinkListIds** | **int[]** | Ids of the lists to remove the contact from | [optional]
+**smtpBlacklistSender** | **string[]** | transactional email forbidden sender for contact. Use only for email Contact | [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/UpdateCouponCollection.md b/docs/Model/UpdateCouponCollection.md
deleted file mode 100644
index 9d99045..0000000
--- a/docs/Model/UpdateCouponCollection.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# UpdateCouponCollection
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**defaultCoupon** | **string** | A default coupon to be used in case there are no coupons left |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
diff --git a/docs/Model/UpdateCouponCollection200Response.md b/docs/Model/UpdateCouponCollection200Response.md
new file mode 100644
index 0000000..0f2d127
--- /dev/null
+++ b/docs/Model/UpdateCouponCollection200Response.md
@@ -0,0 +1,11 @@
+# # UpdateCouponCollection200Response
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | The id of the collection |
+**name** | **string** | The name of the collection |
+**defaultCoupon** | **string** | The default coupon of the collection |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/UpdateCouponCollectionRequest.md b/docs/Model/UpdateCouponCollectionRequest.md
new file mode 100644
index 0000000..b108674
--- /dev/null
+++ b/docs/Model/UpdateCouponCollectionRequest.md
@@ -0,0 +1,12 @@
+# # UpdateCouponCollectionRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**defaultCoupon** | **string** | A default coupon to be used in case there are no coupons left | [optional]
+**expirationDate** | **\DateTime** | Specify an expiration date for the coupon collection in RFC3339 format. Use null to remove the expiration date. | [optional]
+**remainingDaysAlert** | **int** | Send a notification alert (email) when the remaining days until the expiration date are equal or fall bellow this number. Use null to disable alerts. | [optional]
+**remainingCouponsAlert** | **int** | Send a notification alert (email) when the remaining coupons count is equal or fall bellow this number. Use null to disable alerts. | [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/UpdateEmailCampaign.md b/docs/Model/UpdateEmailCampaign.md
index a7e49ea..e7068e6 100644
--- a/docs/Model/UpdateEmailCampaign.md
+++ b/docs/Model/UpdateEmailCampaign.md
@@ -1,40 +1,40 @@
-# UpdateEmailCampaign
+# # UpdateEmailCampaign
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**tag** | **string** | Tag of the campaign | [optional]
-**sender** | [**\Brevo\Client\Model\UpdateEmailCampaignSender**](UpdateEmailCampaignSender.md) | | [optional]
-**name** | **string** | Name of the campaign | [optional]
-**htmlContent** | **string** | Body of the message (HTML version). If the campaign is designed using Drag & Drop editor via HTML content, then the design page will not have Drag & Drop editor access for that campaign. REQUIRED if htmlUrl is empty | [optional]
-**htmlUrl** | **string** | Url which contents the body of the email message. REQUIRED if htmlContent is empty | [optional]
-**scheduledAt** | **string** | UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part). | [optional]
-**subject** | **string** | Subject of the campaign | [optional]
-**previewText** | **string** | Preview text or preheader of the email campaign | [optional]
-**replyTo** | **string** | Email on which campaign recipients will be able to reply to | [optional]
-**toField** | **string** | To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your Brevo account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization | [optional]
-**recipients** | [**\Brevo\Client\Model\UpdateEmailCampaignRecipients**](UpdateEmailCampaignRecipients.md) | | [optional]
-**attachmentUrl** | **string** | Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps | [optional]
-**inlineImageActivation** | **bool** | Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. You cannot send a campaign of more than 4MB with images embedded in the email. Campaigns with the images embedded in the email must be sent to less than 5000 contacts. | [optional] [default to false]
-**mirrorActive** | **bool** | Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign | [optional]
-**recurring** | **bool** | FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times | [optional] [default to false]
-**footer** | **string** | Footer of the email campaign | [optional]
-**header** | **string** | Header of the email campaign | [optional]
-**utmCampaign** | **string** | Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed | [optional]
-**params** | **object** | Pass the set of attributes to customize the type 'classic' campaign. For example, `{\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}`. The 'params' field will get updated, only if the campaign is in New Template Language, else ignored. The New Template Language is dependent on the values of 'subject', 'htmlContent/htmlUrl', 'sender.name' & 'toField' | [optional]
-**sendAtBestTime** | **bool** | Set this to true if you want to send your campaign at best time. Note:- if true, warmup ip will be disabled. | [optional]
-**abTesting** | **bool** | Status of A/B Test. abTesting = false means it is disabled, & abTesting = true means it is enabled. 'subjectA', 'subjectB', 'splitRule', 'winnerCriteria' & 'winnerDelay' will be considered if abTesting is set to true. 'subject' if passed is ignored. Can be set to true only if 'sendAtBestTime' is 'false'. You will be able to set up two subject lines for your campaign and send them to a random sample of your total recipients. Half of the test group will receive version A, and the other half will receive version B | [optional] [default to false]
-**subjectA** | **string** | Subject A of the campaign. Considered if abTesting = true. subjectA & subjectB should have unique value | [optional]
-**subjectB** | **string** | Subject B of the campaign. Considered if abTesting = true. subjectA & subjectB should have unique value | [optional]
-**splitRule** | **int** | Add the size of your test groups. Considered if abTesting = true. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else | [optional]
-**winnerCriteria** | **string** | Choose the metrics that will determinate the winning version. Considered if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerCriteria' is ignored if passed or alreday exist in record | [optional]
-**winnerDelay** | **int** | Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. Considered if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerDelay' is ignored if passed or alreday exist in record | [optional]
-**ipWarmupEnable** | **bool** | Available for dedicated ip clients. Set this to true if you wish to warm up your ip. | [optional] [default to false]
-**initialQuota** | **int** | Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000. | [optional]
-**increaseRate** | **int** | Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%. | [optional]
-**unsubscriptionPageId** | **string** | Enter an unsubscription page id. The page id is a 24 digit alphanumeric id that can be found in the URL when editing the page. | [optional]
-**updateFormId** | **string** | Mandatory if templateId is used containing the {{ update_profile }} tag. Enter an update profile form id. The form id is a 24 digit alphanumeric id that can be found in the URL when editing the form. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**tag** | **string** | Tag of the campaign | [optional]
+**sender** | [**\Brevo\Client\Models\UpdateEmailCampaignSender**](UpdateEmailCampaignSender.md) | | [optional]
+**name** | **string** | Name of the campaign | [optional]
+**htmlContent** | **string** | Body of the message (HTML version). If the campaign is designed using Drag & Drop editor via HTML content, then the design page will not have Drag & Drop editor access for that campaign. **REQUIRED if htmlUrl is empty** | [optional]
+**htmlUrl** | **string** | Url which contents the body of the email message. **REQUIRED if htmlContent is empty** | [optional]
+**scheduledAt** | **string** | UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part). | [optional]
+**subject** | **string** | Subject of the campaign | [optional]
+**previewText** | **string** | Preview text or preheader of the email campaign | [optional]
+**replyTo** | **string** | Email on which campaign recipients will be able to reply to | [optional]
+**toField** | **string** | To personalize the **To** Field. If you want to include the first name and last name of your recipient, add **{FNAME} {LNAME}**. These contact attributes must already exist in your Brevo account. If input parameter **params** used please use **{{contact.FNAME}} {{contact.LNAME}}** for personalization | [optional]
+**recipients** | [**\Brevo\Client\Models\UpdateEmailCampaignRecipients**](UpdateEmailCampaignRecipients.md) | | [optional]
+**attachmentUrl** | **string** | Absolute url of the attachment (no local file). Extension allowed: #### xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps' | [optional]
+**inlineImageActivation** | **bool** | Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. You cannot send a campaign of more than **4MB** with images embedded in the email. Campaigns with the images embedded in the email _must be sent to less than 5000 contacts_. | [optional] [default to false]
+**mirrorActive** | **bool** | Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign | [optional]
+**recurring** | **bool** | **FOR TRIGGER ONLY !** Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times | [optional] [default to false]
+**footer** | **string** | Footer of the email campaign | [optional]
+**header** | **string** | Header of the email campaign | [optional]
+**utmCampaign** | **string** | Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed | [optional]
+**params** | **array** | Pass the set of attributes to customize the type classic campaign. For example: **{\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}**. Only available if **type** is **classic**. It's considered only if campaign is in _New Template Language format_. The New Template Language is dependent on the values of **subject, htmlContent/htmlUrl, sender.name & toField** | [optional]
+**sendAtBestTime** | **bool** | Set this to true if you want to send your campaign at best time. Note:- **if true, warmup ip will be disabled.** | [optional]
+**abTesting** | **bool** | Status of A/B Test. abTesting = false means it is disabled & abTesting = true means it is enabled. **subjectA, subjectB, splitRule, winnerCriteria & winnerDelay** will be considered when abTesting is set to true. subjectA & subjectB are mandatory together & subject if passed is ignored. **Can be set to true only if sendAtBestTime is false**. You will be able to set up two subject lines for your campaign and send them to a random sample of your total recipients. Half of the test group will receive version A, and the other half will receive version B | [optional] [default to false]
+**subjectA** | **string** | Subject A of the campaign. **Mandatory if abTesting = true**. subjectA & subjectB should have unique value | [optional]
+**subjectB** | **string** | Subject B of the campaign. **Mandatory if abTesting = true**. subjectA & subjectB should have unique value | [optional]
+**splitRule** | **int** | Add the size of your test groups. **Mandatory if abTesting = true & 'recipients' is passed**. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else | [optional]
+**winnerCriteria** | **string** | Choose the metrics that will determinate the winning version. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerCriteria` is ignored if passed | [optional]
+**winnerDelay** | **int** | Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerDelay` is ignored if passed | [optional]
+**ipWarmupEnable** | **bool** | **Available for dedicated ip clients**. Set this to true if you wish to warm up your ip. | [optional] [default to false]
+**initialQuota** | **int** | Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000. | [optional]
+**increaseRate** | **int** | Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%. | [optional]
+**unsubscriptionPageId** | **string** | Enter an unsubscription page id. The page id is a 24 digit alphanumeric id that can be found in the URL when editing the page. | [optional]
+**updateFormId** | **string** | **Mandatory if templateId is used containing the {{ update_profile }} tag**. Enter an update profile form id. The form id is a 24 digit alphanumeric id that can be found in the URL when editing the form. | [optional]
+**emailExpirationDate** | [**\Brevo\Client\Models\UpdateEmailCampaignEmailExpirationDate**](UpdateEmailCampaignEmailExpirationDate.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/UpdateEmailCampaignEmailExpirationDate.md b/docs/Model/UpdateEmailCampaignEmailExpirationDate.md
new file mode 100644
index 0000000..5033768
--- /dev/null
+++ b/docs/Model/UpdateEmailCampaignEmailExpirationDate.md
@@ -0,0 +1,10 @@
+# # UpdateEmailCampaignEmailExpirationDate
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**duration** | **int** | Duration of the email expiry. maximum duration can be 3600 days or 480 weeks or 120 months. | [optional]
+**unit** | **string** | unit of the duration | [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/UpdateEmailCampaignRecipients.md b/docs/Model/UpdateEmailCampaignRecipients.md
index 6ed00b1..177321f 100644
--- a/docs/Model/UpdateEmailCampaignRecipients.md
+++ b/docs/Model/UpdateEmailCampaignRecipients.md
@@ -1,12 +1,11 @@
-# UpdateEmailCampaignRecipients
+# # UpdateEmailCampaignRecipients
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**exclusionListIds** | **int[]** | List ids which have to be excluded from a campaign | [optional]
-**listIds** | **int[]** | Lists Ids to send the campaign to. Campaign should only be updated with listIds if listIds were used to create it. REQUIRED if already not present in campaign and scheduledAt is not empty | [optional]
-**segmentIds** | **int[]** | Mandatory if listIds are not used. Campaign should only be updated with segmentIds if segmentIds were used to create it. Segment ids to send the campaign to. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**exclusionListIds** | **int[]** | List ids which have to be excluded from a campaign | [optional]
+**listIds** | **int[]** | Lists Ids to send the campaign to. **Campaign should only be updated with listIds if listIds were used to create it. REQUIRED if already not present in campaign and scheduledAt is not empty** | [optional]
+**segmentIds** | **int[]** | **Mandatory if listIds are not used. Campaign should only be updated with segmentIds if segmentIds were used to create it.** Segment ids to send the campaign to. | [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/UpdateEmailCampaignSender.md b/docs/Model/UpdateEmailCampaignSender.md
index 4ebcd4e..e0ef53d 100644
--- a/docs/Model/UpdateEmailCampaignSender.md
+++ b/docs/Model/UpdateEmailCampaignSender.md
@@ -1,12 +1,11 @@
-# UpdateEmailCampaignSender
+# # UpdateEmailCampaignSender
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**name** | **string** | Sender Name from which the campaign emails are sent | [optional]
-**email** | **string** | Sender email from which the campaign emails are sent | [optional]
-**id** | **int** | Select the sender for the campaign on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**name** | **string** | Sender Name from which the campaign emails are sent | [optional]
+**email** | **string** | Sender email from which the campaign emails are sent | [optional]
+**id** | **int** | Select the sender for the campaign on the basis of sender id. **In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email)**. | [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/UpdateExternalFeed.md b/docs/Model/UpdateExternalFeed.md
index c8ff876..d54d094 100644
--- a/docs/Model/UpdateExternalFeed.md
+++ b/docs/Model/UpdateExternalFeed.md
@@ -1,18 +1,17 @@
-# UpdateExternalFeed
+# # UpdateExternalFeed
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**name** | **string** | Name of the feed | [optional]
-**url** | **string** | URL of the feed | [optional]
-**authType** | **string** | Auth type of the feed: * `basic` * `token` * `noAuth` | [optional]
-**username** | **string** | Username for authType `basic` | [optional]
-**password** | **string** | Password for authType `basic` | [optional]
-**token** | **string** | Token for authType `token` | [optional]
-**headers** | [**\Brevo\Client\Model\GetExternalFeedByUUIDHeaders[]**](GetExternalFeedByUUIDHeaders.md) | Custom headers for the feed | [optional]
-**maxRetries** | **int** | Maximum number of retries on the feed url | [optional]
+**name** | **string** | Name of the feed | [optional]
+**url** | **string** | URL of the feed | [optional]
+**authType** | **string** | Auth type of the feed: * `basic` * `token` * `noAuth` | [optional]
+**username** | **string** | Username for authType `basic` | [optional]
+**password** | **string** | Password for authType `basic` | [optional]
+**token** | **string** | Token for authType `token` | [optional]
+**headers** | [**\Brevo\Client\Models\GetExternalFeedByUUIDHeadersInner[]**](GetExternalFeedByUUIDHeadersInner.md) | Custom headers for the feed | [optional]
+**maxRetries** | **int** | Maximum number of retries on the feed url | [optional] [default to 5]
**cache** | **bool** | Toggle caching of feed url response | [optional] [default to false]
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.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/UpdateList.md b/docs/Model/UpdateList.md
index de3f2c8..04650b6 100644
--- a/docs/Model/UpdateList.md
+++ b/docs/Model/UpdateList.md
@@ -1,11 +1,10 @@
-# UpdateList
+# # UpdateList
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**name** | **string** | Name of the list. Either of the two parameters (name, folderId) can be updated at a time. | [optional]
-**folderId** | **int** | Id of the folder in which the list is to be moved. Either of the two parameters (name, folderId) can be updated at a time. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**name** | **string** | Name of the list. Either of the two parameters (name, folderId) can be updated at a time. | [optional]
+**folderId** | **int** | Id of the folder in which the list is to be moved. Either of the two parameters (name, folderId) can be updated at a time. | [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/UpdateLoyaltyProgramPayload.md b/docs/Model/UpdateLoyaltyProgramPayload.md
new file mode 100644
index 0000000..9a13f6d
--- /dev/null
+++ b/docs/Model/UpdateLoyaltyProgramPayload.md
@@ -0,0 +1,11 @@
+# # UpdateLoyaltyProgramPayload
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | Loyalty Program name |
+**description** | **string** | Loyalty Program description | [optional]
+**meta** | **object** | Loyalty Program meta data | [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/UpdateSender.md b/docs/Model/UpdateSender.md
index 8ce034b..1ba4646 100644
--- a/docs/Model/UpdateSender.md
+++ b/docs/Model/UpdateSender.md
@@ -1,12 +1,11 @@
-# UpdateSender
+# # UpdateSender
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**name** | **string** | From Name to update the sender | [optional]
-**email** | **string** | From Email to update the sender | [optional]
-**ips** | [**\Brevo\Client\Model\CreateSenderIps[]**](CreateSenderIps.md) | Only in case of dedicated IP, IPs to associate to the sender. If passed, will replace all the existing IPs. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**name** | **string** | From Name to update the sender | [optional]
+**email** | **string** | From Email to update the sender | [optional]
+**ips** | [**\Brevo\Client\Models\CreateSenderIpsInner[]**](CreateSenderIpsInner.md) | **Only in case of dedicated IP**. IPs to associate to the sender. If passed, will replace all the existing IPs. | [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/UpdateSmsCampaign.md b/docs/Model/UpdateSmsCampaign.md
index 7d97c27..8715b5d 100644
--- a/docs/Model/UpdateSmsCampaign.md
+++ b/docs/Model/UpdateSmsCampaign.md
@@ -1,17 +1,16 @@
-# UpdateSmsCampaign
+# # UpdateSmsCampaign
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**name** | **string** | Name of the campaign | [optional]
-**sender** | **string** | Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** | [optional]
-**content** | **string** | Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS | [optional]
-**recipients** | [**\Brevo\Client\Model\CreateSmsCampaignRecipients**](CreateSmsCampaignRecipients.md) | | [optional]
-**scheduledAt** | **string** | UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. | [optional]
+**name** | **string** | Name of the campaign | [optional]
+**sender** | **string** | Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** | [optional]
+**content** | **string** | Content of the message. The **maximum characters used per SMS is 160**, if used more than that, it will be counted as more than one SMS | [optional]
+**recipients** | [**\Brevo\Client\Models\CreateSmsCampaignRecipients**](CreateSmsCampaignRecipients.md) | | [optional]
+**scheduledAt** | **string** | UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** | [optional]
**unicodeEnabled** | **bool** | Format of the message. It indicates whether the content should be treated as unicode or not. | [optional] [default to false]
-**organisationPrefix** | **string** | A recognizable prefix will ensure your audience knows who you are. Recommended by U.S. carriers. This will be added as your Brand Name before the message content. **Prefer verifying maximum length of 160 characters including this prefix in message content to avoid multiple sending of same sms.** | [optional]
-**unsubscribeInstruction** | **string** | Instructions to unsubscribe from future communications. Recommended by U.S. carriers. Must include **STOP** keyword. This will be added as instructions after the end of message content. **Prefer verifying maximum length of 160 characters including this instructions in message content to avoid multiple sending of same sms.** | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**organisationPrefix** | **string** | A recognizable prefix will ensure your audience knows who you are. Recommended by U.S. carriers. This will be added as your Brand Name before the message content. **Prefer verifying maximum length of 160 characters including this prefix in message content to avoid multiple sending of same sms.** | [optional]
+**unsubscribeInstruction** | **string** | Instructions to unsubscribe from future communications. Recommended by U.S. carriers. Must include **STOP** keyword. This will be added as instructions after the end of message content. **Prefer verifying maximum length of 160 characters including this instructions in message content to avoid multiple sending of same sms.** | [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/UpdateSmtpTemplate.md b/docs/Model/UpdateSmtpTemplate.md
index a605151..14524ae 100644
--- a/docs/Model/UpdateSmtpTemplate.md
+++ b/docs/Model/UpdateSmtpTemplate.md
@@ -1,19 +1,18 @@
-# UpdateSmtpTemplate
+# # UpdateSmtpTemplate
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**tag** | **string** | Tag of the template | [optional]
-**sender** | [**\Brevo\Client\Model\UpdateSmtpTemplateSender**](UpdateSmtpTemplateSender.md) | | [optional]
-**templateName** | **string** | Name of the template | [optional]
-**htmlContent** | **string** | Required if htmlUrl is empty. If the template is designed using Drag & Drop editor via HTML content, then the design page will not have Drag & Drop editor access for that template. Body of the message (HTML must have more than 10 characters) | [optional]
-**htmlUrl** | **string** | Required if htmlContent is empty. URL to the body of the email (HTML) | [optional]
-**subject** | **string** | Subject of the email | [optional]
-**replyTo** | **string** | Email on which campaign recipients will be able to reply to | [optional]
-**toField** | **string** | To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your Brevo account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization | [optional]
-**attachmentUrl** | **string** | Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps | [optional]
-**isActive** | **bool** | Status of the template. isActive = false means template is inactive, isActive = true means template is active | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**tag** | **string** | Tag of the template | [optional]
+**sender** | [**\Brevo\Client\Models\UpdateSmtpTemplateSender**](UpdateSmtpTemplateSender.md) | | [optional]
+**templateName** | **string** | Name of the template | [optional]
+**htmlContent** | **string** | **Required if htmlUrl is empty**. If the template is designed using Drag & Drop editor via HTML content, then the design page will not have Drag & Drop editor access for that template. Body of the message (HTML must have more than 10 characters) | [optional]
+**htmlUrl** | **string** | **Required if htmlContent is empty**. URL to the body of the email (HTML) | [optional]
+**subject** | **string** | Subject of the email | [optional]
+**replyTo** | **string** | Email on which campaign recipients will be able to reply to | [optional]
+**toField** | **string** | To personalize the **To** Field. If you want to include the first name and last name of your recipient, add **{FNAME} {LNAME}**. These contact attributes must already exist in your Brevo account. If input parameter **params** used please use **{{contact.FNAME}} {{contact.LNAME}}** for personalization | [optional]
+**attachmentUrl** | **string** | Absolute url of the attachment (**no local file**). Extensions allowed: #### xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps | [optional]
+**isActive** | **bool** | Status of the template. isActive = false means template is inactive, isActive = true means template is active | [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/UpdateSmtpTemplateSender.md b/docs/Model/UpdateSmtpTemplateSender.md
index 267f6f7..c658cdc 100644
--- a/docs/Model/UpdateSmtpTemplateSender.md
+++ b/docs/Model/UpdateSmtpTemplateSender.md
@@ -1,12 +1,11 @@
-# UpdateSmtpTemplateSender
+# # UpdateSmtpTemplateSender
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**name** | **string** | Name of the sender | [optional]
-**email** | **string** | Email of the sender | [optional]
-**id** | **int** | Select the sender for the template on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**name** | **string** | Name of the sender | [optional]
+**email** | **string** | Email of the sender | [optional]
+**id** | **int** | Select the sender for the template on the basis of sender id. _In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email)_. | [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/UpdateTierGroup404Response.md b/docs/Model/UpdateTierGroup404Response.md
new file mode 100644
index 0000000..73408c5
--- /dev/null
+++ b/docs/Model/UpdateTierGroup404Response.md
@@ -0,0 +1,9 @@
+# # UpdateTierGroup404Response
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**message** | **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/UpdateTierGroupRequest.md b/docs/Model/UpdateTierGroupRequest.md
new file mode 100644
index 0000000..dc3d5ea
--- /dev/null
+++ b/docs/Model/UpdateTierGroupRequest.md
@@ -0,0 +1,12 @@
+# # UpdateTierGroupRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | Name of the tier group | [optional]
+**tierOrder** | **string** | Order of the tiers in the group in ascending order | [optional]
+**upgradeStrategy** | **string** | Select real_time to upgrade tier on real time balance updates. Select anniversary to upgrade tier on subscription anniversary. | [optional] [default to 'real_time']
+**downgradeStrategy** | **string** | Select real_time to downgrade tier on real time balance updates. Select anniversary to downgrade tier on subscription anniversary. | [optional] [default to 'real_time']
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/UpdateUserResponse.md b/docs/Model/UpdateUserResponse.md
new file mode 100644
index 0000000..3a5f628
--- /dev/null
+++ b/docs/Model/UpdateUserResponse.md
@@ -0,0 +1,11 @@
+# # UpdateUserResponse
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**status** | **string** | Status of the API operation. |
+**creditNotes** | **string[]** | Credit note | [optional]
+**invoiceId** | **string[]** | Invoice id | [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/UpdateWebhook.md b/docs/Model/UpdateWebhook.md
index ed4ccf6..98687f0 100644
--- a/docs/Model/UpdateWebhook.md
+++ b/docs/Model/UpdateWebhook.md
@@ -1,16 +1,15 @@
-# UpdateWebhook
+# # UpdateWebhook
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**url** | **string** | URL of the webhook | [optional]
-**description** | **string** | Description of the webhook | [optional]
-**events** | **string[]** | - Events triggering the webhook. Possible values for **Transactional** type webhook: #### `sent` OR `request`, `delivered`, `hardBounce`, `softBounce`, `blocked`, `spam`, `invalid`, `deferred`, `click`, `opened`, `uniqueOpened` and `unsubscribed` - Possible values for **Marketing** type webhook: #### `spam`, `opened`, `click`, `hardBounce`, `softBounce`, `unsubscribed`, `listAddition` & `delivered` - Possible values for **Inbound** type webhook: #### `inboundEmailProcessed` | [optional]
-**domain** | **string** | Inbound domain of webhook, used in case of event type `inbound` | [optional]
-**batched** | **bool** | To send batched webhooks | [optional]
-**auth** | [**\Brevo\Client\Model\GetWebhookAuth**](GetWebhookAuth.md) | | [optional]
-**headers** | [**\Brevo\Client\Model\GetWebhookHeaders[]**](GetWebhookHeaders.md) | Custom headers to be send with webhooks | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
-
+**url** | **string** | URL of the webhook | [optional]
+**description** | **string** | Description of the webhook | [optional]
+**events** | **string[]** | - Events triggering the webhook. Possible values for **Transactional** type webhook: #### `sent` OR `request`, `delivered`, `hardBounce`, `softBounce`, `blocked`, `spam`, `invalid`, `deferred`, `click`, `opened`, `uniqueOpened` and `unsubscribed` - Possible values for **Marketing** type webhook: #### `spam`, `opened`, `click`, `hardBounce`, `softBounce`, `unsubscribed`, `listAddition` & `delivered` - Possible values for **Inbound** type webhook: #### `inboundEmailProcessed` | [optional]
+**domain** | **string** | Inbound domain of webhook, used in case of event type `inbound` | [optional]
+**batched** | **bool** | Batching configuration of the webhook, we send batched webhooks if its true | [optional]
+**auth** | **object** | Authentication header to be send with the webhook requests | [optional]
+**headers** | **object[]** | | [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/UpdateWhatsAppCampaign.md b/docs/Model/UpdateWhatsAppCampaign.md
index 3685191..999cb6c 100644
--- a/docs/Model/UpdateWhatsAppCampaign.md
+++ b/docs/Model/UpdateWhatsAppCampaign.md
@@ -1,13 +1,12 @@
-# UpdateWhatsAppCampaign
+# # UpdateWhatsAppCampaign
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**campaignName** | **string** | Name of the campaign | [optional]
+**campaignName** | **string** | Name of the campaign | [optional]
**campaignStatus** | **string** | Status of the campaign | [optional] [default to 'scheduled']
-**rescheduleFor** | **string** | Reschedule the sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of campaign. **Prefer to pass your timezone in date-time format for accurate result.For example: **2017-06-01T12:30:00+02:00** Use this field to update the scheduledAt of any existing draft or scheduled WhatsApp campaign. | [optional]
-**recipients** | [**\Brevo\Client\Model\CreateWhatsAppCampaignRecipients**](CreateWhatsAppCampaignRecipients.md) | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**rescheduleFor** | **string** | Reschedule the sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of campaign. **Prefer to pass your timezone in date-time format for accurate result.For example: **2017-06-01T12:30:00+02:00** Use this field to update the scheduledAt of any existing draft or scheduled WhatsApp campaign. | [optional]
+**recipients** | [**\Brevo\Client\Models\CreateWhatsAppCampaignRecipients**](CreateWhatsAppCampaignRecipients.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/UploadImageModel.md b/docs/Model/UploadImageModel.md
index 4973300..6bb89f3 100644
--- a/docs/Model/UploadImageModel.md
+++ b/docs/Model/UploadImageModel.md
@@ -1,10 +1,9 @@
-# UploadImageModel
+# # UploadImageModel
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**url** | **string** | URL of the image uploaded |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**url** | **string** | URL of the image uploaded | [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/UploadImageToGallery.md b/docs/Model/UploadImageToGallery.md
index 50b5f2a..3e4a463 100644
--- a/docs/Model/UploadImageToGallery.md
+++ b/docs/Model/UploadImageToGallery.md
@@ -1,11 +1,10 @@
-# UploadImageToGallery
+# # UploadImageToGallery
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**imageUrl** | **string** | The absolute url of the image (no local file). Maximum allowed size for image is 2MB. Allowed extensions for images are - jpeg, jpg, png, bmp, gif. |
-**name** | **string** | Name of the image. | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**imageUrl** | **string** | The absolute url of the image (**no local file**). Maximum allowed size for image is **2MB**. Allowed extensions for images are: #### jpeg, jpg, png, bmp, gif. |
+**name** | **string** | Name of the image. | [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/ValidateRewardPayload.md b/docs/Model/ValidateRewardPayload.md
new file mode 100644
index 0000000..7e36920
--- /dev/null
+++ b/docs/Model/ValidateRewardPayload.md
@@ -0,0 +1,12 @@
+# # ValidateRewardPayload
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**contactId** | **float** | Contact to attribute the reward | [optional]
+**loyaltySubscriptionId** | **string** | One of contactId or loyaltySubscriptionId is required | [optional]
+**code** | **string** | Code to validate | [optional]
+**attributedRewardId** | **string** | One of code or attributed reward id is required | [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/ValidatedRewardResponse.md b/docs/Model/ValidatedRewardResponse.md
new file mode 100644
index 0000000..d2842df
--- /dev/null
+++ b/docs/Model/ValidatedRewardResponse.md
@@ -0,0 +1,9 @@
+# # ValidatedRewardResponse
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**authorize** | **bool** | Validated reward respone | [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/ValidationError.md b/docs/Model/ValidationError.md
new file mode 100644
index 0000000..da92655
--- /dev/null
+++ b/docs/Model/ValidationError.md
@@ -0,0 +1,9 @@
+# # ValidationError
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**error** | **string** | Validation error message | [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/VariablesItems.md b/docs/Model/VariablesItems.md
index 1eca6db..5ca7f07 100644
--- a/docs/Model/VariablesItems.md
+++ b/docs/Model/VariablesItems.md
@@ -1,12 +1,11 @@
-# VariablesItems
+# # VariablesItems
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**name** | **string** | | [optional]
-**default** | **string** | | [optional]
-**datatype** | **string** | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**name** | **string** | | [optional]
+**default** | **string** | | [optional]
+**datatype** | **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/VersionInfo.md b/docs/Model/VersionInfo.md
new file mode 100644
index 0000000..649ee41
--- /dev/null
+++ b/docs/Model/VersionInfo.md
@@ -0,0 +1,16 @@
+# # VersionInfo
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | Version Name | [optional]
+**loyaltyProgramId** | **string** | Loyalty Program Id | [optional]
+**loyaltyVersionId** | **int** | Loyalty Version Id | [optional]
+**parentVersionId** | **int** | Parent Version Id | [optional]
+**state** | **string** | Version State | [optional]
+**publishedAt** | **\DateTime** | Version Publish date | [optional]
+**createdAt** | **\DateTime** | Version creation date | [optional]
+**updatedAt** | **\DateTime** | Version last modification date | [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/WhatsappCampStats.md b/docs/Model/WhatsappCampStats.md
index b764ed2..6763dcf 100644
--- a/docs/Model/WhatsappCampStats.md
+++ b/docs/Model/WhatsappCampStats.md
@@ -1,14 +1,13 @@
-# WhatsappCampStats
+# # WhatsappCampStats
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**sent** | **int** | |
-**delivered** | **int** | |
-**read** | **int** | |
-**unsubscribe** | **int** | |
-**notSent** | **int** | |
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**sent** | **int** | |
+**delivered** | **int** | |
+**read** | **int** | |
+**unsubscribe** | **int** | |
+**notSent** | **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/WhatsappCampTemplate.md b/docs/Model/WhatsappCampTemplate.md
index 3e929a1..bf9185c 100644
--- a/docs/Model/WhatsappCampTemplate.md
+++ b/docs/Model/WhatsappCampTemplate.md
@@ -1,20 +1,19 @@
-# WhatsappCampTemplate
+# # WhatsappCampTemplate
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**name** | **string** | name of the template | [optional]
-**category** | **string** | description of the template | [optional]
-**language** | **string** | language of the template | [optional]
-**containsButton** | **bool** | | [optional]
-**displayHeader** | **bool** | | [optional]
-**headerType** | **string** | type of header | [optional]
-**components** | [**\Brevo\Client\Model\ComponentItems[]**](ComponentItems.md) | array of component item objects | [optional]
-**headerVariables** | [**\Brevo\Client\Model\VariablesItems[]**](VariablesItems.md) | array of variables item object | [optional]
-**bodyVariables** | [**\Brevo\Client\Model\VariablesItems[]**](VariablesItems.md) | array of variables item variables | [optional]
-**buttonType** | **string** | | [optional]
-**hideFooter** | **bool** | | [optional]
-
-[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
-
+**name** | **string** | name of the template | [optional]
+**category** | **string** | description of the template | [optional]
+**language** | **string** | language of the template | [optional]
+**containsButton** | **bool** | | [optional]
+**displayHeader** | **bool** | | [optional]
+**headerType** | **string** | type of header | [optional]
+**components** | [**\Brevo\Client\Models\ComponentItems[]**](ComponentItems.md) | array of component item objects | [optional]
+**headerVariables** | [**\Brevo\Client\Models\VariablesItems[]**](VariablesItems.md) | array of variables item object | [optional]
+**bodyVariables** | [**\Brevo\Client\Models\VariablesItems[]**](VariablesItems.md) | array of variables item variables | [optional]
+**buttonType** | **string** | | [optional]
+**hideFooter** | **bool** | | [optional]
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/git_push.sh b/git_push.sh
new file mode 100644
index 0000000..8d599e2
--- /dev/null
+++ b/git_push.sh
@@ -0,0 +1,57 @@
+#!/bin/sh
+# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
+#
+# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
+
+git_user_id=$1
+git_repo_id=$2
+release_note=$3
+git_host=$4
+
+if [ "$git_host" = "" ]; then
+ git_host="github.com"
+ echo "[INFO] No command line input provided. Set \$git_host to $git_host"
+fi
+
+if [ "$git_user_id" = "" ]; then
+ git_user_id="getbrevo"
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
+fi
+
+if [ "$git_repo_id" = "" ]; then
+ git_repo_id="brevo-php"
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
+fi
+
+if [ "$release_note" = "" ]; then
+ release_note="Minor update"
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
+fi
+
+# Initialize the local directory as a Git repository
+git init
+
+# Adds the files in the local repository and stages them for commit.
+git add .
+
+# Commits the tracked changes and prepares them to be pushed to a remote repository.
+git commit -m "$release_note"
+
+# Sets the new remote
+git_remote=$(git remote)
+if [ "$git_remote" = "" ]; then # git remote not defined
+
+ if [ "$GIT_TOKEN" = "" ]; then
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
+ git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
+ else
+ git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
+ fi
+
+fi
+
+git pull origin master
+
+# Pushes (Forces) the changes in the local repository up to the remote repository
+echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
+git push origin master 2>&1 | grep -v 'To https'
diff --git a/lib/Api/AccountApi.php b/lib/Api/AccountApi.php
index 920e3fe..3cc87af 100644
--- a/lib/Api/AccountApi.php
+++ b/lib/Api/AccountApi.php
@@ -1,39 +1,41 @@
[
+ 'application/json',
+ ],
+ 'getAccountActivity' => [
+ 'application/json',
+ ],
+ ];
+
+ /**
+ * @param ClientInterface|null $client
+ * @param Configuration|null $config
+ * @param HeaderSelector|null $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
+ HeaderSelector $selector = null,
+ int $hostIndex = 0
) {
$this->client = $client ?: new Client();
- $this->config = $config ?: new Configuration();
+ $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(int $hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex(): int
+ {
+ return $this->hostIndex;
}
/**
* @return Configuration
*/
- public function getConfig()
+ public function getConfig(): Configuration
{
return $this->config;
}
@@ -92,14 +131,17 @@ public function getConfig()
*
* Get your account information, plan and credits details
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAccount'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetAccount
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetAccount
*/
- public function getAccount()
+ public function getAccount(
+ string $contentType = self::contentTypes['getAccount'][0]
+ ): \Brevo\Client\Models\GetAccount
{
- list($response) = $this->getAccountWithHttpInfo();
+ list($response) = $this->getAccountWithHttpInfo($contentType);
return $response;
}
@@ -108,15 +150,17 @@ public function getAccount()
*
* Get your account information, plan and credits details
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAccount'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetAccount, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetAccount, HTTP status code, HTTP response headers (array of strings)
*/
- public function getAccountWithHttpInfo()
+ public function getAccountWithHttpInfo(
+ string $contentType = self::contentTypes['getAccount'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetAccount';
- $request = $this->getAccountRequest();
+ $request = $this->getAccountRequest($contentType);
try {
$options = $this->createHttpClientOption();
@@ -125,34 +169,84 @@ public function getAccountWithHttpInfo()
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetAccount', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetAccount' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetAccount', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetAccount';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -167,7 +261,7 @@ public function getAccountWithHttpInfo()
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetAccount',
+ '\Brevo\Client\Models\GetAccount',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -182,13 +276,16 @@ public function getAccountWithHttpInfo()
*
* Get your account information, plan and credits details
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAccount'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getAccountAsync()
+ public function getAccountAsync(
+ string $contentType = self::contentTypes['getAccount'][0]
+ ): PromiseInterface
{
- return $this->getAccountAsyncWithHttpInfo()
+ return $this->getAccountAsyncWithHttpInfo($contentType)
->then(
function ($response) {
return $response[0];
@@ -201,24 +298,27 @@ function ($response) {
*
* Get your account information, plan and credits details
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAccount'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getAccountAsyncWithHttpInfo()
+ public function getAccountAsyncWithHttpInfo(
+ string $contentType = self::contentTypes['getAccount'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetAccount';
- $request = $this->getAccountRequest();
+ $returnType = '\Brevo\Client\Models\GetAccount';
+ $request = $this->getAccountRequest($contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -241,7 +341,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -250,13 +350,17 @@ function ($exception) {
/**
* Create request for operation 'getAccount'
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAccount'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getAccountRequest()
+ public function getAccountRequest(
+ string $contentType = self::contentTypes['getAccount'][0]
+ ): Request
{
+
$resourcePath = '/account';
$formParams = [];
$queryParams = [];
@@ -266,53 +370,36 @@ protected function getAccountRequest()
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -338,10 +425,11 @@ protected function getAccountRequest()
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -352,18 +440,25 @@ protected function getAccountRequest()
*
* Get user activity logs
*
- * @param string $startDate Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search. (optional)
- * @param string $endDate Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. (optional)
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document in the page. (optional, default to 0)
+ * @param string|null $startDate Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search. (optional)
+ * @param string|null $endDate Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 10)
+ * @param int|null $offset Index of the first document in the page. (optional, default to 0)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAccountActivity'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetAccountActivity
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetAccountActivity|\Brevo\Client\Models\ErrorModel
*/
- public function getAccountActivity($startDate = null, $endDate = null, $limit = '10', $offset = '0')
+ public function getAccountActivity(
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $limit = 10,
+ ?int $offset = 0,
+ string $contentType = self::contentTypes['getAccountActivity'][0]
+ ): \Brevo\Client\Models\GetAccountActivity
{
- list($response) = $this->getAccountActivityWithHttpInfo($startDate, $endDate, $limit, $offset);
+ list($response) = $this->getAccountActivityWithHttpInfo($startDate, $endDate, $limit, $offset, $contentType);
return $response;
}
@@ -372,19 +467,25 @@ public function getAccountActivity($startDate = null, $endDate = null, $limit =
*
* Get user activity logs
*
- * @param string $startDate Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search. (optional)
- * @param string $endDate Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. (optional)
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document in the page. (optional, default to 0)
+ * @param string|null $startDate Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search. (optional)
+ * @param string|null $endDate Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 10)
+ * @param int|null $offset Index of the first document in the page. (optional, default to 0)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAccountActivity'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetAccountActivity, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetAccountActivity|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getAccountActivityWithHttpInfo($startDate = null, $endDate = null, $limit = '10', $offset = '0')
+ public function getAccountActivityWithHttpInfo(
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $limit = 10,
+ ?int $offset = 0,
+ string $contentType = self::contentTypes['getAccountActivity'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetAccountActivity';
- $request = $this->getAccountActivityRequest($startDate, $endDate, $limit, $offset);
+ $request = $this->getAccountActivityRequest($startDate, $endDate, $limit, $offset, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -393,34 +494,111 @@ public function getAccountActivityWithHttpInfo($startDate = null, $endDate = nul
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetAccountActivity', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetAccountActivity' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetAccountActivity', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetAccountActivity';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -435,7 +613,7 @@ public function getAccountActivityWithHttpInfo($startDate = null, $endDate = nul
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetAccountActivity',
+ '\Brevo\Client\Models\GetAccountActivity',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -443,7 +621,7 @@ public function getAccountActivityWithHttpInfo($startDate = null, $endDate = nul
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -458,17 +636,24 @@ public function getAccountActivityWithHttpInfo($startDate = null, $endDate = nul
*
* Get user activity logs
*
- * @param string $startDate Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search. (optional)
- * @param string $endDate Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. (optional)
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document in the page. (optional, default to 0)
+ * @param string|null $startDate Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search. (optional)
+ * @param string|null $endDate Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 10)
+ * @param int|null $offset Index of the first document in the page. (optional, default to 0)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAccountActivity'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getAccountActivityAsync($startDate = null, $endDate = null, $limit = '10', $offset = '0')
+ public function getAccountActivityAsync(
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $limit = 10,
+ ?int $offset = 0,
+ string $contentType = self::contentTypes['getAccountActivity'][0]
+ ): PromiseInterface
{
- return $this->getAccountActivityAsyncWithHttpInfo($startDate, $endDate, $limit, $offset)
+ return $this->getAccountActivityAsyncWithHttpInfo($startDate, $endDate, $limit, $offset, $contentType)
->then(
function ($response) {
return $response[0];
@@ -481,28 +666,35 @@ function ($response) {
*
* Get user activity logs
*
- * @param string $startDate Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search. (optional)
- * @param string $endDate Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. (optional)
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document in the page. (optional, default to 0)
+ * @param string|null $startDate Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search. (optional)
+ * @param string|null $endDate Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 10)
+ * @param int|null $offset Index of the first document in the page. (optional, default to 0)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAccountActivity'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getAccountActivityAsyncWithHttpInfo($startDate = null, $endDate = null, $limit = '10', $offset = '0')
+ public function getAccountActivityAsyncWithHttpInfo(
+ $startDate = null,
+ $endDate = null,
+ $limit = 10,
+ $offset = 0,
+ string $contentType = self::contentTypes['getAccountActivity'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetAccountActivity';
- $request = $this->getAccountActivityRequest($startDate, $endDate, $limit, $offset);
+ $returnType = '\Brevo\Client\Models\GetAccountActivity';
+ $request = $this->getAccountActivityRequest($startDate, $endDate, $limit, $offset, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -525,7 +717,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -534,22 +726,33 @@ function ($exception) {
/**
* Create request for operation 'getAccountActivity'
*
- * @param string $startDate Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search. (optional)
- * @param string $endDate Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. (optional)
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document in the page. (optional, default to 0)
+ * @param string|null $startDate Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search. (optional)
+ * @param string|null $endDate Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 10)
+ * @param int|null $offset Index of the first document in the page. (optional, default to 0)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAccountActivity'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getAccountActivityRequest($startDate = null, $endDate = null, $limit = '10', $offset = '0')
+ public function getAccountActivityRequest(
+ $startDate = null,
+ $endDate = null,
+ $limit = 10,
+ $offset = 0,
+ string $contentType = self::contentTypes['getAccountActivity'][0]
+ ): Request
{
+
+
+
if ($limit !== null && $limit > 100) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling AccountApi.getAccountActivity, must be smaller than or equal to 100.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling AccountApi.getAccountActivity, must be smaller than or equal to 100.');
}
if ($limit !== null && $limit < 1) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling AccountApi.getAccountActivity, must be bigger than or equal to 1.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling AccountApi.getAccountActivity, must be bigger than or equal to 1.');
}
+
$resourcePath = '/organization/activities';
@@ -560,70 +763,73 @@ protected function getAccountActivityRequest($startDate = null, $endDate = null,
$multipart = false;
// query params
- if ($startDate !== null) {
- $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $startDate,
+ 'startDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($endDate !== null) {
- $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $endDate,
+ 'endDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -649,10 +855,11 @@ protected function getAccountActivityRequest($startDate = null, $endDate = null,
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -664,7 +871,7 @@ protected function getAccountActivityRequest($startDate = null, $endDate = null,
* @throws \RuntimeException on file opening failure
* @return array of http client options
*/
- protected function createHttpClientOption()
+ protected function createHttpClientOption(): array
{
$options = [];
if ($this->config->getDebug()) {
diff --git a/lib/Api/AttributesApi.php b/lib/Api/AttributesApi.php
deleted file mode 100644
index add93cd..0000000
--- a/lib/Api/AttributesApi.php
+++ /dev/null
@@ -1,1219 +0,0 @@
-client = $client ?: new Client();
- $this->config = $config ?: new Configuration();
- $this->headerSelector = $selector ?: new HeaderSelector();
- }
-
- /**
- * @return Configuration
- */
- public function getConfig()
- {
- return $this->config;
- }
-
- /**
- * Operation createAttribute
- *
- * Create contact attribute
- *
- * @param string $attributeCategory Category of the attribute (required)
- * @param string $attributeName Name of the attribute (required)
- * @param \Brevo\Client\Model\CreateAttribute $createAttribute Values to create an attribute (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return void
- */
- public function createAttribute($attributeCategory, $attributeName, $createAttribute)
- {
- $this->createAttributeWithHttpInfo($attributeCategory, $attributeName, $createAttribute);
- }
-
- /**
- * Operation createAttributeWithHttpInfo
- *
- * Create contact attribute
- *
- * @param string $attributeCategory Category of the attribute (required)
- * @param string $attributeName Name of the attribute (required)
- * @param \Brevo\Client\Model\CreateAttribute $createAttribute Values to create an attribute (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of null, HTTP status code, HTTP response headers (array of strings)
- */
- public function createAttributeWithHttpInfo($attributeCategory, $attributeName, $createAttribute)
- {
- $returnType = '';
- $request = $this->createAttributeRequest($attributeCategory, $attributeName, $createAttribute);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- return [null, $statusCode, $response->getHeaders()];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation createAttributeAsync
- *
- * Create contact attribute
- *
- * @param string $attributeCategory Category of the attribute (required)
- * @param string $attributeName Name of the attribute (required)
- * @param \Brevo\Client\Model\CreateAttribute $createAttribute Values to create an attribute (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function createAttributeAsync($attributeCategory, $attributeName, $createAttribute)
- {
- return $this->createAttributeAsyncWithHttpInfo($attributeCategory, $attributeName, $createAttribute)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation createAttributeAsyncWithHttpInfo
- *
- * Create contact attribute
- *
- * @param string $attributeCategory Category of the attribute (required)
- * @param string $attributeName Name of the attribute (required)
- * @param \Brevo\Client\Model\CreateAttribute $createAttribute Values to create an attribute (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function createAttributeAsyncWithHttpInfo($attributeCategory, $attributeName, $createAttribute)
- {
- $returnType = '';
- $request = $this->createAttributeRequest($attributeCategory, $attributeName, $createAttribute);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- return [null, $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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'createAttribute'
- *
- * @param string $attributeCategory Category of the attribute (required)
- * @param string $attributeName Name of the attribute (required)
- * @param \Brevo\Client\Model\CreateAttribute $createAttribute Values to create an attribute (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function createAttributeRequest($attributeCategory, $attributeName, $createAttribute)
- {
- // verify the required parameter 'attributeCategory' is set
- if ($attributeCategory === null || (is_array($attributeCategory) && count($attributeCategory) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $attributeCategory when calling createAttribute'
- );
- }
- // verify the required parameter 'attributeName' is set
- if ($attributeName === null || (is_array($attributeName) && count($attributeName) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $attributeName when calling createAttribute'
- );
- }
- // verify the required parameter 'createAttribute' is set
- if ($createAttribute === null || (is_array($createAttribute) && count($createAttribute) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $createAttribute when calling createAttribute'
- );
- }
-
- $resourcePath = '/contacts/attributes/{attributeCategory}/{attributeName}';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
- // path params
- if ($attributeCategory !== null) {
- $resourcePath = str_replace(
- '{' . 'attributeCategory' . '}',
- ObjectSerializer::toPathValue($attributeCategory),
- $resourcePath
- );
- }
- // path params
- if ($attributeName !== null) {
- $resourcePath = str_replace(
- '{' . 'attributeName' . '}',
- ObjectSerializer::toPathValue($attributeName),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
- if (isset($createAttribute)) {
- $_tempBody = $createAttribute;
- }
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation deleteAttribute
- *
- * Delete an attribute
- *
- * @param string $attributeCategory Category of the attribute (required)
- * @param string $attributeName Name of the existing attribute (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return void
- */
- public function deleteAttribute($attributeCategory, $attributeName)
- {
- $this->deleteAttributeWithHttpInfo($attributeCategory, $attributeName);
- }
-
- /**
- * Operation deleteAttributeWithHttpInfo
- *
- * Delete an attribute
- *
- * @param string $attributeCategory Category of the attribute (required)
- * @param string $attributeName Name of the existing attribute (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of null, HTTP status code, HTTP response headers (array of strings)
- */
- public function deleteAttributeWithHttpInfo($attributeCategory, $attributeName)
- {
- $returnType = '';
- $request = $this->deleteAttributeRequest($attributeCategory, $attributeName);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- return [null, $statusCode, $response->getHeaders()];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation deleteAttributeAsync
- *
- * Delete an attribute
- *
- * @param string $attributeCategory Category of the attribute (required)
- * @param string $attributeName Name of the existing attribute (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function deleteAttributeAsync($attributeCategory, $attributeName)
- {
- return $this->deleteAttributeAsyncWithHttpInfo($attributeCategory, $attributeName)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation deleteAttributeAsyncWithHttpInfo
- *
- * Delete an attribute
- *
- * @param string $attributeCategory Category of the attribute (required)
- * @param string $attributeName Name of the existing attribute (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function deleteAttributeAsyncWithHttpInfo($attributeCategory, $attributeName)
- {
- $returnType = '';
- $request = $this->deleteAttributeRequest($attributeCategory, $attributeName);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- return [null, $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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'deleteAttribute'
- *
- * @param string $attributeCategory Category of the attribute (required)
- * @param string $attributeName Name of the existing attribute (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function deleteAttributeRequest($attributeCategory, $attributeName)
- {
- // verify the required parameter 'attributeCategory' is set
- if ($attributeCategory === null || (is_array($attributeCategory) && count($attributeCategory) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $attributeCategory when calling deleteAttribute'
- );
- }
- // verify the required parameter 'attributeName' is set
- if ($attributeName === null || (is_array($attributeName) && count($attributeName) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $attributeName when calling deleteAttribute'
- );
- }
-
- $resourcePath = '/contacts/attributes/{attributeCategory}/{attributeName}';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
- // path params
- if ($attributeCategory !== null) {
- $resourcePath = str_replace(
- '{' . 'attributeCategory' . '}',
- ObjectSerializer::toPathValue($attributeCategory),
- $resourcePath
- );
- }
- // path params
- if ($attributeName !== null) {
- $resourcePath = str_replace(
- '{' . 'attributeName' . '}',
- ObjectSerializer::toPathValue($attributeName),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation getAttributes
- *
- * List all attributes
- *
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetAttributes
- */
- public function getAttributes()
- {
- list($response) = $this->getAttributesWithHttpInfo();
- return $response;
- }
-
- /**
- * Operation getAttributesWithHttpInfo
- *
- * List all attributes
- *
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetAttributes, HTTP status code, HTTP response headers (array of strings)
- */
- public function getAttributesWithHttpInfo()
- {
- $returnType = '\Brevo\Client\Model\GetAttributes';
- $request = $this->getAttributesRequest();
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
-
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 200:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\GetAttributes',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation getAttributesAsync
- *
- * List all attributes
- *
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getAttributesAsync()
- {
- return $this->getAttributesAsyncWithHttpInfo()
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation getAttributesAsyncWithHttpInfo
- *
- * List all attributes
- *
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getAttributesAsyncWithHttpInfo()
- {
- $returnType = '\Brevo\Client\Model\GetAttributes';
- $request = $this->getAttributesRequest();
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- 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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'getAttributes'
- *
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function getAttributesRequest()
- {
-
- $resourcePath = '/contacts/attributes';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
-
- // body params
- $_tempBody = null;
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation updateAttribute
- *
- * Update contact attribute
- *
- * @param string $attributeCategory Category of the attribute (required)
- * @param string $attributeName Name of the existing attribute (required)
- * @param \Brevo\Client\Model\UpdateAttribute $updateAttribute Values to update an attribute (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return void
- */
- public function updateAttribute($attributeCategory, $attributeName, $updateAttribute)
- {
- $this->updateAttributeWithHttpInfo($attributeCategory, $attributeName, $updateAttribute);
- }
-
- /**
- * Operation updateAttributeWithHttpInfo
- *
- * Update contact attribute
- *
- * @param string $attributeCategory Category of the attribute (required)
- * @param string $attributeName Name of the existing attribute (required)
- * @param \Brevo\Client\Model\UpdateAttribute $updateAttribute Values to update an attribute (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of null, HTTP status code, HTTP response headers (array of strings)
- */
- public function updateAttributeWithHttpInfo($attributeCategory, $attributeName, $updateAttribute)
- {
- $returnType = '';
- $request = $this->updateAttributeRequest($attributeCategory, $attributeName, $updateAttribute);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- return [null, $statusCode, $response->getHeaders()];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation updateAttributeAsync
- *
- * Update contact attribute
- *
- * @param string $attributeCategory Category of the attribute (required)
- * @param string $attributeName Name of the existing attribute (required)
- * @param \Brevo\Client\Model\UpdateAttribute $updateAttribute Values to update an attribute (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function updateAttributeAsync($attributeCategory, $attributeName, $updateAttribute)
- {
- return $this->updateAttributeAsyncWithHttpInfo($attributeCategory, $attributeName, $updateAttribute)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation updateAttributeAsyncWithHttpInfo
- *
- * Update contact attribute
- *
- * @param string $attributeCategory Category of the attribute (required)
- * @param string $attributeName Name of the existing attribute (required)
- * @param \Brevo\Client\Model\UpdateAttribute $updateAttribute Values to update an attribute (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function updateAttributeAsyncWithHttpInfo($attributeCategory, $attributeName, $updateAttribute)
- {
- $returnType = '';
- $request = $this->updateAttributeRequest($attributeCategory, $attributeName, $updateAttribute);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- return [null, $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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'updateAttribute'
- *
- * @param string $attributeCategory Category of the attribute (required)
- * @param string $attributeName Name of the existing attribute (required)
- * @param \Brevo\Client\Model\UpdateAttribute $updateAttribute Values to update an attribute (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function updateAttributeRequest($attributeCategory, $attributeName, $updateAttribute)
- {
- // verify the required parameter 'attributeCategory' is set
- if ($attributeCategory === null || (is_array($attributeCategory) && count($attributeCategory) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $attributeCategory when calling updateAttribute'
- );
- }
- // verify the required parameter 'attributeName' is set
- if ($attributeName === null || (is_array($attributeName) && count($attributeName) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $attributeName when calling updateAttribute'
- );
- }
- // verify the required parameter 'updateAttribute' is set
- if ($updateAttribute === null || (is_array($updateAttribute) && count($updateAttribute) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $updateAttribute when calling updateAttribute'
- );
- }
-
- $resourcePath = '/contacts/attributes/{attributeCategory}/{attributeName}';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
- // path params
- if ($attributeCategory !== null) {
- $resourcePath = str_replace(
- '{' . 'attributeCategory' . '}',
- ObjectSerializer::toPathValue($attributeCategory),
- $resourcePath
- );
- }
- // path params
- if ($attributeName !== null) {
- $resourcePath = str_replace(
- '{' . 'attributeName' . '}',
- ObjectSerializer::toPathValue($attributeName),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
- if (isset($updateAttribute)) {
- $_tempBody = $updateAttribute;
- }
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'PUT',
- $this->config->getHost() . $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/BalanceApi.php b/lib/Api/BalanceApi.php
new file mode 100644
index 0000000..c44038d
--- /dev/null
+++ b/lib/Api/BalanceApi.php
@@ -0,0 +1,6579 @@
+ [
+ 'application/json',
+ ],
+ 'cancelTransaction' => [
+ 'application/json',
+ ],
+ 'completeTransaction' => [
+ 'application/json',
+ ],
+ 'createBalanceOrder' => [
+ 'application/json',
+ ],
+ 'getBalanceDefinitionList' => [
+ 'application/json',
+ ],
+ 'getContactBalances' => [
+ 'application/json',
+ ],
+ 'getSubscriptionBalances' => [
+ 'application/json',
+ ],
+ 'loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDelete' => [
+ 'application/json',
+ ],
+ 'loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGet' => [
+ 'application/json',
+ ],
+ 'loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDelete' => [
+ 'application/json',
+ ],
+ 'loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGet' => [
+ 'application/json',
+ ],
+ 'loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPut' => [
+ 'application/json',
+ ],
+ 'loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPost' => [
+ 'application/json',
+ ],
+ 'loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPut' => [
+ 'application/json',
+ ],
+ 'loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPost' => [
+ 'application/json',
+ ],
+ ];
+
+ /**
+ * @param ClientInterface|null $client
+ * @param Configuration|null $config
+ * @param HeaderSelector|null $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(int $hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex(): int
+ {
+ return $this->hostIndex;
+ }
+
+ /**
+ * @return Configuration
+ */
+ public function getConfig(): Configuration
+ {
+ return $this->config;
+ }
+
+ /**
+ * Operation beginTransaction
+ *
+ * Create new transaction
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\CreateTransactionPayload|null $createTransactionPayload Transaction information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['beginTransaction'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\Transaction|\Brevo\Client\Models\BadRequestPayload
+ */
+ public function beginTransaction(
+ string $loyaltyProgramId,
+ ?\Brevo\Client\Models\CreateTransactionPayload $createTransactionPayload = null,
+ string $contentType = self::contentTypes['beginTransaction'][0]
+ ): \Brevo\Client\Models\Transaction
+ {
+ list($response) = $this->beginTransactionWithHttpInfo($loyaltyProgramId, $createTransactionPayload, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation beginTransactionWithHttpInfo
+ *
+ * Create new transaction
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\CreateTransactionPayload|null $createTransactionPayload Transaction information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['beginTransaction'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\Transaction|\Brevo\Client\Models\BadRequestPayload, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function beginTransactionWithHttpInfo(
+ string $loyaltyProgramId,
+ ?\Brevo\Client\Models\CreateTransactionPayload $createTransactionPayload = null,
+ string $contentType = self::contentTypes['beginTransaction'][0]
+ ): array
+ {
+ $request = $this->beginTransactionRequest($loyaltyProgramId, $createTransactionPayload, $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 201:
+ if (in_array('\Brevo\Client\Models\Transaction', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\Transaction' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\Transaction', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $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 = '\Brevo\Client\Models\Transaction';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 201:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\Transaction',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation beginTransactionAsync
+ *
+ * Create new transaction
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\CreateTransactionPayload|null $createTransactionPayload Transaction information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['beginTransaction'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function beginTransactionAsync(
+ string $loyaltyProgramId,
+ ?\Brevo\Client\Models\CreateTransactionPayload $createTransactionPayload = null,
+ string $contentType = self::contentTypes['beginTransaction'][0]
+ ): PromiseInterface
+ {
+ return $this->beginTransactionAsyncWithHttpInfo($loyaltyProgramId, $createTransactionPayload, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation beginTransactionAsyncWithHttpInfo
+ *
+ * Create new transaction
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\CreateTransactionPayload|null $createTransactionPayload Transaction information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['beginTransaction'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function beginTransactionAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $createTransactionPayload = null,
+ string $contentType = self::contentTypes['beginTransaction'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\Transaction';
+ $request = $this->beginTransactionRequest($loyaltyProgramId, $createTransactionPayload, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'beginTransaction'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\CreateTransactionPayload|null $createTransactionPayload Transaction information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['beginTransaction'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function beginTransactionRequest(
+ $loyaltyProgramId,
+ $createTransactionPayload = null,
+ string $contentType = self::contentTypes['beginTransaction'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling beginTransaction'
+ );
+ }
+
+
+
+ $resourcePath = '/loyalty/balance/programs/{loyaltyProgramId}/transactions';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($createTransactionPayload)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createTransactionPayload));
+ } else {
+ $httpBody = $createTransactionPayload;
+ }
+ } 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 cancelTransaction
+ *
+ * Cancel transaction
+ *
+ * @param string $loyaltyProgramId Loyalty program Id (required)
+ * @param string $transactionId Transaction Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelTransaction'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CancelledTransaction|\Brevo\Client\Models\BadRequestPayload
+ */
+ public function cancelTransaction(
+ string $loyaltyProgramId,
+ string $transactionId,
+ string $contentType = self::contentTypes['cancelTransaction'][0]
+ ): \Brevo\Client\Models\CancelledTransaction
+ {
+ list($response) = $this->cancelTransactionWithHttpInfo($loyaltyProgramId, $transactionId, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation cancelTransactionWithHttpInfo
+ *
+ * Cancel transaction
+ *
+ * @param string $loyaltyProgramId Loyalty program Id (required)
+ * @param string $transactionId Transaction Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelTransaction'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CancelledTransaction|\Brevo\Client\Models\BadRequestPayload, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function cancelTransactionWithHttpInfo(
+ string $loyaltyProgramId,
+ string $transactionId,
+ string $contentType = self::contentTypes['cancelTransaction'][0]
+ ): array
+ {
+ $request = $this->cancelTransactionRequest($loyaltyProgramId, $transactionId, $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 (in_array('\Brevo\Client\Models\CancelledTransaction', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CancelledTransaction' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CancelledTransaction', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $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 = '\Brevo\Client\Models\CancelledTransaction';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\CancelledTransaction',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation cancelTransactionAsync
+ *
+ * Cancel transaction
+ *
+ * @param string $loyaltyProgramId Loyalty program Id (required)
+ * @param string $transactionId Transaction Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelTransaction'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function cancelTransactionAsync(
+ string $loyaltyProgramId,
+ string $transactionId,
+ string $contentType = self::contentTypes['cancelTransaction'][0]
+ ): PromiseInterface
+ {
+ return $this->cancelTransactionAsyncWithHttpInfo($loyaltyProgramId, $transactionId, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation cancelTransactionAsyncWithHttpInfo
+ *
+ * Cancel transaction
+ *
+ * @param string $loyaltyProgramId Loyalty program Id (required)
+ * @param string $transactionId Transaction Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelTransaction'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function cancelTransactionAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $transactionId,
+ string $contentType = self::contentTypes['cancelTransaction'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\CancelledTransaction';
+ $request = $this->cancelTransactionRequest($loyaltyProgramId, $transactionId, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'cancelTransaction'
+ *
+ * @param string $loyaltyProgramId Loyalty program Id (required)
+ * @param string $transactionId Transaction Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelTransaction'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function cancelTransactionRequest(
+ $loyaltyProgramId,
+ $transactionId,
+ string $contentType = self::contentTypes['cancelTransaction'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling cancelTransaction'
+ );
+ }
+
+ // verify the required parameter 'transactionId' is set
+ if ($transactionId === null || (is_array($transactionId) && count($transactionId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $transactionId when calling cancelTransaction'
+ );
+ }
+
+
+ $resourcePath = '/loyalty/balance/programs/{loyaltyProgramId}/transactions/{transactionId}/cancel';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($transactionId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'transactionId' . '}',
+ ObjectSerializer::toPathValue($transactionId),
+ $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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 completeTransaction
+ *
+ * Complete transaction
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $transactionId Transaction Id (required)
+ * @param \Brevo\Client\Models\CompleteTransactionPayload|null $completeTransactionPayload Transaction information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['completeTransaction'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CompletedTransaction|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ValidationError
+ */
+ public function completeTransaction(
+ string $loyaltyProgramId,
+ string $transactionId,
+ ?\Brevo\Client\Models\CompleteTransactionPayload $completeTransactionPayload = null,
+ string $contentType = self::contentTypes['completeTransaction'][0]
+ ): \Brevo\Client\Models\CompletedTransaction
+ {
+ list($response) = $this->completeTransactionWithHttpInfo($loyaltyProgramId, $transactionId, $completeTransactionPayload, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation completeTransactionWithHttpInfo
+ *
+ * Complete transaction
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $transactionId Transaction Id (required)
+ * @param \Brevo\Client\Models\CompleteTransactionPayload|null $completeTransactionPayload Transaction information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['completeTransaction'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CompletedTransaction|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ValidationError, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function completeTransactionWithHttpInfo(
+ string $loyaltyProgramId,
+ string $transactionId,
+ ?\Brevo\Client\Models\CompleteTransactionPayload $completeTransactionPayload = null,
+ string $contentType = self::contentTypes['completeTransaction'][0]
+ ): array
+ {
+ $request = $this->completeTransactionRequest($loyaltyProgramId, $transactionId, $completeTransactionPayload, $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 (in_array('\Brevo\Client\Models\CompletedTransaction', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CompletedTransaction' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CompletedTransaction', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if (in_array('\Brevo\Client\Models\ValidationError', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ValidationError' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ValidationError', []),
+ $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 = '\Brevo\Client\Models\CompletedTransaction';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\CompletedTransaction',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation completeTransactionAsync
+ *
+ * Complete transaction
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $transactionId Transaction Id (required)
+ * @param \Brevo\Client\Models\CompleteTransactionPayload|null $completeTransactionPayload Transaction information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['completeTransaction'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function completeTransactionAsync(
+ string $loyaltyProgramId,
+ string $transactionId,
+ ?\Brevo\Client\Models\CompleteTransactionPayload $completeTransactionPayload = null,
+ string $contentType = self::contentTypes['completeTransaction'][0]
+ ): PromiseInterface
+ {
+ return $this->completeTransactionAsyncWithHttpInfo($loyaltyProgramId, $transactionId, $completeTransactionPayload, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation completeTransactionAsyncWithHttpInfo
+ *
+ * Complete transaction
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $transactionId Transaction Id (required)
+ * @param \Brevo\Client\Models\CompleteTransactionPayload|null $completeTransactionPayload Transaction information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['completeTransaction'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function completeTransactionAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $transactionId,
+ $completeTransactionPayload = null,
+ string $contentType = self::contentTypes['completeTransaction'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\CompletedTransaction';
+ $request = $this->completeTransactionRequest($loyaltyProgramId, $transactionId, $completeTransactionPayload, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'completeTransaction'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $transactionId Transaction Id (required)
+ * @param \Brevo\Client\Models\CompleteTransactionPayload|null $completeTransactionPayload Transaction information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['completeTransaction'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function completeTransactionRequest(
+ $loyaltyProgramId,
+ $transactionId,
+ $completeTransactionPayload = null,
+ string $contentType = self::contentTypes['completeTransaction'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling completeTransaction'
+ );
+ }
+
+ // verify the required parameter 'transactionId' is set
+ if ($transactionId === null || (is_array($transactionId) && count($transactionId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $transactionId when calling completeTransaction'
+ );
+ }
+
+
+
+ $resourcePath = '/loyalty/balance/programs/{loyaltyProgramId}/transactions/{transactionId}/complete';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($transactionId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'transactionId' . '}',
+ ObjectSerializer::toPathValue($transactionId),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($completeTransactionPayload)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($completeTransactionPayload));
+ } else {
+ $httpBody = $completeTransactionPayload;
+ }
+ } 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 createBalanceOrder
+ *
+ * Create balance order
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\CreateOrderPayload|null $createOrderPayload Create order information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createBalanceOrder'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CreateOrderPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ValidationError
+ */
+ public function createBalanceOrder(
+ string $loyaltyProgramId,
+ ?\Brevo\Client\Models\CreateOrderPayload $createOrderPayload = null,
+ string $contentType = self::contentTypes['createBalanceOrder'][0]
+ ): \Brevo\Client\Models\CreateOrderPayload
+ {
+ list($response) = $this->createBalanceOrderWithHttpInfo($loyaltyProgramId, $createOrderPayload, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation createBalanceOrderWithHttpInfo
+ *
+ * Create balance order
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\CreateOrderPayload|null $createOrderPayload Create order information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createBalanceOrder'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CreateOrderPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ValidationError, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function createBalanceOrderWithHttpInfo(
+ string $loyaltyProgramId,
+ ?\Brevo\Client\Models\CreateOrderPayload $createOrderPayload = null,
+ string $contentType = self::contentTypes['createBalanceOrder'][0]
+ ): array
+ {
+ $request = $this->createBalanceOrderRequest($loyaltyProgramId, $createOrderPayload, $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 201:
+ if (in_array('\Brevo\Client\Models\CreateOrderPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CreateOrderPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CreateOrderPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if (in_array('\Brevo\Client\Models\ValidationError', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ValidationError' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ValidationError', []),
+ $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 = '\Brevo\Client\Models\CreateOrderPayload';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 201:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\CreateOrderPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation createBalanceOrderAsync
+ *
+ * Create balance order
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\CreateOrderPayload|null $createOrderPayload Create order information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createBalanceOrder'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function createBalanceOrderAsync(
+ string $loyaltyProgramId,
+ ?\Brevo\Client\Models\CreateOrderPayload $createOrderPayload = null,
+ string $contentType = self::contentTypes['createBalanceOrder'][0]
+ ): PromiseInterface
+ {
+ return $this->createBalanceOrderAsyncWithHttpInfo($loyaltyProgramId, $createOrderPayload, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation createBalanceOrderAsyncWithHttpInfo
+ *
+ * Create balance order
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\CreateOrderPayload|null $createOrderPayload Create order information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createBalanceOrder'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function createBalanceOrderAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $createOrderPayload = null,
+ string $contentType = self::contentTypes['createBalanceOrder'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\CreateOrderPayload';
+ $request = $this->createBalanceOrderRequest($loyaltyProgramId, $createOrderPayload, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'createBalanceOrder'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\CreateOrderPayload|null $createOrderPayload Create order information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createBalanceOrder'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function createBalanceOrderRequest(
+ $loyaltyProgramId,
+ $createOrderPayload = null,
+ string $contentType = self::contentTypes['createBalanceOrder'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling createBalanceOrder'
+ );
+ }
+
+
+
+ $resourcePath = '/loyalty/balance/programs/{loyaltyProgramId}/create-order';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($createOrderPayload)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createOrderPayload));
+ } else {
+ $httpBody = $createOrderPayload;
+ }
+ } 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 getBalanceDefinitionList
+ *
+ * Get balance definition list
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sortField Sort documents by field (optional, default to 'name')
+ * @param string|null $sort Sort the documents in the ascending or descending order (optional, default to 'desc')
+ * @param string|null $version Select 'active' to retrieve list of all balances which are live for clients. Select draft to retrieve list of all non deleted balances. (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBalanceDefinitionList'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\BalanceDefinitionPage|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ValidationError
+ */
+ public function getBalanceDefinitionList(
+ string $loyaltyProgramId,
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $sortField = 'name',
+ ?string $sort = 'desc',
+ ?string $version = 'draft',
+ string $contentType = self::contentTypes['getBalanceDefinitionList'][0]
+ ): \Brevo\Client\Models\BalanceDefinitionPage
+ {
+ list($response) = $this->getBalanceDefinitionListWithHttpInfo($loyaltyProgramId, $limit, $offset, $sortField, $sort, $version, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation getBalanceDefinitionListWithHttpInfo
+ *
+ * Get balance definition list
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sortField Sort documents by field (optional, default to 'name')
+ * @param string|null $sort Sort the documents in the ascending or descending order (optional, default to 'desc')
+ * @param string|null $version Select 'active' to retrieve list of all balances which are live for clients. Select draft to retrieve list of all non deleted balances. (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBalanceDefinitionList'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\BalanceDefinitionPage|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ValidationError, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function getBalanceDefinitionListWithHttpInfo(
+ string $loyaltyProgramId,
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $sortField = 'name',
+ ?string $sort = 'desc',
+ ?string $version = 'draft',
+ string $contentType = self::contentTypes['getBalanceDefinitionList'][0]
+ ): array
+ {
+ $request = $this->getBalanceDefinitionListRequest($loyaltyProgramId, $limit, $offset, $sortField, $sort, $version, $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 (in_array('\Brevo\Client\Models\BalanceDefinitionPage', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BalanceDefinitionPage' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BalanceDefinitionPage', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if (in_array('\Brevo\Client\Models\ValidationError', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ValidationError' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ValidationError', []),
+ $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 = '\Brevo\Client\Models\BalanceDefinitionPage';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\BalanceDefinitionPage',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation getBalanceDefinitionListAsync
+ *
+ * Get balance definition list
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sortField Sort documents by field (optional, default to 'name')
+ * @param string|null $sort Sort the documents in the ascending or descending order (optional, default to 'desc')
+ * @param string|null $version Select 'active' to retrieve list of all balances which are live for clients. Select draft to retrieve list of all non deleted balances. (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBalanceDefinitionList'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getBalanceDefinitionListAsync(
+ string $loyaltyProgramId,
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $sortField = 'name',
+ ?string $sort = 'desc',
+ ?string $version = 'draft',
+ string $contentType = self::contentTypes['getBalanceDefinitionList'][0]
+ ): PromiseInterface
+ {
+ return $this->getBalanceDefinitionListAsyncWithHttpInfo($loyaltyProgramId, $limit, $offset, $sortField, $sort, $version, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation getBalanceDefinitionListAsyncWithHttpInfo
+ *
+ * Get balance definition list
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sortField Sort documents by field (optional, default to 'name')
+ * @param string|null $sort Sort the documents in the ascending or descending order (optional, default to 'desc')
+ * @param string|null $version Select 'active' to retrieve list of all balances which are live for clients. Select draft to retrieve list of all non deleted balances. (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBalanceDefinitionList'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getBalanceDefinitionListAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $limit = 50,
+ $offset = 0,
+ $sortField = 'name',
+ $sort = 'desc',
+ $version = 'draft',
+ string $contentType = self::contentTypes['getBalanceDefinitionList'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\BalanceDefinitionPage';
+ $request = $this->getBalanceDefinitionListRequest($loyaltyProgramId, $limit, $offset, $sortField, $sort, $version, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'getBalanceDefinitionList'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sortField Sort documents by field (optional, default to 'name')
+ * @param string|null $sort Sort the documents in the ascending or descending order (optional, default to 'desc')
+ * @param string|null $version Select 'active' to retrieve list of all balances which are live for clients. Select draft to retrieve list of all non deleted balances. (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBalanceDefinitionList'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function getBalanceDefinitionListRequest(
+ $loyaltyProgramId,
+ $limit = 50,
+ $offset = 0,
+ $sortField = 'name',
+ $sort = 'desc',
+ $version = 'draft',
+ string $contentType = self::contentTypes['getBalanceDefinitionList'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling getBalanceDefinitionList'
+ );
+ }
+
+
+
+
+
+
+
+ $resourcePath = '/loyalty/balance/programs/{loyaltyProgramId}/balance-definitions';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // 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(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sortField,
+ 'sortField', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $version,
+ 'version', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 getContactBalances
+ *
+ * Get balance list
+ *
+ * @param string $loyaltyProgramId Loyalty program id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param int|null $limit Number of documents per page (optional, default to 100)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the documents in the ascending or descending order (optional, default to 'desc')
+ * @param string|null $sortField Sort documents by field (optional, default to 'updatedAt')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getContactBalances'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\ContactBalances|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BalanceDefinitionIdDoesNotExist|\Brevo\Client\Models\ValidationError
+ */
+ public function getContactBalances(
+ string $loyaltyProgramId,
+ string $balanceDefinitionId,
+ ?int $limit = 100,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ ?string $sortField = 'updatedAt',
+ string $contentType = self::contentTypes['getContactBalances'][0]
+ ): \Brevo\Client\Models\ContactBalances
+ {
+ list($response) = $this->getContactBalancesWithHttpInfo($loyaltyProgramId, $balanceDefinitionId, $limit, $offset, $sort, $sortField, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation getContactBalancesWithHttpInfo
+ *
+ * Get balance list
+ *
+ * @param string $loyaltyProgramId Loyalty program id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param int|null $limit Number of documents per page (optional, default to 100)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the documents in the ascending or descending order (optional, default to 'desc')
+ * @param string|null $sortField Sort documents by field (optional, default to 'updatedAt')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getContactBalances'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\ContactBalances|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BalanceDefinitionIdDoesNotExist|\Brevo\Client\Models\ValidationError, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function getContactBalancesWithHttpInfo(
+ string $loyaltyProgramId,
+ string $balanceDefinitionId,
+ ?int $limit = 100,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ ?string $sortField = 'updatedAt',
+ string $contentType = self::contentTypes['getContactBalances'][0]
+ ): array
+ {
+ $request = $this->getContactBalancesRequest($loyaltyProgramId, $balanceDefinitionId, $limit, $offset, $sort, $sortField, $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 (in_array('\Brevo\Client\Models\ContactBalances', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ContactBalances' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ContactBalances', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\BalanceDefinitionIdDoesNotExist', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BalanceDefinitionIdDoesNotExist' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BalanceDefinitionIdDoesNotExist', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if (in_array('\Brevo\Client\Models\ValidationError', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ValidationError' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ValidationError', []),
+ $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 = '\Brevo\Client\Models\ContactBalances';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\ContactBalances',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BalanceDefinitionIdDoesNotExist',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation getContactBalancesAsync
+ *
+ * Get balance list
+ *
+ * @param string $loyaltyProgramId Loyalty program id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param int|null $limit Number of documents per page (optional, default to 100)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the documents in the ascending or descending order (optional, default to 'desc')
+ * @param string|null $sortField Sort documents by field (optional, default to 'updatedAt')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getContactBalances'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getContactBalancesAsync(
+ string $loyaltyProgramId,
+ string $balanceDefinitionId,
+ ?int $limit = 100,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ ?string $sortField = 'updatedAt',
+ string $contentType = self::contentTypes['getContactBalances'][0]
+ ): PromiseInterface
+ {
+ return $this->getContactBalancesAsyncWithHttpInfo($loyaltyProgramId, $balanceDefinitionId, $limit, $offset, $sort, $sortField, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation getContactBalancesAsyncWithHttpInfo
+ *
+ * Get balance list
+ *
+ * @param string $loyaltyProgramId Loyalty program id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param int|null $limit Number of documents per page (optional, default to 100)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the documents in the ascending or descending order (optional, default to 'desc')
+ * @param string|null $sortField Sort documents by field (optional, default to 'updatedAt')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getContactBalances'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getContactBalancesAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $balanceDefinitionId,
+ $limit = 100,
+ $offset = 0,
+ $sort = 'desc',
+ $sortField = 'updatedAt',
+ string $contentType = self::contentTypes['getContactBalances'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\ContactBalances';
+ $request = $this->getContactBalancesRequest($loyaltyProgramId, $balanceDefinitionId, $limit, $offset, $sort, $sortField, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'getContactBalances'
+ *
+ * @param string $loyaltyProgramId Loyalty program id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param int|null $limit Number of documents per page (optional, default to 100)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the documents in the ascending or descending order (optional, default to 'desc')
+ * @param string|null $sortField Sort documents by field (optional, default to 'updatedAt')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getContactBalances'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function getContactBalancesRequest(
+ $loyaltyProgramId,
+ $balanceDefinitionId,
+ $limit = 100,
+ $offset = 0,
+ $sort = 'desc',
+ $sortField = 'updatedAt',
+ string $contentType = self::contentTypes['getContactBalances'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling getContactBalances'
+ );
+ }
+
+ // verify the required parameter 'balanceDefinitionId' is set
+ if ($balanceDefinitionId === null || (is_array($balanceDefinitionId) && count($balanceDefinitionId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $balanceDefinitionId when calling getContactBalances'
+ );
+ }
+
+ if ($limit !== null && $limit > 500) {
+ throw new InvalidArgumentException('invalid value for "$limit" when calling BalanceApi.getContactBalances, must be smaller than or equal to 500.');
+ }
+ if ($limit !== null && $limit < 1) {
+ throw new InvalidArgumentException('invalid value for "$limit" when calling BalanceApi.getContactBalances, must be bigger than or equal to 1.');
+ }
+
+
+
+
+
+ $resourcePath = '/loyalty/balance/programs/{loyaltyProgramId}/contact-balances';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // 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(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $balanceDefinitionId,
+ 'balanceDefinitionId', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ true // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sortField,
+ 'sortField', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 getSubscriptionBalances
+ *
+ * Get subscription balances
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contactId Contact id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSubscriptionBalances'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\BalancePage|\Brevo\Client\Models\BadRequestPayload
+ */
+ public function getSubscriptionBalances(
+ string $loyaltyProgramId,
+ string $contactId,
+ string $contentType = self::contentTypes['getSubscriptionBalances'][0]
+ ): \Brevo\Client\Models\BalancePage
+ {
+ list($response) = $this->getSubscriptionBalancesWithHttpInfo($loyaltyProgramId, $contactId, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation getSubscriptionBalancesWithHttpInfo
+ *
+ * Get subscription balances
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contactId Contact id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSubscriptionBalances'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\BalancePage|\Brevo\Client\Models\BadRequestPayload, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function getSubscriptionBalancesWithHttpInfo(
+ string $loyaltyProgramId,
+ string $contactId,
+ string $contentType = self::contentTypes['getSubscriptionBalances'][0]
+ ): array
+ {
+ $request = $this->getSubscriptionBalancesRequest($loyaltyProgramId, $contactId, $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 (in_array('\Brevo\Client\Models\BalancePage', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BalancePage' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BalancePage', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $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 = '\Brevo\Client\Models\BalancePage';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\BalancePage',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation getSubscriptionBalancesAsync
+ *
+ * Get subscription balances
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contactId Contact id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSubscriptionBalances'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getSubscriptionBalancesAsync(
+ string $loyaltyProgramId,
+ string $contactId,
+ string $contentType = self::contentTypes['getSubscriptionBalances'][0]
+ ): PromiseInterface
+ {
+ return $this->getSubscriptionBalancesAsyncWithHttpInfo($loyaltyProgramId, $contactId, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation getSubscriptionBalancesAsyncWithHttpInfo
+ *
+ * Get subscription balances
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contactId Contact id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSubscriptionBalances'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getSubscriptionBalancesAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $contactId,
+ string $contentType = self::contentTypes['getSubscriptionBalances'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\BalancePage';
+ $request = $this->getSubscriptionBalancesRequest($loyaltyProgramId, $contactId, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'getSubscriptionBalances'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contactId Contact id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSubscriptionBalances'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function getSubscriptionBalancesRequest(
+ $loyaltyProgramId,
+ $contactId,
+ string $contentType = self::contentTypes['getSubscriptionBalances'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling getSubscriptionBalances'
+ );
+ }
+
+ // verify the required parameter 'contactId' is set
+ if ($contactId === null || (is_array($contactId) && count($contactId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $contactId when calling getSubscriptionBalances'
+ );
+ }
+
+
+ $resourcePath = '/loyalty/balance/programs/{loyaltyProgramId}/subscriptions/{contactId}/balances';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($contactId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'contactId' . '}',
+ ObjectSerializer::toPathValue($contactId),
+ $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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDelete
+ *
+ * Delete balance definition
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDelete'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return void
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDelete(
+ string $loyaltyProgramId,
+ string $balanceDefinitionId,
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDelete'][0]
+ ): void
+ {
+ $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDeleteWithHttpInfo($loyaltyProgramId, $balanceDefinitionId, $contentType);
+ }
+
+ /**
+ * Operation loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDeleteWithHttpInfo
+ *
+ * Delete balance definition
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDelete'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDeleteWithHttpInfo(
+ string $loyaltyProgramId,
+ string $balanceDefinitionId,
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDelete'][0]
+ ): array
+ {
+ $request = $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDeleteRequest($loyaltyProgramId, $balanceDefinitionId, $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();
+
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDeleteAsync
+ *
+ * Delete balance definition
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDelete'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDeleteAsync(
+ string $loyaltyProgramId,
+ string $balanceDefinitionId,
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDelete'][0]
+ ): PromiseInterface
+ {
+ return $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDeleteAsyncWithHttpInfo($loyaltyProgramId, $balanceDefinitionId, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDeleteAsyncWithHttpInfo
+ *
+ * Delete balance definition
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDelete'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDeleteAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $balanceDefinitionId,
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDelete'][0]
+ ): PromiseInterface
+ {
+ $returnType = '';
+ $request = $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDeleteRequest($loyaltyProgramId, $balanceDefinitionId, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $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 'loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDelete'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDelete'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDeleteRequest(
+ $loyaltyProgramId,
+ $balanceDefinitionId,
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDelete'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDelete'
+ );
+ }
+
+ // verify the required parameter 'balanceDefinitionId' is set
+ if ($balanceDefinitionId === null || (is_array($balanceDefinitionId) && count($balanceDefinitionId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $balanceDefinitionId when calling loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdDelete'
+ );
+ }
+
+
+ $resourcePath = '/loyalty/balance/programs/{loyaltyProgramId}/balance-definitions/{balanceDefinitionId}';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($balanceDefinitionId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'balanceDefinitionId' . '}',
+ ObjectSerializer::toPathValue($balanceDefinitionId),
+ $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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGet
+ *
+ * Get balance definition
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param string|null $version Select active to get balance definition configuration which is live for the clients. Select draft to retrieve balance definition configuration with the recent edits (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGet'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\BalanceDefinition|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ValidationError
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGet(
+ string $loyaltyProgramId,
+ string $balanceDefinitionId,
+ ?string $version = 'draft',
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGet'][0]
+ ): \Brevo\Client\Models\BalanceDefinition
+ {
+ list($response) = $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGetWithHttpInfo($loyaltyProgramId, $balanceDefinitionId, $version, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGetWithHttpInfo
+ *
+ * Get balance definition
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param string|null $version Select active to get balance definition configuration which is live for the clients. Select draft to retrieve balance definition configuration with the recent edits (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGet'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\BalanceDefinition|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ValidationError, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGetWithHttpInfo(
+ string $loyaltyProgramId,
+ string $balanceDefinitionId,
+ ?string $version = 'draft',
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGet'][0]
+ ): array
+ {
+ $request = $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGetRequest($loyaltyProgramId, $balanceDefinitionId, $version, $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 (in_array('\Brevo\Client\Models\BalanceDefinition', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BalanceDefinition' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BalanceDefinition', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if (in_array('\Brevo\Client\Models\ValidationError', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ValidationError' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ValidationError', []),
+ $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 = '\Brevo\Client\Models\BalanceDefinition';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\BalanceDefinition',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGetAsync
+ *
+ * Get balance definition
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param string|null $version Select active to get balance definition configuration which is live for the clients. Select draft to retrieve balance definition configuration with the recent edits (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGet'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGetAsync(
+ string $loyaltyProgramId,
+ string $balanceDefinitionId,
+ ?string $version = 'draft',
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGet'][0]
+ ): PromiseInterface
+ {
+ return $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGetAsyncWithHttpInfo($loyaltyProgramId, $balanceDefinitionId, $version, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGetAsyncWithHttpInfo
+ *
+ * Get balance definition
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param string|null $version Select active to get balance definition configuration which is live for the clients. Select draft to retrieve balance definition configuration with the recent edits (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGet'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGetAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $balanceDefinitionId,
+ $version = 'draft',
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGet'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\BalanceDefinition';
+ $request = $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGetRequest($loyaltyProgramId, $balanceDefinitionId, $version, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGet'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param string|null $version Select active to get balance definition configuration which is live for the clients. Select draft to retrieve balance definition configuration with the recent edits (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGet'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGetRequest(
+ $loyaltyProgramId,
+ $balanceDefinitionId,
+ $version = 'draft',
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGet'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGet'
+ );
+ }
+
+ // verify the required parameter 'balanceDefinitionId' is set
+ if ($balanceDefinitionId === null || (is_array($balanceDefinitionId) && count($balanceDefinitionId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $balanceDefinitionId when calling loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdGet'
+ );
+ }
+
+
+
+ $resourcePath = '/loyalty/balance/programs/{loyaltyProgramId}/balance-definitions/{balanceDefinitionId}';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $version,
+ 'version', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($balanceDefinitionId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'balanceDefinitionId' . '}',
+ ObjectSerializer::toPathValue($balanceDefinitionId),
+ $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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDelete
+ *
+ * Delete balance limit
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param string $balanceLimitId Id of the limit to be deleted (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDelete'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return void
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDelete(
+ string $loyaltyProgramId,
+ string $balanceDefinitionId,
+ string $balanceLimitId,
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDelete'][0]
+ ): void
+ {
+ $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDeleteWithHttpInfo($loyaltyProgramId, $balanceDefinitionId, $balanceLimitId, $contentType);
+ }
+
+ /**
+ * Operation loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDeleteWithHttpInfo
+ *
+ * Delete balance limit
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param string $balanceLimitId Id of the limit to be deleted (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDelete'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDeleteWithHttpInfo(
+ string $loyaltyProgramId,
+ string $balanceDefinitionId,
+ string $balanceLimitId,
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDelete'][0]
+ ): array
+ {
+ $request = $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDeleteRequest($loyaltyProgramId, $balanceDefinitionId, $balanceLimitId, $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();
+
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDeleteAsync
+ *
+ * Delete balance limit
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param string $balanceLimitId Id of the limit to be deleted (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDelete'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDeleteAsync(
+ string $loyaltyProgramId,
+ string $balanceDefinitionId,
+ string $balanceLimitId,
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDelete'][0]
+ ): PromiseInterface
+ {
+ return $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDeleteAsyncWithHttpInfo($loyaltyProgramId, $balanceDefinitionId, $balanceLimitId, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDeleteAsyncWithHttpInfo
+ *
+ * Delete balance limit
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param string $balanceLimitId Id of the limit to be deleted (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDelete'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDeleteAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $balanceDefinitionId,
+ $balanceLimitId,
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDelete'][0]
+ ): PromiseInterface
+ {
+ $returnType = '';
+ $request = $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDeleteRequest($loyaltyProgramId, $balanceDefinitionId, $balanceLimitId, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $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 'loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDelete'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param string $balanceLimitId Id of the limit to be deleted (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDelete'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDeleteRequest(
+ $loyaltyProgramId,
+ $balanceDefinitionId,
+ $balanceLimitId,
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDelete'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDelete'
+ );
+ }
+
+ // verify the required parameter 'balanceDefinitionId' is set
+ if ($balanceDefinitionId === null || (is_array($balanceDefinitionId) && count($balanceDefinitionId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $balanceDefinitionId when calling loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDelete'
+ );
+ }
+
+ // verify the required parameter 'balanceLimitId' is set
+ if ($balanceLimitId === null || (is_array($balanceLimitId) && count($balanceLimitId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $balanceLimitId when calling loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdDelete'
+ );
+ }
+
+
+ $resourcePath = '/loyalty/balance/programs/{loyaltyProgramId}/balance-definitions/{balanceDefinitionId}/limits/{balanceLimitId}';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($balanceDefinitionId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'balanceDefinitionId' . '}',
+ ObjectSerializer::toPathValue($balanceDefinitionId),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($balanceLimitId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'balanceLimitId' . '}',
+ ObjectSerializer::toPathValue($balanceLimitId),
+ $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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGet
+ *
+ * Get balance limits
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance definition id (required)
+ * @param string $balanceLimitId Balance limit id (required)
+ * @param string|null $version Select active to get balance definition configuration which is live for the clients. Select draft to retrieve balance definition configuration with the recent edits (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGet'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\BalanceLimitPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ValidationError
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGet(
+ string $loyaltyProgramId,
+ string $balanceDefinitionId,
+ string $balanceLimitId,
+ ?string $version = 'draft',
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGet'][0]
+ ): \Brevo\Client\Models\BalanceLimitPayload
+ {
+ list($response) = $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGetWithHttpInfo($loyaltyProgramId, $balanceDefinitionId, $balanceLimitId, $version, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGetWithHttpInfo
+ *
+ * Get balance limits
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance definition id (required)
+ * @param string $balanceLimitId Balance limit id (required)
+ * @param string|null $version Select active to get balance definition configuration which is live for the clients. Select draft to retrieve balance definition configuration with the recent edits (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGet'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\BalanceLimitPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ValidationError, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGetWithHttpInfo(
+ string $loyaltyProgramId,
+ string $balanceDefinitionId,
+ string $balanceLimitId,
+ ?string $version = 'draft',
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGet'][0]
+ ): array
+ {
+ $request = $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGetRequest($loyaltyProgramId, $balanceDefinitionId, $balanceLimitId, $version, $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 (in_array('\Brevo\Client\Models\BalanceLimitPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BalanceLimitPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BalanceLimitPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if (in_array('\Brevo\Client\Models\ValidationError', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ValidationError' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ValidationError', []),
+ $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 = '\Brevo\Client\Models\BalanceLimitPayload';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\BalanceLimitPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGetAsync
+ *
+ * Get balance limits
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance definition id (required)
+ * @param string $balanceLimitId Balance limit id (required)
+ * @param string|null $version Select active to get balance definition configuration which is live for the clients. Select draft to retrieve balance definition configuration with the recent edits (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGet'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGetAsync(
+ string $loyaltyProgramId,
+ string $balanceDefinitionId,
+ string $balanceLimitId,
+ ?string $version = 'draft',
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGet'][0]
+ ): PromiseInterface
+ {
+ return $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGetAsyncWithHttpInfo($loyaltyProgramId, $balanceDefinitionId, $balanceLimitId, $version, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGetAsyncWithHttpInfo
+ *
+ * Get balance limits
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance definition id (required)
+ * @param string $balanceLimitId Balance limit id (required)
+ * @param string|null $version Select active to get balance definition configuration which is live for the clients. Select draft to retrieve balance definition configuration with the recent edits (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGet'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGetAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $balanceDefinitionId,
+ $balanceLimitId,
+ $version = 'draft',
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGet'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\BalanceLimitPayload';
+ $request = $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGetRequest($loyaltyProgramId, $balanceDefinitionId, $balanceLimitId, $version, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGet'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance definition id (required)
+ * @param string $balanceLimitId Balance limit id (required)
+ * @param string|null $version Select active to get balance definition configuration which is live for the clients. Select draft to retrieve balance definition configuration with the recent edits (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGet'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGetRequest(
+ $loyaltyProgramId,
+ $balanceDefinitionId,
+ $balanceLimitId,
+ $version = 'draft',
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGet'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGet'
+ );
+ }
+
+ // verify the required parameter 'balanceDefinitionId' is set
+ if ($balanceDefinitionId === null || (is_array($balanceDefinitionId) && count($balanceDefinitionId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $balanceDefinitionId when calling loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGet'
+ );
+ }
+
+ // verify the required parameter 'balanceLimitId' is set
+ if ($balanceLimitId === null || (is_array($balanceLimitId) && count($balanceLimitId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $balanceLimitId when calling loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdGet'
+ );
+ }
+
+
+
+ $resourcePath = '/loyalty/balance/programs/{loyaltyProgramId}/balance-definitions/{balanceDefinitionId}/limits/{balanceLimitId}';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $version,
+ 'version', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($balanceDefinitionId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'balanceDefinitionId' . '}',
+ ObjectSerializer::toPathValue($balanceDefinitionId),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($balanceLimitId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'balanceLimitId' . '}',
+ ObjectSerializer::toPathValue($balanceLimitId),
+ $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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPut
+ *
+ * Updates balance limit
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param string $balanceLimitId Balance Limit Id (required)
+ * @param \Brevo\Client\Models\BalanceLimit|null $balanceLimit Balance limit request (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPut'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\BalanceLimitPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ValidationError
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPut(
+ string $loyaltyProgramId,
+ string $balanceDefinitionId,
+ string $balanceLimitId,
+ ?\Brevo\Client\Models\BalanceLimit $balanceLimit = null,
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPut'][0]
+ ): \Brevo\Client\Models\BalanceLimitPayload
+ {
+ list($response) = $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPutWithHttpInfo($loyaltyProgramId, $balanceDefinitionId, $balanceLimitId, $balanceLimit, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPutWithHttpInfo
+ *
+ * Updates balance limit
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param string $balanceLimitId Balance Limit Id (required)
+ * @param \Brevo\Client\Models\BalanceLimit|null $balanceLimit Balance limit request (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPut'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\BalanceLimitPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ValidationError, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPutWithHttpInfo(
+ string $loyaltyProgramId,
+ string $balanceDefinitionId,
+ string $balanceLimitId,
+ ?\Brevo\Client\Models\BalanceLimit $balanceLimit = null,
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPut'][0]
+ ): array
+ {
+ $request = $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPutRequest($loyaltyProgramId, $balanceDefinitionId, $balanceLimitId, $balanceLimit, $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 (in_array('\Brevo\Client\Models\BalanceLimitPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BalanceLimitPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BalanceLimitPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if (in_array('\Brevo\Client\Models\ValidationError', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ValidationError' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ValidationError', []),
+ $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 = '\Brevo\Client\Models\BalanceLimitPayload';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\BalanceLimitPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPutAsync
+ *
+ * Updates balance limit
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param string $balanceLimitId Balance Limit Id (required)
+ * @param \Brevo\Client\Models\BalanceLimit|null $balanceLimit Balance limit request (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPut'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPutAsync(
+ string $loyaltyProgramId,
+ string $balanceDefinitionId,
+ string $balanceLimitId,
+ ?\Brevo\Client\Models\BalanceLimit $balanceLimit = null,
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPut'][0]
+ ): PromiseInterface
+ {
+ return $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPutAsyncWithHttpInfo($loyaltyProgramId, $balanceDefinitionId, $balanceLimitId, $balanceLimit, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPutAsyncWithHttpInfo
+ *
+ * Updates balance limit
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param string $balanceLimitId Balance Limit Id (required)
+ * @param \Brevo\Client\Models\BalanceLimit|null $balanceLimit Balance limit request (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPut'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPutAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $balanceDefinitionId,
+ $balanceLimitId,
+ $balanceLimit = null,
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPut'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\BalanceLimitPayload';
+ $request = $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPutRequest($loyaltyProgramId, $balanceDefinitionId, $balanceLimitId, $balanceLimit, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPut'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param string $balanceLimitId Balance Limit Id (required)
+ * @param \Brevo\Client\Models\BalanceLimit|null $balanceLimit Balance limit request (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPut'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPutRequest(
+ $loyaltyProgramId,
+ $balanceDefinitionId,
+ $balanceLimitId,
+ $balanceLimit = null,
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPut'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPut'
+ );
+ }
+
+ // verify the required parameter 'balanceDefinitionId' is set
+ if ($balanceDefinitionId === null || (is_array($balanceDefinitionId) && count($balanceDefinitionId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $balanceDefinitionId when calling loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPut'
+ );
+ }
+
+ // verify the required parameter 'balanceLimitId' is set
+ if ($balanceLimitId === null || (is_array($balanceLimitId) && count($balanceLimitId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $balanceLimitId when calling loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsBalanceLimitIdPut'
+ );
+ }
+
+
+
+ $resourcePath = '/loyalty/balance/programs/{loyaltyProgramId}/balance-definitions/{balanceDefinitionId}/limits/{balanceLimitId}';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($balanceDefinitionId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'balanceDefinitionId' . '}',
+ ObjectSerializer::toPathValue($balanceDefinitionId),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($balanceLimitId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'balanceLimitId' . '}',
+ ObjectSerializer::toPathValue($balanceLimitId),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($balanceLimit)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($balanceLimit));
+ } else {
+ $httpBody = $balanceLimit;
+ }
+ } 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPost
+ *
+ * Create balance limits
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param \Brevo\Client\Models\BalanceLimit|null $balanceLimit Balance definition information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPost'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\BalanceLimitPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ValidationError
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPost(
+ string $loyaltyProgramId,
+ string $balanceDefinitionId,
+ ?\Brevo\Client\Models\BalanceLimit $balanceLimit = null,
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPost'][0]
+ ): \Brevo\Client\Models\BalanceLimitPayload
+ {
+ list($response) = $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPostWithHttpInfo($loyaltyProgramId, $balanceDefinitionId, $balanceLimit, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPostWithHttpInfo
+ *
+ * Create balance limits
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param \Brevo\Client\Models\BalanceLimit|null $balanceLimit Balance definition information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPost'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\BalanceLimitPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ValidationError, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPostWithHttpInfo(
+ string $loyaltyProgramId,
+ string $balanceDefinitionId,
+ ?\Brevo\Client\Models\BalanceLimit $balanceLimit = null,
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPost'][0]
+ ): array
+ {
+ $request = $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPostRequest($loyaltyProgramId, $balanceDefinitionId, $balanceLimit, $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 201:
+ if (in_array('\Brevo\Client\Models\BalanceLimitPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BalanceLimitPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BalanceLimitPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if (in_array('\Brevo\Client\Models\ValidationError', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ValidationError' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ValidationError', []),
+ $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 = '\Brevo\Client\Models\BalanceLimitPayload';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 201:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BalanceLimitPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPostAsync
+ *
+ * Create balance limits
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param \Brevo\Client\Models\BalanceLimit|null $balanceLimit Balance definition information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPost'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPostAsync(
+ string $loyaltyProgramId,
+ string $balanceDefinitionId,
+ ?\Brevo\Client\Models\BalanceLimit $balanceLimit = null,
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPost'][0]
+ ): PromiseInterface
+ {
+ return $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPostAsyncWithHttpInfo($loyaltyProgramId, $balanceDefinitionId, $balanceLimit, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPostAsyncWithHttpInfo
+ *
+ * Create balance limits
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param \Brevo\Client\Models\BalanceLimit|null $balanceLimit Balance definition information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPost'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPostAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $balanceDefinitionId,
+ $balanceLimit = null,
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPost'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\BalanceLimitPayload';
+ $request = $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPostRequest($loyaltyProgramId, $balanceDefinitionId, $balanceLimit, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPost'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param \Brevo\Client\Models\BalanceLimit|null $balanceLimit Balance definition information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPost'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPostRequest(
+ $loyaltyProgramId,
+ $balanceDefinitionId,
+ $balanceLimit = null,
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPost'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPost'
+ );
+ }
+
+ // verify the required parameter 'balanceDefinitionId' is set
+ if ($balanceDefinitionId === null || (is_array($balanceDefinitionId) && count($balanceDefinitionId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $balanceDefinitionId when calling loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdLimitsPost'
+ );
+ }
+
+
+
+ $resourcePath = '/loyalty/balance/programs/{loyaltyProgramId}/balance-definitions/{balanceDefinitionId}/limits';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($balanceDefinitionId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'balanceDefinitionId' . '}',
+ ObjectSerializer::toPathValue($balanceDefinitionId),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($balanceLimit)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($balanceLimit));
+ } else {
+ $httpBody = $balanceLimit;
+ }
+ } 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPut
+ *
+ * Update balance definition
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param \Brevo\Client\Models\UpdateBalanceDefinitionPayload|null $updateBalanceDefinitionPayload Balance definition information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPut'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\BalanceDefinition|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ValidationError
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPut(
+ string $loyaltyProgramId,
+ string $balanceDefinitionId,
+ ?\Brevo\Client\Models\UpdateBalanceDefinitionPayload $updateBalanceDefinitionPayload = null,
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPut'][0]
+ ): \Brevo\Client\Models\BalanceDefinition
+ {
+ list($response) = $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPutWithHttpInfo($loyaltyProgramId, $balanceDefinitionId, $updateBalanceDefinitionPayload, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPutWithHttpInfo
+ *
+ * Update balance definition
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param \Brevo\Client\Models\UpdateBalanceDefinitionPayload|null $updateBalanceDefinitionPayload Balance definition information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPut'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\BalanceDefinition|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ValidationError, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPutWithHttpInfo(
+ string $loyaltyProgramId,
+ string $balanceDefinitionId,
+ ?\Brevo\Client\Models\UpdateBalanceDefinitionPayload $updateBalanceDefinitionPayload = null,
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPut'][0]
+ ): array
+ {
+ $request = $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPutRequest($loyaltyProgramId, $balanceDefinitionId, $updateBalanceDefinitionPayload, $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 (in_array('\Brevo\Client\Models\BalanceDefinition', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BalanceDefinition' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BalanceDefinition', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if (in_array('\Brevo\Client\Models\ValidationError', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ValidationError' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ValidationError', []),
+ $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 = '\Brevo\Client\Models\BalanceDefinition';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\BalanceDefinition',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPutAsync
+ *
+ * Update balance definition
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param \Brevo\Client\Models\UpdateBalanceDefinitionPayload|null $updateBalanceDefinitionPayload Balance definition information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPut'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPutAsync(
+ string $loyaltyProgramId,
+ string $balanceDefinitionId,
+ ?\Brevo\Client\Models\UpdateBalanceDefinitionPayload $updateBalanceDefinitionPayload = null,
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPut'][0]
+ ): PromiseInterface
+ {
+ return $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPutAsyncWithHttpInfo($loyaltyProgramId, $balanceDefinitionId, $updateBalanceDefinitionPayload, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPutAsyncWithHttpInfo
+ *
+ * Update balance definition
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param \Brevo\Client\Models\UpdateBalanceDefinitionPayload|null $updateBalanceDefinitionPayload Balance definition information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPut'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPutAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $balanceDefinitionId,
+ $updateBalanceDefinitionPayload = null,
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPut'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\BalanceDefinition';
+ $request = $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPutRequest($loyaltyProgramId, $balanceDefinitionId, $updateBalanceDefinitionPayload, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPut'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $balanceDefinitionId Balance Definition Id (required)
+ * @param \Brevo\Client\Models\UpdateBalanceDefinitionPayload|null $updateBalanceDefinitionPayload Balance definition information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPut'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPutRequest(
+ $loyaltyProgramId,
+ $balanceDefinitionId,
+ $updateBalanceDefinitionPayload = null,
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPut'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPut'
+ );
+ }
+
+ // verify the required parameter 'balanceDefinitionId' is set
+ if ($balanceDefinitionId === null || (is_array($balanceDefinitionId) && count($balanceDefinitionId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $balanceDefinitionId when calling loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsBalanceDefinitionIdPut'
+ );
+ }
+
+
+
+ $resourcePath = '/loyalty/balance/programs/{loyaltyProgramId}/balance-definitions/{balanceDefinitionId}';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($balanceDefinitionId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'balanceDefinitionId' . '}',
+ ObjectSerializer::toPathValue($balanceDefinitionId),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($updateBalanceDefinitionPayload)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($updateBalanceDefinitionPayload));
+ } else {
+ $httpBody = $updateBalanceDefinitionPayload;
+ }
+ } 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPost
+ *
+ * Create balance definition
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\CreateBalanceDefinitionPayload $createBalanceDefinitionPayload Balance definition information (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPost'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\BalanceDefinition|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ValidationError
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPost(
+ string $loyaltyProgramId,
+ \Brevo\Client\Models\CreateBalanceDefinitionPayload $createBalanceDefinitionPayload,
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPost'][0]
+ ): \Brevo\Client\Models\BalanceDefinition
+ {
+ list($response) = $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPostWithHttpInfo($loyaltyProgramId, $createBalanceDefinitionPayload, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPostWithHttpInfo
+ *
+ * Create balance definition
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\CreateBalanceDefinitionPayload $createBalanceDefinitionPayload Balance definition information (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPost'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\BalanceDefinition|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ValidationError, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPostWithHttpInfo(
+ string $loyaltyProgramId,
+ \Brevo\Client\Models\CreateBalanceDefinitionPayload $createBalanceDefinitionPayload,
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPost'][0]
+ ): array
+ {
+ $request = $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPostRequest($loyaltyProgramId, $createBalanceDefinitionPayload, $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 201:
+ if (in_array('\Brevo\Client\Models\BalanceDefinition', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BalanceDefinition' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BalanceDefinition', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if (in_array('\Brevo\Client\Models\ValidationError', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ValidationError' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ValidationError', []),
+ $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 = '\Brevo\Client\Models\BalanceDefinition';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 201:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BalanceDefinition',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPostAsync
+ *
+ * Create balance definition
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\CreateBalanceDefinitionPayload $createBalanceDefinitionPayload Balance definition information (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPost'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPostAsync(
+ string $loyaltyProgramId,
+ \Brevo\Client\Models\CreateBalanceDefinitionPayload $createBalanceDefinitionPayload,
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPost'][0]
+ ): PromiseInterface
+ {
+ return $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPostAsyncWithHttpInfo($loyaltyProgramId, $createBalanceDefinitionPayload, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPostAsyncWithHttpInfo
+ *
+ * Create balance definition
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\CreateBalanceDefinitionPayload $createBalanceDefinitionPayload Balance definition information (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPost'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPostAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $createBalanceDefinitionPayload,
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPost'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\BalanceDefinition';
+ $request = $this->loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPostRequest($loyaltyProgramId, $createBalanceDefinitionPayload, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPost'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\CreateBalanceDefinitionPayload $createBalanceDefinitionPayload Balance definition information (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPost'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPostRequest(
+ $loyaltyProgramId,
+ $createBalanceDefinitionPayload,
+ string $contentType = self::contentTypes['loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPost'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPost'
+ );
+ }
+
+ // verify the required parameter 'createBalanceDefinitionPayload' is set
+ if ($createBalanceDefinitionPayload === null || (is_array($createBalanceDefinitionPayload) && count($createBalanceDefinitionPayload) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $createBalanceDefinitionPayload when calling loyaltyBalanceProgramsLoyaltyProgramIdBalanceDefinitionsPost'
+ );
+ }
+
+
+ $resourcePath = '/loyalty/balance/programs/{loyaltyProgramId}/balance-definitions';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($createBalanceDefinitionPayload)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createBalanceDefinitionPayload));
+ } else {
+ $httpBody = $createBalanceDefinitionPayload;
+ }
+ } 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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
+ );
+ }
+
+ /**
+ * Create http client option
+ *
+ * @throws \RuntimeException on file opening failure
+ * @return array of http client options
+ */
+ protected function createHttpClientOption(): array
+ {
+ $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/CRMApi.php b/lib/Api/CRMApi.php
deleted file mode 100644
index dd67b49..0000000
--- a/lib/Api/CRMApi.php
+++ /dev/null
@@ -1,3306 +0,0 @@
-client = $client ?: new Client();
- $this->config = $config ?: new Configuration();
- $this->headerSelector = $selector ?: new HeaderSelector();
- }
-
- /**
- * @return Configuration
- */
- public function getConfig()
- {
- return $this->config;
- }
-
- /**
- * Operation crmNotesGet
- *
- * Get all notes
- *
- * @param string $entity Filter by note entity type (optional)
- * @param string $entityIds Filter by note entity IDs (optional)
- * @param int $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
- * @param int $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
- * @param int $offset Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\NoteList
- */
- public function crmNotesGet($entity = null, $entityIds = null, $dateFrom = null, $dateTo = null, $offset = null, $limit = '50', $sort = null)
- {
- list($response) = $this->crmNotesGetWithHttpInfo($entity, $entityIds, $dateFrom, $dateTo, $offset, $limit, $sort);
- return $response;
- }
-
- /**
- * Operation crmNotesGetWithHttpInfo
- *
- * Get all notes
- *
- * @param string $entity Filter by note entity type (optional)
- * @param string $entityIds Filter by note entity IDs (optional)
- * @param int $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
- * @param int $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
- * @param int $offset Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\NoteList, HTTP status code, HTTP response headers (array of strings)
- */
- public function crmNotesGetWithHttpInfo($entity = null, $entityIds = null, $dateFrom = null, $dateTo = null, $offset = null, $limit = '50', $sort = null)
- {
- $returnType = '\Brevo\Client\Model\NoteList';
- $request = $this->crmNotesGetRequest($entity, $entityIds, $dateFrom, $dateTo, $offset, $limit, $sort);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
-
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 200:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\NoteList',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation crmNotesGetAsync
- *
- * Get all notes
- *
- * @param string $entity Filter by note entity type (optional)
- * @param string $entityIds Filter by note entity IDs (optional)
- * @param int $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
- * @param int $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
- * @param int $offset Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function crmNotesGetAsync($entity = null, $entityIds = null, $dateFrom = null, $dateTo = null, $offset = null, $limit = '50', $sort = null)
- {
- return $this->crmNotesGetAsyncWithHttpInfo($entity, $entityIds, $dateFrom, $dateTo, $offset, $limit, $sort)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation crmNotesGetAsyncWithHttpInfo
- *
- * Get all notes
- *
- * @param string $entity Filter by note entity type (optional)
- * @param string $entityIds Filter by note entity IDs (optional)
- * @param int $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
- * @param int $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
- * @param int $offset Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function crmNotesGetAsyncWithHttpInfo($entity = null, $entityIds = null, $dateFrom = null, $dateTo = null, $offset = null, $limit = '50', $sort = null)
- {
- $returnType = '\Brevo\Client\Model\NoteList';
- $request = $this->crmNotesGetRequest($entity, $entityIds, $dateFrom, $dateTo, $offset, $limit, $sort);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- 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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'crmNotesGet'
- *
- * @param string $entity Filter by note entity type (optional)
- * @param string $entityIds Filter by note entity IDs (optional)
- * @param int $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
- * @param int $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
- * @param int $offset Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function crmNotesGetRequest($entity = null, $entityIds = null, $dateFrom = null, $dateTo = null, $offset = null, $limit = '50', $sort = null)
- {
-
- $resourcePath = '/crm/notes';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
- // query params
- if ($entity !== null) {
- $queryParams['entity'] = ObjectSerializer::toQueryValue($entity);
- }
- // query params
- if ($entityIds !== null) {
- $queryParams['entityIds'] = ObjectSerializer::toQueryValue($entityIds);
- }
- // query params
- if ($dateFrom !== null) {
- $queryParams['dateFrom'] = ObjectSerializer::toQueryValue($dateFrom);
- }
- // query params
- if ($dateTo !== null) {
- $queryParams['dateTo'] = ObjectSerializer::toQueryValue($dateTo);
- }
- // query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
- // query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
- // query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
-
-
- // body params
- $_tempBody = null;
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation crmNotesIdDelete
- *
- * Delete a note
- *
- * @param string $id Note ID to delete (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return void
- */
- public function crmNotesIdDelete($id)
- {
- $this->crmNotesIdDeleteWithHttpInfo($id);
- }
-
- /**
- * Operation crmNotesIdDeleteWithHttpInfo
- *
- * Delete a note
- *
- * @param string $id Note ID to delete (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of null, HTTP status code, HTTP response headers (array of strings)
- */
- public function crmNotesIdDeleteWithHttpInfo($id)
- {
- $returnType = '';
- $request = $this->crmNotesIdDeleteRequest($id);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- return [null, $statusCode, $response->getHeaders()];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation crmNotesIdDeleteAsync
- *
- * Delete a note
- *
- * @param string $id Note ID to delete (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function crmNotesIdDeleteAsync($id)
- {
- return $this->crmNotesIdDeleteAsyncWithHttpInfo($id)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation crmNotesIdDeleteAsyncWithHttpInfo
- *
- * Delete a note
- *
- * @param string $id Note ID to delete (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function crmNotesIdDeleteAsyncWithHttpInfo($id)
- {
- $returnType = '';
- $request = $this->crmNotesIdDeleteRequest($id);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- return [null, $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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'crmNotesIdDelete'
- *
- * @param string $id Note ID to delete (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function crmNotesIdDeleteRequest($id)
- {
- // 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 crmNotesIdDelete'
- );
- }
-
- $resourcePath = '/crm/notes/{id}';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
- // path params
- if ($id !== null) {
- $resourcePath = str_replace(
- '{' . 'id' . '}',
- ObjectSerializer::toPathValue($id),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation crmNotesIdGet
- *
- * Get a note
- *
- * @param string $id Note ID to get (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\Note
- */
- public function crmNotesIdGet($id)
- {
- list($response) = $this->crmNotesIdGetWithHttpInfo($id);
- return $response;
- }
-
- /**
- * Operation crmNotesIdGetWithHttpInfo
- *
- * Get a note
- *
- * @param string $id Note ID to get (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\Note, HTTP status code, HTTP response headers (array of strings)
- */
- public function crmNotesIdGetWithHttpInfo($id)
- {
- $returnType = '\Brevo\Client\Model\Note';
- $request = $this->crmNotesIdGetRequest($id);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
-
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 200:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\Note',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation crmNotesIdGetAsync
- *
- * Get a note
- *
- * @param string $id Note ID to get (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function crmNotesIdGetAsync($id)
- {
- return $this->crmNotesIdGetAsyncWithHttpInfo($id)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation crmNotesIdGetAsyncWithHttpInfo
- *
- * Get a note
- *
- * @param string $id Note ID to get (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function crmNotesIdGetAsyncWithHttpInfo($id)
- {
- $returnType = '\Brevo\Client\Model\Note';
- $request = $this->crmNotesIdGetRequest($id);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- 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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'crmNotesIdGet'
- *
- * @param string $id Note ID to get (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function crmNotesIdGetRequest($id)
- {
- // 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 crmNotesIdGet'
- );
- }
-
- $resourcePath = '/crm/notes/{id}';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
- // path params
- if ($id !== null) {
- $resourcePath = str_replace(
- '{' . 'id' . '}',
- ObjectSerializer::toPathValue($id),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation crmNotesIdPatch
- *
- * Update a note
- *
- * @param string $id Note ID to update (required)
- * @param \Brevo\Client\Model\NoteData $body Note data to update a note (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return void
- */
- public function crmNotesIdPatch($id, $body)
- {
- $this->crmNotesIdPatchWithHttpInfo($id, $body);
- }
-
- /**
- * Operation crmNotesIdPatchWithHttpInfo
- *
- * Update a note
- *
- * @param string $id Note ID to update (required)
- * @param \Brevo\Client\Model\NoteData $body Note data to update a note (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of null, HTTP status code, HTTP response headers (array of strings)
- */
- public function crmNotesIdPatchWithHttpInfo($id, $body)
- {
- $returnType = '';
- $request = $this->crmNotesIdPatchRequest($id, $body);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- return [null, $statusCode, $response->getHeaders()];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 415:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation crmNotesIdPatchAsync
- *
- * Update a note
- *
- * @param string $id Note ID to update (required)
- * @param \Brevo\Client\Model\NoteData $body Note data to update a note (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function crmNotesIdPatchAsync($id, $body)
- {
- return $this->crmNotesIdPatchAsyncWithHttpInfo($id, $body)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation crmNotesIdPatchAsyncWithHttpInfo
- *
- * Update a note
- *
- * @param string $id Note ID to update (required)
- * @param \Brevo\Client\Model\NoteData $body Note data to update a note (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function crmNotesIdPatchAsyncWithHttpInfo($id, $body)
- {
- $returnType = '';
- $request = $this->crmNotesIdPatchRequest($id, $body);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- return [null, $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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'crmNotesIdPatch'
- *
- * @param string $id Note ID to update (required)
- * @param \Brevo\Client\Model\NoteData $body Note data to update a note (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function crmNotesIdPatchRequest($id, $body)
- {
- // 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 crmNotesIdPatch'
- );
- }
- // verify the required parameter 'body' is set
- if ($body === null || (is_array($body) && count($body) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $body when calling crmNotesIdPatch'
- );
- }
-
- $resourcePath = '/crm/notes/{id}';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
- // path params
- if ($id !== null) {
- $resourcePath = str_replace(
- '{' . 'id' . '}',
- ObjectSerializer::toPathValue($id),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
- if (isset($body)) {
- $_tempBody = $body;
- }
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'PATCH',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation crmNotesPost
- *
- * Create a note
- *
- * @param \Brevo\Client\Model\NoteData $body Note data to create a note. (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\NoteId
- */
- public function crmNotesPost($body)
- {
- list($response) = $this->crmNotesPostWithHttpInfo($body);
- return $response;
- }
-
- /**
- * Operation crmNotesPostWithHttpInfo
- *
- * Create a note
- *
- * @param \Brevo\Client\Model\NoteData $body Note data to create a note. (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\NoteId, HTTP status code, HTTP response headers (array of strings)
- */
- public function crmNotesPostWithHttpInfo($body)
- {
- $returnType = '\Brevo\Client\Model\NoteId';
- $request = $this->crmNotesPostRequest($body);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
-
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 200:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\NoteId',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 415:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation crmNotesPostAsync
- *
- * Create a note
- *
- * @param \Brevo\Client\Model\NoteData $body Note data to create a note. (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function crmNotesPostAsync($body)
- {
- return $this->crmNotesPostAsyncWithHttpInfo($body)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation crmNotesPostAsyncWithHttpInfo
- *
- * Create a note
- *
- * @param \Brevo\Client\Model\NoteData $body Note data to create a note. (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function crmNotesPostAsyncWithHttpInfo($body)
- {
- $returnType = '\Brevo\Client\Model\NoteId';
- $request = $this->crmNotesPostRequest($body);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- 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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'crmNotesPost'
- *
- * @param \Brevo\Client\Model\NoteData $body Note data to create a note. (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function crmNotesPostRequest($body)
- {
- // verify the required parameter 'body' is set
- if ($body === null || (is_array($body) && count($body) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $body when calling crmNotesPost'
- );
- }
-
- $resourcePath = '/crm/notes';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
-
- // body params
- $_tempBody = null;
- if (isset($body)) {
- $_tempBody = $body;
- }
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation crmTasksGet
- *
- * Get all tasks
- *
- * @param string $filterType Filter by task type (ID) (optional)
- * @param string $filterStatus Filter by task status (optional)
- * @param string $filterDate Filter by date (optional)
- * @param string $filterAssignTo Filter by assignTo id (optional)
- * @param string $filterContacts Filter by contact ids (optional)
- * @param string $filterDeals Filter by deals ids (optional)
- * @param string $filterCompanies Filter by companies ids (optional)
- * @param int $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
- * @param int $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
- * @param int $offset Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- * @param string $sortBy The field used to sort field names. (optional)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\TaskList
- */
- public function crmTasksGet($filterType = null, $filterStatus = null, $filterDate = null, $filterAssignTo = null, $filterContacts = null, $filterDeals = null, $filterCompanies = null, $dateFrom = null, $dateTo = null, $offset = null, $limit = '50', $sort = null, $sortBy = null)
- {
- list($response) = $this->crmTasksGetWithHttpInfo($filterType, $filterStatus, $filterDate, $filterAssignTo, $filterContacts, $filterDeals, $filterCompanies, $dateFrom, $dateTo, $offset, $limit, $sort, $sortBy);
- return $response;
- }
-
- /**
- * Operation crmTasksGetWithHttpInfo
- *
- * Get all tasks
- *
- * @param string $filterType Filter by task type (ID) (optional)
- * @param string $filterStatus Filter by task status (optional)
- * @param string $filterDate Filter by date (optional)
- * @param string $filterAssignTo Filter by assignTo id (optional)
- * @param string $filterContacts Filter by contact ids (optional)
- * @param string $filterDeals Filter by deals ids (optional)
- * @param string $filterCompanies Filter by companies ids (optional)
- * @param int $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
- * @param int $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
- * @param int $offset Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- * @param string $sortBy The field used to sort field names. (optional)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\TaskList, HTTP status code, HTTP response headers (array of strings)
- */
- public function crmTasksGetWithHttpInfo($filterType = null, $filterStatus = null, $filterDate = null, $filterAssignTo = null, $filterContacts = null, $filterDeals = null, $filterCompanies = null, $dateFrom = null, $dateTo = null, $offset = null, $limit = '50', $sort = null, $sortBy = null)
- {
- $returnType = '\Brevo\Client\Model\TaskList';
- $request = $this->crmTasksGetRequest($filterType, $filterStatus, $filterDate, $filterAssignTo, $filterContacts, $filterDeals, $filterCompanies, $dateFrom, $dateTo, $offset, $limit, $sort, $sortBy);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
-
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 200:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\TaskList',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation crmTasksGetAsync
- *
- * Get all tasks
- *
- * @param string $filterType Filter by task type (ID) (optional)
- * @param string $filterStatus Filter by task status (optional)
- * @param string $filterDate Filter by date (optional)
- * @param string $filterAssignTo Filter by assignTo id (optional)
- * @param string $filterContacts Filter by contact ids (optional)
- * @param string $filterDeals Filter by deals ids (optional)
- * @param string $filterCompanies Filter by companies ids (optional)
- * @param int $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
- * @param int $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
- * @param int $offset Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- * @param string $sortBy The field used to sort field names. (optional)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function crmTasksGetAsync($filterType = null, $filterStatus = null, $filterDate = null, $filterAssignTo = null, $filterContacts = null, $filterDeals = null, $filterCompanies = null, $dateFrom = null, $dateTo = null, $offset = null, $limit = '50', $sort = null, $sortBy = null)
- {
- return $this->crmTasksGetAsyncWithHttpInfo($filterType, $filterStatus, $filterDate, $filterAssignTo, $filterContacts, $filterDeals, $filterCompanies, $dateFrom, $dateTo, $offset, $limit, $sort, $sortBy)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation crmTasksGetAsyncWithHttpInfo
- *
- * Get all tasks
- *
- * @param string $filterType Filter by task type (ID) (optional)
- * @param string $filterStatus Filter by task status (optional)
- * @param string $filterDate Filter by date (optional)
- * @param string $filterAssignTo Filter by assignTo id (optional)
- * @param string $filterContacts Filter by contact ids (optional)
- * @param string $filterDeals Filter by deals ids (optional)
- * @param string $filterCompanies Filter by companies ids (optional)
- * @param int $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
- * @param int $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
- * @param int $offset Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- * @param string $sortBy The field used to sort field names. (optional)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function crmTasksGetAsyncWithHttpInfo($filterType = null, $filterStatus = null, $filterDate = null, $filterAssignTo = null, $filterContacts = null, $filterDeals = null, $filterCompanies = null, $dateFrom = null, $dateTo = null, $offset = null, $limit = '50', $sort = null, $sortBy = null)
- {
- $returnType = '\Brevo\Client\Model\TaskList';
- $request = $this->crmTasksGetRequest($filterType, $filterStatus, $filterDate, $filterAssignTo, $filterContacts, $filterDeals, $filterCompanies, $dateFrom, $dateTo, $offset, $limit, $sort, $sortBy);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- 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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'crmTasksGet'
- *
- * @param string $filterType Filter by task type (ID) (optional)
- * @param string $filterStatus Filter by task status (optional)
- * @param string $filterDate Filter by date (optional)
- * @param string $filterAssignTo Filter by assignTo id (optional)
- * @param string $filterContacts Filter by contact ids (optional)
- * @param string $filterDeals Filter by deals ids (optional)
- * @param string $filterCompanies Filter by companies ids (optional)
- * @param int $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
- * @param int $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
- * @param int $offset Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- * @param string $sortBy The field used to sort field names. (optional)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function crmTasksGetRequest($filterType = null, $filterStatus = null, $filterDate = null, $filterAssignTo = null, $filterContacts = null, $filterDeals = null, $filterCompanies = null, $dateFrom = null, $dateTo = null, $offset = null, $limit = '50', $sort = null, $sortBy = null)
- {
-
- $resourcePath = '/crm/tasks';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
- // query params
- if ($filterType !== null) {
- $queryParams['filter[type]'] = ObjectSerializer::toQueryValue($filterType);
- }
- // query params
- if ($filterStatus !== null) {
- $queryParams['filter[status]'] = ObjectSerializer::toQueryValue($filterStatus);
- }
- // query params
- if ($filterDate !== null) {
- $queryParams['filter[date]'] = ObjectSerializer::toQueryValue($filterDate);
- }
- // query params
- if ($filterAssignTo !== null) {
- $queryParams['filter[assignTo]'] = ObjectSerializer::toQueryValue($filterAssignTo);
- }
- // query params
- if ($filterContacts !== null) {
- $queryParams['filter[contacts]'] = ObjectSerializer::toQueryValue($filterContacts);
- }
- // query params
- if ($filterDeals !== null) {
- $queryParams['filter[deals]'] = ObjectSerializer::toQueryValue($filterDeals);
- }
- // query params
- if ($filterCompanies !== null) {
- $queryParams['filter[companies]'] = ObjectSerializer::toQueryValue($filterCompanies);
- }
- // query params
- if ($dateFrom !== null) {
- $queryParams['dateFrom'] = ObjectSerializer::toQueryValue($dateFrom);
- }
- // query params
- if ($dateTo !== null) {
- $queryParams['dateTo'] = ObjectSerializer::toQueryValue($dateTo);
- }
- // query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
- // query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
- // query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
- // query params
- if ($sortBy !== null) {
- $queryParams['sortBy'] = ObjectSerializer::toQueryValue($sortBy);
- }
-
-
- // body params
- $_tempBody = null;
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation crmTasksIdDelete
- *
- * Delete a task
- *
- * @param string $id id (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return void
- */
- public function crmTasksIdDelete($id)
- {
- $this->crmTasksIdDeleteWithHttpInfo($id);
- }
-
- /**
- * Operation crmTasksIdDeleteWithHttpInfo
- *
- * Delete a task
- *
- * @param string $id (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of null, HTTP status code, HTTP response headers (array of strings)
- */
- public function crmTasksIdDeleteWithHttpInfo($id)
- {
- $returnType = '';
- $request = $this->crmTasksIdDeleteRequest($id);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- return [null, $statusCode, $response->getHeaders()];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation crmTasksIdDeleteAsync
- *
- * Delete a task
- *
- * @param string $id (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function crmTasksIdDeleteAsync($id)
- {
- return $this->crmTasksIdDeleteAsyncWithHttpInfo($id)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation crmTasksIdDeleteAsyncWithHttpInfo
- *
- * Delete a task
- *
- * @param string $id (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function crmTasksIdDeleteAsyncWithHttpInfo($id)
- {
- $returnType = '';
- $request = $this->crmTasksIdDeleteRequest($id);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- return [null, $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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'crmTasksIdDelete'
- *
- * @param string $id (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function crmTasksIdDeleteRequest($id)
- {
- // 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 crmTasksIdDelete'
- );
- }
-
- $resourcePath = '/crm/tasks/{id}';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
- // path params
- if ($id !== null) {
- $resourcePath = str_replace(
- '{' . 'id' . '}',
- ObjectSerializer::toPathValue($id),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation crmTasksIdGet
- *
- * Get a task
- *
- * @param string $id id (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\Task
- */
- public function crmTasksIdGet($id)
- {
- list($response) = $this->crmTasksIdGetWithHttpInfo($id);
- return $response;
- }
-
- /**
- * Operation crmTasksIdGetWithHttpInfo
- *
- * Get a task
- *
- * @param string $id (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\Task, HTTP status code, HTTP response headers (array of strings)
- */
- public function crmTasksIdGetWithHttpInfo($id)
- {
- $returnType = '\Brevo\Client\Model\Task';
- $request = $this->crmTasksIdGetRequest($id);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
-
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 200:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\Task',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation crmTasksIdGetAsync
- *
- * Get a task
- *
- * @param string $id (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function crmTasksIdGetAsync($id)
- {
- return $this->crmTasksIdGetAsyncWithHttpInfo($id)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation crmTasksIdGetAsyncWithHttpInfo
- *
- * Get a task
- *
- * @param string $id (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function crmTasksIdGetAsyncWithHttpInfo($id)
- {
- $returnType = '\Brevo\Client\Model\Task';
- $request = $this->crmTasksIdGetRequest($id);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- 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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'crmTasksIdGet'
- *
- * @param string $id (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function crmTasksIdGetRequest($id)
- {
- // 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 crmTasksIdGet'
- );
- }
-
- $resourcePath = '/crm/tasks/{id}';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
- // path params
- if ($id !== null) {
- $resourcePath = str_replace(
- '{' . 'id' . '}',
- ObjectSerializer::toPathValue($id),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation crmTasksIdPatch
- *
- * Update a task
- *
- * @param string $id id (required)
- * @param \Brevo\Client\Model\Body1 $body Updated task details. (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return void
- */
- public function crmTasksIdPatch($id, $body)
- {
- $this->crmTasksIdPatchWithHttpInfo($id, $body);
- }
-
- /**
- * Operation crmTasksIdPatchWithHttpInfo
- *
- * Update a task
- *
- * @param string $id (required)
- * @param \Brevo\Client\Model\Body1 $body Updated task details. (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of null, HTTP status code, HTTP response headers (array of strings)
- */
- public function crmTasksIdPatchWithHttpInfo($id, $body)
- {
- $returnType = '';
- $request = $this->crmTasksIdPatchRequest($id, $body);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- return [null, $statusCode, $response->getHeaders()];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation crmTasksIdPatchAsync
- *
- * Update a task
- *
- * @param string $id (required)
- * @param \Brevo\Client\Model\Body1 $body Updated task details. (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function crmTasksIdPatchAsync($id, $body)
- {
- return $this->crmTasksIdPatchAsyncWithHttpInfo($id, $body)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation crmTasksIdPatchAsyncWithHttpInfo
- *
- * Update a task
- *
- * @param string $id (required)
- * @param \Brevo\Client\Model\Body1 $body Updated task details. (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function crmTasksIdPatchAsyncWithHttpInfo($id, $body)
- {
- $returnType = '';
- $request = $this->crmTasksIdPatchRequest($id, $body);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- return [null, $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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'crmTasksIdPatch'
- *
- * @param string $id (required)
- * @param \Brevo\Client\Model\Body1 $body Updated task details. (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function crmTasksIdPatchRequest($id, $body)
- {
- // 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 crmTasksIdPatch'
- );
- }
- // verify the required parameter 'body' is set
- if ($body === null || (is_array($body) && count($body) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $body when calling crmTasksIdPatch'
- );
- }
-
- $resourcePath = '/crm/tasks/{id}';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
- // path params
- if ($id !== null) {
- $resourcePath = str_replace(
- '{' . 'id' . '}',
- ObjectSerializer::toPathValue($id),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
- if (isset($body)) {
- $_tempBody = $body;
- }
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'PATCH',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation crmTasksPost
- *
- * Create a task
- *
- * @param \Brevo\Client\Model\Body $body Task name. (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\InlineResponse201
- */
- public function crmTasksPost($body)
- {
- list($response) = $this->crmTasksPostWithHttpInfo($body);
- return $response;
- }
-
- /**
- * Operation crmTasksPostWithHttpInfo
- *
- * Create a task
- *
- * @param \Brevo\Client\Model\Body $body Task name. (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\InlineResponse201, HTTP status code, HTTP response headers (array of strings)
- */
- public function crmTasksPostWithHttpInfo($body)
- {
- $returnType = '\Brevo\Client\Model\InlineResponse201';
- $request = $this->crmTasksPostRequest($body);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
-
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 201:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\InlineResponse201',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation crmTasksPostAsync
- *
- * Create a task
- *
- * @param \Brevo\Client\Model\Body $body Task name. (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function crmTasksPostAsync($body)
- {
- return $this->crmTasksPostAsyncWithHttpInfo($body)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation crmTasksPostAsyncWithHttpInfo
- *
- * Create a task
- *
- * @param \Brevo\Client\Model\Body $body Task name. (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function crmTasksPostAsyncWithHttpInfo($body)
- {
- $returnType = '\Brevo\Client\Model\InlineResponse201';
- $request = $this->crmTasksPostRequest($body);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- 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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'crmTasksPost'
- *
- * @param \Brevo\Client\Model\Body $body Task name. (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function crmTasksPostRequest($body)
- {
- // verify the required parameter 'body' is set
- if ($body === null || (is_array($body) && count($body) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $body when calling crmTasksPost'
- );
- }
-
- $resourcePath = '/crm/tasks';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
-
- // body params
- $_tempBody = null;
- if (isset($body)) {
- $_tempBody = $body;
- }
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation crmTasktypesGet
- *
- * Get all task types
- *
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\TaskTypes
- */
- public function crmTasktypesGet()
- {
- list($response) = $this->crmTasktypesGetWithHttpInfo();
- return $response;
- }
-
- /**
- * Operation crmTasktypesGetWithHttpInfo
- *
- * Get all task types
- *
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\TaskTypes, HTTP status code, HTTP response headers (array of strings)
- */
- public function crmTasktypesGetWithHttpInfo()
- {
- $returnType = '\Brevo\Client\Model\TaskTypes';
- $request = $this->crmTasktypesGetRequest();
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
-
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 200:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\TaskTypes',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation crmTasktypesGetAsync
- *
- * Get all task types
- *
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function crmTasktypesGetAsync()
- {
- return $this->crmTasktypesGetAsyncWithHttpInfo()
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation crmTasktypesGetAsyncWithHttpInfo
- *
- * Get all task types
- *
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function crmTasktypesGetAsyncWithHttpInfo()
- {
- $returnType = '\Brevo\Client\Model\TaskTypes';
- $request = $this->crmTasktypesGetRequest();
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- 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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'crmTasktypesGet'
- *
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function crmTasktypesGetRequest()
- {
-
- $resourcePath = '/crm/tasktypes';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
-
- // body params
- $_tempBody = null;
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'GET',
- $this->config->getHost() . $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/CompaniesApi.php b/lib/Api/CompaniesApi.php
index e2216dd..4d0af6f 100644
--- a/lib/Api/CompaniesApi.php
+++ b/lib/Api/CompaniesApi.php
@@ -1,39 +1,41 @@
[
+ 'application/json',
+ ],
+ 'companiesGet' => [
+ 'application/json',
+ ],
+ 'companiesIdDelete' => [
+ 'application/json',
+ ],
+ 'companiesIdGet' => [
+ 'application/json',
+ ],
+ 'companiesIdPatch' => [
+ 'application/json',
+ ],
+ 'companiesImportPost' => [
+ 'multipart/form-data',
+ ],
+ 'companiesLinkUnlinkIdPatch' => [
+ 'application/json',
+ ],
+ 'companiesPost' => [
+ 'application/json',
+ ],
+ ];
+
+ /**
+ * @param ClientInterface|null $client
+ * @param Configuration|null $config
+ * @param HeaderSelector|null $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
+ HeaderSelector $selector = null,
+ int $hostIndex = 0
) {
$this->client = $client ?: new Client();
- $this->config = $config ?: new Configuration();
+ $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(int $hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex(): int
+ {
+ return $this->hostIndex;
}
/**
* @return Configuration
*/
- public function getConfig()
+ public function getConfig(): Configuration
{
return $this->config;
}
@@ -92,14 +149,17 @@ public function getConfig()
*
* Get company attributes
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesAttributesGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\CompanyAttributes
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CompanyAttributesInner[]
*/
- public function companiesAttributesGet()
+ public function companiesAttributesGet(
+ string $contentType = self::contentTypes['companiesAttributesGet'][0]
+ ): array
{
- list($response) = $this->companiesAttributesGetWithHttpInfo();
+ list($response) = $this->companiesAttributesGetWithHttpInfo($contentType);
return $response;
}
@@ -108,15 +168,17 @@ public function companiesAttributesGet()
*
* Get company attributes
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesAttributesGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\CompanyAttributes, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CompanyAttributesInner[], HTTP status code, HTTP response headers (array of strings)
*/
- public function companiesAttributesGetWithHttpInfo()
+ public function companiesAttributesGetWithHttpInfo(
+ string $contentType = self::contentTypes['companiesAttributesGet'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\CompanyAttributes';
- $request = $this->companiesAttributesGetRequest();
+ $request = $this->companiesAttributesGetRequest($contentType);
try {
$options = $this->createHttpClientOption();
@@ -125,34 +187,84 @@ public function companiesAttributesGetWithHttpInfo()
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\CompanyAttributesInner[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CompanyAttributesInner[]' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CompanyAttributesInner[]', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CompanyAttributesInner[]';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -167,7 +279,7 @@ public function companiesAttributesGetWithHttpInfo()
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\CompanyAttributes',
+ '\Brevo\Client\Models\CompanyAttributesInner[]',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -182,13 +294,16 @@ public function companiesAttributesGetWithHttpInfo()
*
* Get company attributes
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesAttributesGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function companiesAttributesGetAsync()
+ public function companiesAttributesGetAsync(
+ string $contentType = self::contentTypes['companiesAttributesGet'][0]
+ ): PromiseInterface
{
- return $this->companiesAttributesGetAsyncWithHttpInfo()
+ return $this->companiesAttributesGetAsyncWithHttpInfo($contentType)
->then(
function ($response) {
return $response[0];
@@ -201,24 +316,27 @@ function ($response) {
*
* Get company attributes
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesAttributesGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function companiesAttributesGetAsyncWithHttpInfo()
+ public function companiesAttributesGetAsyncWithHttpInfo(
+ string $contentType = self::contentTypes['companiesAttributesGet'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\CompanyAttributes';
- $request = $this->companiesAttributesGetRequest();
+ $returnType = '\Brevo\Client\Models\CompanyAttributesInner[]';
+ $request = $this->companiesAttributesGetRequest($contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -241,7 +359,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -250,13 +368,17 @@ function ($exception) {
/**
* Create request for operation 'companiesAttributesGet'
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesAttributesGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function companiesAttributesGetRequest()
+ public function companiesAttributesGetRequest(
+ string $contentType = self::contentTypes['companiesAttributesGet'][0]
+ ): Request
{
+
$resourcePath = '/companies/attributes';
$formParams = [];
$queryParams = [];
@@ -266,53 +388,36 @@ protected function companiesAttributesGetRequest()
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -338,10 +443,11 @@ protected function companiesAttributesGetRequest()
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -350,47 +456,66 @@ protected function companiesAttributesGetRequest()
/**
* Operation companiesGet
*
- * Get all companies
+ * Get all Companies
*
- * @param string $filters Filter by attrbutes. If you have filter for owner on your side please send it as {\"attributes.owner\":\"5b1a17d914b73d35a76ca0c7\"} (optional)
- * @param int $linkedContactsIds Filter by linked contacts ids (optional)
- * @param string $linkedDealsIds Filter by linked deals ids (optional)
- * @param int $page Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- * @param string $sortBy The field used to sort field names. (optional)
+ * @param string|null $filters Filter by attrbutes. If you have filter for owner on your side please send it as {\"attributes.owner\":\"6299dcf3874a14eacbc65c46\"} (optional)
+ * @param int|null $linkedContactsIds Filter by linked contacts ids (optional)
+ * @param string|null $linkedDealsIds Filter by linked Deals ids (optional)
+ * @param int|null $page Index of the first document of the page (optional)
+ * @param int|null $limit Number of documents per page (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
+ * @param string|null $sortBy The field used to sort field names. (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\CompaniesList
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CompaniesList|\Brevo\Client\Models\ErrorModel
*/
- public function companiesGet($filters = null, $linkedContactsIds = null, $linkedDealsIds = null, $page = null, $limit = '50', $sort = null, $sortBy = null)
+ public function companiesGet(
+ ?string $filters = null,
+ ?int $linkedContactsIds = null,
+ ?string $linkedDealsIds = null,
+ ?int $page = null,
+ ?int $limit = null,
+ ?string $sort = null,
+ ?string $sortBy = null,
+ string $contentType = self::contentTypes['companiesGet'][0]
+ ): \Brevo\Client\Models\CompaniesList
{
- list($response) = $this->companiesGetWithHttpInfo($filters, $linkedContactsIds, $linkedDealsIds, $page, $limit, $sort, $sortBy);
+ list($response) = $this->companiesGetWithHttpInfo($filters, $linkedContactsIds, $linkedDealsIds, $page, $limit, $sort, $sortBy, $contentType);
return $response;
}
/**
* Operation companiesGetWithHttpInfo
*
- * Get all companies
+ * Get all Companies
*
- * @param string $filters Filter by attrbutes. If you have filter for owner on your side please send it as {\"attributes.owner\":\"5b1a17d914b73d35a76ca0c7\"} (optional)
- * @param int $linkedContactsIds Filter by linked contacts ids (optional)
- * @param string $linkedDealsIds Filter by linked deals ids (optional)
- * @param int $page Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- * @param string $sortBy The field used to sort field names. (optional)
+ * @param string|null $filters Filter by attrbutes. If you have filter for owner on your side please send it as {\"attributes.owner\":\"6299dcf3874a14eacbc65c46\"} (optional)
+ * @param int|null $linkedContactsIds Filter by linked contacts ids (optional)
+ * @param string|null $linkedDealsIds Filter by linked Deals ids (optional)
+ * @param int|null $page Index of the first document of the page (optional)
+ * @param int|null $limit Number of documents per page (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
+ * @param string|null $sortBy The field used to sort field names. (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\CompaniesList, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CompaniesList|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function companiesGetWithHttpInfo($filters = null, $linkedContactsIds = null, $linkedDealsIds = null, $page = null, $limit = '50', $sort = null, $sortBy = null)
+ public function companiesGetWithHttpInfo(
+ ?string $filters = null,
+ ?int $linkedContactsIds = null,
+ ?string $linkedDealsIds = null,
+ ?int $page = null,
+ ?int $limit = null,
+ ?string $sort = null,
+ ?string $sortBy = null,
+ string $contentType = self::contentTypes['companiesGet'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\CompaniesList';
- $request = $this->companiesGetRequest($filters, $linkedContactsIds, $linkedDealsIds, $page, $limit, $sort, $sortBy);
+ $request = $this->companiesGetRequest($filters, $linkedContactsIds, $linkedDealsIds, $page, $limit, $sort, $sortBy, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -399,34 +524,111 @@ public function companiesGetWithHttpInfo($filters = null, $linkedContactsIds = n
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\CompaniesList', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CompaniesList' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CompaniesList', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CompaniesList';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -441,7 +643,7 @@ public function companiesGetWithHttpInfo($filters = null, $linkedContactsIds = n
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\CompaniesList',
+ '\Brevo\Client\Models\CompaniesList',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -449,7 +651,7 @@ public function companiesGetWithHttpInfo($filters = null, $linkedContactsIds = n
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -462,22 +664,32 @@ public function companiesGetWithHttpInfo($filters = null, $linkedContactsIds = n
/**
* Operation companiesGetAsync
*
- * Get all companies
+ * Get all Companies
*
- * @param string $filters Filter by attrbutes. If you have filter for owner on your side please send it as {\"attributes.owner\":\"5b1a17d914b73d35a76ca0c7\"} (optional)
- * @param int $linkedContactsIds Filter by linked contacts ids (optional)
- * @param string $linkedDealsIds Filter by linked deals ids (optional)
- * @param int $page Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- * @param string $sortBy The field used to sort field names. (optional)
+ * @param string|null $filters Filter by attrbutes. If you have filter for owner on your side please send it as {\"attributes.owner\":\"6299dcf3874a14eacbc65c46\"} (optional)
+ * @param int|null $linkedContactsIds Filter by linked contacts ids (optional)
+ * @param string|null $linkedDealsIds Filter by linked Deals ids (optional)
+ * @param int|null $page Index of the first document of the page (optional)
+ * @param int|null $limit Number of documents per page (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
+ * @param string|null $sortBy The field used to sort field names. (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function companiesGetAsync($filters = null, $linkedContactsIds = null, $linkedDealsIds = null, $page = null, $limit = '50', $sort = null, $sortBy = null)
+ public function companiesGetAsync(
+ ?string $filters = null,
+ ?int $linkedContactsIds = null,
+ ?string $linkedDealsIds = null,
+ ?int $page = null,
+ ?int $limit = null,
+ ?string $sort = null,
+ ?string $sortBy = null,
+ string $contentType = self::contentTypes['companiesGet'][0]
+ ): PromiseInterface
{
- return $this->companiesGetAsyncWithHttpInfo($filters, $linkedContactsIds, $linkedDealsIds, $page, $limit, $sort, $sortBy)
+ return $this->companiesGetAsyncWithHttpInfo($filters, $linkedContactsIds, $linkedDealsIds, $page, $limit, $sort, $sortBy, $contentType)
->then(
function ($response) {
return $response[0];
@@ -488,33 +700,43 @@ function ($response) {
/**
* Operation companiesGetAsyncWithHttpInfo
*
- * Get all companies
+ * Get all Companies
*
- * @param string $filters Filter by attrbutes. If you have filter for owner on your side please send it as {\"attributes.owner\":\"5b1a17d914b73d35a76ca0c7\"} (optional)
- * @param int $linkedContactsIds Filter by linked contacts ids (optional)
- * @param string $linkedDealsIds Filter by linked deals ids (optional)
- * @param int $page Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- * @param string $sortBy The field used to sort field names. (optional)
+ * @param string|null $filters Filter by attrbutes. If you have filter for owner on your side please send it as {\"attributes.owner\":\"6299dcf3874a14eacbc65c46\"} (optional)
+ * @param int|null $linkedContactsIds Filter by linked contacts ids (optional)
+ * @param string|null $linkedDealsIds Filter by linked Deals ids (optional)
+ * @param int|null $page Index of the first document of the page (optional)
+ * @param int|null $limit Number of documents per page (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
+ * @param string|null $sortBy The field used to sort field names. (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function companiesGetAsyncWithHttpInfo($filters = null, $linkedContactsIds = null, $linkedDealsIds = null, $page = null, $limit = '50', $sort = null, $sortBy = null)
+ public function companiesGetAsyncWithHttpInfo(
+ $filters = null,
+ $linkedContactsIds = null,
+ $linkedDealsIds = null,
+ $page = null,
+ $limit = null,
+ $sort = null,
+ $sortBy = null,
+ string $contentType = self::contentTypes['companiesGet'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\CompaniesList';
- $request = $this->companiesGetRequest($filters, $linkedContactsIds, $linkedDealsIds, $page, $limit, $sort, $sortBy);
+ $returnType = '\Brevo\Client\Models\CompaniesList';
+ $request = $this->companiesGetRequest($filters, $linkedContactsIds, $linkedDealsIds, $page, $limit, $sort, $sortBy, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -537,7 +759,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -546,20 +768,38 @@ function ($exception) {
/**
* Create request for operation 'companiesGet'
*
- * @param string $filters Filter by attrbutes. If you have filter for owner on your side please send it as {\"attributes.owner\":\"5b1a17d914b73d35a76ca0c7\"} (optional)
- * @param int $linkedContactsIds Filter by linked contacts ids (optional)
- * @param string $linkedDealsIds Filter by linked deals ids (optional)
- * @param int $page Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- * @param string $sortBy The field used to sort field names. (optional)
+ * @param string|null $filters Filter by attrbutes. If you have filter for owner on your side please send it as {\"attributes.owner\":\"6299dcf3874a14eacbc65c46\"} (optional)
+ * @param int|null $linkedContactsIds Filter by linked contacts ids (optional)
+ * @param string|null $linkedDealsIds Filter by linked Deals ids (optional)
+ * @param int|null $page Index of the first document of the page (optional)
+ * @param int|null $limit Number of documents per page (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
+ * @param string|null $sortBy The field used to sort field names. (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function companiesGetRequest($filters = null, $linkedContactsIds = null, $linkedDealsIds = null, $page = null, $limit = '50', $sort = null, $sortBy = null)
+ public function companiesGetRequest(
+ $filters = null,
+ $linkedContactsIds = null,
+ $linkedDealsIds = null,
+ $page = null,
+ $limit = null,
+ $sort = null,
+ $sortBy = null,
+ string $contentType = self::contentTypes['companiesGet'][0]
+ ): Request
{
+
+
+
+
+
+
+
+
$resourcePath = '/companies';
$formParams = [];
$queryParams = [];
@@ -568,82 +808,100 @@ protected function companiesGetRequest($filters = null, $linkedContactsIds = nul
$multipart = false;
// query params
- if ($filters !== null) {
- $queryParams['filters'] = ObjectSerializer::toQueryValue($filters);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $filters,
+ 'filters', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($linkedContactsIds !== null) {
- $queryParams['linkedContactsIds'] = ObjectSerializer::toQueryValue($linkedContactsIds);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $linkedContactsIds,
+ 'linkedContactsIds', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($linkedDealsIds !== null) {
- $queryParams['linkedDealsIds'] = ObjectSerializer::toQueryValue($linkedDealsIds);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $linkedDealsIds,
+ 'linkedDealsIds', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($page !== null) {
- $queryParams['page'] = ObjectSerializer::toQueryValue($page);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $page,
+ 'page', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($sortBy !== null) {
- $queryParams['sortBy'] = ObjectSerializer::toQueryValue($sortBy);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sortBy,
+ 'sortBy', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -669,10 +927,11 @@ protected function companiesGetRequest($filters = null, $linkedContactsIds = nul
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -683,15 +942,19 @@ protected function companiesGetRequest($filters = null, $linkedContactsIds = nul
*
* Delete a company
*
- * @param string $id id (required)
+ * @param string $id Company ID to delete (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesIdDelete'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function companiesIdDelete($id)
+ public function companiesIdDelete(
+ string $id,
+ string $contentType = self::contentTypes['companiesIdDelete'][0]
+ ): void
{
- $this->companiesIdDeleteWithHttpInfo($id);
+ $this->companiesIdDeleteWithHttpInfo($id, $contentType);
}
/**
@@ -699,16 +962,19 @@ public function companiesIdDelete($id)
*
* Delete a company
*
- * @param string $id (required)
+ * @param string $id Company ID to delete (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesIdDelete'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function companiesIdDeleteWithHttpInfo($id)
+ public function companiesIdDeleteWithHttpInfo(
+ string $id,
+ string $contentType = self::contentTypes['companiesIdDelete'][0]
+ ): array
{
- $returnType = '';
- $request = $this->companiesIdDeleteRequest($id);
+ $request = $this->companiesIdDeleteRequest($id, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -717,26 +983,21 @@ public function companiesIdDeleteWithHttpInfo($id)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -745,7 +1006,7 @@ public function companiesIdDeleteWithHttpInfo($id)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -753,7 +1014,7 @@ public function companiesIdDeleteWithHttpInfo($id)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -768,14 +1029,18 @@ public function companiesIdDeleteWithHttpInfo($id)
*
* Delete a company
*
- * @param string $id (required)
+ * @param string $id Company ID to delete (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesIdDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function companiesIdDeleteAsync($id)
+ public function companiesIdDeleteAsync(
+ string $id,
+ string $contentType = self::contentTypes['companiesIdDelete'][0]
+ ): PromiseInterface
{
- return $this->companiesIdDeleteAsyncWithHttpInfo($id)
+ return $this->companiesIdDeleteAsyncWithHttpInfo($id, $contentType)
->then(
function ($response) {
return $response[0];
@@ -788,15 +1053,20 @@ function ($response) {
*
* Delete a company
*
- * @param string $id (required)
+ * @param string $id Company ID to delete (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesIdDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function companiesIdDeleteAsyncWithHttpInfo($id)
+ public function companiesIdDeleteAsyncWithHttpInfo(
+ $id,
+ string $contentType = self::contentTypes['companiesIdDelete'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->companiesIdDeleteRequest($id);
+ $request = $this->companiesIdDeleteRequest($id, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -815,7 +1085,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -824,20 +1094,26 @@ function ($exception) {
/**
* Create request for operation 'companiesIdDelete'
*
- * @param string $id (required)
+ * @param string $id Company ID to delete (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesIdDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function companiesIdDeleteRequest($id)
+ public function companiesIdDeleteRequest(
+ $id,
+ string $contentType = self::contentTypes['companiesIdDelete'][0]
+ ): Request
{
+
// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $id when calling companiesIdDelete'
);
}
+
$resourcePath = '/companies/{id}';
$formParams = [];
$queryParams = [];
@@ -846,6 +1122,7 @@ protected function companiesIdDeleteRequest($id)
$multipart = false;
+
// path params
if ($id !== null) {
$resourcePath = str_replace(
@@ -855,53 +1132,35 @@ protected function companiesIdDeleteRequest($id)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -927,10 +1186,11 @@ protected function companiesIdDeleteRequest($id)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -941,15 +1201,19 @@ protected function companiesIdDeleteRequest($id)
*
* Get a company
*
- * @param string $id id (required)
+ * @param string $id Get Company Details (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesIdGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\Company
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\Company|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function companiesIdGet($id)
+ public function companiesIdGet(
+ string $id,
+ string $contentType = self::contentTypes['companiesIdGet'][0]
+ ): \Brevo\Client\Models\Company
{
- list($response) = $this->companiesIdGetWithHttpInfo($id);
+ list($response) = $this->companiesIdGetWithHttpInfo($id, $contentType);
return $response;
}
@@ -958,16 +1222,19 @@ public function companiesIdGet($id)
*
* Get a company
*
- * @param string $id (required)
+ * @param string $id Get Company Details (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesIdGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\Company, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\Company|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function companiesIdGetWithHttpInfo($id)
+ public function companiesIdGetWithHttpInfo(
+ string $id,
+ string $contentType = self::contentTypes['companiesIdGet'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\Company';
- $request = $this->companiesIdGetRequest($id);
+ $request = $this->companiesIdGetRequest($id, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -976,34 +1243,138 @@ public function companiesIdGetWithHttpInfo($id)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\Company', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\Company' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\Company', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\Company';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1018,7 +1389,7 @@ public function companiesIdGetWithHttpInfo($id)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\Company',
+ '\Brevo\Client\Models\Company',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1026,7 +1397,7 @@ public function companiesIdGetWithHttpInfo($id)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1034,7 +1405,7 @@ public function companiesIdGetWithHttpInfo($id)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1049,14 +1420,18 @@ public function companiesIdGetWithHttpInfo($id)
*
* Get a company
*
- * @param string $id (required)
+ * @param string $id Get Company Details (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesIdGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function companiesIdGetAsync($id)
+ public function companiesIdGetAsync(
+ string $id,
+ string $contentType = self::contentTypes['companiesIdGet'][0]
+ ): PromiseInterface
{
- return $this->companiesIdGetAsyncWithHttpInfo($id)
+ return $this->companiesIdGetAsyncWithHttpInfo($id, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1069,25 +1444,29 @@ function ($response) {
*
* Get a company
*
- * @param string $id (required)
+ * @param string $id Get Company Details (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesIdGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function companiesIdGetAsyncWithHttpInfo($id)
+ public function companiesIdGetAsyncWithHttpInfo(
+ $id,
+ string $contentType = self::contentTypes['companiesIdGet'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\Company';
- $request = $this->companiesIdGetRequest($id);
+ $returnType = '\Brevo\Client\Models\Company';
+ $request = $this->companiesIdGetRequest($id, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1110,7 +1489,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1119,20 +1498,26 @@ function ($exception) {
/**
* Create request for operation 'companiesIdGet'
*
- * @param string $id (required)
+ * @param string $id Get Company Details (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesIdGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function companiesIdGetRequest($id)
+ public function companiesIdGetRequest(
+ $id,
+ string $contentType = self::contentTypes['companiesIdGet'][0]
+ ): Request
{
+
// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $id when calling companiesIdGet'
);
}
+
$resourcePath = '/companies/{id}';
$formParams = [];
$queryParams = [];
@@ -1141,6 +1526,7 @@ protected function companiesIdGetRequest($id)
$multipart = false;
+
// path params
if ($id !== null) {
$resourcePath = str_replace(
@@ -1150,53 +1536,35 @@ protected function companiesIdGetRequest($id)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1222,10 +1590,11 @@ protected function companiesIdGetRequest($id)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1237,15 +1606,20 @@ protected function companiesIdGetRequest($id)
* Update a company
*
* @param string $id id (required)
- * @param \Brevo\Client\Model\Body3 $body Updated company details. (required)
+ * @param \Brevo\Client\Models\CompaniesIdPatchRequest $companiesIdPatchRequest Updated company details. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesIdPatch'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\Company
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\Company|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function companiesIdPatch($id, $body)
+ public function companiesIdPatch(
+ string $id,
+ \Brevo\Client\Models\CompaniesIdPatchRequest $companiesIdPatchRequest,
+ string $contentType = self::contentTypes['companiesIdPatch'][0]
+ ): \Brevo\Client\Models\Company
{
- list($response) = $this->companiesIdPatchWithHttpInfo($id, $body);
+ list($response) = $this->companiesIdPatchWithHttpInfo($id, $companiesIdPatchRequest, $contentType);
return $response;
}
@@ -1255,16 +1629,20 @@ public function companiesIdPatch($id, $body)
* Update a company
*
* @param string $id (required)
- * @param \Brevo\Client\Model\Body3 $body Updated company details. (required)
+ * @param \Brevo\Client\Models\CompaniesIdPatchRequest $companiesIdPatchRequest Updated company details. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesIdPatch'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\Company, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\Company|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function companiesIdPatchWithHttpInfo($id, $body)
+ public function companiesIdPatchWithHttpInfo(
+ string $id,
+ \Brevo\Client\Models\CompaniesIdPatchRequest $companiesIdPatchRequest,
+ string $contentType = self::contentTypes['companiesIdPatch'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\Company';
- $request = $this->companiesIdPatchRequest($id, $body);
+ $request = $this->companiesIdPatchRequest($id, $companiesIdPatchRequest, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1273,34 +1651,138 @@ public function companiesIdPatchWithHttpInfo($id, $body)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\Company', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\Company' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\Company', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\Company';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1315,7 +1797,7 @@ public function companiesIdPatchWithHttpInfo($id, $body)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\Company',
+ '\Brevo\Client\Models\Company',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1323,7 +1805,7 @@ public function companiesIdPatchWithHttpInfo($id, $body)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1331,7 +1813,7 @@ public function companiesIdPatchWithHttpInfo($id, $body)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1347,14 +1829,19 @@ public function companiesIdPatchWithHttpInfo($id, $body)
* Update a company
*
* @param string $id (required)
- * @param \Brevo\Client\Model\Body3 $body Updated company details. (required)
+ * @param \Brevo\Client\Models\CompaniesIdPatchRequest $companiesIdPatchRequest Updated company details. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesIdPatch'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function companiesIdPatchAsync($id, $body)
+ public function companiesIdPatchAsync(
+ string $id,
+ \Brevo\Client\Models\CompaniesIdPatchRequest $companiesIdPatchRequest,
+ string $contentType = self::contentTypes['companiesIdPatch'][0]
+ ): PromiseInterface
{
- return $this->companiesIdPatchAsyncWithHttpInfo($id, $body)
+ return $this->companiesIdPatchAsyncWithHttpInfo($id, $companiesIdPatchRequest, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1368,25 +1855,30 @@ function ($response) {
* Update a company
*
* @param string $id (required)
- * @param \Brevo\Client\Model\Body3 $body Updated company details. (required)
+ * @param \Brevo\Client\Models\CompaniesIdPatchRequest $companiesIdPatchRequest Updated company details. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesIdPatch'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function companiesIdPatchAsyncWithHttpInfo($id, $body)
+ public function companiesIdPatchAsyncWithHttpInfo(
+ $id,
+ $companiesIdPatchRequest,
+ string $contentType = self::contentTypes['companiesIdPatch'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\Company';
- $request = $this->companiesIdPatchRequest($id, $body);
+ $returnType = '\Brevo\Client\Models\Company';
+ $request = $this->companiesIdPatchRequest($id, $companiesIdPatchRequest, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1409,7 +1901,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1419,26 +1911,34 @@ function ($exception) {
* Create request for operation 'companiesIdPatch'
*
* @param string $id (required)
- * @param \Brevo\Client\Model\Body3 $body Updated company details. (required)
+ * @param \Brevo\Client\Models\CompaniesIdPatchRequest $companiesIdPatchRequest Updated company details. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesIdPatch'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function companiesIdPatchRequest($id, $body)
+ public function companiesIdPatchRequest(
+ $id,
+ $companiesIdPatchRequest,
+ string $contentType = self::contentTypes['companiesIdPatch'][0]
+ ): Request
{
+
// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $id when calling companiesIdPatch'
);
}
- // verify the required parameter 'body' is set
- if ($body === null || (is_array($body) && count($body) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $body when calling companiesIdPatch'
+
+ // verify the required parameter 'companiesIdPatchRequest' is set
+ if ($companiesIdPatchRequest === null || (is_array($companiesIdPatchRequest) && count($companiesIdPatchRequest) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $companiesIdPatchRequest when calling companiesIdPatch'
);
}
+
$resourcePath = '/companies/{id}';
$formParams = [];
$queryParams = [];
@@ -1447,6 +1947,7 @@ protected function companiesIdPatchRequest($id, $body)
$multipart = false;
+
// path params
if ($id !== null) {
$resourcePath = str_replace(
@@ -1456,56 +1957,42 @@ protected function companiesIdPatchRequest($id, $body)
);
}
- // body params
- $_tempBody = null;
- if (isset($body)) {
- $_tempBody = $body;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($companiesIdPatchRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($companiesIdPatchRequest));
+ } else {
+ $httpBody = $companiesIdPatchRequest;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1531,48 +2018,59 @@ protected function companiesIdPatchRequest($id, $body)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'PATCH',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
}
/**
- * Operation companiesLinkUnlinkIdPatch
+ * Operation companiesImportPost
*
- * Link and Unlink company with contacts and deals
+ * Import companies(creation and updation)
*
- * @param string $id id (required)
- * @param \Brevo\Client\Model\Body4 $body Linked / Unlinked contacts and deals ids. (required)
+ * @param \SplFileObject|null $file The CSV file to upload.The file should have the first row as the mapping attribute. Some default attribute names are (a) company_id [brevo mongoID to update deals] (b) associated_contact (c) associated_deal (f) any other attribute with internal name (optional)
+ * @param object|null $mapping The mapping options in JSON format. Here is an example of the JSON structure: ```json { \\\"link_entities\\\": true, // Determines whether to link related entities during the import process \\\"unlink_entities\\\": false, // Determines whether to unlink related entities during the import process \\\"update_existing_records\\\": true, // Determines whether to update based on company ID or treat every row as create \\\"unset_empty_attributes\\\": false // Determines whether to unset a specific attribute during update if the values input is blank } ``` (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesImportPost'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return void
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CompaniesImportPost200Response|\Brevo\Client\Models\CompaniesImportPost400Response
*/
- public function companiesLinkUnlinkIdPatch($id, $body)
+ public function companiesImportPost(
+ ?\SplFileObject $file = null,
+ ?array $mapping = null,
+ string $contentType = self::contentTypes['companiesImportPost'][0]
+ ): \Brevo\Client\Models\CompaniesImportPost200Response
{
- $this->companiesLinkUnlinkIdPatchWithHttpInfo($id, $body);
+ list($response) = $this->companiesImportPostWithHttpInfo($file, $mapping, $contentType);
+ return $response;
}
/**
- * Operation companiesLinkUnlinkIdPatchWithHttpInfo
+ * Operation companiesImportPostWithHttpInfo
*
- * Link and Unlink company with contacts and deals
+ * Import companies(creation and updation)
*
- * @param string $id (required)
- * @param \Brevo\Client\Model\Body4 $body Linked / Unlinked contacts and deals ids. (required)
+ * @param \SplFileObject|null $file The CSV file to upload.The file should have the first row as the mapping attribute. Some default attribute names are (a) company_id [brevo mongoID to update deals] (b) associated_contact (c) associated_deal (f) any other attribute with internal name (optional)
+ * @param object|null $mapping The mapping options in JSON format. Here is an example of the JSON structure: ```json { \\\"link_entities\\\": true, // Determines whether to link related entities during the import process \\\"unlink_entities\\\": false, // Determines whether to unlink related entities during the import process \\\"update_existing_records\\\": true, // Determines whether to update based on company ID or treat every row as create \\\"unset_empty_attributes\\\": false // Determines whether to unset a specific attribute during update if the values input is blank } ``` (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesImportPost'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CompaniesImportPost200Response|\Brevo\Client\Models\CompaniesImportPost400Response, HTTP status code, HTTP response headers (array of strings)
*/
- public function companiesLinkUnlinkIdPatchWithHttpInfo($id, $body)
+ public function companiesImportPostWithHttpInfo(
+ ?\SplFileObject $file = null,
+ ?array $mapping = null,
+ string $contentType = self::contentTypes['companiesImportPost'][0]
+ ): array
{
- $returnType = '';
- $request = $this->companiesLinkUnlinkIdPatchRequest($id, $body);
+ $request = $this->companiesImportPostRequest($file, $mapping, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1581,26 +2079,404 @@ public function companiesLinkUnlinkIdPatchWithHttpInfo($id, $body)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\CompaniesImportPost200Response', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CompaniesImportPost200Response' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CompaniesImportPost200Response', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\CompaniesImportPost400Response', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CompaniesImportPost400Response' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CompaniesImportPost400Response', []),
+ $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 = '\Brevo\Client\Models\CompaniesImportPost200Response';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\CompaniesImportPost200Response',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\CompaniesImportPost400Response',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation companiesImportPostAsync
+ *
+ * Import companies(creation and updation)
+ *
+ * @param \SplFileObject|null $file The CSV file to upload.The file should have the first row as the mapping attribute. Some default attribute names are (a) company_id [brevo mongoID to update deals] (b) associated_contact (c) associated_deal (f) any other attribute with internal name (optional)
+ * @param object|null $mapping The mapping options in JSON format. Here is an example of the JSON structure: ```json { \\\"link_entities\\\": true, // Determines whether to link related entities during the import process \\\"unlink_entities\\\": false, // Determines whether to unlink related entities during the import process \\\"update_existing_records\\\": true, // Determines whether to update based on company ID or treat every row as create \\\"unset_empty_attributes\\\": false // Determines whether to unset a specific attribute during update if the values input is blank } ``` (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesImportPost'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function companiesImportPostAsync(
+ ?\SplFileObject $file = null,
+ ?array $mapping = null,
+ string $contentType = self::contentTypes['companiesImportPost'][0]
+ ): PromiseInterface
+ {
+ return $this->companiesImportPostAsyncWithHttpInfo($file, $mapping, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation companiesImportPostAsyncWithHttpInfo
+ *
+ * Import companies(creation and updation)
+ *
+ * @param \SplFileObject|null $file The CSV file to upload.The file should have the first row as the mapping attribute. Some default attribute names are (a) company_id [brevo mongoID to update deals] (b) associated_contact (c) associated_deal (f) any other attribute with internal name (optional)
+ * @param object|null $mapping The mapping options in JSON format. Here is an example of the JSON structure: ```json { \\\"link_entities\\\": true, // Determines whether to link related entities during the import process \\\"unlink_entities\\\": false, // Determines whether to unlink related entities during the import process \\\"update_existing_records\\\": true, // Determines whether to update based on company ID or treat every row as create \\\"unset_empty_attributes\\\": false // Determines whether to unset a specific attribute during update if the values input is blank } ``` (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesImportPost'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function companiesImportPostAsyncWithHttpInfo(
+ $file = null,
+ $mapping = null,
+ string $contentType = self::contentTypes['companiesImportPost'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\CompaniesImportPost200Response';
+ $request = $this->companiesImportPostRequest($file, $mapping, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'companiesImportPost'
+ *
+ * @param \SplFileObject|null $file The CSV file to upload.The file should have the first row as the mapping attribute. Some default attribute names are (a) company_id [brevo mongoID to update deals] (b) associated_contact (c) associated_deal (f) any other attribute with internal name (optional)
+ * @param object|null $mapping The mapping options in JSON format. Here is an example of the JSON structure: ```json { \\\"link_entities\\\": true, // Determines whether to link related entities during the import process \\\"unlink_entities\\\": false, // Determines whether to unlink related entities during the import process \\\"update_existing_records\\\": true, // Determines whether to update based on company ID or treat every row as create \\\"unset_empty_attributes\\\": false // Determines whether to unset a specific attribute during update if the values input is blank } ``` (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesImportPost'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function companiesImportPostRequest(
+ $file = null,
+ $mapping = null,
+ string $contentType = self::contentTypes['companiesImportPost'][0]
+ ): Request
+ {
+
+
+
+
+ $resourcePath = '/companies/import';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+
+ // form params
+ if ($file !== null) {
+ $multipart = true;
+ $formParams['file'] = [];
+ $paramFiles = is_array($file) ? $file : [$file];
+ foreach ($paramFiles as $paramFile) {
+ $formParams['file'][] = $paramFile instanceof \Psr\Http\Message\StreamInterface
+ ? $paramFile
+ : \GuzzleHttp\Psr7\Utils::tryFopen(
+ ObjectSerializer::toFormValue($paramFile),
+ 'rb'
+ );
+ }
+ }
+ // form params
+ if ($mapping !== null) {
+ $formParams['mapping'] = ObjectSerializer::toFormValue($mapping);
+ }
+
+ $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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 companiesLinkUnlinkIdPatch
+ *
+ * Link and Unlink company with contact and deal
+ *
+ * @param string $id id (required)
+ * @param \Brevo\Client\Models\CompaniesLinkUnlinkIdPatchRequest $companiesLinkUnlinkIdPatchRequest Linked / Unlinked contacts and deals ids. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesLinkUnlinkIdPatch'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return void
+ */
+ public function companiesLinkUnlinkIdPatch(
+ string $id,
+ \Brevo\Client\Models\CompaniesLinkUnlinkIdPatchRequest $companiesLinkUnlinkIdPatchRequest,
+ string $contentType = self::contentTypes['companiesLinkUnlinkIdPatch'][0]
+ ): void
+ {
+ $this->companiesLinkUnlinkIdPatchWithHttpInfo($id, $companiesLinkUnlinkIdPatchRequest, $contentType);
+ }
+
+ /**
+ * Operation companiesLinkUnlinkIdPatchWithHttpInfo
+ *
+ * Link and Unlink company with contact and deal
+ *
+ * @param string $id (required)
+ * @param \Brevo\Client\Models\CompaniesLinkUnlinkIdPatchRequest $companiesLinkUnlinkIdPatchRequest Linked / Unlinked contacts and deals ids. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesLinkUnlinkIdPatch'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function companiesLinkUnlinkIdPatchWithHttpInfo(
+ string $id,
+ \Brevo\Client\Models\CompaniesLinkUnlinkIdPatchRequest $companiesLinkUnlinkIdPatchRequest,
+ string $contentType = self::contentTypes['companiesLinkUnlinkIdPatch'][0]
+ ): array
+ {
+ $request = $this->companiesLinkUnlinkIdPatchRequest($id, $companiesLinkUnlinkIdPatchRequest, $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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -1609,7 +2485,7 @@ public function companiesLinkUnlinkIdPatchWithHttpInfo($id, $body)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1622,17 +2498,22 @@ public function companiesLinkUnlinkIdPatchWithHttpInfo($id, $body)
/**
* Operation companiesLinkUnlinkIdPatchAsync
*
- * Link and Unlink company with contacts and deals
+ * Link and Unlink company with contact and deal
*
* @param string $id (required)
- * @param \Brevo\Client\Model\Body4 $body Linked / Unlinked contacts and deals ids. (required)
+ * @param \Brevo\Client\Models\CompaniesLinkUnlinkIdPatchRequest $companiesLinkUnlinkIdPatchRequest Linked / Unlinked contacts and deals ids. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesLinkUnlinkIdPatch'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function companiesLinkUnlinkIdPatchAsync($id, $body)
+ public function companiesLinkUnlinkIdPatchAsync(
+ string $id,
+ \Brevo\Client\Models\CompaniesLinkUnlinkIdPatchRequest $companiesLinkUnlinkIdPatchRequest,
+ string $contentType = self::contentTypes['companiesLinkUnlinkIdPatch'][0]
+ ): PromiseInterface
{
- return $this->companiesLinkUnlinkIdPatchAsyncWithHttpInfo($id, $body)
+ return $this->companiesLinkUnlinkIdPatchAsyncWithHttpInfo($id, $companiesLinkUnlinkIdPatchRequest, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1643,18 +2524,24 @@ function ($response) {
/**
* Operation companiesLinkUnlinkIdPatchAsyncWithHttpInfo
*
- * Link and Unlink company with contacts and deals
+ * Link and Unlink company with contact and deal
*
* @param string $id (required)
- * @param \Brevo\Client\Model\Body4 $body Linked / Unlinked contacts and deals ids. (required)
+ * @param \Brevo\Client\Models\CompaniesLinkUnlinkIdPatchRequest $companiesLinkUnlinkIdPatchRequest Linked / Unlinked contacts and deals ids. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesLinkUnlinkIdPatch'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function companiesLinkUnlinkIdPatchAsyncWithHttpInfo($id, $body)
+ public function companiesLinkUnlinkIdPatchAsyncWithHttpInfo(
+ $id,
+ $companiesLinkUnlinkIdPatchRequest,
+ string $contentType = self::contentTypes['companiesLinkUnlinkIdPatch'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->companiesLinkUnlinkIdPatchRequest($id, $body);
+ $request = $this->companiesLinkUnlinkIdPatchRequest($id, $companiesLinkUnlinkIdPatchRequest, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -1673,7 +2560,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1683,26 +2570,34 @@ function ($exception) {
* Create request for operation 'companiesLinkUnlinkIdPatch'
*
* @param string $id (required)
- * @param \Brevo\Client\Model\Body4 $body Linked / Unlinked contacts and deals ids. (required)
+ * @param \Brevo\Client\Models\CompaniesLinkUnlinkIdPatchRequest $companiesLinkUnlinkIdPatchRequest Linked / Unlinked contacts and deals ids. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesLinkUnlinkIdPatch'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function companiesLinkUnlinkIdPatchRequest($id, $body)
+ public function companiesLinkUnlinkIdPatchRequest(
+ $id,
+ $companiesLinkUnlinkIdPatchRequest,
+ string $contentType = self::contentTypes['companiesLinkUnlinkIdPatch'][0]
+ ): Request
{
+
// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $id when calling companiesLinkUnlinkIdPatch'
);
}
- // verify the required parameter 'body' is set
- if ($body === null || (is_array($body) && count($body) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $body when calling companiesLinkUnlinkIdPatch'
+
+ // verify the required parameter 'companiesLinkUnlinkIdPatchRequest' is set
+ if ($companiesLinkUnlinkIdPatchRequest === null || (is_array($companiesLinkUnlinkIdPatchRequest) && count($companiesLinkUnlinkIdPatchRequest) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $companiesLinkUnlinkIdPatchRequest when calling companiesLinkUnlinkIdPatch'
);
}
+
$resourcePath = '/companies/link-unlink/{id}';
$formParams = [];
$queryParams = [];
@@ -1711,6 +2606,7 @@ protected function companiesLinkUnlinkIdPatchRequest($id, $body)
$multipart = false;
+
// path params
if ($id !== null) {
$resourcePath = str_replace(
@@ -1720,56 +2616,42 @@ protected function companiesLinkUnlinkIdPatchRequest($id, $body)
);
}
- // body params
- $_tempBody = null;
- if (isset($body)) {
- $_tempBody = $body;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($companiesLinkUnlinkIdPatchRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($companiesLinkUnlinkIdPatchRequest));
+ } else {
+ $httpBody = $companiesLinkUnlinkIdPatchRequest;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1795,10 +2677,11 @@ protected function companiesLinkUnlinkIdPatchRequest($id, $body)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'PATCH',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1809,15 +2692,19 @@ protected function companiesLinkUnlinkIdPatchRequest($id, $body)
*
* Create a company
*
- * @param \Brevo\Client\Model\Body2 $body Company create data. (required)
+ * @param \Brevo\Client\Models\CompaniesPostRequest $companiesPostRequest Company create data. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesPost'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\InlineResponse2001
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CompaniesPost200Response|\Brevo\Client\Models\ErrorModel
*/
- public function companiesPost($body)
+ public function companiesPost(
+ \Brevo\Client\Models\CompaniesPostRequest $companiesPostRequest,
+ string $contentType = self::contentTypes['companiesPost'][0]
+ ): \Brevo\Client\Models\CompaniesPost200Response
{
- list($response) = $this->companiesPostWithHttpInfo($body);
+ list($response) = $this->companiesPostWithHttpInfo($companiesPostRequest, $contentType);
return $response;
}
@@ -1826,16 +2713,19 @@ public function companiesPost($body)
*
* Create a company
*
- * @param \Brevo\Client\Model\Body2 $body Company create data. (required)
+ * @param \Brevo\Client\Models\CompaniesPostRequest $companiesPostRequest Company create data. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesPost'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\InlineResponse2001, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CompaniesPost200Response|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function companiesPostWithHttpInfo($body)
+ public function companiesPostWithHttpInfo(
+ \Brevo\Client\Models\CompaniesPostRequest $companiesPostRequest,
+ string $contentType = self::contentTypes['companiesPost'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\InlineResponse2001';
- $request = $this->companiesPostRequest($body);
+ $request = $this->companiesPostRequest($companiesPostRequest, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1844,34 +2734,111 @@ public function companiesPostWithHttpInfo($body)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\CompaniesPost200Response', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CompaniesPost200Response' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CompaniesPost200Response', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CompaniesPost200Response';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1886,7 +2853,15 @@ public function companiesPostWithHttpInfo($body)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\InlineResponse2001',
+ '\Brevo\Client\Models\CompaniesPost200Response',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1901,14 +2876,18 @@ public function companiesPostWithHttpInfo($body)
*
* Create a company
*
- * @param \Brevo\Client\Model\Body2 $body Company create data. (required)
+ * @param \Brevo\Client\Models\CompaniesPostRequest $companiesPostRequest Company create data. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function companiesPostAsync($body)
+ public function companiesPostAsync(
+ \Brevo\Client\Models\CompaniesPostRequest $companiesPostRequest,
+ string $contentType = self::contentTypes['companiesPost'][0]
+ ): PromiseInterface
{
- return $this->companiesPostAsyncWithHttpInfo($body)
+ return $this->companiesPostAsyncWithHttpInfo($companiesPostRequest, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1921,25 +2900,29 @@ function ($response) {
*
* Create a company
*
- * @param \Brevo\Client\Model\Body2 $body Company create data. (required)
+ * @param \Brevo\Client\Models\CompaniesPostRequest $companiesPostRequest Company create data. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function companiesPostAsyncWithHttpInfo($body)
+ public function companiesPostAsyncWithHttpInfo(
+ $companiesPostRequest,
+ string $contentType = self::contentTypes['companiesPost'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\InlineResponse2001';
- $request = $this->companiesPostRequest($body);
+ $returnType = '\Brevo\Client\Models\CompaniesPost200Response';
+ $request = $this->companiesPostRequest($companiesPostRequest, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1962,7 +2945,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1971,20 +2954,26 @@ function ($exception) {
/**
* Create request for operation 'companiesPost'
*
- * @param \Brevo\Client\Model\Body2 $body Company create data. (required)
+ * @param \Brevo\Client\Models\CompaniesPostRequest $companiesPostRequest Company create data. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function companiesPostRequest($body)
+ public function companiesPostRequest(
+ $companiesPostRequest,
+ string $contentType = self::contentTypes['companiesPost'][0]
+ ): Request
{
- // verify the required parameter 'body' is set
- if ($body === null || (is_array($body) && count($body) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $body when calling companiesPost'
+
+ // verify the required parameter 'companiesPostRequest' is set
+ if ($companiesPostRequest === null || (is_array($companiesPostRequest) && count($companiesPostRequest) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $companiesPostRequest when calling companiesPost'
);
}
+
$resourcePath = '/companies';
$formParams = [];
$queryParams = [];
@@ -1994,56 +2983,43 @@ protected function companiesPostRequest($body)
- // body params
- $_tempBody = null;
- if (isset($body)) {
- $_tempBody = $body;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($companiesPostRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($companiesPostRequest));
+ } else {
+ $httpBody = $companiesPostRequest;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -2069,10 +3045,11 @@ protected function companiesPostRequest($body)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -2084,7 +3061,7 @@ protected function companiesPostRequest($body)
* @throws \RuntimeException on file opening failure
* @return array of http client options
*/
- protected function createHttpClientOption()
+ protected function createHttpClientOption(): array
{
$options = [];
if ($this->config->getDebug()) {
diff --git a/lib/Api/ContactsApi.php b/lib/Api/ContactsApi.php
index 8b5dc55..45bf389 100644
--- a/lib/Api/ContactsApi.php
+++ b/lib/Api/ContactsApi.php
@@ -1,12 +1,11 @@
[
+ 'application/json',
+ ],
+ 'createAttribute' => [
+ 'application/json',
+ ],
+ 'createContact' => [
+ 'application/json',
+ ],
+ 'createDoiContact' => [
+ 'application/json',
+ ],
+ 'createFolder' => [
+ 'application/json',
+ ],
+ 'createList' => [
+ 'application/json',
+ ],
+ 'deleteAttribute' => [
+ 'application/json',
+ ],
+ 'deleteContact' => [
+ 'application/json',
+ ],
+ 'deleteFolder' => [
+ 'application/json',
+ ],
+ 'deleteList' => [
+ 'application/json',
+ ],
+ 'deleteMultiAttributeOptions' => [
+ 'application/json',
+ ],
+ 'getAttributes' => [
+ 'application/json',
+ ],
+ 'getContactInfo' => [
+ 'application/json',
+ ],
+ 'getContactStats' => [
+ 'application/json',
+ ],
+ 'getContacts' => [
+ 'application/json',
+ ],
+ 'getContactsFromList' => [
+ 'application/json',
+ ],
+ 'getFolder' => [
+ 'application/json',
+ ],
+ 'getFolderLists' => [
+ 'application/json',
+ ],
+ 'getFolders' => [
+ 'application/json',
+ ],
+ 'getList' => [
+ 'application/json',
+ ],
+ 'getLists' => [
+ 'application/json',
+ ],
+ 'getSegments' => [
+ 'application/json',
+ ],
+ 'importContacts' => [
+ 'application/json',
+ ],
+ 'removeContactFromList' => [
+ 'application/json',
+ ],
+ 'requestContactExport' => [
+ 'application/json',
+ ],
+ 'updateAttribute' => [
+ 'application/json',
+ ],
+ 'updateBatchContacts' => [
+ 'application/json',
+ ],
+ 'updateContact' => [
+ 'application/json',
+ ],
+ 'updateFolder' => [
+ 'application/json',
+ ],
+ 'updateList' => [
+ 'application/json',
+ ],
+ ];
+
+ /**
+ * @param ClientInterface|null $client
+ * @param Configuration|null $config
+ * @param HeaderSelector|null $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
+ HeaderSelector $selector = null,
+ int $hostIndex = 0
) {
$this->client = $client ?: new Client();
- $this->config = $config ?: new Configuration();
+ $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(int $hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex(): int
+ {
+ return $this->hostIndex;
}
/**
* @return Configuration
*/
- public function getConfig()
+ public function getConfig(): Configuration
{
return $this->config;
}
@@ -93,15 +216,20 @@ public function getConfig()
* Add existing contacts to a list
*
* @param int $listId Id of the list (required)
- * @param \Brevo\Client\Model\AddContactToList $contactEmails Emails addresses OR IDs of the contacts (required)
+ * @param \Brevo\Client\Models\AddContactToListRequest $addContactToListRequest Emails addresses OR IDs OR EXT_ID attributes of the contacts (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addContactToList'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\PostContactInfo
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\PostContactInfo|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function addContactToList($listId, $contactEmails)
+ public function addContactToList(
+ int $listId,
+ \Brevo\Client\Models\AddContactToListRequest $addContactToListRequest,
+ string $contentType = self::contentTypes['addContactToList'][0]
+ ): \Brevo\Client\Models\PostContactInfo
{
- list($response) = $this->addContactToListWithHttpInfo($listId, $contactEmails);
+ list($response) = $this->addContactToListWithHttpInfo($listId, $addContactToListRequest, $contentType);
return $response;
}
@@ -111,16 +239,20 @@ public function addContactToList($listId, $contactEmails)
* Add existing contacts to a list
*
* @param int $listId Id of the list (required)
- * @param \Brevo\Client\Model\AddContactToList $contactEmails Emails addresses OR IDs of the contacts (required)
+ * @param \Brevo\Client\Models\AddContactToListRequest $addContactToListRequest Emails addresses OR IDs OR EXT_ID attributes of the contacts (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addContactToList'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\PostContactInfo, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\PostContactInfo|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function addContactToListWithHttpInfo($listId, $contactEmails)
+ public function addContactToListWithHttpInfo(
+ int $listId,
+ \Brevo\Client\Models\AddContactToListRequest $addContactToListRequest,
+ string $contentType = self::contentTypes['addContactToList'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\PostContactInfo';
- $request = $this->addContactToListRequest($listId, $contactEmails);
+ $request = $this->addContactToListRequest($listId, $addContactToListRequest, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -129,34 +261,138 @@ public function addContactToListWithHttpInfo($listId, $contactEmails)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 201:
+ if (in_array('\Brevo\Client\Models\PostContactInfo', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\PostContactInfo' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\PostContactInfo', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\PostContactInfo';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -171,7 +407,7 @@ public function addContactToListWithHttpInfo($listId, $contactEmails)
case 201:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\PostContactInfo',
+ '\Brevo\Client\Models\PostContactInfo',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -179,7 +415,7 @@ public function addContactToListWithHttpInfo($listId, $contactEmails)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -187,7 +423,7 @@ public function addContactToListWithHttpInfo($listId, $contactEmails)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -203,14 +439,19 @@ public function addContactToListWithHttpInfo($listId, $contactEmails)
* Add existing contacts to a list
*
* @param int $listId Id of the list (required)
- * @param \Brevo\Client\Model\AddContactToList $contactEmails Emails addresses OR IDs of the contacts (required)
+ * @param \Brevo\Client\Models\AddContactToListRequest $addContactToListRequest Emails addresses OR IDs OR EXT_ID attributes of the contacts (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addContactToList'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function addContactToListAsync($listId, $contactEmails)
+ public function addContactToListAsync(
+ int $listId,
+ \Brevo\Client\Models\AddContactToListRequest $addContactToListRequest,
+ string $contentType = self::contentTypes['addContactToList'][0]
+ ): PromiseInterface
{
- return $this->addContactToListAsyncWithHttpInfo($listId, $contactEmails)
+ return $this->addContactToListAsyncWithHttpInfo($listId, $addContactToListRequest, $contentType)
->then(
function ($response) {
return $response[0];
@@ -224,25 +465,30 @@ function ($response) {
* Add existing contacts to a list
*
* @param int $listId Id of the list (required)
- * @param \Brevo\Client\Model\AddContactToList $contactEmails Emails addresses OR IDs of the contacts (required)
+ * @param \Brevo\Client\Models\AddContactToListRequest $addContactToListRequest Emails addresses OR IDs OR EXT_ID attributes of the contacts (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addContactToList'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function addContactToListAsyncWithHttpInfo($listId, $contactEmails)
+ public function addContactToListAsyncWithHttpInfo(
+ $listId,
+ $addContactToListRequest,
+ string $contentType = self::contentTypes['addContactToList'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\PostContactInfo';
- $request = $this->addContactToListRequest($listId, $contactEmails);
+ $returnType = '\Brevo\Client\Models\PostContactInfo';
+ $request = $this->addContactToListRequest($listId, $addContactToListRequest, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -265,7 +511,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -275,26 +521,34 @@ function ($exception) {
* Create request for operation 'addContactToList'
*
* @param int $listId Id of the list (required)
- * @param \Brevo\Client\Model\AddContactToList $contactEmails Emails addresses OR IDs of the contacts (required)
+ * @param \Brevo\Client\Models\AddContactToListRequest $addContactToListRequest Emails addresses OR IDs OR EXT_ID attributes of the contacts (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addContactToList'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function addContactToListRequest($listId, $contactEmails)
+ public function addContactToListRequest(
+ $listId,
+ $addContactToListRequest,
+ string $contentType = self::contentTypes['addContactToList'][0]
+ ): Request
{
+
// verify the required parameter 'listId' is set
if ($listId === null || (is_array($listId) && count($listId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $listId when calling addContactToList'
);
}
- // verify the required parameter 'contactEmails' is set
- if ($contactEmails === null || (is_array($contactEmails) && count($contactEmails) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $contactEmails when calling addContactToList'
+
+ // verify the required parameter 'addContactToListRequest' is set
+ if ($addContactToListRequest === null || (is_array($addContactToListRequest) && count($addContactToListRequest) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $addContactToListRequest when calling addContactToList'
);
}
+
$resourcePath = '/contacts/lists/{listId}/contacts/add';
$formParams = [];
$queryParams = [];
@@ -303,6 +557,7 @@ protected function addContactToListRequest($listId, $contactEmails)
$multipart = false;
+
// path params
if ($listId !== null) {
$resourcePath = str_replace(
@@ -312,56 +567,42 @@ protected function addContactToListRequest($listId, $contactEmails)
);
}
- // body params
- $_tempBody = null;
- if (isset($contactEmails)) {
- $_tempBody = $contactEmails;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($addContactToListRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($addContactToListRequest));
+ } else {
+ $httpBody = $addContactToListRequest;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -387,10 +628,11 @@ protected function addContactToListRequest($listId, $contactEmails)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -403,15 +645,21 @@ protected function addContactToListRequest($listId, $contactEmails)
*
* @param string $attributeCategory Category of the attribute (required)
* @param string $attributeName Name of the attribute (required)
- * @param \Brevo\Client\Model\CreateAttribute $createAttribute Values to create an attribute (required)
+ * @param \Brevo\Client\Models\CreateAttribute $createAttribute Values to create an attribute (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAttribute'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function createAttribute($attributeCategory, $attributeName, $createAttribute)
+ public function createAttribute(
+ string $attributeCategory,
+ string $attributeName,
+ \Brevo\Client\Models\CreateAttribute $createAttribute,
+ string $contentType = self::contentTypes['createAttribute'][0]
+ ): void
{
- $this->createAttributeWithHttpInfo($attributeCategory, $attributeName, $createAttribute);
+ $this->createAttributeWithHttpInfo($attributeCategory, $attributeName, $createAttribute, $contentType);
}
/**
@@ -421,16 +669,21 @@ public function createAttribute($attributeCategory, $attributeName, $createAttri
*
* @param string $attributeCategory Category of the attribute (required)
* @param string $attributeName Name of the attribute (required)
- * @param \Brevo\Client\Model\CreateAttribute $createAttribute Values to create an attribute (required)
+ * @param \Brevo\Client\Models\CreateAttribute $createAttribute Values to create an attribute (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAttribute'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function createAttributeWithHttpInfo($attributeCategory, $attributeName, $createAttribute)
+ public function createAttributeWithHttpInfo(
+ string $attributeCategory,
+ string $attributeName,
+ \Brevo\Client\Models\CreateAttribute $createAttribute,
+ string $contentType = self::contentTypes['createAttribute'][0]
+ ): array
{
- $returnType = '';
- $request = $this->createAttributeRequest($attributeCategory, $attributeName, $createAttribute);
+ $request = $this->createAttributeRequest($attributeCategory, $attributeName, $createAttribute, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -439,26 +692,21 @@ public function createAttributeWithHttpInfo($attributeCategory, $attributeName,
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -467,7 +715,7 @@ public function createAttributeWithHttpInfo($attributeCategory, $attributeName,
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -484,14 +732,20 @@ public function createAttributeWithHttpInfo($attributeCategory, $attributeName,
*
* @param string $attributeCategory Category of the attribute (required)
* @param string $attributeName Name of the attribute (required)
- * @param \Brevo\Client\Model\CreateAttribute $createAttribute Values to create an attribute (required)
+ * @param \Brevo\Client\Models\CreateAttribute $createAttribute Values to create an attribute (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAttribute'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createAttributeAsync($attributeCategory, $attributeName, $createAttribute)
+ public function createAttributeAsync(
+ string $attributeCategory,
+ string $attributeName,
+ \Brevo\Client\Models\CreateAttribute $createAttribute,
+ string $contentType = self::contentTypes['createAttribute'][0]
+ ): PromiseInterface
{
- return $this->createAttributeAsyncWithHttpInfo($attributeCategory, $attributeName, $createAttribute)
+ return $this->createAttributeAsyncWithHttpInfo($attributeCategory, $attributeName, $createAttribute, $contentType)
->then(
function ($response) {
return $response[0];
@@ -506,15 +760,22 @@ function ($response) {
*
* @param string $attributeCategory Category of the attribute (required)
* @param string $attributeName Name of the attribute (required)
- * @param \Brevo\Client\Model\CreateAttribute $createAttribute Values to create an attribute (required)
+ * @param \Brevo\Client\Models\CreateAttribute $createAttribute Values to create an attribute (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAttribute'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createAttributeAsyncWithHttpInfo($attributeCategory, $attributeName, $createAttribute)
+ public function createAttributeAsyncWithHttpInfo(
+ $attributeCategory,
+ $attributeName,
+ $createAttribute,
+ string $contentType = self::contentTypes['createAttribute'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->createAttributeRequest($attributeCategory, $attributeName, $createAttribute);
+ $request = $this->createAttributeRequest($attributeCategory, $attributeName, $createAttribute, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -533,7 +794,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -544,32 +805,42 @@ function ($exception) {
*
* @param string $attributeCategory Category of the attribute (required)
* @param string $attributeName Name of the attribute (required)
- * @param \Brevo\Client\Model\CreateAttribute $createAttribute Values to create an attribute (required)
+ * @param \Brevo\Client\Models\CreateAttribute $createAttribute Values to create an attribute (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAttribute'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function createAttributeRequest($attributeCategory, $attributeName, $createAttribute)
+ public function createAttributeRequest(
+ $attributeCategory,
+ $attributeName,
+ $createAttribute,
+ string $contentType = self::contentTypes['createAttribute'][0]
+ ): Request
{
+
// verify the required parameter 'attributeCategory' is set
if ($attributeCategory === null || (is_array($attributeCategory) && count($attributeCategory) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $attributeCategory when calling createAttribute'
);
}
+
// verify the required parameter 'attributeName' is set
if ($attributeName === null || (is_array($attributeName) && count($attributeName) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $attributeName when calling createAttribute'
);
}
+
// verify the required parameter 'createAttribute' is set
if ($createAttribute === null || (is_array($createAttribute) && count($createAttribute) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $createAttribute when calling createAttribute'
);
}
+
$resourcePath = '/contacts/attributes/{attributeCategory}/{attributeName}';
$formParams = [];
$queryParams = [];
@@ -578,6 +849,7 @@ protected function createAttributeRequest($attributeCategory, $attributeName, $c
$multipart = false;
+
// path params
if ($attributeCategory !== null) {
$resourcePath = str_replace(
@@ -595,56 +867,42 @@ protected function createAttributeRequest($attributeCategory, $attributeName, $c
);
}
- // body params
- $_tempBody = null;
- if (isset($createAttribute)) {
- $_tempBody = $createAttribute;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($createAttribute)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createAttribute));
+ } else {
+ $httpBody = $createAttribute;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -670,10 +928,11 @@ protected function createAttributeRequest($attributeCategory, $attributeName, $c
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -684,15 +943,19 @@ protected function createAttributeRequest($attributeCategory, $attributeName, $c
*
* Create a contact
*
- * @param \Brevo\Client\Model\CreateContact $createContact Values to create a contact (required)
+ * @param \Brevo\Client\Models\CreateContact $createContact Values to create a contact (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createContact'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\CreateUpdateContactModel
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CreateUpdateContactModel|\Brevo\Client\Models\ContactErrorModel|\Brevo\Client\Models\ContactErrorModel
*/
- public function createContact($createContact)
+ public function createContact(
+ \Brevo\Client\Models\CreateContact $createContact,
+ string $contentType = self::contentTypes['createContact'][0]
+ ): \Brevo\Client\Models\CreateUpdateContactModel
{
- list($response) = $this->createContactWithHttpInfo($createContact);
+ list($response) = $this->createContactWithHttpInfo($createContact, $contentType);
return $response;
}
@@ -701,16 +964,19 @@ public function createContact($createContact)
*
* Create a contact
*
- * @param \Brevo\Client\Model\CreateContact $createContact Values to create a contact (required)
+ * @param \Brevo\Client\Models\CreateContact $createContact Values to create a contact (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createContact'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\CreateUpdateContactModel, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CreateUpdateContactModel|\Brevo\Client\Models\ContactErrorModel|\Brevo\Client\Models\ContactErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function createContactWithHttpInfo($createContact)
+ public function createContactWithHttpInfo(
+ \Brevo\Client\Models\CreateContact $createContact,
+ string $contentType = self::contentTypes['createContact'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\CreateUpdateContactModel';
- $request = $this->createContactRequest($createContact);
+ $request = $this->createContactRequest($createContact, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -719,34 +985,138 @@ public function createContactWithHttpInfo($createContact)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 201:
+ if (in_array('\Brevo\Client\Models\CreateUpdateContactModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CreateUpdateContactModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CreateUpdateContactModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ContactErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ContactErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ContactErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 425:
+ if (in_array('\Brevo\Client\Models\ContactErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ContactErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ContactErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CreateUpdateContactModel';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -761,7 +1131,7 @@ public function createContactWithHttpInfo($createContact)
case 201:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\CreateUpdateContactModel',
+ '\Brevo\Client\Models\CreateUpdateContactModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -769,7 +1139,7 @@ public function createContactWithHttpInfo($createContact)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ContactErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -777,7 +1147,7 @@ public function createContactWithHttpInfo($createContact)
case 425:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ContactErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -792,14 +1162,18 @@ public function createContactWithHttpInfo($createContact)
*
* Create a contact
*
- * @param \Brevo\Client\Model\CreateContact $createContact Values to create a contact (required)
+ * @param \Brevo\Client\Models\CreateContact $createContact Values to create a contact (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createContact'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createContactAsync($createContact)
+ public function createContactAsync(
+ \Brevo\Client\Models\CreateContact $createContact,
+ string $contentType = self::contentTypes['createContact'][0]
+ ): PromiseInterface
{
- return $this->createContactAsyncWithHttpInfo($createContact)
+ return $this->createContactAsyncWithHttpInfo($createContact, $contentType)
->then(
function ($response) {
return $response[0];
@@ -812,25 +1186,29 @@ function ($response) {
*
* Create a contact
*
- * @param \Brevo\Client\Model\CreateContact $createContact Values to create a contact (required)
+ * @param \Brevo\Client\Models\CreateContact $createContact Values to create a contact (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createContact'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createContactAsyncWithHttpInfo($createContact)
+ public function createContactAsyncWithHttpInfo(
+ $createContact,
+ string $contentType = self::contentTypes['createContact'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\CreateUpdateContactModel';
- $request = $this->createContactRequest($createContact);
+ $returnType = '\Brevo\Client\Models\CreateUpdateContactModel';
+ $request = $this->createContactRequest($createContact, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -853,7 +1231,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -862,20 +1240,26 @@ function ($exception) {
/**
* Create request for operation 'createContact'
*
- * @param \Brevo\Client\Model\CreateContact $createContact Values to create a contact (required)
+ * @param \Brevo\Client\Models\CreateContact $createContact Values to create a contact (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createContact'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function createContactRequest($createContact)
+ public function createContactRequest(
+ $createContact,
+ string $contentType = self::contentTypes['createContact'][0]
+ ): Request
{
+
// verify the required parameter 'createContact' is set
if ($createContact === null || (is_array($createContact) && count($createContact) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $createContact when calling createContact'
);
}
+
$resourcePath = '/contacts';
$formParams = [];
$queryParams = [];
@@ -885,56 +1269,43 @@ protected function createContactRequest($createContact)
- // body params
- $_tempBody = null;
- if (isset($createContact)) {
- $_tempBody = $createContact;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($createContact)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createContact));
+ } else {
+ $httpBody = $createContact;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -960,10 +1331,11 @@ protected function createContactRequest($createContact)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -974,15 +1346,19 @@ protected function createContactRequest($createContact)
*
* Create Contact via DOI (Double-Opt-In) Flow
*
- * @param \Brevo\Client\Model\CreateDoiContact $createDoiContact Values to create the Double opt-in (DOI) contact (required)
+ * @param \Brevo\Client\Models\CreateDoiContact $createDoiContact Values to create the Double opt-in (DOI) contact (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDoiContact'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function createDoiContact($createDoiContact)
+ public function createDoiContact(
+ \Brevo\Client\Models\CreateDoiContact $createDoiContact,
+ string $contentType = self::contentTypes['createDoiContact'][0]
+ ): void
{
- $this->createDoiContactWithHttpInfo($createDoiContact);
+ $this->createDoiContactWithHttpInfo($createDoiContact, $contentType);
}
/**
@@ -990,16 +1366,19 @@ public function createDoiContact($createDoiContact)
*
* Create Contact via DOI (Double-Opt-In) Flow
*
- * @param \Brevo\Client\Model\CreateDoiContact $createDoiContact Values to create the Double opt-in (DOI) contact (required)
+ * @param \Brevo\Client\Models\CreateDoiContact $createDoiContact Values to create the Double opt-in (DOI) contact (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDoiContact'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function createDoiContactWithHttpInfo($createDoiContact)
+ public function createDoiContactWithHttpInfo(
+ \Brevo\Client\Models\CreateDoiContact $createDoiContact,
+ string $contentType = self::contentTypes['createDoiContact'][0]
+ ): array
{
- $returnType = '';
- $request = $this->createDoiContactRequest($createDoiContact);
+ $request = $this->createDoiContactRequest($createDoiContact, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1008,26 +1387,21 @@ public function createDoiContactWithHttpInfo($createDoiContact)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -1036,7 +1410,7 @@ public function createDoiContactWithHttpInfo($createDoiContact)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1051,14 +1425,18 @@ public function createDoiContactWithHttpInfo($createDoiContact)
*
* Create Contact via DOI (Double-Opt-In) Flow
*
- * @param \Brevo\Client\Model\CreateDoiContact $createDoiContact Values to create the Double opt-in (DOI) contact (required)
+ * @param \Brevo\Client\Models\CreateDoiContact $createDoiContact Values to create the Double opt-in (DOI) contact (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDoiContact'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createDoiContactAsync($createDoiContact)
+ public function createDoiContactAsync(
+ \Brevo\Client\Models\CreateDoiContact $createDoiContact,
+ string $contentType = self::contentTypes['createDoiContact'][0]
+ ): PromiseInterface
{
- return $this->createDoiContactAsyncWithHttpInfo($createDoiContact)
+ return $this->createDoiContactAsyncWithHttpInfo($createDoiContact, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1071,15 +1449,20 @@ function ($response) {
*
* Create Contact via DOI (Double-Opt-In) Flow
*
- * @param \Brevo\Client\Model\CreateDoiContact $createDoiContact Values to create the Double opt-in (DOI) contact (required)
+ * @param \Brevo\Client\Models\CreateDoiContact $createDoiContact Values to create the Double opt-in (DOI) contact (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDoiContact'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createDoiContactAsyncWithHttpInfo($createDoiContact)
+ public function createDoiContactAsyncWithHttpInfo(
+ $createDoiContact,
+ string $contentType = self::contentTypes['createDoiContact'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->createDoiContactRequest($createDoiContact);
+ $request = $this->createDoiContactRequest($createDoiContact, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -1098,7 +1481,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1107,20 +1490,26 @@ function ($exception) {
/**
* Create request for operation 'createDoiContact'
*
- * @param \Brevo\Client\Model\CreateDoiContact $createDoiContact Values to create the Double opt-in (DOI) contact (required)
+ * @param \Brevo\Client\Models\CreateDoiContact $createDoiContact Values to create the Double opt-in (DOI) contact (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDoiContact'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function createDoiContactRequest($createDoiContact)
+ public function createDoiContactRequest(
+ $createDoiContact,
+ string $contentType = self::contentTypes['createDoiContact'][0]
+ ): Request
{
+
// verify the required parameter 'createDoiContact' is set
if ($createDoiContact === null || (is_array($createDoiContact) && count($createDoiContact) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $createDoiContact when calling createDoiContact'
);
}
+
$resourcePath = '/contacts/doubleOptinConfirmation';
$formParams = [];
$queryParams = [];
@@ -1130,56 +1519,43 @@ protected function createDoiContactRequest($createDoiContact)
- // body params
- $_tempBody = null;
- if (isset($createDoiContact)) {
- $_tempBody = $createDoiContact;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($createDoiContact)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createDoiContact));
+ } else {
+ $httpBody = $createDoiContact;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1205,10 +1581,11 @@ protected function createDoiContactRequest($createDoiContact)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1219,15 +1596,19 @@ protected function createDoiContactRequest($createDoiContact)
*
* Create a folder
*
- * @param \Brevo\Client\Model\CreateUpdateFolder $createFolder Name of the folder (required)
+ * @param \Brevo\Client\Models\CreateUpdateFolder $createFolder Name of the folder (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createFolder'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\CreateModel
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CreateModel|\Brevo\Client\Models\ErrorModel
*/
- public function createFolder($createFolder)
+ public function createFolder(
+ \Brevo\Client\Models\CreateUpdateFolder $createFolder,
+ string $contentType = self::contentTypes['createFolder'][0]
+ ): \Brevo\Client\Models\CreateModel
{
- list($response) = $this->createFolderWithHttpInfo($createFolder);
+ list($response) = $this->createFolderWithHttpInfo($createFolder, $contentType);
return $response;
}
@@ -1236,16 +1617,19 @@ public function createFolder($createFolder)
*
* Create a folder
*
- * @param \Brevo\Client\Model\CreateUpdateFolder $createFolder Name of the folder (required)
+ * @param \Brevo\Client\Models\CreateUpdateFolder $createFolder Name of the folder (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createFolder'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\CreateModel, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CreateModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function createFolderWithHttpInfo($createFolder)
+ public function createFolderWithHttpInfo(
+ \Brevo\Client\Models\CreateUpdateFolder $createFolder,
+ string $contentType = self::contentTypes['createFolder'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\CreateModel';
- $request = $this->createFolderRequest($createFolder);
+ $request = $this->createFolderRequest($createFolder, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1254,34 +1638,111 @@ public function createFolderWithHttpInfo($createFolder)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 201:
+ if (in_array('\Brevo\Client\Models\CreateModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CreateModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CreateModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CreateModel';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1296,7 +1757,7 @@ public function createFolderWithHttpInfo($createFolder)
case 201:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\CreateModel',
+ '\Brevo\Client\Models\CreateModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1304,7 +1765,7 @@ public function createFolderWithHttpInfo($createFolder)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1319,14 +1780,18 @@ public function createFolderWithHttpInfo($createFolder)
*
* Create a folder
*
- * @param \Brevo\Client\Model\CreateUpdateFolder $createFolder Name of the folder (required)
+ * @param \Brevo\Client\Models\CreateUpdateFolder $createFolder Name of the folder (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createFolder'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createFolderAsync($createFolder)
+ public function createFolderAsync(
+ \Brevo\Client\Models\CreateUpdateFolder $createFolder,
+ string $contentType = self::contentTypes['createFolder'][0]
+ ): PromiseInterface
{
- return $this->createFolderAsyncWithHttpInfo($createFolder)
+ return $this->createFolderAsyncWithHttpInfo($createFolder, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1339,25 +1804,29 @@ function ($response) {
*
* Create a folder
*
- * @param \Brevo\Client\Model\CreateUpdateFolder $createFolder Name of the folder (required)
+ * @param \Brevo\Client\Models\CreateUpdateFolder $createFolder Name of the folder (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createFolder'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createFolderAsyncWithHttpInfo($createFolder)
+ public function createFolderAsyncWithHttpInfo(
+ $createFolder,
+ string $contentType = self::contentTypes['createFolder'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\CreateModel';
- $request = $this->createFolderRequest($createFolder);
+ $returnType = '\Brevo\Client\Models\CreateModel';
+ $request = $this->createFolderRequest($createFolder, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1380,7 +1849,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1389,20 +1858,26 @@ function ($exception) {
/**
* Create request for operation 'createFolder'
*
- * @param \Brevo\Client\Model\CreateUpdateFolder $createFolder Name of the folder (required)
+ * @param \Brevo\Client\Models\CreateUpdateFolder $createFolder Name of the folder (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createFolder'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function createFolderRequest($createFolder)
+ public function createFolderRequest(
+ $createFolder,
+ string $contentType = self::contentTypes['createFolder'][0]
+ ): Request
{
+
// verify the required parameter 'createFolder' is set
if ($createFolder === null || (is_array($createFolder) && count($createFolder) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $createFolder when calling createFolder'
);
}
+
$resourcePath = '/contacts/folders';
$formParams = [];
$queryParams = [];
@@ -1412,56 +1887,43 @@ protected function createFolderRequest($createFolder)
- // body params
- $_tempBody = null;
- if (isset($createFolder)) {
- $_tempBody = $createFolder;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($createFolder)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createFolder));
+ } else {
+ $httpBody = $createFolder;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1487,10 +1949,11 @@ protected function createFolderRequest($createFolder)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1501,15 +1964,19 @@ protected function createFolderRequest($createFolder)
*
* Create a list
*
- * @param \Brevo\Client\Model\CreateList $createList Values to create a list (required)
+ * @param \Brevo\Client\Models\CreateList $createList Values to create a list (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createList'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\CreateModel
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CreateModel|\Brevo\Client\Models\ErrorModel
*/
- public function createList($createList)
+ public function createList(
+ \Brevo\Client\Models\CreateList $createList,
+ string $contentType = self::contentTypes['createList'][0]
+ ): \Brevo\Client\Models\CreateModel
{
- list($response) = $this->createListWithHttpInfo($createList);
+ list($response) = $this->createListWithHttpInfo($createList, $contentType);
return $response;
}
@@ -1518,16 +1985,19 @@ public function createList($createList)
*
* Create a list
*
- * @param \Brevo\Client\Model\CreateList $createList Values to create a list (required)
+ * @param \Brevo\Client\Models\CreateList $createList Values to create a list (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createList'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\CreateModel, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CreateModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function createListWithHttpInfo($createList)
+ public function createListWithHttpInfo(
+ \Brevo\Client\Models\CreateList $createList,
+ string $contentType = self::contentTypes['createList'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\CreateModel';
- $request = $this->createListRequest($createList);
+ $request = $this->createListRequest($createList, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1536,34 +2006,111 @@ public function createListWithHttpInfo($createList)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 201:
+ if (in_array('\Brevo\Client\Models\CreateModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CreateModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CreateModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CreateModel';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1578,7 +2125,7 @@ public function createListWithHttpInfo($createList)
case 201:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\CreateModel',
+ '\Brevo\Client\Models\CreateModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1586,7 +2133,7 @@ public function createListWithHttpInfo($createList)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1601,14 +2148,18 @@ public function createListWithHttpInfo($createList)
*
* Create a list
*
- * @param \Brevo\Client\Model\CreateList $createList Values to create a list (required)
+ * @param \Brevo\Client\Models\CreateList $createList Values to create a list (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createList'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createListAsync($createList)
+ public function createListAsync(
+ \Brevo\Client\Models\CreateList $createList,
+ string $contentType = self::contentTypes['createList'][0]
+ ): PromiseInterface
{
- return $this->createListAsyncWithHttpInfo($createList)
+ return $this->createListAsyncWithHttpInfo($createList, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1621,25 +2172,29 @@ function ($response) {
*
* Create a list
*
- * @param \Brevo\Client\Model\CreateList $createList Values to create a list (required)
+ * @param \Brevo\Client\Models\CreateList $createList Values to create a list (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createList'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createListAsyncWithHttpInfo($createList)
+ public function createListAsyncWithHttpInfo(
+ $createList,
+ string $contentType = self::contentTypes['createList'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\CreateModel';
- $request = $this->createListRequest($createList);
+ $returnType = '\Brevo\Client\Models\CreateModel';
+ $request = $this->createListRequest($createList, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1662,7 +2217,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1671,20 +2226,26 @@ function ($exception) {
/**
* Create request for operation 'createList'
*
- * @param \Brevo\Client\Model\CreateList $createList Values to create a list (required)
+ * @param \Brevo\Client\Models\CreateList $createList Values to create a list (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createList'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function createListRequest($createList)
+ public function createListRequest(
+ $createList,
+ string $contentType = self::contentTypes['createList'][0]
+ ): Request
{
+
// verify the required parameter 'createList' is set
if ($createList === null || (is_array($createList) && count($createList) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $createList when calling createList'
);
}
+
$resourcePath = '/contacts/lists';
$formParams = [];
$queryParams = [];
@@ -1694,56 +2255,43 @@ protected function createListRequest($createList)
- // body params
- $_tempBody = null;
- if (isset($createList)) {
- $_tempBody = $createList;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($createList)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createList));
+ } else {
+ $httpBody = $createList;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1769,10 +2317,11 @@ protected function createListRequest($createList)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1785,14 +2334,19 @@ protected function createListRequest($createList)
*
* @param string $attributeCategory Category of the attribute (required)
* @param string $attributeName Name of the existing attribute (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAttribute'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function deleteAttribute($attributeCategory, $attributeName)
+ public function deleteAttribute(
+ string $attributeCategory,
+ string $attributeName,
+ string $contentType = self::contentTypes['deleteAttribute'][0]
+ ): void
{
- $this->deleteAttributeWithHttpInfo($attributeCategory, $attributeName);
+ $this->deleteAttributeWithHttpInfo($attributeCategory, $attributeName, $contentType);
}
/**
@@ -1802,15 +2356,19 @@ public function deleteAttribute($attributeCategory, $attributeName)
*
* @param string $attributeCategory Category of the attribute (required)
* @param string $attributeName Name of the existing attribute (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAttribute'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function deleteAttributeWithHttpInfo($attributeCategory, $attributeName)
+ public function deleteAttributeWithHttpInfo(
+ string $attributeCategory,
+ string $attributeName,
+ string $contentType = self::contentTypes['deleteAttribute'][0]
+ ): array
{
- $returnType = '';
- $request = $this->deleteAttributeRequest($attributeCategory, $attributeName);
+ $request = $this->deleteAttributeRequest($attributeCategory, $attributeName, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1819,43 +2377,38 @@ public function deleteAttributeWithHttpInfo($attributeCategory, $attributeName)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
} catch (ApiException $e) {
switch ($e->getCode()) {
- case 404:
+ case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 400:
+ case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1872,13 +2425,18 @@ public function deleteAttributeWithHttpInfo($attributeCategory, $attributeName)
*
* @param string $attributeCategory Category of the attribute (required)
* @param string $attributeName Name of the existing attribute (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAttribute'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteAttributeAsync($attributeCategory, $attributeName)
+ public function deleteAttributeAsync(
+ string $attributeCategory,
+ string $attributeName,
+ string $contentType = self::contentTypes['deleteAttribute'][0]
+ ): PromiseInterface
{
- return $this->deleteAttributeAsyncWithHttpInfo($attributeCategory, $attributeName)
+ return $this->deleteAttributeAsyncWithHttpInfo($attributeCategory, $attributeName, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1893,14 +2451,20 @@ function ($response) {
*
* @param string $attributeCategory Category of the attribute (required)
* @param string $attributeName Name of the existing attribute (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAttribute'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteAttributeAsyncWithHttpInfo($attributeCategory, $attributeName)
+ public function deleteAttributeAsyncWithHttpInfo(
+ $attributeCategory,
+ $attributeName,
+ string $contentType = self::contentTypes['deleteAttribute'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->deleteAttributeRequest($attributeCategory, $attributeName);
+ $request = $this->deleteAttributeRequest($attributeCategory, $attributeName, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -1919,7 +2483,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1930,25 +2494,33 @@ function ($exception) {
*
* @param string $attributeCategory Category of the attribute (required)
* @param string $attributeName Name of the existing attribute (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAttribute'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function deleteAttributeRequest($attributeCategory, $attributeName)
+ public function deleteAttributeRequest(
+ $attributeCategory,
+ $attributeName,
+ string $contentType = self::contentTypes['deleteAttribute'][0]
+ ): Request
{
+
// verify the required parameter 'attributeCategory' is set
if ($attributeCategory === null || (is_array($attributeCategory) && count($attributeCategory) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $attributeCategory when calling deleteAttribute'
);
}
+
// verify the required parameter 'attributeName' is set
if ($attributeName === null || (is_array($attributeName) && count($attributeName) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $attributeName when calling deleteAttribute'
);
}
+
$resourcePath = '/contacts/attributes/{attributeCategory}/{attributeName}';
$formParams = [];
$queryParams = [];
@@ -1957,6 +2529,7 @@ protected function deleteAttributeRequest($attributeCategory, $attributeName)
$multipart = false;
+
// path params
if ($attributeCategory !== null) {
$resourcePath = str_replace(
@@ -1974,53 +2547,35 @@ protected function deleteAttributeRequest($attributeCategory, $attributeName)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -2046,10 +2601,11 @@ protected function deleteAttributeRequest($attributeCategory, $attributeName)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -2060,16 +2616,21 @@ protected function deleteAttributeRequest($attributeCategory, $attributeName)
*
* Delete a contact
*
- * @param string $identifier Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) (required)
- * @param object $identifierType email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute (optional)
+ * @param \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) (required)
+ * @param string|null $identifierType email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteContact'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function deleteContact($identifier, $identifierType = null)
+ public function deleteContact(
+ \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier,
+ ?string $identifierType = null,
+ string $contentType = self::contentTypes['deleteContact'][0]
+ ): void
{
- $this->deleteContactWithHttpInfo($identifier, $identifierType);
+ $this->deleteContactWithHttpInfo($identifier, $identifierType, $contentType);
}
/**
@@ -2077,17 +2638,21 @@ public function deleteContact($identifier, $identifierType = null)
*
* Delete a contact
*
- * @param string $identifier Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) (required)
- * @param object $identifierType email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute (optional)
+ * @param \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) (required)
+ * @param string|null $identifierType email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteContact'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function deleteContactWithHttpInfo($identifier, $identifierType = null)
+ public function deleteContactWithHttpInfo(
+ \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier,
+ ?string $identifierType = null,
+ string $contentType = self::contentTypes['deleteContact'][0]
+ ): array
{
- $returnType = '';
- $request = $this->deleteContactRequest($identifier, $identifierType);
+ $request = $this->deleteContactRequest($identifier, $identifierType, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -2096,43 +2661,38 @@ public function deleteContactWithHttpInfo($identifier, $identifierType = null)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
} catch (ApiException $e) {
switch ($e->getCode()) {
- case 404:
+ case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 400:
+ case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2140,7 +2700,7 @@ public function deleteContactWithHttpInfo($identifier, $identifierType = null)
case 405:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2155,15 +2715,20 @@ public function deleteContactWithHttpInfo($identifier, $identifierType = null)
*
* Delete a contact
*
- * @param string $identifier Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) (required)
- * @param object $identifierType email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute (optional)
+ * @param \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) (required)
+ * @param string|null $identifierType email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteContact'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteContactAsync($identifier, $identifierType = null)
+ public function deleteContactAsync(
+ \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier,
+ ?string $identifierType = null,
+ string $contentType = self::contentTypes['deleteContact'][0]
+ ): PromiseInterface
{
- return $this->deleteContactAsyncWithHttpInfo($identifier, $identifierType)
+ return $this->deleteContactAsyncWithHttpInfo($identifier, $identifierType, $contentType)
->then(
function ($response) {
return $response[0];
@@ -2176,16 +2741,22 @@ function ($response) {
*
* Delete a contact
*
- * @param string $identifier Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) (required)
- * @param object $identifierType email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute (optional)
+ * @param \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) (required)
+ * @param string|null $identifierType email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteContact'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteContactAsyncWithHttpInfo($identifier, $identifierType = null)
+ public function deleteContactAsyncWithHttpInfo(
+ $identifier,
+ $identifierType = null,
+ string $contentType = self::contentTypes['deleteContact'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->deleteContactRequest($identifier, $identifierType);
+ $request = $this->deleteContactRequest($identifier, $identifierType, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -2204,7 +2775,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -2213,21 +2784,29 @@ function ($exception) {
/**
* Create request for operation 'deleteContact'
*
- * @param string $identifier Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) (required)
- * @param object $identifierType email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute (optional)
+ * @param \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) (required)
+ * @param string|null $identifierType email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteContact'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function deleteContactRequest($identifier, $identifierType = null)
+ public function deleteContactRequest(
+ $identifier,
+ $identifierType = null,
+ string $contentType = self::contentTypes['deleteContact'][0]
+ ): Request
{
+
// verify the required parameter 'identifier' is set
if ($identifier === null || (is_array($identifier) && count($identifier) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $identifier when calling deleteContact'
);
}
+
+
$resourcePath = '/contacts/{identifier}';
$formParams = [];
$queryParams = [];
@@ -2236,9 +2815,15 @@ protected function deleteContactRequest($identifier, $identifierType = null)
$multipart = false;
// query params
- if ($identifierType !== null) {
- $queryParams['identifierType'] = ObjectSerializer::toQueryValue($identifierType);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $identifierType,
+ 'identifierType', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
// path params
if ($identifier !== null) {
@@ -2249,53 +2834,35 @@ protected function deleteContactRequest($identifier, $identifierType = null)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -2321,10 +2888,11 @@ protected function deleteContactRequest($identifier, $identifierType = null)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -2336,14 +2904,18 @@ protected function deleteContactRequest($identifier, $identifierType = null)
* Delete a folder (and all its lists)
*
* @param int $folderId Id of the folder (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFolder'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function deleteFolder($folderId)
+ public function deleteFolder(
+ int $folderId,
+ string $contentType = self::contentTypes['deleteFolder'][0]
+ ): void
{
- $this->deleteFolderWithHttpInfo($folderId);
+ $this->deleteFolderWithHttpInfo($folderId, $contentType);
}
/**
@@ -2352,15 +2924,18 @@ public function deleteFolder($folderId)
* Delete a folder (and all its lists)
*
* @param int $folderId Id of the folder (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFolder'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function deleteFolderWithHttpInfo($folderId)
+ public function deleteFolderWithHttpInfo(
+ int $folderId,
+ string $contentType = self::contentTypes['deleteFolder'][0]
+ ): array
{
- $returnType = '';
- $request = $this->deleteFolderRequest($folderId);
+ $request = $this->deleteFolderRequest($folderId, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -2369,43 +2944,38 @@ public function deleteFolderWithHttpInfo($folderId)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
} catch (ApiException $e) {
switch ($e->getCode()) {
- case 404:
+ case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 400:
+ case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2421,13 +2991,17 @@ public function deleteFolderWithHttpInfo($folderId)
* Delete a folder (and all its lists)
*
* @param int $folderId Id of the folder (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFolder'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteFolderAsync($folderId)
+ public function deleteFolderAsync(
+ int $folderId,
+ string $contentType = self::contentTypes['deleteFolder'][0]
+ ): PromiseInterface
{
- return $this->deleteFolderAsyncWithHttpInfo($folderId)
+ return $this->deleteFolderAsyncWithHttpInfo($folderId, $contentType)
->then(
function ($response) {
return $response[0];
@@ -2441,14 +3015,19 @@ function ($response) {
* Delete a folder (and all its lists)
*
* @param int $folderId Id of the folder (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFolder'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteFolderAsyncWithHttpInfo($folderId)
+ public function deleteFolderAsyncWithHttpInfo(
+ $folderId,
+ string $contentType = self::contentTypes['deleteFolder'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->deleteFolderRequest($folderId);
+ $request = $this->deleteFolderRequest($folderId, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -2467,7 +3046,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -2477,19 +3056,25 @@ function ($exception) {
* Create request for operation 'deleteFolder'
*
* @param int $folderId Id of the folder (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFolder'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function deleteFolderRequest($folderId)
+ public function deleteFolderRequest(
+ $folderId,
+ string $contentType = self::contentTypes['deleteFolder'][0]
+ ): Request
{
+
// verify the required parameter 'folderId' is set
if ($folderId === null || (is_array($folderId) && count($folderId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $folderId when calling deleteFolder'
);
}
+
$resourcePath = '/contacts/folders/{folderId}';
$formParams = [];
$queryParams = [];
@@ -2498,6 +3083,7 @@ protected function deleteFolderRequest($folderId)
$multipart = false;
+
// path params
if ($folderId !== null) {
$resourcePath = str_replace(
@@ -2507,53 +3093,35 @@ protected function deleteFolderRequest($folderId)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -2579,10 +3147,11 @@ protected function deleteFolderRequest($folderId)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -2594,14 +3163,18 @@ protected function deleteFolderRequest($folderId)
* Delete a list
*
* @param int $listId Id of the list (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteList'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function deleteList($listId)
+ public function deleteList(
+ int $listId,
+ string $contentType = self::contentTypes['deleteList'][0]
+ ): void
{
- $this->deleteListWithHttpInfo($listId);
+ $this->deleteListWithHttpInfo($listId, $contentType);
}
/**
@@ -2610,15 +3183,18 @@ public function deleteList($listId)
* Delete a list
*
* @param int $listId Id of the list (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteList'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function deleteListWithHttpInfo($listId)
+ public function deleteListWithHttpInfo(
+ int $listId,
+ string $contentType = self::contentTypes['deleteList'][0]
+ ): array
{
- $returnType = '';
- $request = $this->deleteListRequest($listId);
+ $request = $this->deleteListRequest($listId, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -2627,43 +3203,38 @@ public function deleteListWithHttpInfo($listId)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
} catch (ApiException $e) {
switch ($e->getCode()) {
- case 404:
+ case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 400:
+ case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2679,13 +3250,17 @@ public function deleteListWithHttpInfo($listId)
* Delete a list
*
* @param int $listId Id of the list (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteList'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteListAsync($listId)
+ public function deleteListAsync(
+ int $listId,
+ string $contentType = self::contentTypes['deleteList'][0]
+ ): PromiseInterface
{
- return $this->deleteListAsyncWithHttpInfo($listId)
+ return $this->deleteListAsyncWithHttpInfo($listId, $contentType)
->then(
function ($response) {
return $response[0];
@@ -2699,14 +3274,19 @@ function ($response) {
* Delete a list
*
* @param int $listId Id of the list (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteList'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteListAsyncWithHttpInfo($listId)
+ public function deleteListAsyncWithHttpInfo(
+ $listId,
+ string $contentType = self::contentTypes['deleteList'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->deleteListRequest($listId);
+ $request = $this->deleteListRequest($listId, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -2725,7 +3305,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -2735,19 +3315,25 @@ function ($exception) {
* Create request for operation 'deleteList'
*
* @param int $listId Id of the list (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteList'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function deleteListRequest($listId)
+ public function deleteListRequest(
+ $listId,
+ string $contentType = self::contentTypes['deleteList'][0]
+ ): Request
{
+
// verify the required parameter 'listId' is set
if ($listId === null || (is_array($listId) && count($listId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $listId when calling deleteList'
);
}
+
$resourcePath = '/contacts/lists/{listId}';
$formParams = [];
$queryParams = [];
@@ -2756,6 +3342,7 @@ protected function deleteListRequest($listId)
$multipart = false;
+
// path params
if ($listId !== null) {
$resourcePath = str_replace(
@@ -2765,53 +3352,35 @@ protected function deleteListRequest($listId)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -2837,10 +3406,11 @@ protected function deleteListRequest($listId)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -2852,16 +3422,22 @@ protected function deleteListRequest($listId)
* Delete a multiple-choice attribute option
*
* @param string $attributeType Type of the attribute (required)
- * @param string $multipleChoiceAttribute Name of the existing multiple-choice attribute (required)
+ * @param string $multipleChoiceAttribute Name of the existing muliple-choice attribute (required)
* @param string $multipleChoiceAttributeOption Name of the existing multiple-choice attribute option that you want to delete (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteMultiAttributeOptions'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function deleteMultiAttributeOptions($attributeType, $multipleChoiceAttribute, $multipleChoiceAttributeOption)
+ public function deleteMultiAttributeOptions(
+ string $attributeType,
+ string $multipleChoiceAttribute,
+ string $multipleChoiceAttributeOption,
+ string $contentType = self::contentTypes['deleteMultiAttributeOptions'][0]
+ ): void
{
- $this->deleteMultiAttributeOptionsWithHttpInfo($attributeType, $multipleChoiceAttribute, $multipleChoiceAttributeOption);
+ $this->deleteMultiAttributeOptionsWithHttpInfo($attributeType, $multipleChoiceAttribute, $multipleChoiceAttributeOption, $contentType);
}
/**
@@ -2870,17 +3446,22 @@ public function deleteMultiAttributeOptions($attributeType, $multipleChoiceAttri
* Delete a multiple-choice attribute option
*
* @param string $attributeType Type of the attribute (required)
- * @param string $multipleChoiceAttribute Name of the existing multiple-choice attribute (required)
+ * @param string $multipleChoiceAttribute Name of the existing muliple-choice attribute (required)
* @param string $multipleChoiceAttributeOption Name of the existing multiple-choice attribute option that you want to delete (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteMultiAttributeOptions'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function deleteMultiAttributeOptionsWithHttpInfo($attributeType, $multipleChoiceAttribute, $multipleChoiceAttributeOption)
+ public function deleteMultiAttributeOptionsWithHttpInfo(
+ string $attributeType,
+ string $multipleChoiceAttribute,
+ string $multipleChoiceAttributeOption,
+ string $contentType = self::contentTypes['deleteMultiAttributeOptions'][0]
+ ): array
{
- $returnType = '';
- $request = $this->deleteMultiAttributeOptionsRequest($attributeType, $multipleChoiceAttribute, $multipleChoiceAttributeOption);
+ $request = $this->deleteMultiAttributeOptionsRequest($attributeType, $multipleChoiceAttribute, $multipleChoiceAttributeOption, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -2889,43 +3470,38 @@ public function deleteMultiAttributeOptionsWithHttpInfo($attributeType, $multipl
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
} catch (ApiException $e) {
switch ($e->getCode()) {
- case 404:
+ case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 400:
+ case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2941,15 +3517,21 @@ public function deleteMultiAttributeOptionsWithHttpInfo($attributeType, $multipl
* Delete a multiple-choice attribute option
*
* @param string $attributeType Type of the attribute (required)
- * @param string $multipleChoiceAttribute Name of the existing multiple-choice attribute (required)
+ * @param string $multipleChoiceAttribute Name of the existing muliple-choice attribute (required)
* @param string $multipleChoiceAttributeOption Name of the existing multiple-choice attribute option that you want to delete (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteMultiAttributeOptions'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteMultiAttributeOptionsAsync($attributeType, $multipleChoiceAttribute, $multipleChoiceAttributeOption)
+ public function deleteMultiAttributeOptionsAsync(
+ string $attributeType,
+ string $multipleChoiceAttribute,
+ string $multipleChoiceAttributeOption,
+ string $contentType = self::contentTypes['deleteMultiAttributeOptions'][0]
+ ): PromiseInterface
{
- return $this->deleteMultiAttributeOptionsAsyncWithHttpInfo($attributeType, $multipleChoiceAttribute, $multipleChoiceAttributeOption)
+ return $this->deleteMultiAttributeOptionsAsyncWithHttpInfo($attributeType, $multipleChoiceAttribute, $multipleChoiceAttributeOption, $contentType)
->then(
function ($response) {
return $response[0];
@@ -2963,16 +3545,23 @@ function ($response) {
* Delete a multiple-choice attribute option
*
* @param string $attributeType Type of the attribute (required)
- * @param string $multipleChoiceAttribute Name of the existing multiple-choice attribute (required)
+ * @param string $multipleChoiceAttribute Name of the existing muliple-choice attribute (required)
* @param string $multipleChoiceAttributeOption Name of the existing multiple-choice attribute option that you want to delete (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteMultiAttributeOptions'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteMultiAttributeOptionsAsyncWithHttpInfo($attributeType, $multipleChoiceAttribute, $multipleChoiceAttributeOption)
+ public function deleteMultiAttributeOptionsAsyncWithHttpInfo(
+ $attributeType,
+ $multipleChoiceAttribute,
+ $multipleChoiceAttributeOption,
+ string $contentType = self::contentTypes['deleteMultiAttributeOptions'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->deleteMultiAttributeOptionsRequest($attributeType, $multipleChoiceAttribute, $multipleChoiceAttributeOption);
+ $request = $this->deleteMultiAttributeOptionsRequest($attributeType, $multipleChoiceAttribute, $multipleChoiceAttributeOption, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -2991,7 +3580,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -3001,33 +3590,43 @@ function ($exception) {
* Create request for operation 'deleteMultiAttributeOptions'
*
* @param string $attributeType Type of the attribute (required)
- * @param string $multipleChoiceAttribute Name of the existing multiple-choice attribute (required)
+ * @param string $multipleChoiceAttribute Name of the existing muliple-choice attribute (required)
* @param string $multipleChoiceAttributeOption Name of the existing multiple-choice attribute option that you want to delete (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteMultiAttributeOptions'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function deleteMultiAttributeOptionsRequest($attributeType, $multipleChoiceAttribute, $multipleChoiceAttributeOption)
+ public function deleteMultiAttributeOptionsRequest(
+ $attributeType,
+ $multipleChoiceAttribute,
+ $multipleChoiceAttributeOption,
+ string $contentType = self::contentTypes['deleteMultiAttributeOptions'][0]
+ ): Request
{
+
// verify the required parameter 'attributeType' is set
if ($attributeType === null || (is_array($attributeType) && count($attributeType) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $attributeType when calling deleteMultiAttributeOptions'
);
}
+
// verify the required parameter 'multipleChoiceAttribute' is set
if ($multipleChoiceAttribute === null || (is_array($multipleChoiceAttribute) && count($multipleChoiceAttribute) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $multipleChoiceAttribute when calling deleteMultiAttributeOptions'
);
}
+
// verify the required parameter 'multipleChoiceAttributeOption' is set
if ($multipleChoiceAttributeOption === null || (is_array($multipleChoiceAttributeOption) && count($multipleChoiceAttributeOption) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $multipleChoiceAttributeOption when calling deleteMultiAttributeOptions'
);
}
+
$resourcePath = '/contacts/attributes/{attributeType}/{multipleChoiceAttribute}/{multipleChoiceAttributeOption}';
$formParams = [];
$queryParams = [];
@@ -3036,6 +3635,7 @@ protected function deleteMultiAttributeOptionsRequest($attributeType, $multipleC
$multipart = false;
+
// path params
if ($attributeType !== null) {
$resourcePath = str_replace(
@@ -3061,53 +3661,35 @@ protected function deleteMultiAttributeOptionsRequest($attributeType, $multipleC
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -3133,10 +3715,11 @@ protected function deleteMultiAttributeOptionsRequest($attributeType, $multipleC
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -3147,14 +3730,17 @@ protected function deleteMultiAttributeOptionsRequest($attributeType, $multipleC
*
* List all attributes
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAttributes'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetAttributes
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetAttributes
*/
- public function getAttributes()
+ public function getAttributes(
+ string $contentType = self::contentTypes['getAttributes'][0]
+ ): \Brevo\Client\Models\GetAttributes
{
- list($response) = $this->getAttributesWithHttpInfo();
+ list($response) = $this->getAttributesWithHttpInfo($contentType);
return $response;
}
@@ -3163,15 +3749,17 @@ public function getAttributes()
*
* List all attributes
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAttributes'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetAttributes, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetAttributes, HTTP status code, HTTP response headers (array of strings)
*/
- public function getAttributesWithHttpInfo()
+ public function getAttributesWithHttpInfo(
+ string $contentType = self::contentTypes['getAttributes'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetAttributes';
- $request = $this->getAttributesRequest();
+ $request = $this->getAttributesRequest($contentType);
try {
$options = $this->createHttpClientOption();
@@ -3180,34 +3768,84 @@ public function getAttributesWithHttpInfo()
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetAttributes', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetAttributes' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetAttributes', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetAttributes';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -3222,7 +3860,7 @@ public function getAttributesWithHttpInfo()
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetAttributes',
+ '\Brevo\Client\Models\GetAttributes',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -3237,13 +3875,16 @@ public function getAttributesWithHttpInfo()
*
* List all attributes
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAttributes'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getAttributesAsync()
+ public function getAttributesAsync(
+ string $contentType = self::contentTypes['getAttributes'][0]
+ ): PromiseInterface
{
- return $this->getAttributesAsyncWithHttpInfo()
+ return $this->getAttributesAsyncWithHttpInfo($contentType)
->then(
function ($response) {
return $response[0];
@@ -3256,24 +3897,27 @@ function ($response) {
*
* List all attributes
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAttributes'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getAttributesAsyncWithHttpInfo()
+ public function getAttributesAsyncWithHttpInfo(
+ string $contentType = self::contentTypes['getAttributes'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetAttributes';
- $request = $this->getAttributesRequest();
+ $returnType = '\Brevo\Client\Models\GetAttributes';
+ $request = $this->getAttributesRequest($contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -3296,7 +3940,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -3305,13 +3949,17 @@ function ($exception) {
/**
* Create request for operation 'getAttributes'
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAttributes'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getAttributesRequest()
+ public function getAttributesRequest(
+ string $contentType = self::contentTypes['getAttributes'][0]
+ ): Request
{
+
$resourcePath = '/contacts/attributes';
$formParams = [];
$queryParams = [];
@@ -3321,53 +3969,36 @@ protected function getAttributesRequest()
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -3393,10 +4024,11 @@ protected function getAttributesRequest()
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -3405,41 +4037,54 @@ protected function getAttributesRequest()
/**
* Operation getContactInfo
*
- * Get a contact's details
+ * Get a contact's details
*
- * @param string $identifier Email (urlencoded) OR ID of the contact OR its SMS attribute value OR EXT_ID attribute (urlencoded) (required)
- * @param object $identifierType email_id for Email, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute (optional)
- * @param string $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional)
- * @param string $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. (optional)
+ * @param \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier Email (urlencoded) OR ID of the contact OR its SMS attribute value OR EXT_ID attribute (urlencoded) (required)
+ * @param string|null $identifierType email_id for Email, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute (optional)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getContactInfo'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetExtendedContactDetails
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetExtendedContactDetails|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function getContactInfo($identifier, $identifierType = null, $startDate = null, $endDate = null)
+ public function getContactInfo(
+ \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier,
+ ?string $identifierType = null,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ string $contentType = self::contentTypes['getContactInfo'][0]
+ ): \Brevo\Client\Models\GetExtendedContactDetails
{
- list($response) = $this->getContactInfoWithHttpInfo($identifier, $identifierType, $startDate, $endDate);
+ list($response) = $this->getContactInfoWithHttpInfo($identifier, $identifierType, $startDate, $endDate, $contentType);
return $response;
}
/**
* Operation getContactInfoWithHttpInfo
*
- * Get a contact's details
+ * Get a contact's details
*
- * @param string $identifier Email (urlencoded) OR ID of the contact OR its SMS attribute value OR EXT_ID attribute (urlencoded) (required)
- * @param object $identifierType email_id for Email, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute (optional)
- * @param string $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional)
- * @param string $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. (optional)
+ * @param \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier Email (urlencoded) OR ID of the contact OR its SMS attribute value OR EXT_ID attribute (urlencoded) (required)
+ * @param string|null $identifierType email_id for Email, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute (optional)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getContactInfo'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetExtendedContactDetails, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetExtendedContactDetails|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getContactInfoWithHttpInfo($identifier, $identifierType = null, $startDate = null, $endDate = null)
+ public function getContactInfoWithHttpInfo(
+ \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier,
+ ?string $identifierType = null,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ string $contentType = self::contentTypes['getContactInfo'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetExtendedContactDetails';
- $request = $this->getContactInfoRequest($identifier, $identifierType, $startDate, $endDate);
+ $request = $this->getContactInfoRequest($identifier, $identifierType, $startDate, $endDate, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -3448,34 +4093,138 @@ public function getContactInfoWithHttpInfo($identifier, $identifierType = null,
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetExtendedContactDetails', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetExtendedContactDetails' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetExtendedContactDetails', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetExtendedContactDetails';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -3490,23 +4239,23 @@ public function getContactInfoWithHttpInfo($identifier, $identifierType = null,
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetExtendedContactDetails',
+ '\Brevo\Client\Models\GetExtendedContactDetails',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 404:
+ case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 400:
+ case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -3519,19 +4268,26 @@ public function getContactInfoWithHttpInfo($identifier, $identifierType = null,
/**
* Operation getContactInfoAsync
*
- * Get a contact's details
+ * Get a contact's details
*
- * @param string $identifier Email (urlencoded) OR ID of the contact OR its SMS attribute value OR EXT_ID attribute (urlencoded) (required)
- * @param object $identifierType email_id for Email, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute (optional)
- * @param string $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional)
- * @param string $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. (optional)
+ * @param \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier Email (urlencoded) OR ID of the contact OR its SMS attribute value OR EXT_ID attribute (urlencoded) (required)
+ * @param string|null $identifierType email_id for Email, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute (optional)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getContactInfo'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getContactInfoAsync($identifier, $identifierType = null, $startDate = null, $endDate = null)
+ public function getContactInfoAsync(
+ \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier,
+ ?string $identifierType = null,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ string $contentType = self::contentTypes['getContactInfo'][0]
+ ): PromiseInterface
{
- return $this->getContactInfoAsyncWithHttpInfo($identifier, $identifierType, $startDate, $endDate)
+ return $this->getContactInfoAsyncWithHttpInfo($identifier, $identifierType, $startDate, $endDate, $contentType)
->then(
function ($response) {
return $response[0];
@@ -3542,30 +4298,37 @@ function ($response) {
/**
* Operation getContactInfoAsyncWithHttpInfo
*
- * Get a contact's details
+ * Get a contact's details
*
- * @param string $identifier Email (urlencoded) OR ID of the contact OR its SMS attribute value OR EXT_ID attribute (urlencoded) (required)
- * @param object $identifierType email_id for Email, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute (optional)
- * @param string $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional)
- * @param string $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. (optional)
+ * @param \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier Email (urlencoded) OR ID of the contact OR its SMS attribute value OR EXT_ID attribute (urlencoded) (required)
+ * @param string|null $identifierType email_id for Email, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute (optional)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getContactInfo'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getContactInfoAsyncWithHttpInfo($identifier, $identifierType = null, $startDate = null, $endDate = null)
+ public function getContactInfoAsyncWithHttpInfo(
+ $identifier,
+ $identifierType = null,
+ $startDate = null,
+ $endDate = null,
+ string $contentType = self::contentTypes['getContactInfo'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetExtendedContactDetails';
- $request = $this->getContactInfoRequest($identifier, $identifierType, $startDate, $endDate);
+ $returnType = '\Brevo\Client\Models\GetExtendedContactDetails';
+ $request = $this->getContactInfoRequest($identifier, $identifierType, $startDate, $endDate, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -3588,7 +4351,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -3597,23 +4360,35 @@ function ($exception) {
/**
* Create request for operation 'getContactInfo'
*
- * @param string $identifier Email (urlencoded) OR ID of the contact OR its SMS attribute value OR EXT_ID attribute (urlencoded) (required)
- * @param object $identifierType email_id for Email, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute (optional)
- * @param string $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional)
- * @param string $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. (optional)
+ * @param \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier Email (urlencoded) OR ID of the contact OR its SMS attribute value OR EXT_ID attribute (urlencoded) (required)
+ * @param string|null $identifierType email_id for Email, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute (optional)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getContactInfo'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getContactInfoRequest($identifier, $identifierType = null, $startDate = null, $endDate = null)
+ public function getContactInfoRequest(
+ $identifier,
+ $identifierType = null,
+ $startDate = null,
+ $endDate = null,
+ string $contentType = self::contentTypes['getContactInfo'][0]
+ ): Request
{
+
// verify the required parameter 'identifier' is set
if ($identifier === null || (is_array($identifier) && count($identifier) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $identifier when calling getContactInfo'
);
}
+
+
+
+
$resourcePath = '/contacts/{identifier}';
$formParams = [];
$queryParams = [];
@@ -3622,17 +4397,33 @@ protected function getContactInfoRequest($identifier, $identifierType = null, $s
$multipart = false;
// query params
- if ($identifierType !== null) {
- $queryParams['identifierType'] = ObjectSerializer::toQueryValue($identifierType);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $identifierType,
+ 'identifierType', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($startDate !== null) {
- $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $startDate,
+ 'startDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($endDate !== null) {
- $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $endDate,
+ 'endDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
// path params
if ($identifier !== null) {
@@ -3643,53 +4434,35 @@ protected function getContactInfoRequest($identifier, $identifierType = null, $s
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -3715,10 +4488,11 @@ protected function getContactInfoRequest($identifier, $identifierType = null, $s
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -3727,39 +4501,50 @@ protected function getContactInfoRequest($identifier, $identifierType = null, $s
/**
* Operation getContactStats
*
- * Get email campaigns' statistics for a contact
+ * Get email campaigns' statistics for a contact
*
- * @param string $identifier Email (urlencoded) OR ID of the contact (required)
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days (optional)
+ * @param \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier Email (urlencoded) OR ID of the contact (required)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getContactStats'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetContactCampaignStats
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetContactCampaignStats|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function getContactStats($identifier, $startDate = null, $endDate = null)
+ public function getContactStats(
+ \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ string $contentType = self::contentTypes['getContactStats'][0]
+ ): \Brevo\Client\Models\GetContactCampaignStats
{
- list($response) = $this->getContactStatsWithHttpInfo($identifier, $startDate, $endDate);
+ list($response) = $this->getContactStatsWithHttpInfo($identifier, $startDate, $endDate, $contentType);
return $response;
}
/**
* Operation getContactStatsWithHttpInfo
*
- * Get email campaigns' statistics for a contact
+ * Get email campaigns' statistics for a contact
*
- * @param string $identifier Email (urlencoded) OR ID of the contact (required)
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days (optional)
+ * @param \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier Email (urlencoded) OR ID of the contact (required)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getContactStats'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetContactCampaignStats, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetContactCampaignStats|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getContactStatsWithHttpInfo($identifier, $startDate = null, $endDate = null)
+ public function getContactStatsWithHttpInfo(
+ \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ string $contentType = self::contentTypes['getContactStats'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetContactCampaignStats';
- $request = $this->getContactStatsRequest($identifier, $startDate, $endDate);
+ $request = $this->getContactStatsRequest($identifier, $startDate, $endDate, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -3768,34 +4553,138 @@ public function getContactStatsWithHttpInfo($identifier, $startDate = null, $end
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetContactCampaignStats', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetContactCampaignStats' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetContactCampaignStats', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetContactCampaignStats';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -3810,23 +4699,23 @@ public function getContactStatsWithHttpInfo($identifier, $startDate = null, $end
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetContactCampaignStats',
+ '\Brevo\Client\Models\GetContactCampaignStats',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 404:
+ case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 400:
+ case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -3839,18 +4728,24 @@ public function getContactStatsWithHttpInfo($identifier, $startDate = null, $end
/**
* Operation getContactStatsAsync
*
- * Get email campaigns' statistics for a contact
+ * Get email campaigns' statistics for a contact
*
- * @param string $identifier Email (urlencoded) OR ID of the contact (required)
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days (optional)
+ * @param \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier Email (urlencoded) OR ID of the contact (required)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getContactStats'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getContactStatsAsync($identifier, $startDate = null, $endDate = null)
+ public function getContactStatsAsync(
+ \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ string $contentType = self::contentTypes['getContactStats'][0]
+ ): PromiseInterface
{
- return $this->getContactStatsAsyncWithHttpInfo($identifier, $startDate, $endDate)
+ return $this->getContactStatsAsyncWithHttpInfo($identifier, $startDate, $endDate, $contentType)
->then(
function ($response) {
return $response[0];
@@ -3861,29 +4756,35 @@ function ($response) {
/**
* Operation getContactStatsAsyncWithHttpInfo
*
- * Get email campaigns' statistics for a contact
+ * Get email campaigns' statistics for a contact
*
- * @param string $identifier Email (urlencoded) OR ID of the contact (required)
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days (optional)
+ * @param \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier Email (urlencoded) OR ID of the contact (required)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getContactStats'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getContactStatsAsyncWithHttpInfo($identifier, $startDate = null, $endDate = null)
+ public function getContactStatsAsyncWithHttpInfo(
+ $identifier,
+ $startDate = null,
+ $endDate = null,
+ string $contentType = self::contentTypes['getContactStats'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetContactCampaignStats';
- $request = $this->getContactStatsRequest($identifier, $startDate, $endDate);
+ $returnType = '\Brevo\Client\Models\GetContactCampaignStats';
+ $request = $this->getContactStatsRequest($identifier, $startDate, $endDate, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -3906,7 +4807,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -3915,22 +4816,32 @@ function ($exception) {
/**
* Create request for operation 'getContactStats'
*
- * @param string $identifier Email (urlencoded) OR ID of the contact (required)
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days (optional)
+ * @param \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier Email (urlencoded) OR ID of the contact (required)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getContactStats'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getContactStatsRequest($identifier, $startDate = null, $endDate = null)
+ public function getContactStatsRequest(
+ $identifier,
+ $startDate = null,
+ $endDate = null,
+ string $contentType = self::contentTypes['getContactStats'][0]
+ ): Request
{
+
// verify the required parameter 'identifier' is set
if ($identifier === null || (is_array($identifier) && count($identifier) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $identifier when calling getContactStats'
);
}
+
+
+
$resourcePath = '/contacts/{identifier}/campaignStats';
$formParams = [];
$queryParams = [];
@@ -3939,13 +4850,24 @@ protected function getContactStatsRequest($identifier, $startDate = null, $endDa
$multipart = false;
// query params
- if ($startDate !== null) {
- $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $startDate,
+ 'startDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($endDate !== null) {
- $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $endDate,
+ 'endDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
// path params
if ($identifier !== null) {
@@ -3956,53 +4878,35 @@ protected function getContactStatsRequest($identifier, $startDate = null, $endDa
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -4028,10 +4932,11 @@ protected function getContactStatsRequest($identifier, $startDate = null, $endDa
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -4042,22 +4947,33 @@ protected function getContactStatsRequest($identifier, $startDate = null, $endDa
*
* Get all the contacts
*
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional)
- * @param string $createdSince Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param int $segmentId Id of the segment. **Either listIds or segmentId can be passed.** (optional)
- * @param int[] $listIds Ids of the list. **Either listIds or segmentId can be passed.** (optional)
- * @param string $filter Filter the contacts on the basis of attributes. **Allowed operator: equals. (e.g. filter=equals(FIRSTNAME,\"Antoine\"), filter=equals(B1, true), filter=equals(DOB, \"1989-11-23\"))** (optional)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetContacts
- */
- public function getContacts($limit = '50', $offset = '0', $modifiedSince = null, $createdSince = null, $sort = 'desc', $segmentId = null, $listIds = null, $filter = null)
- {
- list($response) = $this->getContactsWithHttpInfo($limit, $offset, $modifiedSince, $createdSince, $sort, $segmentId, $listIds, $filter);
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param string|null $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string|null $createdSince Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param int|null $segmentId Id of the segment. **Either listIds or segmentId can be passed.** (optional)
+ * @param int[]|null $listIds Ids of the list. **Either listIds or segmentId can be passed.** (optional)
+ * @param string|null $filter Filter the contacts on the basis of attributes. **Allowed operator: equals. (e.g. filter=equals(FIRSTNAME,\"Antoine\"), filter=equals(B1, true), filter=equals(DOB, \"1989-11-23\"))** (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getContacts'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetContacts|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
+ */
+ public function getContacts(
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $modifiedSince = null,
+ ?string $createdSince = null,
+ ?string $sort = 'desc',
+ ?int $segmentId = null,
+ ?array $listIds = null,
+ ?string $filter = null,
+ string $contentType = self::contentTypes['getContacts'][0]
+ ): \Brevo\Client\Models\GetContacts
+ {
+ list($response) = $this->getContactsWithHttpInfo($limit, $offset, $modifiedSince, $createdSince, $sort, $segmentId, $listIds, $filter, $contentType);
return $response;
}
@@ -4066,23 +4982,33 @@ public function getContacts($limit = '50', $offset = '0', $modifiedSince = null,
*
* Get all the contacts
*
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional)
- * @param string $createdSince Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param int $segmentId Id of the segment. **Either listIds or segmentId can be passed.** (optional)
- * @param int[] $listIds Ids of the list. **Either listIds or segmentId can be passed.** (optional)
- * @param string $filter Filter the contacts on the basis of attributes. **Allowed operator: equals. (e.g. filter=equals(FIRSTNAME,\"Antoine\"), filter=equals(B1, true), filter=equals(DOB, \"1989-11-23\"))** (optional)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetContacts, HTTP status code, HTTP response headers (array of strings)
- */
- public function getContactsWithHttpInfo($limit = '50', $offset = '0', $modifiedSince = null, $createdSince = null, $sort = 'desc', $segmentId = null, $listIds = null, $filter = null)
- {
- $returnType = '\Brevo\Client\Model\GetContacts';
- $request = $this->getContactsRequest($limit, $offset, $modifiedSince, $createdSince, $sort, $segmentId, $listIds, $filter);
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param string|null $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string|null $createdSince Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param int|null $segmentId Id of the segment. **Either listIds or segmentId can be passed.** (optional)
+ * @param int[]|null $listIds Ids of the list. **Either listIds or segmentId can be passed.** (optional)
+ * @param string|null $filter Filter the contacts on the basis of attributes. **Allowed operator: equals. (e.g. filter=equals(FIRSTNAME,\"Antoine\"), filter=equals(B1, true), filter=equals(DOB, \"1989-11-23\"))** (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getContacts'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetContacts|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function getContactsWithHttpInfo(
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $modifiedSince = null,
+ ?string $createdSince = null,
+ ?string $sort = 'desc',
+ ?int $segmentId = null,
+ ?array $listIds = null,
+ ?string $filter = null,
+ string $contentType = self::contentTypes['getContacts'][0]
+ ): array
+ {
+ $request = $this->getContactsRequest($limit, $offset, $modifiedSince, $createdSince, $sort, $segmentId, $listIds, $filter, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -4091,34 +5017,138 @@ public function getContactsWithHttpInfo($limit = '50', $offset = '0', $modifiedS
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetContacts', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetContacts' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetContacts', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetContacts';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -4133,7 +5163,7 @@ public function getContactsWithHttpInfo($limit = '50', $offset = '0', $modifiedS
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetContacts',
+ '\Brevo\Client\Models\GetContacts',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -4141,7 +5171,7 @@ public function getContactsWithHttpInfo($limit = '50', $offset = '0', $modifiedS
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -4149,7 +5179,7 @@ public function getContactsWithHttpInfo($limit = '50', $offset = '0', $modifiedS
case 429:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -4164,21 +5194,32 @@ public function getContactsWithHttpInfo($limit = '50', $offset = '0', $modifiedS
*
* Get all the contacts
*
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional)
- * @param string $createdSince Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param int $segmentId Id of the segment. **Either listIds or segmentId can be passed.** (optional)
- * @param int[] $listIds Ids of the list. **Either listIds or segmentId can be passed.** (optional)
- * @param string $filter Filter the contacts on the basis of attributes. **Allowed operator: equals. (e.g. filter=equals(FIRSTNAME,\"Antoine\"), filter=equals(B1, true), filter=equals(DOB, \"1989-11-23\"))** (optional)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getContactsAsync($limit = '50', $offset = '0', $modifiedSince = null, $createdSince = null, $sort = 'desc', $segmentId = null, $listIds = null, $filter = null)
- {
- return $this->getContactsAsyncWithHttpInfo($limit, $offset, $modifiedSince, $createdSince, $sort, $segmentId, $listIds, $filter)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param string|null $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string|null $createdSince Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param int|null $segmentId Id of the segment. **Either listIds or segmentId can be passed.** (optional)
+ * @param int[]|null $listIds Ids of the list. **Either listIds or segmentId can be passed.** (optional)
+ * @param string|null $filter Filter the contacts on the basis of attributes. **Allowed operator: equals. (e.g. filter=equals(FIRSTNAME,\"Antoine\"), filter=equals(B1, true), filter=equals(DOB, \"1989-11-23\"))** (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getContacts'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getContactsAsync(
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $modifiedSince = null,
+ ?string $createdSince = null,
+ ?string $sort = 'desc',
+ ?int $segmentId = null,
+ ?array $listIds = null,
+ ?string $filter = null,
+ string $contentType = self::contentTypes['getContacts'][0]
+ ): PromiseInterface
+ {
+ return $this->getContactsAsyncWithHttpInfo($limit, $offset, $modifiedSince, $createdSince, $sort, $segmentId, $listIds, $filter, $contentType)
->then(
function ($response) {
return $response[0];
@@ -4191,32 +5232,43 @@ function ($response) {
*
* Get all the contacts
*
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional)
- * @param string $createdSince Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param int $segmentId Id of the segment. **Either listIds or segmentId can be passed.** (optional)
- * @param int[] $listIds Ids of the list. **Either listIds or segmentId can be passed.** (optional)
- * @param string $filter Filter the contacts on the basis of attributes. **Allowed operator: equals. (e.g. filter=equals(FIRSTNAME,\"Antoine\"), filter=equals(B1, true), filter=equals(DOB, \"1989-11-23\"))** (optional)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getContactsAsyncWithHttpInfo($limit = '50', $offset = '0', $modifiedSince = null, $createdSince = null, $sort = 'desc', $segmentId = null, $listIds = null, $filter = null)
- {
- $returnType = '\Brevo\Client\Model\GetContacts';
- $request = $this->getContactsRequest($limit, $offset, $modifiedSince, $createdSince, $sort, $segmentId, $listIds, $filter);
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param string|null $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string|null $createdSince Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param int|null $segmentId Id of the segment. **Either listIds or segmentId can be passed.** (optional)
+ * @param int[]|null $listIds Ids of the list. **Either listIds or segmentId can be passed.** (optional)
+ * @param string|null $filter Filter the contacts on the basis of attributes. **Allowed operator: equals. (e.g. filter=equals(FIRSTNAME,\"Antoine\"), filter=equals(B1, true), filter=equals(DOB, \"1989-11-23\"))** (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getContacts'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getContactsAsyncWithHttpInfo(
+ $limit = 50,
+ $offset = 0,
+ $modifiedSince = null,
+ $createdSince = null,
+ $sort = 'desc',
+ $segmentId = null,
+ $listIds = null,
+ $filter = null,
+ string $contentType = self::contentTypes['getContacts'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\GetContacts';
+ $request = $this->getContactsRequest($limit, $offset, $modifiedSince, $createdSince, $sort, $segmentId, $listIds, $filter, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -4239,7 +5291,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -4248,26 +5300,45 @@ function ($exception) {
/**
* Create request for operation 'getContacts'
*
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional)
- * @param string $createdSince Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param int $segmentId Id of the segment. **Either listIds or segmentId can be passed.** (optional)
- * @param int[] $listIds Ids of the list. **Either listIds or segmentId can be passed.** (optional)
- * @param string $filter Filter the contacts on the basis of attributes. **Allowed operator: equals. (e.g. filter=equals(FIRSTNAME,\"Antoine\"), filter=equals(B1, true), filter=equals(DOB, \"1989-11-23\"))** (optional)
- *
- * @throws \InvalidArgumentException
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param string|null $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string|null $createdSince Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param int|null $segmentId Id of the segment. **Either listIds or segmentId can be passed.** (optional)
+ * @param int[]|null $listIds Ids of the list. **Either listIds or segmentId can be passed.** (optional)
+ * @param string|null $filter Filter the contacts on the basis of attributes. **Allowed operator: equals. (e.g. filter=equals(FIRSTNAME,\"Antoine\"), filter=equals(B1, true), filter=equals(DOB, \"1989-11-23\"))** (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getContacts'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getContactsRequest($limit = '50', $offset = '0', $modifiedSince = null, $createdSince = null, $sort = 'desc', $segmentId = null, $listIds = null, $filter = null)
+ public function getContactsRequest(
+ $limit = 50,
+ $offset = 0,
+ $modifiedSince = null,
+ $createdSince = null,
+ $sort = 'desc',
+ $segmentId = null,
+ $listIds = null,
+ $filter = null,
+ string $contentType = self::contentTypes['getContacts'][0]
+ ): Request
{
+
if ($limit !== null && $limit > 1000) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling ContactsApi.getContacts, must be smaller than or equal to 1000.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling ContactsApi.getContacts, must be smaller than or equal to 1000.');
}
if ($limit !== null && $limit < 0) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling ContactsApi.getContacts, must be bigger than or equal to 0.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling ContactsApi.getContacts, must be bigger than or equal to 0.');
}
+
+
+
+
+
+
+
$resourcePath = '/contacts';
@@ -4278,89 +5349,109 @@ protected function getContactsRequest($limit = '50', $offset = '0', $modifiedSin
$multipart = false;
// query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($modifiedSince !== null) {
- $queryParams['modifiedSince'] = ObjectSerializer::toQueryValue($modifiedSince);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $modifiedSince,
+ 'modifiedSince', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($createdSince !== null) {
- $queryParams['createdSince'] = ObjectSerializer::toQueryValue($createdSince);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $createdSince,
+ 'createdSince', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($segmentId !== null) {
- $queryParams['segmentId'] = ObjectSerializer::toQueryValue($segmentId);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $segmentId,
+ 'segmentId', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if (is_array($listIds)) {
- $queryParams['listIds'] = $listIds;
- } else
- if ($listIds !== null) {
- $queryParams['listIds'] = ObjectSerializer::toQueryValue($listIds);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $listIds,
+ 'listIds', // param base name
+ 'array', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($filter !== null) {
- $queryParams['filter'] = ObjectSerializer::toQueryValue($filter);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $filter,
+ 'filter', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -4386,10 +5477,11 @@ protected function getContactsRequest($limit = '50', $offset = '0', $modifiedSin
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -4401,18 +5493,26 @@ protected function getContactsRequest($limit = '50', $offset = '0', $modifiedSin
* Get contacts in a list
*
* @param int $listId Id of the list (required)
- * @param string $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetContacts
- */
- public function getContactsFromList($listId, $modifiedSince = null, $limit = '50', $offset = '0', $sort = 'desc')
- {
- list($response) = $this->getContactsFromListWithHttpInfo($listId, $modifiedSince, $limit, $offset, $sort);
+ * @param string|null $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getContactsFromList'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetContacts|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
+ */
+ public function getContactsFromList(
+ int $listId,
+ ?string $modifiedSince = null,
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getContactsFromList'][0]
+ ): \Brevo\Client\Models\GetContacts
+ {
+ list($response) = $this->getContactsFromListWithHttpInfo($listId, $modifiedSince, $limit, $offset, $sort, $contentType);
return $response;
}
@@ -4422,19 +5522,26 @@ public function getContactsFromList($listId, $modifiedSince = null, $limit = '50
* Get contacts in a list
*
* @param int $listId Id of the list (required)
- * @param string $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetContacts, HTTP status code, HTTP response headers (array of strings)
- */
- public function getContactsFromListWithHttpInfo($listId, $modifiedSince = null, $limit = '50', $offset = '0', $sort = 'desc')
- {
- $returnType = '\Brevo\Client\Model\GetContacts';
- $request = $this->getContactsFromListRequest($listId, $modifiedSince, $limit, $offset, $sort);
+ * @param string|null $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getContactsFromList'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetContacts|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function getContactsFromListWithHttpInfo(
+ int $listId,
+ ?string $modifiedSince = null,
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getContactsFromList'][0]
+ ): array
+ {
+ $request = $this->getContactsFromListRequest($listId, $modifiedSince, $limit, $offset, $sort, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -4443,34 +5550,138 @@ public function getContactsFromListWithHttpInfo($listId, $modifiedSince = null,
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetContacts', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetContacts' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetContacts', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetContacts';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -4485,7 +5696,7 @@ public function getContactsFromListWithHttpInfo($listId, $modifiedSince = null,
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetContacts',
+ '\Brevo\Client\Models\GetContacts',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -4493,7 +5704,7 @@ public function getContactsFromListWithHttpInfo($listId, $modifiedSince = null,
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -4501,7 +5712,7 @@ public function getContactsFromListWithHttpInfo($listId, $modifiedSince = null,
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -4517,17 +5728,25 @@ public function getContactsFromListWithHttpInfo($listId, $modifiedSince = null,
* Get contacts in a list
*
* @param int $listId Id of the list (required)
- * @param string $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getContactsFromListAsync($listId, $modifiedSince = null, $limit = '50', $offset = '0', $sort = 'desc')
- {
- return $this->getContactsFromListAsyncWithHttpInfo($listId, $modifiedSince, $limit, $offset, $sort)
+ * @param string|null $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getContactsFromList'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getContactsFromListAsync(
+ int $listId,
+ ?string $modifiedSince = null,
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getContactsFromList'][0]
+ ): PromiseInterface
+ {
+ return $this->getContactsFromListAsyncWithHttpInfo($listId, $modifiedSince, $limit, $offset, $sort, $contentType)
->then(
function ($response) {
return $response[0];
@@ -4541,28 +5760,36 @@ function ($response) {
* Get contacts in a list
*
* @param int $listId Id of the list (required)
- * @param string $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getContactsFromListAsyncWithHttpInfo($listId, $modifiedSince = null, $limit = '50', $offset = '0', $sort = 'desc')
- {
- $returnType = '\Brevo\Client\Model\GetContacts';
- $request = $this->getContactsFromListRequest($listId, $modifiedSince, $limit, $offset, $sort);
+ * @param string|null $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getContactsFromList'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getContactsFromListAsyncWithHttpInfo(
+ $listId,
+ $modifiedSince = null,
+ $limit = 50,
+ $offset = 0,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getContactsFromList'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\GetContacts';
+ $request = $this->getContactsFromListRequest($listId, $modifiedSince, $limit, $offset, $sort, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -4585,7 +5812,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -4595,28 +5822,41 @@ function ($exception) {
* Create request for operation 'getContactsFromList'
*
* @param int $listId Id of the list (required)
- * @param string $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param string|null $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getContactsFromList'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getContactsFromListRequest($listId, $modifiedSince = null, $limit = '50', $offset = '0', $sort = 'desc')
+ public function getContactsFromListRequest(
+ $listId,
+ $modifiedSince = null,
+ $limit = 50,
+ $offset = 0,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getContactsFromList'][0]
+ ): Request
{
+
// verify the required parameter 'listId' is set
if ($listId === null || (is_array($listId) && count($listId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $listId when calling getContactsFromList'
);
}
+
+
if ($limit !== null && $limit > 500) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling ContactsApi.getContactsFromList, must be smaller than or equal to 500.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling ContactsApi.getContactsFromList, must be smaller than or equal to 500.');
}
if ($limit !== null && $limit < 0) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling ContactsApi.getContactsFromList, must be bigger than or equal to 0.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling ContactsApi.getContactsFromList, must be bigger than or equal to 0.');
}
+
+
$resourcePath = '/contacts/lists/{listId}/contacts';
@@ -4627,21 +5867,42 @@ protected function getContactsFromListRequest($listId, $modifiedSince = null, $l
$multipart = false;
// query params
- if ($modifiedSince !== null) {
- $queryParams['modifiedSince'] = ObjectSerializer::toQueryValue($modifiedSince);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $modifiedSince,
+ 'modifiedSince', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
// path params
if ($listId !== null) {
@@ -4652,53 +5913,35 @@ protected function getContactsFromListRequest($listId, $modifiedSince = null, $l
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -4724,10 +5967,11 @@ protected function getContactsFromListRequest($listId, $modifiedSince = null, $l
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -4736,35 +5980,42 @@ protected function getContactsFromListRequest($listId, $modifiedSince = null, $l
/**
* Operation getFolder
*
- * Returns a folder's details
+ * Returns a folder's details
*
* @param int $folderId id of the folder (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFolder'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetFolder
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetFolder|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function getFolder($folderId)
+ public function getFolder(
+ int $folderId,
+ string $contentType = self::contentTypes['getFolder'][0]
+ ): \Brevo\Client\Models\GetFolder
{
- list($response) = $this->getFolderWithHttpInfo($folderId);
+ list($response) = $this->getFolderWithHttpInfo($folderId, $contentType);
return $response;
}
/**
* Operation getFolderWithHttpInfo
*
- * Returns a folder's details
+ * Returns a folder's details
*
* @param int $folderId id of the folder (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFolder'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetFolder, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetFolder|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getFolderWithHttpInfo($folderId)
+ public function getFolderWithHttpInfo(
+ int $folderId,
+ string $contentType = self::contentTypes['getFolder'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetFolder';
- $request = $this->getFolderRequest($folderId);
+ $request = $this->getFolderRequest($folderId, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -4773,34 +6024,138 @@ public function getFolderWithHttpInfo($folderId)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetFolder', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetFolder' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetFolder', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetFolder';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -4815,23 +6170,23 @@ public function getFolderWithHttpInfo($folderId)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetFolder',
+ '\Brevo\Client\Models\GetFolder',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 404:
+ case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 400:
+ case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -4844,16 +6199,20 @@ public function getFolderWithHttpInfo($folderId)
/**
* Operation getFolderAsync
*
- * Returns a folder's details
+ * Returns a folder's details
*
* @param int $folderId id of the folder (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFolder'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getFolderAsync($folderId)
+ public function getFolderAsync(
+ int $folderId,
+ string $contentType = self::contentTypes['getFolder'][0]
+ ): PromiseInterface
{
- return $this->getFolderAsyncWithHttpInfo($folderId)
+ return $this->getFolderAsyncWithHttpInfo($folderId, $contentType)
->then(
function ($response) {
return $response[0];
@@ -4864,27 +6223,31 @@ function ($response) {
/**
* Operation getFolderAsyncWithHttpInfo
*
- * Returns a folder's details
+ * Returns a folder's details
*
* @param int $folderId id of the folder (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFolder'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getFolderAsyncWithHttpInfo($folderId)
+ public function getFolderAsyncWithHttpInfo(
+ $folderId,
+ string $contentType = self::contentTypes['getFolder'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetFolder';
- $request = $this->getFolderRequest($folderId);
+ $returnType = '\Brevo\Client\Models\GetFolder';
+ $request = $this->getFolderRequest($folderId, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -4907,7 +6270,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -4917,19 +6280,25 @@ function ($exception) {
* Create request for operation 'getFolder'
*
* @param int $folderId id of the folder (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFolder'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getFolderRequest($folderId)
+ public function getFolderRequest(
+ $folderId,
+ string $contentType = self::contentTypes['getFolder'][0]
+ ): Request
{
+
// verify the required parameter 'folderId' is set
if ($folderId === null || (is_array($folderId) && count($folderId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $folderId when calling getFolder'
);
}
+
$resourcePath = '/contacts/folders/{folderId}';
$formParams = [];
$queryParams = [];
@@ -4938,6 +6307,7 @@ protected function getFolderRequest($folderId)
$multipart = false;
+
// path params
if ($folderId !== null) {
$resourcePath = str_replace(
@@ -4947,53 +6317,35 @@ protected function getFolderRequest($folderId)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -5019,10 +6371,11 @@ protected function getFolderRequest($folderId)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -5034,17 +6387,24 @@ protected function getFolderRequest($folderId)
* Get lists in a folder
*
* @param int $folderId Id of the folder (required)
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetFolderLists
- */
- public function getFolderLists($folderId, $limit = '10', $offset = '0', $sort = 'desc')
- {
- list($response) = $this->getFolderListsWithHttpInfo($folderId, $limit, $offset, $sort);
+ * @param int|null $limit Number of documents per page (optional, default to 10)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFolderLists'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetFolderLists|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
+ */
+ public function getFolderLists(
+ int $folderId,
+ ?int $limit = 10,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getFolderLists'][0]
+ ): \Brevo\Client\Models\GetFolderLists
+ {
+ list($response) = $this->getFolderListsWithHttpInfo($folderId, $limit, $offset, $sort, $contentType);
return $response;
}
@@ -5054,18 +6414,24 @@ public function getFolderLists($folderId, $limit = '10', $offset = '0', $sort =
* Get lists in a folder
*
* @param int $folderId Id of the folder (required)
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number of documents per page (optional, default to 10)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFolderLists'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetFolderLists, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetFolderLists|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getFolderListsWithHttpInfo($folderId, $limit = '10', $offset = '0', $sort = 'desc')
+ public function getFolderListsWithHttpInfo(
+ int $folderId,
+ ?int $limit = 10,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getFolderLists'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetFolderLists';
- $request = $this->getFolderListsRequest($folderId, $limit, $offset, $sort);
+ $request = $this->getFolderListsRequest($folderId, $limit, $offset, $sort, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -5074,34 +6440,138 @@ public function getFolderListsWithHttpInfo($folderId, $limit = '10', $offset = '
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetFolderLists', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetFolderLists' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetFolderLists', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetFolderLists';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -5116,23 +6586,23 @@ public function getFolderListsWithHttpInfo($folderId, $limit = '10', $offset = '
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetFolderLists',
+ '\Brevo\Client\Models\GetFolderLists',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 404:
+ case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 400:
+ case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -5148,16 +6618,23 @@ public function getFolderListsWithHttpInfo($folderId, $limit = '10', $offset = '
* Get lists in a folder
*
* @param int $folderId Id of the folder (required)
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getFolderListsAsync($folderId, $limit = '10', $offset = '0', $sort = 'desc')
- {
- return $this->getFolderListsAsyncWithHttpInfo($folderId, $limit, $offset, $sort)
+ * @param int|null $limit Number of documents per page (optional, default to 10)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFolderLists'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getFolderListsAsync(
+ int $folderId,
+ ?int $limit = 10,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getFolderLists'][0]
+ ): PromiseInterface
+ {
+ return $this->getFolderListsAsyncWithHttpInfo($folderId, $limit, $offset, $sort, $contentType)
->then(
function ($response) {
return $response[0];
@@ -5171,27 +6648,34 @@ function ($response) {
* Get lists in a folder
*
* @param int $folderId Id of the folder (required)
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getFolderListsAsyncWithHttpInfo($folderId, $limit = '10', $offset = '0', $sort = 'desc')
- {
- $returnType = '\Brevo\Client\Model\GetFolderLists';
- $request = $this->getFolderListsRequest($folderId, $limit, $offset, $sort);
+ * @param int|null $limit Number of documents per page (optional, default to 10)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFolderLists'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getFolderListsAsyncWithHttpInfo(
+ $folderId,
+ $limit = 10,
+ $offset = 0,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getFolderLists'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\GetFolderLists';
+ $request = $this->getFolderListsRequest($folderId, $limit, $offset, $sort, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -5214,7 +6698,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -5224,27 +6708,38 @@ function ($exception) {
* Create request for operation 'getFolderLists'
*
* @param int $folderId Id of the folder (required)
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number of documents per page (optional, default to 10)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFolderLists'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getFolderListsRequest($folderId, $limit = '10', $offset = '0', $sort = 'desc')
+ public function getFolderListsRequest(
+ $folderId,
+ $limit = 10,
+ $offset = 0,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getFolderLists'][0]
+ ): Request
{
+
// verify the required parameter 'folderId' is set
if ($folderId === null || (is_array($folderId) && count($folderId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $folderId when calling getFolderLists'
);
}
+
if ($limit !== null && $limit > 50) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling ContactsApi.getFolderLists, must be smaller than or equal to 50.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling ContactsApi.getFolderLists, must be smaller than or equal to 50.');
}
if ($limit !== null && $limit < 0) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling ContactsApi.getFolderLists, must be bigger than or equal to 0.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling ContactsApi.getFolderLists, must be bigger than or equal to 0.');
}
+
+
$resourcePath = '/contacts/folders/{folderId}/lists';
@@ -5255,17 +6750,33 @@ protected function getFolderListsRequest($folderId, $limit = '10', $offset = '0'
$multipart = false;
// query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
// path params
if ($folderId !== null) {
@@ -5276,53 +6787,35 @@ protected function getFolderListsRequest($folderId, $limit = '10', $offset = '0'
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -5348,10 +6841,11 @@ protected function getFolderListsRequest($folderId, $limit = '10', $offset = '0'
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -5362,17 +6856,23 @@ protected function getFolderListsRequest($folderId, $limit = '10', $offset = '0'
*
* Get all folders
*
- * @param int $limit Number of documents per page (required)
- * @param int $offset Index of the first document of the page (required)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number of documents per page (optional, default to 10)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFolders'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetFolders
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetFolders|\Brevo\Client\Models\ErrorModel
*/
- public function getFolders($limit, $offset, $sort = 'desc')
+ public function getFolders(
+ ?int $limit = 10,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getFolders'][0]
+ ): \Brevo\Client\Models\GetFolders
{
- list($response) = $this->getFoldersWithHttpInfo($limit, $offset, $sort);
+ list($response) = $this->getFoldersWithHttpInfo($limit, $offset, $sort, $contentType);
return $response;
}
@@ -5381,18 +6881,23 @@ public function getFolders($limit, $offset, $sort = 'desc')
*
* Get all folders
*
- * @param int $limit Number of documents per page (required)
- * @param int $offset Index of the first document of the page (required)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number of documents per page (optional, default to 10)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFolders'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetFolders, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetFolders|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getFoldersWithHttpInfo($limit, $offset, $sort = 'desc')
+ public function getFoldersWithHttpInfo(
+ ?int $limit = 10,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getFolders'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetFolders';
- $request = $this->getFoldersRequest($limit, $offset, $sort);
+ $request = $this->getFoldersRequest($limit, $offset, $sort, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -5401,34 +6906,111 @@ public function getFoldersWithHttpInfo($limit, $offset, $sort = 'desc')
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
+ $statusCode = $response->getStatusCode();
+
+
+ switch($statusCode) {
+ case 200:
+ if (in_array('\Brevo\Client\Models\GetFolders', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetFolders' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetFolders', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetFolders';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -5443,7 +7025,7 @@ public function getFoldersWithHttpInfo($limit, $offset, $sort = 'desc')
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetFolders',
+ '\Brevo\Client\Models\GetFolders',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -5451,7 +7033,7 @@ public function getFoldersWithHttpInfo($limit, $offset, $sort = 'desc')
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -5466,16 +7048,22 @@ public function getFoldersWithHttpInfo($limit, $offset, $sort = 'desc')
*
* Get all folders
*
- * @param int $limit Number of documents per page (required)
- * @param int $offset Index of the first document of the page (required)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number of documents per page (optional, default to 10)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFolders'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getFoldersAsync($limit, $offset, $sort = 'desc')
+ public function getFoldersAsync(
+ ?int $limit = 10,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getFolders'][0]
+ ): PromiseInterface
{
- return $this->getFoldersAsyncWithHttpInfo($limit, $offset, $sort)
+ return $this->getFoldersAsyncWithHttpInfo($limit, $offset, $sort, $contentType)
->then(
function ($response) {
return $response[0];
@@ -5488,27 +7076,33 @@ function ($response) {
*
* Get all folders
*
- * @param int $limit Number of documents per page (required)
- * @param int $offset Index of the first document of the page (required)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number of documents per page (optional, default to 10)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFolders'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getFoldersAsyncWithHttpInfo($limit, $offset, $sort = 'desc')
+ public function getFoldersAsyncWithHttpInfo(
+ $limit = 10,
+ $offset = 0,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getFolders'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetFolders';
- $request = $this->getFoldersRequest($limit, $offset, $sort);
+ $returnType = '\Brevo\Client\Models\GetFolders';
+ $request = $this->getFoldersRequest($limit, $offset, $sort, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -5531,7 +7125,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -5540,34 +7134,31 @@ function ($exception) {
/**
* Create request for operation 'getFolders'
*
- * @param int $limit Number of documents per page (required)
- * @param int $offset Index of the first document of the page (required)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number of documents per page (optional, default to 10)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFolders'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getFoldersRequest($limit, $offset, $sort = 'desc')
+ public function getFoldersRequest(
+ $limit = 10,
+ $offset = 0,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getFolders'][0]
+ ): Request
{
- // verify the required parameter 'limit' is set
- if ($limit === null || (is_array($limit) && count($limit) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $limit when calling getFolders'
- );
- }
- if ($limit > 50) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling ContactsApi.getFolders, must be smaller than or equal to 50.');
+
+ if ($limit !== null && $limit > 50) {
+ throw new InvalidArgumentException('invalid value for "$limit" when calling ContactsApi.getFolders, must be smaller than or equal to 50.');
}
- if ($limit < 0) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling ContactsApi.getFolders, must be bigger than or equal to 0.');
+ if ($limit !== null && $limit < 0) {
+ throw new InvalidArgumentException('invalid value for "$limit" when calling ContactsApi.getFolders, must be bigger than or equal to 0.');
}
+
+
- // verify the required parameter 'offset' is set
- if ($offset === null || (is_array($offset) && count($offset) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $offset when calling getFolders'
- );
- }
$resourcePath = '/contacts/folders';
$formParams = [];
@@ -5577,66 +7168,64 @@ protected function getFoldersRequest($limit, $offset, $sort = 'desc')
$multipart = false;
// query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -5662,10 +7251,11 @@ protected function getFoldersRequest($limit, $offset, $sort = 'desc')
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -5674,39 +7264,50 @@ protected function getFoldersRequest($limit, $offset, $sort = 'desc')
/**
* Operation getList
*
- * Get a list's details
+ * Get a list's details
*
* @param int $listId Id of the list (required)
- * @param string $startDate Mandatory if endDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id.Prefer to pass your timezone in date-time format for accurate result (optional)
- * @param string $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id.Prefer to pass your timezone in date-time format for accurate result (optional)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetExtendedList
- */
- public function getList($listId, $startDate = null, $endDate = null)
- {
- list($response) = $this->getListWithHttpInfo($listId, $startDate, $endDate);
+ * @param string|null $startDate **Mandatory if endDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id. **Prefer to pass your timezone in date-time format for accurate result** (optional)
+ * @param string|null $endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id. **Prefer to pass your timezone in date-time format for accurate result** (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getList'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetExtendedList|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
+ */
+ public function getList(
+ int $listId,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ string $contentType = self::contentTypes['getList'][0]
+ ): \Brevo\Client\Models\GetExtendedList
+ {
+ list($response) = $this->getListWithHttpInfo($listId, $startDate, $endDate, $contentType);
return $response;
}
/**
* Operation getListWithHttpInfo
*
- * Get a list's details
+ * Get a list's details
*
* @param int $listId Id of the list (required)
- * @param string $startDate Mandatory if endDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id.Prefer to pass your timezone in date-time format for accurate result (optional)
- * @param string $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id.Prefer to pass your timezone in date-time format for accurate result (optional)
+ * @param string|null $startDate **Mandatory if endDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id. **Prefer to pass your timezone in date-time format for accurate result** (optional)
+ * @param string|null $endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id. **Prefer to pass your timezone in date-time format for accurate result** (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getList'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetExtendedList, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetExtendedList|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getListWithHttpInfo($listId, $startDate = null, $endDate = null)
+ public function getListWithHttpInfo(
+ int $listId,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ string $contentType = self::contentTypes['getList'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetExtendedList';
- $request = $this->getListRequest($listId, $startDate, $endDate);
+ $request = $this->getListRequest($listId, $startDate, $endDate, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -5715,34 +7316,138 @@ public function getListWithHttpInfo($listId, $startDate = null, $endDate = null)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetExtendedList', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetExtendedList' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetExtendedList', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetExtendedList';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -5757,23 +7462,23 @@ public function getListWithHttpInfo($listId, $startDate = null, $endDate = null)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetExtendedList',
+ '\Brevo\Client\Models\GetExtendedList',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 404:
+ case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 400:
+ case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -5786,18 +7491,24 @@ public function getListWithHttpInfo($listId, $startDate = null, $endDate = null)
/**
* Operation getListAsync
*
- * Get a list's details
+ * Get a list's details
*
* @param int $listId Id of the list (required)
- * @param string $startDate Mandatory if endDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id.Prefer to pass your timezone in date-time format for accurate result (optional)
- * @param string $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id.Prefer to pass your timezone in date-time format for accurate result (optional)
+ * @param string|null $startDate **Mandatory if endDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id. **Prefer to pass your timezone in date-time format for accurate result** (optional)
+ * @param string|null $endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id. **Prefer to pass your timezone in date-time format for accurate result** (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getList'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getListAsync($listId, $startDate = null, $endDate = null)
+ public function getListAsync(
+ int $listId,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ string $contentType = self::contentTypes['getList'][0]
+ ): PromiseInterface
{
- return $this->getListAsyncWithHttpInfo($listId, $startDate, $endDate)
+ return $this->getListAsyncWithHttpInfo($listId, $startDate, $endDate, $contentType)
->then(
function ($response) {
return $response[0];
@@ -5808,29 +7519,35 @@ function ($response) {
/**
* Operation getListAsyncWithHttpInfo
*
- * Get a list's details
+ * Get a list's details
*
* @param int $listId Id of the list (required)
- * @param string $startDate Mandatory if endDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id.Prefer to pass your timezone in date-time format for accurate result (optional)
- * @param string $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id.Prefer to pass your timezone in date-time format for accurate result (optional)
+ * @param string|null $startDate **Mandatory if endDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id. **Prefer to pass your timezone in date-time format for accurate result** (optional)
+ * @param string|null $endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id. **Prefer to pass your timezone in date-time format for accurate result** (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getList'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getListAsyncWithHttpInfo($listId, $startDate = null, $endDate = null)
+ public function getListAsyncWithHttpInfo(
+ $listId,
+ $startDate = null,
+ $endDate = null,
+ string $contentType = self::contentTypes['getList'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetExtendedList';
- $request = $this->getListRequest($listId, $startDate, $endDate);
+ $returnType = '\Brevo\Client\Models\GetExtendedList';
+ $request = $this->getListRequest($listId, $startDate, $endDate, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -5853,7 +7570,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -5863,21 +7580,31 @@ function ($exception) {
* Create request for operation 'getList'
*
* @param int $listId Id of the list (required)
- * @param string $startDate Mandatory if endDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id.Prefer to pass your timezone in date-time format for accurate result (optional)
- * @param string $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id.Prefer to pass your timezone in date-time format for accurate result (optional)
+ * @param string|null $startDate **Mandatory if endDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id. **Prefer to pass your timezone in date-time format for accurate result** (optional)
+ * @param string|null $endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id. **Prefer to pass your timezone in date-time format for accurate result** (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getList'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getListRequest($listId, $startDate = null, $endDate = null)
+ public function getListRequest(
+ $listId,
+ $startDate = null,
+ $endDate = null,
+ string $contentType = self::contentTypes['getList'][0]
+ ): Request
{
+
// verify the required parameter 'listId' is set
if ($listId === null || (is_array($listId) && count($listId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $listId when calling getList'
);
}
+
+
+
$resourcePath = '/contacts/lists/{listId}';
$formParams = [];
$queryParams = [];
@@ -5886,13 +7613,24 @@ protected function getListRequest($listId, $startDate = null, $endDate = null)
$multipart = false;
// query params
- if ($startDate !== null) {
- $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $startDate,
+ 'startDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($endDate !== null) {
- $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $endDate,
+ 'endDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
// path params
if ($listId !== null) {
@@ -5903,53 +7641,35 @@ protected function getListRequest($listId, $startDate = null, $endDate = null)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -5975,10 +7695,11 @@ protected function getListRequest($listId, $startDate = null, $endDate = null)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -5989,17 +7710,23 @@ protected function getListRequest($listId, $startDate = null, $endDate = null)
*
* Get all the lists
*
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number of documents per page (optional, default to 10)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLists'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetLists
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetLists|\Brevo\Client\Models\ErrorModel
*/
- public function getLists($limit = '10', $offset = '0', $sort = 'desc')
+ public function getLists(
+ ?int $limit = 10,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getLists'][0]
+ ): \Brevo\Client\Models\GetLists
{
- list($response) = $this->getListsWithHttpInfo($limit, $offset, $sort);
+ list($response) = $this->getListsWithHttpInfo($limit, $offset, $sort, $contentType);
return $response;
}
@@ -6008,18 +7735,23 @@ public function getLists($limit = '10', $offset = '0', $sort = 'desc')
*
* Get all the lists
*
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number of documents per page (optional, default to 10)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLists'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetLists, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetLists|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getListsWithHttpInfo($limit = '10', $offset = '0', $sort = 'desc')
+ public function getListsWithHttpInfo(
+ ?int $limit = 10,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getLists'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetLists';
- $request = $this->getListsRequest($limit, $offset, $sort);
+ $request = $this->getListsRequest($limit, $offset, $sort, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -6028,34 +7760,111 @@ public function getListsWithHttpInfo($limit = '10', $offset = '0', $sort = 'desc
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetLists', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetLists' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetLists', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetLists';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -6070,7 +7879,7 @@ public function getListsWithHttpInfo($limit = '10', $offset = '0', $sort = 'desc
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetLists',
+ '\Brevo\Client\Models\GetLists',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -6078,7 +7887,7 @@ public function getListsWithHttpInfo($limit = '10', $offset = '0', $sort = 'desc
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -6093,16 +7902,22 @@ public function getListsWithHttpInfo($limit = '10', $offset = '0', $sort = 'desc
*
* Get all the lists
*
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number of documents per page (optional, default to 10)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLists'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getListsAsync($limit = '10', $offset = '0', $sort = 'desc')
+ public function getListsAsync(
+ ?int $limit = 10,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getLists'][0]
+ ): PromiseInterface
{
- return $this->getListsAsyncWithHttpInfo($limit, $offset, $sort)
+ return $this->getListsAsyncWithHttpInfo($limit, $offset, $sort, $contentType)
->then(
function ($response) {
return $response[0];
@@ -6115,27 +7930,33 @@ function ($response) {
*
* Get all the lists
*
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number of documents per page (optional, default to 10)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLists'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getListsAsyncWithHttpInfo($limit = '10', $offset = '0', $sort = 'desc')
+ public function getListsAsyncWithHttpInfo(
+ $limit = 10,
+ $offset = 0,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getLists'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetLists';
- $request = $this->getListsRequest($limit, $offset, $sort);
+ $returnType = '\Brevo\Client\Models\GetLists';
+ $request = $this->getListsRequest($limit, $offset, $sort, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -6158,7 +7979,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -6167,21 +7988,30 @@ function ($exception) {
/**
* Create request for operation 'getLists'
*
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number of documents per page (optional, default to 10)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLists'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getListsRequest($limit = '10', $offset = '0', $sort = 'desc')
+ public function getListsRequest(
+ $limit = 10,
+ $offset = 0,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getLists'][0]
+ ): Request
{
+
if ($limit !== null && $limit > 50) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling ContactsApi.getLists, must be smaller than or equal to 50.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling ContactsApi.getLists, must be smaller than or equal to 50.');
}
if ($limit !== null && $limit < 0) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling ContactsApi.getLists, must be bigger than or equal to 0.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling ContactsApi.getLists, must be bigger than or equal to 0.');
}
+
+
$resourcePath = '/contacts/lists';
@@ -6192,66 +8022,64 @@ protected function getListsRequest($limit = '10', $offset = '0', $sort = 'desc')
$multipart = false;
// query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -6277,10 +8105,11 @@ protected function getListsRequest($limit = '10', $offset = '0', $sort = 'desc')
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -6289,39 +8118,50 @@ protected function getListsRequest($limit = '10', $offset = '0', $sort = 'desc')
/**
* Operation getSegments
*
- * Get all the Segments
+ * Get all the segments
*
- * @param int $limit Number of documents per page (required)
- * @param int $offset Index of the first document of the page (required)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number of documents per page (optional, default to 10)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSegments'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetSegments
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetSegments|\Brevo\Client\Models\ErrorModel
*/
- public function getSegments($limit, $offset, $sort = 'desc')
+ public function getSegments(
+ ?int $limit = 10,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getSegments'][0]
+ ): \Brevo\Client\Models\GetSegments
{
- list($response) = $this->getSegmentsWithHttpInfo($limit, $offset, $sort);
+ list($response) = $this->getSegmentsWithHttpInfo($limit, $offset, $sort, $contentType);
return $response;
}
/**
* Operation getSegmentsWithHttpInfo
*
- * Get all the Segments
+ * Get all the segments
*
- * @param int $limit Number of documents per page (required)
- * @param int $offset Index of the first document of the page (required)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number of documents per page (optional, default to 10)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSegments'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetSegments, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetSegments|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getSegmentsWithHttpInfo($limit, $offset, $sort = 'desc')
+ public function getSegmentsWithHttpInfo(
+ ?int $limit = 10,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getSegments'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetSegments';
- $request = $this->getSegmentsRequest($limit, $offset, $sort);
+ $request = $this->getSegmentsRequest($limit, $offset, $sort, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -6330,34 +8170,111 @@ public function getSegmentsWithHttpInfo($limit, $offset, $sort = 'desc')
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetSegments', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetSegments' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetSegments', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetSegments';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -6372,7 +8289,7 @@ public function getSegmentsWithHttpInfo($limit, $offset, $sort = 'desc')
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetSegments',
+ '\Brevo\Client\Models\GetSegments',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -6380,7 +8297,7 @@ public function getSegmentsWithHttpInfo($limit, $offset, $sort = 'desc')
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -6393,18 +8310,24 @@ public function getSegmentsWithHttpInfo($limit, $offset, $sort = 'desc')
/**
* Operation getSegmentsAsync
*
- * Get all the Segments
+ * Get all the segments
*
- * @param int $limit Number of documents per page (required)
- * @param int $offset Index of the first document of the page (required)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number of documents per page (optional, default to 10)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSegments'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getSegmentsAsync($limit, $offset, $sort = 'desc')
+ public function getSegmentsAsync(
+ ?int $limit = 10,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getSegments'][0]
+ ): PromiseInterface
{
- return $this->getSegmentsAsyncWithHttpInfo($limit, $offset, $sort)
+ return $this->getSegmentsAsyncWithHttpInfo($limit, $offset, $sort, $contentType)
->then(
function ($response) {
return $response[0];
@@ -6415,29 +8338,35 @@ function ($response) {
/**
* Operation getSegmentsAsyncWithHttpInfo
*
- * Get all the Segments
+ * Get all the segments
*
- * @param int $limit Number of documents per page (required)
- * @param int $offset Index of the first document of the page (required)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number of documents per page (optional, default to 10)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSegments'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getSegmentsAsyncWithHttpInfo($limit, $offset, $sort = 'desc')
+ public function getSegmentsAsyncWithHttpInfo(
+ $limit = 10,
+ $offset = 0,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getSegments'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetSegments';
- $request = $this->getSegmentsRequest($limit, $offset, $sort);
+ $returnType = '\Brevo\Client\Models\GetSegments';
+ $request = $this->getSegmentsRequest($limit, $offset, $sort, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -6460,7 +8389,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -6469,34 +8398,31 @@ function ($exception) {
/**
* Create request for operation 'getSegments'
*
- * @param int $limit Number of documents per page (required)
- * @param int $offset Index of the first document of the page (required)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number of documents per page (optional, default to 10)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSegments'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getSegmentsRequest($limit, $offset, $sort = 'desc')
+ public function getSegmentsRequest(
+ $limit = 10,
+ $offset = 0,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getSegments'][0]
+ ): Request
{
- // verify the required parameter 'limit' is set
- if ($limit === null || (is_array($limit) && count($limit) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $limit when calling getSegments'
- );
- }
- if ($limit > 50) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling ContactsApi.getSegments, must be smaller than or equal to 50.');
+
+ if ($limit !== null && $limit > 50) {
+ throw new InvalidArgumentException('invalid value for "$limit" when calling ContactsApi.getSegments, must be smaller than or equal to 50.');
}
- if ($limit < 0) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling ContactsApi.getSegments, must be bigger than or equal to 0.');
+ if ($limit !== null && $limit < 0) {
+ throw new InvalidArgumentException('invalid value for "$limit" when calling ContactsApi.getSegments, must be bigger than or equal to 0.');
}
+
+
- // verify the required parameter 'offset' is set
- if ($offset === null || (is_array($offset) && count($offset) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $offset when calling getSegments'
- );
- }
$resourcePath = '/contacts/segments';
$formParams = [];
@@ -6506,66 +8432,64 @@ protected function getSegmentsRequest($limit, $offset, $sort = 'desc')
$multipart = false;
// query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -6591,10 +8515,11 @@ protected function getSegmentsRequest($limit, $offset, $sort = 'desc')
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -6605,15 +8530,19 @@ protected function getSegmentsRequest($limit, $offset, $sort = 'desc')
*
* Import contacts
*
- * @param \Brevo\Client\Model\RequestContactImport $requestContactImport Values to import contacts in Brevo. To know more about the expected format, please have a look at ``https://help.brevo.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` (required)
+ * @param \Brevo\Client\Models\RequestContactImport $requestContactImport Values to import contacts in Brevo. To know more about the expected format, please have a look at ``https://help.brevo.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importContacts'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\CreatedProcessId
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CreatedProcessId|\Brevo\Client\Models\ErrorModel
*/
- public function importContacts($requestContactImport)
+ public function importContacts(
+ \Brevo\Client\Models\RequestContactImport $requestContactImport,
+ string $contentType = self::contentTypes['importContacts'][0]
+ ): \Brevo\Client\Models\CreatedProcessId
{
- list($response) = $this->importContactsWithHttpInfo($requestContactImport);
+ list($response) = $this->importContactsWithHttpInfo($requestContactImport, $contentType);
return $response;
}
@@ -6622,16 +8551,19 @@ public function importContacts($requestContactImport)
*
* Import contacts
*
- * @param \Brevo\Client\Model\RequestContactImport $requestContactImport Values to import contacts in Brevo. To know more about the expected format, please have a look at ``https://help.brevo.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` (required)
+ * @param \Brevo\Client\Models\RequestContactImport $requestContactImport Values to import contacts in Brevo. To know more about the expected format, please have a look at ``https://help.brevo.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importContacts'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\CreatedProcessId, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CreatedProcessId|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function importContactsWithHttpInfo($requestContactImport)
+ public function importContactsWithHttpInfo(
+ \Brevo\Client\Models\RequestContactImport $requestContactImport,
+ string $contentType = self::contentTypes['importContacts'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\CreatedProcessId';
- $request = $this->importContactsRequest($requestContactImport);
+ $request = $this->importContactsRequest($requestContactImport, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -6640,34 +8572,111 @@ public function importContactsWithHttpInfo($requestContactImport)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 202:
+ if (in_array('\Brevo\Client\Models\CreatedProcessId', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CreatedProcessId' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CreatedProcessId', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CreatedProcessId';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -6682,7 +8691,7 @@ public function importContactsWithHttpInfo($requestContactImport)
case 202:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\CreatedProcessId',
+ '\Brevo\Client\Models\CreatedProcessId',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -6690,7 +8699,7 @@ public function importContactsWithHttpInfo($requestContactImport)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -6705,14 +8714,18 @@ public function importContactsWithHttpInfo($requestContactImport)
*
* Import contacts
*
- * @param \Brevo\Client\Model\RequestContactImport $requestContactImport Values to import contacts in Brevo. To know more about the expected format, please have a look at ``https://help.brevo.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` (required)
+ * @param \Brevo\Client\Models\RequestContactImport $requestContactImport Values to import contacts in Brevo. To know more about the expected format, please have a look at ``https://help.brevo.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importContacts'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function importContactsAsync($requestContactImport)
+ public function importContactsAsync(
+ \Brevo\Client\Models\RequestContactImport $requestContactImport,
+ string $contentType = self::contentTypes['importContacts'][0]
+ ): PromiseInterface
{
- return $this->importContactsAsyncWithHttpInfo($requestContactImport)
+ return $this->importContactsAsyncWithHttpInfo($requestContactImport, $contentType)
->then(
function ($response) {
return $response[0];
@@ -6725,25 +8738,29 @@ function ($response) {
*
* Import contacts
*
- * @param \Brevo\Client\Model\RequestContactImport $requestContactImport Values to import contacts in Brevo. To know more about the expected format, please have a look at ``https://help.brevo.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` (required)
+ * @param \Brevo\Client\Models\RequestContactImport $requestContactImport Values to import contacts in Brevo. To know more about the expected format, please have a look at ``https://help.brevo.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importContacts'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function importContactsAsyncWithHttpInfo($requestContactImport)
+ public function importContactsAsyncWithHttpInfo(
+ $requestContactImport,
+ string $contentType = self::contentTypes['importContacts'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\CreatedProcessId';
- $request = $this->importContactsRequest($requestContactImport);
+ $returnType = '\Brevo\Client\Models\CreatedProcessId';
+ $request = $this->importContactsRequest($requestContactImport, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -6766,7 +8783,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -6775,20 +8792,26 @@ function ($exception) {
/**
* Create request for operation 'importContacts'
*
- * @param \Brevo\Client\Model\RequestContactImport $requestContactImport Values to import contacts in Brevo. To know more about the expected format, please have a look at ``https://help.brevo.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` (required)
+ * @param \Brevo\Client\Models\RequestContactImport $requestContactImport Values to import contacts in Brevo. To know more about the expected format, please have a look at ``https://help.brevo.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importContacts'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function importContactsRequest($requestContactImport)
+ public function importContactsRequest(
+ $requestContactImport,
+ string $contentType = self::contentTypes['importContacts'][0]
+ ): Request
{
+
// verify the required parameter 'requestContactImport' is set
if ($requestContactImport === null || (is_array($requestContactImport) && count($requestContactImport) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $requestContactImport when calling importContacts'
);
}
+
$resourcePath = '/contacts/import';
$formParams = [];
$queryParams = [];
@@ -6798,56 +8821,43 @@ protected function importContactsRequest($requestContactImport)
- // body params
- $_tempBody = null;
- if (isset($requestContactImport)) {
- $_tempBody = $requestContactImport;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($requestContactImport)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($requestContactImport));
+ } else {
+ $httpBody = $requestContactImport;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -6873,10 +8883,11 @@ protected function importContactsRequest($requestContactImport)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -6888,15 +8899,20 @@ protected function importContactsRequest($requestContactImport)
* Delete a contact from a list
*
* @param int $listId Id of the list (required)
- * @param \Brevo\Client\Model\RemoveContactFromList $contactEmails Emails addresses OR IDs of the contacts (required)
+ * @param \Brevo\Client\Models\RemoveContactFromListRequest $contactEmails Emails adresses OR IDs OR EXT_ID attributes of the contacts OR 'all' true (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removeContactFromList'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\PostContactInfo
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\PostContactInfo|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function removeContactFromList($listId, $contactEmails)
+ public function removeContactFromList(
+ int $listId,
+ \Brevo\Client\Models\RemoveContactFromListRequest $contactEmails,
+ string $contentType = self::contentTypes['removeContactFromList'][0]
+ ): \Brevo\Client\Models\PostContactInfo
{
- list($response) = $this->removeContactFromListWithHttpInfo($listId, $contactEmails);
+ list($response) = $this->removeContactFromListWithHttpInfo($listId, $contactEmails, $contentType);
return $response;
}
@@ -6906,52 +8922,160 @@ public function removeContactFromList($listId, $contactEmails)
* Delete a contact from a list
*
* @param int $listId Id of the list (required)
- * @param \Brevo\Client\Model\RemoveContactFromList $contactEmails Emails addresses OR IDs of the contacts (required)
+ * @param \Brevo\Client\Models\RemoveContactFromListRequest $contactEmails Emails adresses OR IDs OR EXT_ID attributes of the contacts OR 'all' true (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removeContactFromList'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\PostContactInfo, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\PostContactInfo|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function removeContactFromListWithHttpInfo($listId, $contactEmails)
+ public function removeContactFromListWithHttpInfo(
+ int $listId,
+ \Brevo\Client\Models\RemoveContactFromListRequest $contactEmails,
+ string $contentType = self::contentTypes['removeContactFromList'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\PostContactInfo';
- $request = $this->removeContactFromListRequest($listId, $contactEmails);
+ $request = $this->removeContactFromListRequest($listId, $contactEmails, $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 201:
+ if (in_array('\Brevo\Client\Models\PostContactInfo', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\PostContactInfo' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\PostContactInfo', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
- $statusCode = $response->getStatusCode();
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\PostContactInfo';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -6966,7 +9090,7 @@ public function removeContactFromListWithHttpInfo($listId, $contactEmails)
case 201:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\PostContactInfo',
+ '\Brevo\Client\Models\PostContactInfo',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -6974,7 +9098,7 @@ public function removeContactFromListWithHttpInfo($listId, $contactEmails)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -6982,7 +9106,7 @@ public function removeContactFromListWithHttpInfo($listId, $contactEmails)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -6998,14 +9122,19 @@ public function removeContactFromListWithHttpInfo($listId, $contactEmails)
* Delete a contact from a list
*
* @param int $listId Id of the list (required)
- * @param \Brevo\Client\Model\RemoveContactFromList $contactEmails Emails addresses OR IDs of the contacts (required)
+ * @param \Brevo\Client\Models\RemoveContactFromListRequest $contactEmails Emails adresses OR IDs OR EXT_ID attributes of the contacts OR 'all' true (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removeContactFromList'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function removeContactFromListAsync($listId, $contactEmails)
+ public function removeContactFromListAsync(
+ int $listId,
+ \Brevo\Client\Models\RemoveContactFromListRequest $contactEmails,
+ string $contentType = self::contentTypes['removeContactFromList'][0]
+ ): PromiseInterface
{
- return $this->removeContactFromListAsyncWithHttpInfo($listId, $contactEmails)
+ return $this->removeContactFromListAsyncWithHttpInfo($listId, $contactEmails, $contentType)
->then(
function ($response) {
return $response[0];
@@ -7019,25 +9148,30 @@ function ($response) {
* Delete a contact from a list
*
* @param int $listId Id of the list (required)
- * @param \Brevo\Client\Model\RemoveContactFromList $contactEmails Emails addresses OR IDs of the contacts (required)
+ * @param \Brevo\Client\Models\RemoveContactFromListRequest $contactEmails Emails adresses OR IDs OR EXT_ID attributes of the contacts OR 'all' true (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removeContactFromList'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function removeContactFromListAsyncWithHttpInfo($listId, $contactEmails)
+ public function removeContactFromListAsyncWithHttpInfo(
+ $listId,
+ $contactEmails,
+ string $contentType = self::contentTypes['removeContactFromList'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\PostContactInfo';
- $request = $this->removeContactFromListRequest($listId, $contactEmails);
+ $returnType = '\Brevo\Client\Models\PostContactInfo';
+ $request = $this->removeContactFromListRequest($listId, $contactEmails, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -7060,7 +9194,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -7070,26 +9204,34 @@ function ($exception) {
* Create request for operation 'removeContactFromList'
*
* @param int $listId Id of the list (required)
- * @param \Brevo\Client\Model\RemoveContactFromList $contactEmails Emails addresses OR IDs of the contacts (required)
+ * @param \Brevo\Client\Models\RemoveContactFromListRequest $contactEmails Emails adresses OR IDs OR EXT_ID attributes of the contacts OR 'all' true (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removeContactFromList'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function removeContactFromListRequest($listId, $contactEmails)
+ public function removeContactFromListRequest(
+ $listId,
+ $contactEmails,
+ string $contentType = self::contentTypes['removeContactFromList'][0]
+ ): Request
{
+
// verify the required parameter 'listId' is set
if ($listId === null || (is_array($listId) && count($listId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $listId when calling removeContactFromList'
);
}
+
// verify the required parameter 'contactEmails' is set
if ($contactEmails === null || (is_array($contactEmails) && count($contactEmails) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $contactEmails when calling removeContactFromList'
);
}
+
$resourcePath = '/contacts/lists/{listId}/contacts/remove';
$formParams = [];
$queryParams = [];
@@ -7098,6 +9240,7 @@ protected function removeContactFromListRequest($listId, $contactEmails)
$multipart = false;
+
// path params
if ($listId !== null) {
$resourcePath = str_replace(
@@ -7107,56 +9250,42 @@ protected function removeContactFromListRequest($listId, $contactEmails)
);
}
- // body params
- $_tempBody = null;
- if (isset($contactEmails)) {
- $_tempBody = $contactEmails;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($contactEmails)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contactEmails));
+ } else {
+ $httpBody = $contactEmails;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -7182,10 +9311,11 @@ protected function removeContactFromListRequest($listId, $contactEmails)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -7196,15 +9326,19 @@ protected function removeContactFromListRequest($listId, $contactEmails)
*
* Export contacts
*
- * @param \Brevo\Client\Model\RequestContactExport $requestContactExport Values to request a contact export (required)
+ * @param \Brevo\Client\Models\RequestContactExport $requestContactExport Values to request a contact export (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requestContactExport'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\CreatedProcessId
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CreatedProcessId|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function requestContactExport($requestContactExport)
+ public function requestContactExport(
+ \Brevo\Client\Models\RequestContactExport $requestContactExport,
+ string $contentType = self::contentTypes['requestContactExport'][0]
+ ): \Brevo\Client\Models\CreatedProcessId
{
- list($response) = $this->requestContactExportWithHttpInfo($requestContactExport);
+ list($response) = $this->requestContactExportWithHttpInfo($requestContactExport, $contentType);
return $response;
}
@@ -7213,16 +9347,19 @@ public function requestContactExport($requestContactExport)
*
* Export contacts
*
- * @param \Brevo\Client\Model\RequestContactExport $requestContactExport Values to request a contact export (required)
+ * @param \Brevo\Client\Models\RequestContactExport $requestContactExport Values to request a contact export (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requestContactExport'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\CreatedProcessId, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CreatedProcessId|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function requestContactExportWithHttpInfo($requestContactExport)
+ public function requestContactExportWithHttpInfo(
+ \Brevo\Client\Models\RequestContactExport $requestContactExport,
+ string $contentType = self::contentTypes['requestContactExport'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\CreatedProcessId';
- $request = $this->requestContactExportRequest($requestContactExport);
+ $request = $this->requestContactExportRequest($requestContactExport, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -7231,34 +9368,138 @@ public function requestContactExportWithHttpInfo($requestContactExport)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 202:
+ if (in_array('\Brevo\Client\Models\CreatedProcessId', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CreatedProcessId' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CreatedProcessId', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CreatedProcessId';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -7273,7 +9514,7 @@ public function requestContactExportWithHttpInfo($requestContactExport)
case 202:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\CreatedProcessId',
+ '\Brevo\Client\Models\CreatedProcessId',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -7281,7 +9522,7 @@ public function requestContactExportWithHttpInfo($requestContactExport)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -7289,7 +9530,7 @@ public function requestContactExportWithHttpInfo($requestContactExport)
case 429:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -7304,14 +9545,18 @@ public function requestContactExportWithHttpInfo($requestContactExport)
*
* Export contacts
*
- * @param \Brevo\Client\Model\RequestContactExport $requestContactExport Values to request a contact export (required)
+ * @param \Brevo\Client\Models\RequestContactExport $requestContactExport Values to request a contact export (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requestContactExport'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function requestContactExportAsync($requestContactExport)
+ public function requestContactExportAsync(
+ \Brevo\Client\Models\RequestContactExport $requestContactExport,
+ string $contentType = self::contentTypes['requestContactExport'][0]
+ ): PromiseInterface
{
- return $this->requestContactExportAsyncWithHttpInfo($requestContactExport)
+ return $this->requestContactExportAsyncWithHttpInfo($requestContactExport, $contentType)
->then(
function ($response) {
return $response[0];
@@ -7324,25 +9569,29 @@ function ($response) {
*
* Export contacts
*
- * @param \Brevo\Client\Model\RequestContactExport $requestContactExport Values to request a contact export (required)
+ * @param \Brevo\Client\Models\RequestContactExport $requestContactExport Values to request a contact export (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requestContactExport'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function requestContactExportAsyncWithHttpInfo($requestContactExport)
+ public function requestContactExportAsyncWithHttpInfo(
+ $requestContactExport,
+ string $contentType = self::contentTypes['requestContactExport'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\CreatedProcessId';
- $request = $this->requestContactExportRequest($requestContactExport);
+ $returnType = '\Brevo\Client\Models\CreatedProcessId';
+ $request = $this->requestContactExportRequest($requestContactExport, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -7365,7 +9614,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -7374,20 +9623,26 @@ function ($exception) {
/**
* Create request for operation 'requestContactExport'
*
- * @param \Brevo\Client\Model\RequestContactExport $requestContactExport Values to request a contact export (required)
+ * @param \Brevo\Client\Models\RequestContactExport $requestContactExport Values to request a contact export (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requestContactExport'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function requestContactExportRequest($requestContactExport)
+ public function requestContactExportRequest(
+ $requestContactExport,
+ string $contentType = self::contentTypes['requestContactExport'][0]
+ ): Request
{
+
// verify the required parameter 'requestContactExport' is set
if ($requestContactExport === null || (is_array($requestContactExport) && count($requestContactExport) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $requestContactExport when calling requestContactExport'
);
}
+
$resourcePath = '/contacts/export';
$formParams = [];
$queryParams = [];
@@ -7397,56 +9652,43 @@ protected function requestContactExportRequest($requestContactExport)
- // body params
- $_tempBody = null;
- if (isset($requestContactExport)) {
- $_tempBody = $requestContactExport;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($requestContactExport)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($requestContactExport));
+ } else {
+ $httpBody = $requestContactExport;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -7472,10 +9714,11 @@ protected function requestContactExportRequest($requestContactExport)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -7488,15 +9731,21 @@ protected function requestContactExportRequest($requestContactExport)
*
* @param string $attributeCategory Category of the attribute (required)
* @param string $attributeName Name of the existing attribute (required)
- * @param \Brevo\Client\Model\UpdateAttribute $updateAttribute Values to update an attribute (required)
+ * @param \Brevo\Client\Models\UpdateAttribute $updateAttribute Values to update an attribute (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAttribute'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function updateAttribute($attributeCategory, $attributeName, $updateAttribute)
+ public function updateAttribute(
+ string $attributeCategory,
+ string $attributeName,
+ \Brevo\Client\Models\UpdateAttribute $updateAttribute,
+ string $contentType = self::contentTypes['updateAttribute'][0]
+ ): void
{
- $this->updateAttributeWithHttpInfo($attributeCategory, $attributeName, $updateAttribute);
+ $this->updateAttributeWithHttpInfo($attributeCategory, $attributeName, $updateAttribute, $contentType);
}
/**
@@ -7506,16 +9755,21 @@ public function updateAttribute($attributeCategory, $attributeName, $updateAttri
*
* @param string $attributeCategory Category of the attribute (required)
* @param string $attributeName Name of the existing attribute (required)
- * @param \Brevo\Client\Model\UpdateAttribute $updateAttribute Values to update an attribute (required)
+ * @param \Brevo\Client\Models\UpdateAttribute $updateAttribute Values to update an attribute (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAttribute'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function updateAttributeWithHttpInfo($attributeCategory, $attributeName, $updateAttribute)
+ public function updateAttributeWithHttpInfo(
+ string $attributeCategory,
+ string $attributeName,
+ \Brevo\Client\Models\UpdateAttribute $updateAttribute,
+ string $contentType = self::contentTypes['updateAttribute'][0]
+ ): array
{
- $returnType = '';
- $request = $this->updateAttributeRequest($attributeCategory, $attributeName, $updateAttribute);
+ $request = $this->updateAttributeRequest($attributeCategory, $attributeName, $updateAttribute, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -7524,26 +9778,21 @@ public function updateAttributeWithHttpInfo($attributeCategory, $attributeName,
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -7552,7 +9801,7 @@ public function updateAttributeWithHttpInfo($attributeCategory, $attributeName,
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -7560,7 +9809,7 @@ public function updateAttributeWithHttpInfo($attributeCategory, $attributeName,
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -7577,14 +9826,20 @@ public function updateAttributeWithHttpInfo($attributeCategory, $attributeName,
*
* @param string $attributeCategory Category of the attribute (required)
* @param string $attributeName Name of the existing attribute (required)
- * @param \Brevo\Client\Model\UpdateAttribute $updateAttribute Values to update an attribute (required)
+ * @param \Brevo\Client\Models\UpdateAttribute $updateAttribute Values to update an attribute (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAttribute'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function updateAttributeAsync($attributeCategory, $attributeName, $updateAttribute)
+ public function updateAttributeAsync(
+ string $attributeCategory,
+ string $attributeName,
+ \Brevo\Client\Models\UpdateAttribute $updateAttribute,
+ string $contentType = self::contentTypes['updateAttribute'][0]
+ ): PromiseInterface
{
- return $this->updateAttributeAsyncWithHttpInfo($attributeCategory, $attributeName, $updateAttribute)
+ return $this->updateAttributeAsyncWithHttpInfo($attributeCategory, $attributeName, $updateAttribute, $contentType)
->then(
function ($response) {
return $response[0];
@@ -7599,15 +9854,22 @@ function ($response) {
*
* @param string $attributeCategory Category of the attribute (required)
* @param string $attributeName Name of the existing attribute (required)
- * @param \Brevo\Client\Model\UpdateAttribute $updateAttribute Values to update an attribute (required)
+ * @param \Brevo\Client\Models\UpdateAttribute $updateAttribute Values to update an attribute (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAttribute'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function updateAttributeAsyncWithHttpInfo($attributeCategory, $attributeName, $updateAttribute)
+ public function updateAttributeAsyncWithHttpInfo(
+ $attributeCategory,
+ $attributeName,
+ $updateAttribute,
+ string $contentType = self::contentTypes['updateAttribute'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->updateAttributeRequest($attributeCategory, $attributeName, $updateAttribute);
+ $request = $this->updateAttributeRequest($attributeCategory, $attributeName, $updateAttribute, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -7626,7 +9888,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -7637,32 +9899,42 @@ function ($exception) {
*
* @param string $attributeCategory Category of the attribute (required)
* @param string $attributeName Name of the existing attribute (required)
- * @param \Brevo\Client\Model\UpdateAttribute $updateAttribute Values to update an attribute (required)
+ * @param \Brevo\Client\Models\UpdateAttribute $updateAttribute Values to update an attribute (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAttribute'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function updateAttributeRequest($attributeCategory, $attributeName, $updateAttribute)
+ public function updateAttributeRequest(
+ $attributeCategory,
+ $attributeName,
+ $updateAttribute,
+ string $contentType = self::contentTypes['updateAttribute'][0]
+ ): Request
{
+
// verify the required parameter 'attributeCategory' is set
if ($attributeCategory === null || (is_array($attributeCategory) && count($attributeCategory) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $attributeCategory when calling updateAttribute'
);
}
+
// verify the required parameter 'attributeName' is set
if ($attributeName === null || (is_array($attributeName) && count($attributeName) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $attributeName when calling updateAttribute'
);
}
+
// verify the required parameter 'updateAttribute' is set
if ($updateAttribute === null || (is_array($updateAttribute) && count($updateAttribute) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $updateAttribute when calling updateAttribute'
);
}
+
$resourcePath = '/contacts/attributes/{attributeCategory}/{attributeName}';
$formParams = [];
$queryParams = [];
@@ -7671,6 +9943,7 @@ protected function updateAttributeRequest($attributeCategory, $attributeName, $u
$multipart = false;
+
// path params
if ($attributeCategory !== null) {
$resourcePath = str_replace(
@@ -7688,56 +9961,42 @@ protected function updateAttributeRequest($attributeCategory, $attributeName, $u
);
}
- // body params
- $_tempBody = null;
- if (isset($updateAttribute)) {
- $_tempBody = $updateAttribute;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($updateAttribute)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($updateAttribute));
+ } else {
+ $httpBody = $updateAttribute;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -7763,10 +10022,11 @@ protected function updateAttributeRequest($attributeCategory, $attributeName, $u
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'PUT',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -7777,15 +10037,19 @@ protected function updateAttributeRequest($attributeCategory, $attributeName, $u
*
* Update multiple contacts
*
- * @param \Brevo\Client\Model\UpdateBatchContacts $updateBatchContacts Values to update multiple contacts (required)
+ * @param \Brevo\Client\Models\UpdateBatchContacts $updateBatchContacts Values to update multiple contacts (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBatchContacts'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function updateBatchContacts($updateBatchContacts)
+ public function updateBatchContacts(
+ \Brevo\Client\Models\UpdateBatchContacts $updateBatchContacts,
+ string $contentType = self::contentTypes['updateBatchContacts'][0]
+ ): void
{
- $this->updateBatchContactsWithHttpInfo($updateBatchContacts);
+ $this->updateBatchContactsWithHttpInfo($updateBatchContacts, $contentType);
}
/**
@@ -7793,16 +10057,19 @@ public function updateBatchContacts($updateBatchContacts)
*
* Update multiple contacts
*
- * @param \Brevo\Client\Model\UpdateBatchContacts $updateBatchContacts Values to update multiple contacts (required)
+ * @param \Brevo\Client\Models\UpdateBatchContacts $updateBatchContacts Values to update multiple contacts (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBatchContacts'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function updateBatchContactsWithHttpInfo($updateBatchContacts)
+ public function updateBatchContactsWithHttpInfo(
+ \Brevo\Client\Models\UpdateBatchContacts $updateBatchContacts,
+ string $contentType = self::contentTypes['updateBatchContacts'][0]
+ ): array
{
- $returnType = '';
- $request = $this->updateBatchContactsRequest($updateBatchContacts);
+ $request = $this->updateBatchContactsRequest($updateBatchContacts, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -7811,26 +10078,21 @@ public function updateBatchContactsWithHttpInfo($updateBatchContacts)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -7839,7 +10101,7 @@ public function updateBatchContactsWithHttpInfo($updateBatchContacts)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -7854,14 +10116,18 @@ public function updateBatchContactsWithHttpInfo($updateBatchContacts)
*
* Update multiple contacts
*
- * @param \Brevo\Client\Model\UpdateBatchContacts $updateBatchContacts Values to update multiple contacts (required)
+ * @param \Brevo\Client\Models\UpdateBatchContacts $updateBatchContacts Values to update multiple contacts (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBatchContacts'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function updateBatchContactsAsync($updateBatchContacts)
+ public function updateBatchContactsAsync(
+ \Brevo\Client\Models\UpdateBatchContacts $updateBatchContacts,
+ string $contentType = self::contentTypes['updateBatchContacts'][0]
+ ): PromiseInterface
{
- return $this->updateBatchContactsAsyncWithHttpInfo($updateBatchContacts)
+ return $this->updateBatchContactsAsyncWithHttpInfo($updateBatchContacts, $contentType)
->then(
function ($response) {
return $response[0];
@@ -7874,15 +10140,20 @@ function ($response) {
*
* Update multiple contacts
*
- * @param \Brevo\Client\Model\UpdateBatchContacts $updateBatchContacts Values to update multiple contacts (required)
+ * @param \Brevo\Client\Models\UpdateBatchContacts $updateBatchContacts Values to update multiple contacts (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBatchContacts'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function updateBatchContactsAsyncWithHttpInfo($updateBatchContacts)
+ public function updateBatchContactsAsyncWithHttpInfo(
+ $updateBatchContacts,
+ string $contentType = self::contentTypes['updateBatchContacts'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->updateBatchContactsRequest($updateBatchContacts);
+ $request = $this->updateBatchContactsRequest($updateBatchContacts, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -7901,7 +10172,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -7910,20 +10181,26 @@ function ($exception) {
/**
* Create request for operation 'updateBatchContacts'
*
- * @param \Brevo\Client\Model\UpdateBatchContacts $updateBatchContacts Values to update multiple contacts (required)
+ * @param \Brevo\Client\Models\UpdateBatchContacts $updateBatchContacts Values to update multiple contacts (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBatchContacts'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function updateBatchContactsRequest($updateBatchContacts)
+ public function updateBatchContactsRequest(
+ $updateBatchContacts,
+ string $contentType = self::contentTypes['updateBatchContacts'][0]
+ ): Request
{
+
// verify the required parameter 'updateBatchContacts' is set
if ($updateBatchContacts === null || (is_array($updateBatchContacts) && count($updateBatchContacts) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $updateBatchContacts when calling updateBatchContacts'
);
}
+
$resourcePath = '/contacts/batch';
$formParams = [];
$queryParams = [];
@@ -7933,56 +10210,43 @@ protected function updateBatchContactsRequest($updateBatchContacts)
- // body params
- $_tempBody = null;
- if (isset($updateBatchContacts)) {
- $_tempBody = $updateBatchContacts;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($updateBatchContacts)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($updateBatchContacts));
+ } else {
+ $httpBody = $updateBatchContacts;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -8008,10 +10272,11 @@ protected function updateBatchContactsRequest($updateBatchContacts)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -8022,17 +10287,23 @@ protected function updateBatchContactsRequest($updateBatchContacts)
*
* Update a contact
*
- * @param string $identifier Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) OR its SMS attribute value OR its WHATSAPP attribute value OR its LANDLINE attribute value (required)
- * @param \Brevo\Client\Model\UpdateContact $updateContact Values to update a contact (required)
- * @param object $identifierType email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute (optional)
+ * @param \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) OR its SMS attribute value OR its WHATSAPP attribute value OR its LANDLINE attribute value (required)
+ * @param \Brevo\Client\Models\UpdateContact $updateContact Values to update a contact (required)
+ * @param string|null $identifierType email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateContact'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function updateContact($identifier, $updateContact, $identifierType = null)
+ public function updateContact(
+ \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier,
+ \Brevo\Client\Models\UpdateContact $updateContact,
+ ?string $identifierType = null,
+ string $contentType = self::contentTypes['updateContact'][0]
+ ): void
{
- $this->updateContactWithHttpInfo($identifier, $updateContact, $identifierType);
+ $this->updateContactWithHttpInfo($identifier, $updateContact, $identifierType, $contentType);
}
/**
@@ -8040,18 +10311,23 @@ public function updateContact($identifier, $updateContact, $identifierType = nul
*
* Update a contact
*
- * @param string $identifier Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) OR its SMS attribute value OR its WHATSAPP attribute value OR its LANDLINE attribute value (required)
- * @param \Brevo\Client\Model\UpdateContact $updateContact Values to update a contact (required)
- * @param object $identifierType email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute (optional)
+ * @param \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) OR its SMS attribute value OR its WHATSAPP attribute value OR its LANDLINE attribute value (required)
+ * @param \Brevo\Client\Models\UpdateContact $updateContact Values to update a contact (required)
+ * @param string|null $identifierType email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateContact'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function updateContactWithHttpInfo($identifier, $updateContact, $identifierType = null)
+ public function updateContactWithHttpInfo(
+ \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier,
+ \Brevo\Client\Models\UpdateContact $updateContact,
+ ?string $identifierType = null,
+ string $contentType = self::contentTypes['updateContact'][0]
+ ): array
{
- $returnType = '';
- $request = $this->updateContactRequest($identifier, $updateContact, $identifierType);
+ $request = $this->updateContactRequest($identifier, $updateContact, $identifierType, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -8060,26 +10336,21 @@ public function updateContactWithHttpInfo($identifier, $updateContact, $identifi
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -8088,7 +10359,7 @@ public function updateContactWithHttpInfo($identifier, $updateContact, $identifi
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ContactErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -8096,7 +10367,7 @@ public function updateContactWithHttpInfo($identifier, $updateContact, $identifi
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ContactErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -8104,7 +10375,7 @@ public function updateContactWithHttpInfo($identifier, $updateContact, $identifi
case 425:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ContactErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -8119,16 +10390,22 @@ public function updateContactWithHttpInfo($identifier, $updateContact, $identifi
*
* Update a contact
*
- * @param string $identifier Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) OR its SMS attribute value OR its WHATSAPP attribute value OR its LANDLINE attribute value (required)
- * @param \Brevo\Client\Model\UpdateContact $updateContact Values to update a contact (required)
- * @param object $identifierType email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute (optional)
+ * @param \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) OR its SMS attribute value OR its WHATSAPP attribute value OR its LANDLINE attribute value (required)
+ * @param \Brevo\Client\Models\UpdateContact $updateContact Values to update a contact (required)
+ * @param string|null $identifierType email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateContact'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function updateContactAsync($identifier, $updateContact, $identifierType = null)
+ public function updateContactAsync(
+ \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier,
+ \Brevo\Client\Models\UpdateContact $updateContact,
+ ?string $identifierType = null,
+ string $contentType = self::contentTypes['updateContact'][0]
+ ): PromiseInterface
{
- return $this->updateContactAsyncWithHttpInfo($identifier, $updateContact, $identifierType)
+ return $this->updateContactAsyncWithHttpInfo($identifier, $updateContact, $identifierType, $contentType)
->then(
function ($response) {
return $response[0];
@@ -8141,17 +10418,24 @@ function ($response) {
*
* Update a contact
*
- * @param string $identifier Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) OR its SMS attribute value OR its WHATSAPP attribute value OR its LANDLINE attribute value (required)
- * @param \Brevo\Client\Model\UpdateContact $updateContact Values to update a contact (required)
- * @param object $identifierType email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute (optional)
+ * @param \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) OR its SMS attribute value OR its WHATSAPP attribute value OR its LANDLINE attribute value (required)
+ * @param \Brevo\Client\Models\UpdateContact $updateContact Values to update a contact (required)
+ * @param string|null $identifierType email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateContact'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function updateContactAsyncWithHttpInfo($identifier, $updateContact, $identifierType = null)
+ public function updateContactAsyncWithHttpInfo(
+ $identifier,
+ $updateContact,
+ $identifierType = null,
+ string $contentType = self::contentTypes['updateContact'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->updateContactRequest($identifier, $updateContact, $identifierType);
+ $request = $this->updateContactRequest($identifier, $updateContact, $identifierType, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -8170,7 +10454,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -8179,28 +10463,38 @@ function ($exception) {
/**
* Create request for operation 'updateContact'
*
- * @param string $identifier Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) OR its SMS attribute value OR its WHATSAPP attribute value OR its LANDLINE attribute value (required)
- * @param \Brevo\Client\Model\UpdateContact $updateContact Values to update a contact (required)
- * @param object $identifierType email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute (optional)
+ * @param \Brevo\Client\Models\GetContactInfoIdentifierParameter $identifier Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) OR its SMS attribute value OR its WHATSAPP attribute value OR its LANDLINE attribute value (required)
+ * @param \Brevo\Client\Models\UpdateContact $updateContact Values to update a contact (required)
+ * @param string|null $identifierType email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateContact'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function updateContactRequest($identifier, $updateContact, $identifierType = null)
+ public function updateContactRequest(
+ $identifier,
+ $updateContact,
+ $identifierType = null,
+ string $contentType = self::contentTypes['updateContact'][0]
+ ): Request
{
+
// verify the required parameter 'identifier' is set
if ($identifier === null || (is_array($identifier) && count($identifier) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $identifier when calling updateContact'
);
}
+
// verify the required parameter 'updateContact' is set
if ($updateContact === null || (is_array($updateContact) && count($updateContact) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $updateContact when calling updateContact'
);
}
+
+
$resourcePath = '/contacts/{identifier}';
$formParams = [];
$queryParams = [];
@@ -8209,9 +10503,15 @@ protected function updateContactRequest($identifier, $updateContact, $identifier
$multipart = false;
// query params
- if ($identifierType !== null) {
- $queryParams['identifierType'] = ObjectSerializer::toQueryValue($identifierType);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $identifierType,
+ 'identifierType', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
// path params
if ($identifier !== null) {
@@ -8222,56 +10522,42 @@ protected function updateContactRequest($identifier, $updateContact, $identifier
);
}
- // body params
- $_tempBody = null;
- if (isset($updateContact)) {
- $_tempBody = $updateContact;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($updateContact)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($updateContact));
+ } else {
+ $httpBody = $updateContact;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -8297,10 +10583,11 @@ protected function updateContactRequest($identifier, $updateContact, $identifier
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'PUT',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -8312,15 +10599,20 @@ protected function updateContactRequest($identifier, $updateContact, $identifier
* Update a folder
*
* @param int $folderId Id of the folder (required)
- * @param \Brevo\Client\Model\CreateUpdateFolder $updateFolder Name of the folder (required)
+ * @param \Brevo\Client\Models\CreateUpdateFolder $updateFolder Name of the folder (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateFolder'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function updateFolder($folderId, $updateFolder)
+ public function updateFolder(
+ int $folderId,
+ \Brevo\Client\Models\CreateUpdateFolder $updateFolder,
+ string $contentType = self::contentTypes['updateFolder'][0]
+ ): void
{
- $this->updateFolderWithHttpInfo($folderId, $updateFolder);
+ $this->updateFolderWithHttpInfo($folderId, $updateFolder, $contentType);
}
/**
@@ -8329,16 +10621,20 @@ public function updateFolder($folderId, $updateFolder)
* Update a folder
*
* @param int $folderId Id of the folder (required)
- * @param \Brevo\Client\Model\CreateUpdateFolder $updateFolder Name of the folder (required)
+ * @param \Brevo\Client\Models\CreateUpdateFolder $updateFolder Name of the folder (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateFolder'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function updateFolderWithHttpInfo($folderId, $updateFolder)
+ public function updateFolderWithHttpInfo(
+ int $folderId,
+ \Brevo\Client\Models\CreateUpdateFolder $updateFolder,
+ string $contentType = self::contentTypes['updateFolder'][0]
+ ): array
{
- $returnType = '';
- $request = $this->updateFolderRequest($folderId, $updateFolder);
+ $request = $this->updateFolderRequest($folderId, $updateFolder, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -8347,26 +10643,21 @@ public function updateFolderWithHttpInfo($folderId, $updateFolder)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -8375,7 +10666,7 @@ public function updateFolderWithHttpInfo($folderId, $updateFolder)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -8383,7 +10674,7 @@ public function updateFolderWithHttpInfo($folderId, $updateFolder)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -8399,14 +10690,19 @@ public function updateFolderWithHttpInfo($folderId, $updateFolder)
* Update a folder
*
* @param int $folderId Id of the folder (required)
- * @param \Brevo\Client\Model\CreateUpdateFolder $updateFolder Name of the folder (required)
+ * @param \Brevo\Client\Models\CreateUpdateFolder $updateFolder Name of the folder (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateFolder'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function updateFolderAsync($folderId, $updateFolder)
+ public function updateFolderAsync(
+ int $folderId,
+ \Brevo\Client\Models\CreateUpdateFolder $updateFolder,
+ string $contentType = self::contentTypes['updateFolder'][0]
+ ): PromiseInterface
{
- return $this->updateFolderAsyncWithHttpInfo($folderId, $updateFolder)
+ return $this->updateFolderAsyncWithHttpInfo($folderId, $updateFolder, $contentType)
->then(
function ($response) {
return $response[0];
@@ -8420,15 +10716,21 @@ function ($response) {
* Update a folder
*
* @param int $folderId Id of the folder (required)
- * @param \Brevo\Client\Model\CreateUpdateFolder $updateFolder Name of the folder (required)
+ * @param \Brevo\Client\Models\CreateUpdateFolder $updateFolder Name of the folder (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateFolder'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function updateFolderAsyncWithHttpInfo($folderId, $updateFolder)
+ public function updateFolderAsyncWithHttpInfo(
+ $folderId,
+ $updateFolder,
+ string $contentType = self::contentTypes['updateFolder'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->updateFolderRequest($folderId, $updateFolder);
+ $request = $this->updateFolderRequest($folderId, $updateFolder, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -8447,7 +10749,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -8457,26 +10759,34 @@ function ($exception) {
* Create request for operation 'updateFolder'
*
* @param int $folderId Id of the folder (required)
- * @param \Brevo\Client\Model\CreateUpdateFolder $updateFolder Name of the folder (required)
+ * @param \Brevo\Client\Models\CreateUpdateFolder $updateFolder Name of the folder (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateFolder'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function updateFolderRequest($folderId, $updateFolder)
+ public function updateFolderRequest(
+ $folderId,
+ $updateFolder,
+ string $contentType = self::contentTypes['updateFolder'][0]
+ ): Request
{
+
// verify the required parameter 'folderId' is set
if ($folderId === null || (is_array($folderId) && count($folderId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $folderId when calling updateFolder'
);
}
+
// verify the required parameter 'updateFolder' is set
if ($updateFolder === null || (is_array($updateFolder) && count($updateFolder) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $updateFolder when calling updateFolder'
);
}
+
$resourcePath = '/contacts/folders/{folderId}';
$formParams = [];
$queryParams = [];
@@ -8485,6 +10795,7 @@ protected function updateFolderRequest($folderId, $updateFolder)
$multipart = false;
+
// path params
if ($folderId !== null) {
$resourcePath = str_replace(
@@ -8494,56 +10805,42 @@ protected function updateFolderRequest($folderId, $updateFolder)
);
}
- // body params
- $_tempBody = null;
- if (isset($updateFolder)) {
- $_tempBody = $updateFolder;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($updateFolder)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($updateFolder));
+ } else {
+ $httpBody = $updateFolder;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -8569,10 +10866,11 @@ protected function updateFolderRequest($folderId, $updateFolder)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'PUT',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -8584,15 +10882,20 @@ protected function updateFolderRequest($folderId, $updateFolder)
* Update a list
*
* @param int $listId Id of the list (required)
- * @param \Brevo\Client\Model\UpdateList $updateList Values to update a list (required)
+ * @param \Brevo\Client\Models\UpdateList $updateList Values to update a list (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateList'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function updateList($listId, $updateList)
+ public function updateList(
+ int $listId,
+ \Brevo\Client\Models\UpdateList $updateList,
+ string $contentType = self::contentTypes['updateList'][0]
+ ): void
{
- $this->updateListWithHttpInfo($listId, $updateList);
+ $this->updateListWithHttpInfo($listId, $updateList, $contentType);
}
/**
@@ -8601,16 +10904,20 @@ public function updateList($listId, $updateList)
* Update a list
*
* @param int $listId Id of the list (required)
- * @param \Brevo\Client\Model\UpdateList $updateList Values to update a list (required)
+ * @param \Brevo\Client\Models\UpdateList $updateList Values to update a list (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateList'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function updateListWithHttpInfo($listId, $updateList)
+ public function updateListWithHttpInfo(
+ int $listId,
+ \Brevo\Client\Models\UpdateList $updateList,
+ string $contentType = self::contentTypes['updateList'][0]
+ ): array
{
- $returnType = '';
- $request = $this->updateListRequest($listId, $updateList);
+ $request = $this->updateListRequest($listId, $updateList, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -8619,26 +10926,21 @@ public function updateListWithHttpInfo($listId, $updateList)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -8647,7 +10949,7 @@ public function updateListWithHttpInfo($listId, $updateList)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -8655,7 +10957,7 @@ public function updateListWithHttpInfo($listId, $updateList)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -8671,14 +10973,19 @@ public function updateListWithHttpInfo($listId, $updateList)
* Update a list
*
* @param int $listId Id of the list (required)
- * @param \Brevo\Client\Model\UpdateList $updateList Values to update a list (required)
+ * @param \Brevo\Client\Models\UpdateList $updateList Values to update a list (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateList'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function updateListAsync($listId, $updateList)
+ public function updateListAsync(
+ int $listId,
+ \Brevo\Client\Models\UpdateList $updateList,
+ string $contentType = self::contentTypes['updateList'][0]
+ ): PromiseInterface
{
- return $this->updateListAsyncWithHttpInfo($listId, $updateList)
+ return $this->updateListAsyncWithHttpInfo($listId, $updateList, $contentType)
->then(
function ($response) {
return $response[0];
@@ -8692,15 +10999,21 @@ function ($response) {
* Update a list
*
* @param int $listId Id of the list (required)
- * @param \Brevo\Client\Model\UpdateList $updateList Values to update a list (required)
+ * @param \Brevo\Client\Models\UpdateList $updateList Values to update a list (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateList'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function updateListAsyncWithHttpInfo($listId, $updateList)
+ public function updateListAsyncWithHttpInfo(
+ $listId,
+ $updateList,
+ string $contentType = self::contentTypes['updateList'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->updateListRequest($listId, $updateList);
+ $request = $this->updateListRequest($listId, $updateList, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -8719,7 +11032,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -8729,26 +11042,34 @@ function ($exception) {
* Create request for operation 'updateList'
*
* @param int $listId Id of the list (required)
- * @param \Brevo\Client\Model\UpdateList $updateList Values to update a list (required)
+ * @param \Brevo\Client\Models\UpdateList $updateList Values to update a list (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateList'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function updateListRequest($listId, $updateList)
+ public function updateListRequest(
+ $listId,
+ $updateList,
+ string $contentType = self::contentTypes['updateList'][0]
+ ): Request
{
+
// verify the required parameter 'listId' is set
if ($listId === null || (is_array($listId) && count($listId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $listId when calling updateList'
);
}
+
// verify the required parameter 'updateList' is set
if ($updateList === null || (is_array($updateList) && count($updateList) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $updateList when calling updateList'
);
}
+
$resourcePath = '/contacts/lists/{listId}';
$formParams = [];
$queryParams = [];
@@ -8757,6 +11078,7 @@ protected function updateListRequest($listId, $updateList)
$multipart = false;
+
// path params
if ($listId !== null) {
$resourcePath = str_replace(
@@ -8766,56 +11088,42 @@ protected function updateListRequest($listId, $updateList)
);
}
- // body params
- $_tempBody = null;
- if (isset($updateList)) {
- $_tempBody = $updateList;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($updateList)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($updateList));
+ } else {
+ $httpBody = $updateList;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -8841,10 +11149,11 @@ protected function updateListRequest($listId, $updateList)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'PUT',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -8856,7 +11165,7 @@ protected function updateListRequest($listId, $updateList)
* @throws \RuntimeException on file opening failure
* @return array of http client options
*/
- protected function createHttpClientOption()
+ protected function createHttpClientOption(): array
{
$options = [];
if ($this->config->getDebug()) {
diff --git a/lib/Api/ConversationsApi.php b/lib/Api/ConversationsApi.php
index 570d4c5..b096985 100644
--- a/lib/Api/ConversationsApi.php
+++ b/lib/Api/ConversationsApi.php
@@ -1,39 +1,41 @@
[
+ 'application/json',
+ ],
+ 'conversationsMessagesIdDelete' => [
+ 'application/json',
+ ],
+ 'conversationsMessagesIdGet' => [
+ 'application/json',
+ ],
+ 'conversationsMessagesIdPut' => [
+ 'application/json',
+ ],
+ 'conversationsMessagesPost' => [
+ 'application/json',
+ ],
+ 'conversationsPushedMessagesIdDelete' => [
+ 'application/json',
+ ],
+ 'conversationsPushedMessagesIdGet' => [
+ 'application/json',
+ ],
+ 'conversationsPushedMessagesIdPut' => [
+ 'application/json',
+ ],
+ 'conversationsPushedMessagesPost' => [
+ 'application/json',
+ ],
+ ];
+
+ /**
+ * @param ClientInterface|null $client
+ * @param Configuration|null $config
+ * @param HeaderSelector|null $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
+ HeaderSelector $selector = null,
+ int $hostIndex = 0
) {
$this->client = $client ?: new Client();
- $this->config = $config ?: new Configuration();
+ $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(int $hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex(): int
+ {
+ return $this->hostIndex;
}
/**
* @return Configuration
*/
- public function getConfig()
+ public function getConfig(): Configuration
{
return $this->config;
}
@@ -92,15 +152,19 @@ public function getConfig()
*
* Sets agent’s status to online for 2-3 minutes
*
- * @param \Brevo\Client\Model\Body14 $body Agent fields. (required)
+ * @param \Brevo\Client\Models\ConversationsAgentOnlinePingPostRequest $conversationsAgentOnlinePingPostRequest conversationsAgentOnlinePingPostRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsAgentOnlinePingPost'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function conversationsAgentOnlinePingPost($body)
+ public function conversationsAgentOnlinePingPost(
+ \Brevo\Client\Models\ConversationsAgentOnlinePingPostRequest $conversationsAgentOnlinePingPostRequest,
+ string $contentType = self::contentTypes['conversationsAgentOnlinePingPost'][0]
+ ): void
{
- $this->conversationsAgentOnlinePingPostWithHttpInfo($body);
+ $this->conversationsAgentOnlinePingPostWithHttpInfo($conversationsAgentOnlinePingPostRequest, $contentType);
}
/**
@@ -108,16 +172,19 @@ public function conversationsAgentOnlinePingPost($body)
*
* Sets agent’s status to online for 2-3 minutes
*
- * @param \Brevo\Client\Model\Body14 $body Agent fields. (required)
+ * @param \Brevo\Client\Models\ConversationsAgentOnlinePingPostRequest $conversationsAgentOnlinePingPostRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsAgentOnlinePingPost'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function conversationsAgentOnlinePingPostWithHttpInfo($body)
+ public function conversationsAgentOnlinePingPostWithHttpInfo(
+ \Brevo\Client\Models\ConversationsAgentOnlinePingPostRequest $conversationsAgentOnlinePingPostRequest,
+ string $contentType = self::contentTypes['conversationsAgentOnlinePingPost'][0]
+ ): array
{
- $returnType = '';
- $request = $this->conversationsAgentOnlinePingPostRequest($body);
+ $request = $this->conversationsAgentOnlinePingPostRequest($conversationsAgentOnlinePingPostRequest, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -126,26 +193,21 @@ public function conversationsAgentOnlinePingPostWithHttpInfo($body)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -154,7 +216,7 @@ public function conversationsAgentOnlinePingPostWithHttpInfo($body)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -169,14 +231,18 @@ public function conversationsAgentOnlinePingPostWithHttpInfo($body)
*
* Sets agent’s status to online for 2-3 minutes
*
- * @param \Brevo\Client\Model\Body14 $body Agent fields. (required)
+ * @param \Brevo\Client\Models\ConversationsAgentOnlinePingPostRequest $conversationsAgentOnlinePingPostRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsAgentOnlinePingPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function conversationsAgentOnlinePingPostAsync($body)
+ public function conversationsAgentOnlinePingPostAsync(
+ \Brevo\Client\Models\ConversationsAgentOnlinePingPostRequest $conversationsAgentOnlinePingPostRequest,
+ string $contentType = self::contentTypes['conversationsAgentOnlinePingPost'][0]
+ ): PromiseInterface
{
- return $this->conversationsAgentOnlinePingPostAsyncWithHttpInfo($body)
+ return $this->conversationsAgentOnlinePingPostAsyncWithHttpInfo($conversationsAgentOnlinePingPostRequest, $contentType)
->then(
function ($response) {
return $response[0];
@@ -189,15 +255,20 @@ function ($response) {
*
* Sets agent’s status to online for 2-3 minutes
*
- * @param \Brevo\Client\Model\Body14 $body Agent fields. (required)
+ * @param \Brevo\Client\Models\ConversationsAgentOnlinePingPostRequest $conversationsAgentOnlinePingPostRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsAgentOnlinePingPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function conversationsAgentOnlinePingPostAsyncWithHttpInfo($body)
+ public function conversationsAgentOnlinePingPostAsyncWithHttpInfo(
+ $conversationsAgentOnlinePingPostRequest,
+ string $contentType = self::contentTypes['conversationsAgentOnlinePingPost'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->conversationsAgentOnlinePingPostRequest($body);
+ $request = $this->conversationsAgentOnlinePingPostRequest($conversationsAgentOnlinePingPostRequest, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -216,7 +287,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -225,20 +296,26 @@ function ($exception) {
/**
* Create request for operation 'conversationsAgentOnlinePingPost'
*
- * @param \Brevo\Client\Model\Body14 $body Agent fields. (required)
+ * @param \Brevo\Client\Models\ConversationsAgentOnlinePingPostRequest $conversationsAgentOnlinePingPostRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsAgentOnlinePingPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function conversationsAgentOnlinePingPostRequest($body)
+ public function conversationsAgentOnlinePingPostRequest(
+ $conversationsAgentOnlinePingPostRequest,
+ string $contentType = self::contentTypes['conversationsAgentOnlinePingPost'][0]
+ ): Request
{
- // verify the required parameter 'body' is set
- if ($body === null || (is_array($body) && count($body) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $body when calling conversationsAgentOnlinePingPost'
+
+ // verify the required parameter 'conversationsAgentOnlinePingPostRequest' is set
+ if ($conversationsAgentOnlinePingPostRequest === null || (is_array($conversationsAgentOnlinePingPostRequest) && count($conversationsAgentOnlinePingPostRequest) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $conversationsAgentOnlinePingPostRequest when calling conversationsAgentOnlinePingPost'
);
}
+
$resourcePath = '/conversations/agentOnlinePing';
$formParams = [];
$queryParams = [];
@@ -248,56 +325,43 @@ protected function conversationsAgentOnlinePingPostRequest($body)
- // body params
- $_tempBody = null;
- if (isset($body)) {
- $_tempBody = $body;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($conversationsAgentOnlinePingPostRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($conversationsAgentOnlinePingPostRequest));
+ } else {
+ $httpBody = $conversationsAgentOnlinePingPostRequest;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -323,10 +387,11 @@ protected function conversationsAgentOnlinePingPostRequest($body)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -338,14 +403,18 @@ protected function conversationsAgentOnlinePingPostRequest($body)
* Delete a message sent by an agent
*
* @param string $id ID of the message (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsMessagesIdDelete'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function conversationsMessagesIdDelete($id)
+ public function conversationsMessagesIdDelete(
+ string $id,
+ string $contentType = self::contentTypes['conversationsMessagesIdDelete'][0]
+ ): void
{
- $this->conversationsMessagesIdDeleteWithHttpInfo($id);
+ $this->conversationsMessagesIdDeleteWithHttpInfo($id, $contentType);
}
/**
@@ -354,15 +423,18 @@ public function conversationsMessagesIdDelete($id)
* Delete a message sent by an agent
*
* @param string $id ID of the message (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsMessagesIdDelete'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function conversationsMessagesIdDeleteWithHttpInfo($id)
+ public function conversationsMessagesIdDeleteWithHttpInfo(
+ string $id,
+ string $contentType = self::contentTypes['conversationsMessagesIdDelete'][0]
+ ): array
{
- $returnType = '';
- $request = $this->conversationsMessagesIdDeleteRequest($id);
+ $request = $this->conversationsMessagesIdDeleteRequest($id, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -371,26 +443,21 @@ public function conversationsMessagesIdDeleteWithHttpInfo($id)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -399,7 +466,7 @@ public function conversationsMessagesIdDeleteWithHttpInfo($id)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -407,7 +474,7 @@ public function conversationsMessagesIdDeleteWithHttpInfo($id)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -423,13 +490,17 @@ public function conversationsMessagesIdDeleteWithHttpInfo($id)
* Delete a message sent by an agent
*
* @param string $id ID of the message (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsMessagesIdDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function conversationsMessagesIdDeleteAsync($id)
+ public function conversationsMessagesIdDeleteAsync(
+ string $id,
+ string $contentType = self::contentTypes['conversationsMessagesIdDelete'][0]
+ ): PromiseInterface
{
- return $this->conversationsMessagesIdDeleteAsyncWithHttpInfo($id)
+ return $this->conversationsMessagesIdDeleteAsyncWithHttpInfo($id, $contentType)
->then(
function ($response) {
return $response[0];
@@ -443,14 +514,19 @@ function ($response) {
* Delete a message sent by an agent
*
* @param string $id ID of the message (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsMessagesIdDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function conversationsMessagesIdDeleteAsyncWithHttpInfo($id)
+ public function conversationsMessagesIdDeleteAsyncWithHttpInfo(
+ $id,
+ string $contentType = self::contentTypes['conversationsMessagesIdDelete'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->conversationsMessagesIdDeleteRequest($id);
+ $request = $this->conversationsMessagesIdDeleteRequest($id, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -469,7 +545,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -479,19 +555,25 @@ function ($exception) {
* Create request for operation 'conversationsMessagesIdDelete'
*
* @param string $id ID of the message (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsMessagesIdDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function conversationsMessagesIdDeleteRequest($id)
+ public function conversationsMessagesIdDeleteRequest(
+ $id,
+ string $contentType = self::contentTypes['conversationsMessagesIdDelete'][0]
+ ): Request
{
+
// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $id when calling conversationsMessagesIdDelete'
);
}
+
$resourcePath = '/conversations/messages/{id}';
$formParams = [];
$queryParams = [];
@@ -500,6 +582,7 @@ protected function conversationsMessagesIdDeleteRequest($id)
$multipart = false;
+
// path params
if ($id !== null) {
$resourcePath = str_replace(
@@ -509,53 +592,35 @@ protected function conversationsMessagesIdDeleteRequest($id)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -581,10 +646,11 @@ protected function conversationsMessagesIdDeleteRequest($id)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -596,14 +662,18 @@ protected function conversationsMessagesIdDeleteRequest($id)
* Get a message
*
* @param string $id ID of the message (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsMessagesIdGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\ConversationsMessage
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\ConversationsMessage|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function conversationsMessagesIdGet($id)
+ public function conversationsMessagesIdGet(
+ string $id,
+ string $contentType = self::contentTypes['conversationsMessagesIdGet'][0]
+ ): \Brevo\Client\Models\ConversationsMessage
{
- list($response) = $this->conversationsMessagesIdGetWithHttpInfo($id);
+ list($response) = $this->conversationsMessagesIdGetWithHttpInfo($id, $contentType);
return $response;
}
@@ -613,15 +683,18 @@ public function conversationsMessagesIdGet($id)
* Get a message
*
* @param string $id ID of the message (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsMessagesIdGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\ConversationsMessage, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\ConversationsMessage|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function conversationsMessagesIdGetWithHttpInfo($id)
+ public function conversationsMessagesIdGetWithHttpInfo(
+ string $id,
+ string $contentType = self::contentTypes['conversationsMessagesIdGet'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\ConversationsMessage';
- $request = $this->conversationsMessagesIdGetRequest($id);
+ $request = $this->conversationsMessagesIdGetRequest($id, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -630,34 +703,138 @@ public function conversationsMessagesIdGetWithHttpInfo($id)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\ConversationsMessage', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ConversationsMessage' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ConversationsMessage', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\ConversationsMessage';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -672,7 +849,7 @@ public function conversationsMessagesIdGetWithHttpInfo($id)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ConversationsMessage',
+ '\Brevo\Client\Models\ConversationsMessage',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -680,7 +857,7 @@ public function conversationsMessagesIdGetWithHttpInfo($id)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -688,7 +865,7 @@ public function conversationsMessagesIdGetWithHttpInfo($id)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -704,13 +881,17 @@ public function conversationsMessagesIdGetWithHttpInfo($id)
* Get a message
*
* @param string $id ID of the message (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsMessagesIdGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function conversationsMessagesIdGetAsync($id)
+ public function conversationsMessagesIdGetAsync(
+ string $id,
+ string $contentType = self::contentTypes['conversationsMessagesIdGet'][0]
+ ): PromiseInterface
{
- return $this->conversationsMessagesIdGetAsyncWithHttpInfo($id)
+ return $this->conversationsMessagesIdGetAsyncWithHttpInfo($id, $contentType)
->then(
function ($response) {
return $response[0];
@@ -724,24 +905,28 @@ function ($response) {
* Get a message
*
* @param string $id ID of the message (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsMessagesIdGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function conversationsMessagesIdGetAsyncWithHttpInfo($id)
+ public function conversationsMessagesIdGetAsyncWithHttpInfo(
+ $id,
+ string $contentType = self::contentTypes['conversationsMessagesIdGet'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\ConversationsMessage';
- $request = $this->conversationsMessagesIdGetRequest($id);
+ $returnType = '\Brevo\Client\Models\ConversationsMessage';
+ $request = $this->conversationsMessagesIdGetRequest($id, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -764,7 +949,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -774,19 +959,25 @@ function ($exception) {
* Create request for operation 'conversationsMessagesIdGet'
*
* @param string $id ID of the message (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsMessagesIdGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function conversationsMessagesIdGetRequest($id)
+ public function conversationsMessagesIdGetRequest(
+ $id,
+ string $contentType = self::contentTypes['conversationsMessagesIdGet'][0]
+ ): Request
{
+
// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $id when calling conversationsMessagesIdGet'
);
}
+
$resourcePath = '/conversations/messages/{id}';
$formParams = [];
$queryParams = [];
@@ -795,6 +986,7 @@ protected function conversationsMessagesIdGetRequest($id)
$multipart = false;
+
// path params
if ($id !== null) {
$resourcePath = str_replace(
@@ -804,53 +996,35 @@ protected function conversationsMessagesIdGetRequest($id)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -876,10 +1050,11 @@ protected function conversationsMessagesIdGetRequest($id)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -891,15 +1066,20 @@ protected function conversationsMessagesIdGetRequest($id)
* Update a message sent by an agent
*
* @param string $id ID of the message (required)
- * @param \Brevo\Client\Model\Body11 $body body (optional)
+ * @param \Brevo\Client\Models\ConversationsMessagesIdPutRequest $conversationsMessagesIdPutRequest conversationsMessagesIdPutRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsMessagesIdPut'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\ConversationsMessage
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\ConversationsMessage|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function conversationsMessagesIdPut($id, $body = null)
+ public function conversationsMessagesIdPut(
+ string $id,
+ \Brevo\Client\Models\ConversationsMessagesIdPutRequest $conversationsMessagesIdPutRequest,
+ string $contentType = self::contentTypes['conversationsMessagesIdPut'][0]
+ ): \Brevo\Client\Models\ConversationsMessage
{
- list($response) = $this->conversationsMessagesIdPutWithHttpInfo($id, $body);
+ list($response) = $this->conversationsMessagesIdPutWithHttpInfo($id, $conversationsMessagesIdPutRequest, $contentType);
return $response;
}
@@ -909,16 +1089,20 @@ public function conversationsMessagesIdPut($id, $body = null)
* Update a message sent by an agent
*
* @param string $id ID of the message (required)
- * @param \Brevo\Client\Model\Body11 $body (optional)
+ * @param \Brevo\Client\Models\ConversationsMessagesIdPutRequest $conversationsMessagesIdPutRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsMessagesIdPut'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\ConversationsMessage, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\ConversationsMessage|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function conversationsMessagesIdPutWithHttpInfo($id, $body = null)
+ public function conversationsMessagesIdPutWithHttpInfo(
+ string $id,
+ \Brevo\Client\Models\ConversationsMessagesIdPutRequest $conversationsMessagesIdPutRequest,
+ string $contentType = self::contentTypes['conversationsMessagesIdPut'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\ConversationsMessage';
- $request = $this->conversationsMessagesIdPutRequest($id, $body);
+ $request = $this->conversationsMessagesIdPutRequest($id, $conversationsMessagesIdPutRequest, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -927,34 +1111,138 @@ public function conversationsMessagesIdPutWithHttpInfo($id, $body = null)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\ConversationsMessage', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ConversationsMessage' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ConversationsMessage', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\ConversationsMessage';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -969,7 +1257,7 @@ public function conversationsMessagesIdPutWithHttpInfo($id, $body = null)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ConversationsMessage',
+ '\Brevo\Client\Models\ConversationsMessage',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -977,7 +1265,7 @@ public function conversationsMessagesIdPutWithHttpInfo($id, $body = null)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -985,7 +1273,7 @@ public function conversationsMessagesIdPutWithHttpInfo($id, $body = null)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1001,14 +1289,19 @@ public function conversationsMessagesIdPutWithHttpInfo($id, $body = null)
* Update a message sent by an agent
*
* @param string $id ID of the message (required)
- * @param \Brevo\Client\Model\Body11 $body (optional)
+ * @param \Brevo\Client\Models\ConversationsMessagesIdPutRequest $conversationsMessagesIdPutRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsMessagesIdPut'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function conversationsMessagesIdPutAsync($id, $body = null)
+ public function conversationsMessagesIdPutAsync(
+ string $id,
+ \Brevo\Client\Models\ConversationsMessagesIdPutRequest $conversationsMessagesIdPutRequest,
+ string $contentType = self::contentTypes['conversationsMessagesIdPut'][0]
+ ): PromiseInterface
{
- return $this->conversationsMessagesIdPutAsyncWithHttpInfo($id, $body)
+ return $this->conversationsMessagesIdPutAsyncWithHttpInfo($id, $conversationsMessagesIdPutRequest, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1022,25 +1315,30 @@ function ($response) {
* Update a message sent by an agent
*
* @param string $id ID of the message (required)
- * @param \Brevo\Client\Model\Body11 $body (optional)
+ * @param \Brevo\Client\Models\ConversationsMessagesIdPutRequest $conversationsMessagesIdPutRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsMessagesIdPut'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function conversationsMessagesIdPutAsyncWithHttpInfo($id, $body = null)
+ public function conversationsMessagesIdPutAsyncWithHttpInfo(
+ $id,
+ $conversationsMessagesIdPutRequest,
+ string $contentType = self::contentTypes['conversationsMessagesIdPut'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\ConversationsMessage';
- $request = $this->conversationsMessagesIdPutRequest($id, $body);
+ $returnType = '\Brevo\Client\Models\ConversationsMessage';
+ $request = $this->conversationsMessagesIdPutRequest($id, $conversationsMessagesIdPutRequest, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1063,7 +1361,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1073,20 +1371,34 @@ function ($exception) {
* Create request for operation 'conversationsMessagesIdPut'
*
* @param string $id ID of the message (required)
- * @param \Brevo\Client\Model\Body11 $body (optional)
+ * @param \Brevo\Client\Models\ConversationsMessagesIdPutRequest $conversationsMessagesIdPutRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsMessagesIdPut'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function conversationsMessagesIdPutRequest($id, $body = null)
+ public function conversationsMessagesIdPutRequest(
+ $id,
+ $conversationsMessagesIdPutRequest,
+ string $contentType = self::contentTypes['conversationsMessagesIdPut'][0]
+ ): Request
{
+
// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $id when calling conversationsMessagesIdPut'
);
}
+ // verify the required parameter 'conversationsMessagesIdPutRequest' is set
+ if ($conversationsMessagesIdPutRequest === null || (is_array($conversationsMessagesIdPutRequest) && count($conversationsMessagesIdPutRequest) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $conversationsMessagesIdPutRequest when calling conversationsMessagesIdPut'
+ );
+ }
+
+
$resourcePath = '/conversations/messages/{id}';
$formParams = [];
$queryParams = [];
@@ -1095,6 +1407,7 @@ protected function conversationsMessagesIdPutRequest($id, $body = null)
$multipart = false;
+
// path params
if ($id !== null) {
$resourcePath = str_replace(
@@ -1104,56 +1417,42 @@ protected function conversationsMessagesIdPutRequest($id, $body = null)
);
}
- // body params
- $_tempBody = null;
- if (isset($body)) {
- $_tempBody = $body;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($conversationsMessagesIdPutRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($conversationsMessagesIdPutRequest));
+ } else {
+ $httpBody = $conversationsMessagesIdPutRequest;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1179,10 +1478,11 @@ protected function conversationsMessagesIdPutRequest($id, $body = null)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'PUT',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1193,15 +1493,19 @@ protected function conversationsMessagesIdPutRequest($id, $body = null)
*
* Send a message as an agent
*
- * @param \Brevo\Client\Model\Body10 $body Message fields. (required)
+ * @param \Brevo\Client\Models\ConversationsMessagesPostRequest $conversationsMessagesPostRequest conversationsMessagesPostRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsMessagesPost'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\ConversationsMessage
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\ConversationsMessage|\Brevo\Client\Models\ErrorModel
*/
- public function conversationsMessagesPost($body)
+ public function conversationsMessagesPost(
+ \Brevo\Client\Models\ConversationsMessagesPostRequest $conversationsMessagesPostRequest,
+ string $contentType = self::contentTypes['conversationsMessagesPost'][0]
+ ): \Brevo\Client\Models\ConversationsMessage
{
- list($response) = $this->conversationsMessagesPostWithHttpInfo($body);
+ list($response) = $this->conversationsMessagesPostWithHttpInfo($conversationsMessagesPostRequest, $contentType);
return $response;
}
@@ -1210,16 +1514,19 @@ public function conversationsMessagesPost($body)
*
* Send a message as an agent
*
- * @param \Brevo\Client\Model\Body10 $body Message fields. (required)
+ * @param \Brevo\Client\Models\ConversationsMessagesPostRequest $conversationsMessagesPostRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsMessagesPost'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\ConversationsMessage, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\ConversationsMessage|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function conversationsMessagesPostWithHttpInfo($body)
+ public function conversationsMessagesPostWithHttpInfo(
+ \Brevo\Client\Models\ConversationsMessagesPostRequest $conversationsMessagesPostRequest,
+ string $contentType = self::contentTypes['conversationsMessagesPost'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\ConversationsMessage';
- $request = $this->conversationsMessagesPostRequest($body);
+ $request = $this->conversationsMessagesPostRequest($conversationsMessagesPostRequest, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1228,34 +1535,111 @@ public function conversationsMessagesPostWithHttpInfo($body)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\ConversationsMessage', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ConversationsMessage' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ConversationsMessage', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\ConversationsMessage';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1270,7 +1654,7 @@ public function conversationsMessagesPostWithHttpInfo($body)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ConversationsMessage',
+ '\Brevo\Client\Models\ConversationsMessage',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1278,7 +1662,7 @@ public function conversationsMessagesPostWithHttpInfo($body)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1293,14 +1677,18 @@ public function conversationsMessagesPostWithHttpInfo($body)
*
* Send a message as an agent
*
- * @param \Brevo\Client\Model\Body10 $body Message fields. (required)
+ * @param \Brevo\Client\Models\ConversationsMessagesPostRequest $conversationsMessagesPostRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsMessagesPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function conversationsMessagesPostAsync($body)
+ public function conversationsMessagesPostAsync(
+ \Brevo\Client\Models\ConversationsMessagesPostRequest $conversationsMessagesPostRequest,
+ string $contentType = self::contentTypes['conversationsMessagesPost'][0]
+ ): PromiseInterface
{
- return $this->conversationsMessagesPostAsyncWithHttpInfo($body)
+ return $this->conversationsMessagesPostAsyncWithHttpInfo($conversationsMessagesPostRequest, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1313,25 +1701,29 @@ function ($response) {
*
* Send a message as an agent
*
- * @param \Brevo\Client\Model\Body10 $body Message fields. (required)
+ * @param \Brevo\Client\Models\ConversationsMessagesPostRequest $conversationsMessagesPostRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsMessagesPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function conversationsMessagesPostAsyncWithHttpInfo($body)
+ public function conversationsMessagesPostAsyncWithHttpInfo(
+ $conversationsMessagesPostRequest,
+ string $contentType = self::contentTypes['conversationsMessagesPost'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\ConversationsMessage';
- $request = $this->conversationsMessagesPostRequest($body);
+ $returnType = '\Brevo\Client\Models\ConversationsMessage';
+ $request = $this->conversationsMessagesPostRequest($conversationsMessagesPostRequest, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1354,7 +1746,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1363,20 +1755,26 @@ function ($exception) {
/**
* Create request for operation 'conversationsMessagesPost'
*
- * @param \Brevo\Client\Model\Body10 $body Message fields. (required)
+ * @param \Brevo\Client\Models\ConversationsMessagesPostRequest $conversationsMessagesPostRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsMessagesPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function conversationsMessagesPostRequest($body)
+ public function conversationsMessagesPostRequest(
+ $conversationsMessagesPostRequest,
+ string $contentType = self::contentTypes['conversationsMessagesPost'][0]
+ ): Request
{
- // verify the required parameter 'body' is set
- if ($body === null || (is_array($body) && count($body) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $body when calling conversationsMessagesPost'
+
+ // verify the required parameter 'conversationsMessagesPostRequest' is set
+ if ($conversationsMessagesPostRequest === null || (is_array($conversationsMessagesPostRequest) && count($conversationsMessagesPostRequest) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $conversationsMessagesPostRequest when calling conversationsMessagesPost'
);
}
+
$resourcePath = '/conversations/messages';
$formParams = [];
$queryParams = [];
@@ -1386,56 +1784,43 @@ protected function conversationsMessagesPostRequest($body)
- // body params
- $_tempBody = null;
- if (isset($body)) {
- $_tempBody = $body;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($conversationsMessagesPostRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($conversationsMessagesPostRequest));
+ } else {
+ $httpBody = $conversationsMessagesPostRequest;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1461,10 +1846,11 @@ protected function conversationsMessagesPostRequest($body)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1476,14 +1862,18 @@ protected function conversationsMessagesPostRequest($body)
* Delete an automated message
*
* @param string $id ID of the message (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsPushedMessagesIdDelete'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function conversationsPushedMessagesIdDelete($id)
+ public function conversationsPushedMessagesIdDelete(
+ string $id,
+ string $contentType = self::contentTypes['conversationsPushedMessagesIdDelete'][0]
+ ): void
{
- $this->conversationsPushedMessagesIdDeleteWithHttpInfo($id);
+ $this->conversationsPushedMessagesIdDeleteWithHttpInfo($id, $contentType);
}
/**
@@ -1492,15 +1882,18 @@ public function conversationsPushedMessagesIdDelete($id)
* Delete an automated message
*
* @param string $id ID of the message (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsPushedMessagesIdDelete'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function conversationsPushedMessagesIdDeleteWithHttpInfo($id)
+ public function conversationsPushedMessagesIdDeleteWithHttpInfo(
+ string $id,
+ string $contentType = self::contentTypes['conversationsPushedMessagesIdDelete'][0]
+ ): array
{
- $returnType = '';
- $request = $this->conversationsPushedMessagesIdDeleteRequest($id);
+ $request = $this->conversationsPushedMessagesIdDeleteRequest($id, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1509,26 +1902,21 @@ public function conversationsPushedMessagesIdDeleteWithHttpInfo($id)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -1537,7 +1925,7 @@ public function conversationsPushedMessagesIdDeleteWithHttpInfo($id)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1545,7 +1933,7 @@ public function conversationsPushedMessagesIdDeleteWithHttpInfo($id)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1561,13 +1949,17 @@ public function conversationsPushedMessagesIdDeleteWithHttpInfo($id)
* Delete an automated message
*
* @param string $id ID of the message (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsPushedMessagesIdDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function conversationsPushedMessagesIdDeleteAsync($id)
+ public function conversationsPushedMessagesIdDeleteAsync(
+ string $id,
+ string $contentType = self::contentTypes['conversationsPushedMessagesIdDelete'][0]
+ ): PromiseInterface
{
- return $this->conversationsPushedMessagesIdDeleteAsyncWithHttpInfo($id)
+ return $this->conversationsPushedMessagesIdDeleteAsyncWithHttpInfo($id, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1581,14 +1973,19 @@ function ($response) {
* Delete an automated message
*
* @param string $id ID of the message (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsPushedMessagesIdDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function conversationsPushedMessagesIdDeleteAsyncWithHttpInfo($id)
+ public function conversationsPushedMessagesIdDeleteAsyncWithHttpInfo(
+ $id,
+ string $contentType = self::contentTypes['conversationsPushedMessagesIdDelete'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->conversationsPushedMessagesIdDeleteRequest($id);
+ $request = $this->conversationsPushedMessagesIdDeleteRequest($id, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -1607,7 +2004,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1617,19 +2014,25 @@ function ($exception) {
* Create request for operation 'conversationsPushedMessagesIdDelete'
*
* @param string $id ID of the message (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsPushedMessagesIdDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function conversationsPushedMessagesIdDeleteRequest($id)
+ public function conversationsPushedMessagesIdDeleteRequest(
+ $id,
+ string $contentType = self::contentTypes['conversationsPushedMessagesIdDelete'][0]
+ ): Request
{
+
// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $id when calling conversationsPushedMessagesIdDelete'
);
}
+
$resourcePath = '/conversations/pushedMessages/{id}';
$formParams = [];
$queryParams = [];
@@ -1638,6 +2041,7 @@ protected function conversationsPushedMessagesIdDeleteRequest($id)
$multipart = false;
+
// path params
if ($id !== null) {
$resourcePath = str_replace(
@@ -1647,53 +2051,35 @@ protected function conversationsPushedMessagesIdDeleteRequest($id)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1719,10 +2105,11 @@ protected function conversationsPushedMessagesIdDeleteRequest($id)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1734,14 +2121,18 @@ protected function conversationsPushedMessagesIdDeleteRequest($id)
* Get an automated message
*
* @param string $id ID of the message sent previously (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsPushedMessagesIdGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\ConversationsMessage
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\ConversationsMessage|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function conversationsPushedMessagesIdGet($id)
+ public function conversationsPushedMessagesIdGet(
+ string $id,
+ string $contentType = self::contentTypes['conversationsPushedMessagesIdGet'][0]
+ ): \Brevo\Client\Models\ConversationsMessage
{
- list($response) = $this->conversationsPushedMessagesIdGetWithHttpInfo($id);
+ list($response) = $this->conversationsPushedMessagesIdGetWithHttpInfo($id, $contentType);
return $response;
}
@@ -1751,15 +2142,18 @@ public function conversationsPushedMessagesIdGet($id)
* Get an automated message
*
* @param string $id ID of the message sent previously (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsPushedMessagesIdGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\ConversationsMessage, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\ConversationsMessage|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function conversationsPushedMessagesIdGetWithHttpInfo($id)
+ public function conversationsPushedMessagesIdGetWithHttpInfo(
+ string $id,
+ string $contentType = self::contentTypes['conversationsPushedMessagesIdGet'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\ConversationsMessage';
- $request = $this->conversationsPushedMessagesIdGetRequest($id);
+ $request = $this->conversationsPushedMessagesIdGetRequest($id, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1768,34 +2162,138 @@ public function conversationsPushedMessagesIdGetWithHttpInfo($id)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\ConversationsMessage', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ConversationsMessage' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ConversationsMessage', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\ConversationsMessage';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1810,7 +2308,7 @@ public function conversationsPushedMessagesIdGetWithHttpInfo($id)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ConversationsMessage',
+ '\Brevo\Client\Models\ConversationsMessage',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1818,7 +2316,7 @@ public function conversationsPushedMessagesIdGetWithHttpInfo($id)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1826,7 +2324,7 @@ public function conversationsPushedMessagesIdGetWithHttpInfo($id)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1842,13 +2340,17 @@ public function conversationsPushedMessagesIdGetWithHttpInfo($id)
* Get an automated message
*
* @param string $id ID of the message sent previously (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsPushedMessagesIdGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function conversationsPushedMessagesIdGetAsync($id)
+ public function conversationsPushedMessagesIdGetAsync(
+ string $id,
+ string $contentType = self::contentTypes['conversationsPushedMessagesIdGet'][0]
+ ): PromiseInterface
{
- return $this->conversationsPushedMessagesIdGetAsyncWithHttpInfo($id)
+ return $this->conversationsPushedMessagesIdGetAsyncWithHttpInfo($id, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1862,24 +2364,28 @@ function ($response) {
* Get an automated message
*
* @param string $id ID of the message sent previously (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsPushedMessagesIdGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function conversationsPushedMessagesIdGetAsyncWithHttpInfo($id)
+ public function conversationsPushedMessagesIdGetAsyncWithHttpInfo(
+ $id,
+ string $contentType = self::contentTypes['conversationsPushedMessagesIdGet'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\ConversationsMessage';
- $request = $this->conversationsPushedMessagesIdGetRequest($id);
+ $returnType = '\Brevo\Client\Models\ConversationsMessage';
+ $request = $this->conversationsPushedMessagesIdGetRequest($id, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1902,7 +2408,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1912,19 +2418,25 @@ function ($exception) {
* Create request for operation 'conversationsPushedMessagesIdGet'
*
* @param string $id ID of the message sent previously (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsPushedMessagesIdGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function conversationsPushedMessagesIdGetRequest($id)
+ public function conversationsPushedMessagesIdGetRequest(
+ $id,
+ string $contentType = self::contentTypes['conversationsPushedMessagesIdGet'][0]
+ ): Request
{
+
// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $id when calling conversationsPushedMessagesIdGet'
);
}
+
$resourcePath = '/conversations/pushedMessages/{id}';
$formParams = [];
$queryParams = [];
@@ -1933,6 +2445,7 @@ protected function conversationsPushedMessagesIdGetRequest($id)
$multipart = false;
+
// path params
if ($id !== null) {
$resourcePath = str_replace(
@@ -1942,53 +2455,35 @@ protected function conversationsPushedMessagesIdGetRequest($id)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -2014,10 +2509,11 @@ protected function conversationsPushedMessagesIdGetRequest($id)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -2029,15 +2525,20 @@ protected function conversationsPushedMessagesIdGetRequest($id)
* Update an automated message
*
* @param string $id ID of the message (required)
- * @param \Brevo\Client\Model\Body13 $body body (required)
+ * @param \Brevo\Client\Models\ConversationsMessagesIdPutRequest $conversationsMessagesIdPutRequest conversationsMessagesIdPutRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsPushedMessagesIdPut'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\ConversationsMessage
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\ConversationsMessage|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function conversationsPushedMessagesIdPut($id, $body)
+ public function conversationsPushedMessagesIdPut(
+ string $id,
+ \Brevo\Client\Models\ConversationsMessagesIdPutRequest $conversationsMessagesIdPutRequest,
+ string $contentType = self::contentTypes['conversationsPushedMessagesIdPut'][0]
+ ): \Brevo\Client\Models\ConversationsMessage
{
- list($response) = $this->conversationsPushedMessagesIdPutWithHttpInfo($id, $body);
+ list($response) = $this->conversationsPushedMessagesIdPutWithHttpInfo($id, $conversationsMessagesIdPutRequest, $contentType);
return $response;
}
@@ -2047,16 +2548,20 @@ public function conversationsPushedMessagesIdPut($id, $body)
* Update an automated message
*
* @param string $id ID of the message (required)
- * @param \Brevo\Client\Model\Body13 $body (required)
+ * @param \Brevo\Client\Models\ConversationsMessagesIdPutRequest $conversationsMessagesIdPutRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsPushedMessagesIdPut'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\ConversationsMessage, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\ConversationsMessage|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function conversationsPushedMessagesIdPutWithHttpInfo($id, $body)
+ public function conversationsPushedMessagesIdPutWithHttpInfo(
+ string $id,
+ \Brevo\Client\Models\ConversationsMessagesIdPutRequest $conversationsMessagesIdPutRequest,
+ string $contentType = self::contentTypes['conversationsPushedMessagesIdPut'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\ConversationsMessage';
- $request = $this->conversationsPushedMessagesIdPutRequest($id, $body);
+ $request = $this->conversationsPushedMessagesIdPutRequest($id, $conversationsMessagesIdPutRequest, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -2065,34 +2570,138 @@ public function conversationsPushedMessagesIdPutWithHttpInfo($id, $body)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\ConversationsMessage', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ConversationsMessage' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ConversationsMessage', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\ConversationsMessage';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -2107,7 +2716,7 @@ public function conversationsPushedMessagesIdPutWithHttpInfo($id, $body)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ConversationsMessage',
+ '\Brevo\Client\Models\ConversationsMessage',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2115,7 +2724,7 @@ public function conversationsPushedMessagesIdPutWithHttpInfo($id, $body)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2123,7 +2732,7 @@ public function conversationsPushedMessagesIdPutWithHttpInfo($id, $body)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2139,14 +2748,19 @@ public function conversationsPushedMessagesIdPutWithHttpInfo($id, $body)
* Update an automated message
*
* @param string $id ID of the message (required)
- * @param \Brevo\Client\Model\Body13 $body (required)
+ * @param \Brevo\Client\Models\ConversationsMessagesIdPutRequest $conversationsMessagesIdPutRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsPushedMessagesIdPut'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function conversationsPushedMessagesIdPutAsync($id, $body)
+ public function conversationsPushedMessagesIdPutAsync(
+ string $id,
+ \Brevo\Client\Models\ConversationsMessagesIdPutRequest $conversationsMessagesIdPutRequest,
+ string $contentType = self::contentTypes['conversationsPushedMessagesIdPut'][0]
+ ): PromiseInterface
{
- return $this->conversationsPushedMessagesIdPutAsyncWithHttpInfo($id, $body)
+ return $this->conversationsPushedMessagesIdPutAsyncWithHttpInfo($id, $conversationsMessagesIdPutRequest, $contentType)
->then(
function ($response) {
return $response[0];
@@ -2160,25 +2774,30 @@ function ($response) {
* Update an automated message
*
* @param string $id ID of the message (required)
- * @param \Brevo\Client\Model\Body13 $body (required)
+ * @param \Brevo\Client\Models\ConversationsMessagesIdPutRequest $conversationsMessagesIdPutRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsPushedMessagesIdPut'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function conversationsPushedMessagesIdPutAsyncWithHttpInfo($id, $body)
+ public function conversationsPushedMessagesIdPutAsyncWithHttpInfo(
+ $id,
+ $conversationsMessagesIdPutRequest,
+ string $contentType = self::contentTypes['conversationsPushedMessagesIdPut'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\ConversationsMessage';
- $request = $this->conversationsPushedMessagesIdPutRequest($id, $body);
+ $returnType = '\Brevo\Client\Models\ConversationsMessage';
+ $request = $this->conversationsPushedMessagesIdPutRequest($id, $conversationsMessagesIdPutRequest, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -2201,7 +2820,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -2211,26 +2830,34 @@ function ($exception) {
* Create request for operation 'conversationsPushedMessagesIdPut'
*
* @param string $id ID of the message (required)
- * @param \Brevo\Client\Model\Body13 $body (required)
+ * @param \Brevo\Client\Models\ConversationsMessagesIdPutRequest $conversationsMessagesIdPutRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsPushedMessagesIdPut'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function conversationsPushedMessagesIdPutRequest($id, $body)
+ public function conversationsPushedMessagesIdPutRequest(
+ $id,
+ $conversationsMessagesIdPutRequest,
+ string $contentType = self::contentTypes['conversationsPushedMessagesIdPut'][0]
+ ): Request
{
+
// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $id when calling conversationsPushedMessagesIdPut'
);
}
- // verify the required parameter 'body' is set
- if ($body === null || (is_array($body) && count($body) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $body when calling conversationsPushedMessagesIdPut'
+
+ // verify the required parameter 'conversationsMessagesIdPutRequest' is set
+ if ($conversationsMessagesIdPutRequest === null || (is_array($conversationsMessagesIdPutRequest) && count($conversationsMessagesIdPutRequest) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $conversationsMessagesIdPutRequest when calling conversationsPushedMessagesIdPut'
);
}
+
$resourcePath = '/conversations/pushedMessages/{id}';
$formParams = [];
$queryParams = [];
@@ -2239,6 +2866,7 @@ protected function conversationsPushedMessagesIdPutRequest($id, $body)
$multipart = false;
+
// path params
if ($id !== null) {
$resourcePath = str_replace(
@@ -2248,56 +2876,42 @@ protected function conversationsPushedMessagesIdPutRequest($id, $body)
);
}
- // body params
- $_tempBody = null;
- if (isset($body)) {
- $_tempBody = $body;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($conversationsMessagesIdPutRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($conversationsMessagesIdPutRequest));
+ } else {
+ $httpBody = $conversationsMessagesIdPutRequest;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -2323,10 +2937,11 @@ protected function conversationsPushedMessagesIdPutRequest($id, $body)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'PUT',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -2337,15 +2952,19 @@ protected function conversationsPushedMessagesIdPutRequest($id, $body)
*
* Send an automated message to a visitor
*
- * @param \Brevo\Client\Model\Body12 $body body (required)
+ * @param \Brevo\Client\Models\ConversationsPushedMessagesPostRequest $conversationsPushedMessagesPostRequest conversationsPushedMessagesPostRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsPushedMessagesPost'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\ConversationsMessage
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\ConversationsMessage|\Brevo\Client\Models\ErrorModel
*/
- public function conversationsPushedMessagesPost($body)
+ public function conversationsPushedMessagesPost(
+ \Brevo\Client\Models\ConversationsPushedMessagesPostRequest $conversationsPushedMessagesPostRequest,
+ string $contentType = self::contentTypes['conversationsPushedMessagesPost'][0]
+ ): \Brevo\Client\Models\ConversationsMessage
{
- list($response) = $this->conversationsPushedMessagesPostWithHttpInfo($body);
+ list($response) = $this->conversationsPushedMessagesPostWithHttpInfo($conversationsPushedMessagesPostRequest, $contentType);
return $response;
}
@@ -2354,16 +2973,19 @@ public function conversationsPushedMessagesPost($body)
*
* Send an automated message to a visitor
*
- * @param \Brevo\Client\Model\Body12 $body (required)
+ * @param \Brevo\Client\Models\ConversationsPushedMessagesPostRequest $conversationsPushedMessagesPostRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsPushedMessagesPost'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\ConversationsMessage, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\ConversationsMessage|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function conversationsPushedMessagesPostWithHttpInfo($body)
+ public function conversationsPushedMessagesPostWithHttpInfo(
+ \Brevo\Client\Models\ConversationsPushedMessagesPostRequest $conversationsPushedMessagesPostRequest,
+ string $contentType = self::contentTypes['conversationsPushedMessagesPost'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\ConversationsMessage';
- $request = $this->conversationsPushedMessagesPostRequest($body);
+ $request = $this->conversationsPushedMessagesPostRequest($conversationsPushedMessagesPostRequest, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -2372,34 +2994,111 @@ public function conversationsPushedMessagesPostWithHttpInfo($body)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\ConversationsMessage', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ConversationsMessage' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ConversationsMessage', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\ConversationsMessage';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -2414,7 +3113,7 @@ public function conversationsPushedMessagesPostWithHttpInfo($body)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ConversationsMessage',
+ '\Brevo\Client\Models\ConversationsMessage',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2422,7 +3121,7 @@ public function conversationsPushedMessagesPostWithHttpInfo($body)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2437,14 +3136,18 @@ public function conversationsPushedMessagesPostWithHttpInfo($body)
*
* Send an automated message to a visitor
*
- * @param \Brevo\Client\Model\Body12 $body (required)
+ * @param \Brevo\Client\Models\ConversationsPushedMessagesPostRequest $conversationsPushedMessagesPostRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsPushedMessagesPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function conversationsPushedMessagesPostAsync($body)
+ public function conversationsPushedMessagesPostAsync(
+ \Brevo\Client\Models\ConversationsPushedMessagesPostRequest $conversationsPushedMessagesPostRequest,
+ string $contentType = self::contentTypes['conversationsPushedMessagesPost'][0]
+ ): PromiseInterface
{
- return $this->conversationsPushedMessagesPostAsyncWithHttpInfo($body)
+ return $this->conversationsPushedMessagesPostAsyncWithHttpInfo($conversationsPushedMessagesPostRequest, $contentType)
->then(
function ($response) {
return $response[0];
@@ -2457,25 +3160,29 @@ function ($response) {
*
* Send an automated message to a visitor
*
- * @param \Brevo\Client\Model\Body12 $body (required)
+ * @param \Brevo\Client\Models\ConversationsPushedMessagesPostRequest $conversationsPushedMessagesPostRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsPushedMessagesPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function conversationsPushedMessagesPostAsyncWithHttpInfo($body)
+ public function conversationsPushedMessagesPostAsyncWithHttpInfo(
+ $conversationsPushedMessagesPostRequest,
+ string $contentType = self::contentTypes['conversationsPushedMessagesPost'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\ConversationsMessage';
- $request = $this->conversationsPushedMessagesPostRequest($body);
+ $returnType = '\Brevo\Client\Models\ConversationsMessage';
+ $request = $this->conversationsPushedMessagesPostRequest($conversationsPushedMessagesPostRequest, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -2498,7 +3205,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -2507,20 +3214,26 @@ function ($exception) {
/**
* Create request for operation 'conversationsPushedMessagesPost'
*
- * @param \Brevo\Client\Model\Body12 $body (required)
+ * @param \Brevo\Client\Models\ConversationsPushedMessagesPostRequest $conversationsPushedMessagesPostRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['conversationsPushedMessagesPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function conversationsPushedMessagesPostRequest($body)
+ public function conversationsPushedMessagesPostRequest(
+ $conversationsPushedMessagesPostRequest,
+ string $contentType = self::contentTypes['conversationsPushedMessagesPost'][0]
+ ): Request
{
- // verify the required parameter 'body' is set
- if ($body === null || (is_array($body) && count($body) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $body when calling conversationsPushedMessagesPost'
+
+ // verify the required parameter 'conversationsPushedMessagesPostRequest' is set
+ if ($conversationsPushedMessagesPostRequest === null || (is_array($conversationsPushedMessagesPostRequest) && count($conversationsPushedMessagesPostRequest) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $conversationsPushedMessagesPostRequest when calling conversationsPushedMessagesPost'
);
}
+
$resourcePath = '/conversations/pushedMessages';
$formParams = [];
$queryParams = [];
@@ -2530,56 +3243,43 @@ protected function conversationsPushedMessagesPostRequest($body)
- // body params
- $_tempBody = null;
- if (isset($body)) {
- $_tempBody = $body;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($conversationsPushedMessagesPostRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($conversationsPushedMessagesPostRequest));
+ } else {
+ $httpBody = $conversationsPushedMessagesPostRequest;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -2605,10 +3305,11 @@ protected function conversationsPushedMessagesPostRequest($body)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -2620,7 +3321,7 @@ protected function conversationsPushedMessagesPostRequest($body)
* @throws \RuntimeException on file opening failure
* @return array of http client options
*/
- protected function createHttpClientOption()
+ protected function createHttpClientOption(): array
{
$options = [];
if ($this->config->getDebug()) {
diff --git a/lib/Api/CouponsApi.php b/lib/Api/CouponsApi.php
index ee2bde7..87cef44 100644
--- a/lib/Api/CouponsApi.php
+++ b/lib/Api/CouponsApi.php
@@ -1,39 +1,41 @@
[
+ 'application/json',
+ ],
+ 'createCoupons' => [
+ 'application/json',
+ ],
+ 'getCouponCollection' => [
+ 'application/json',
+ ],
+ 'getCouponCollections' => [
+ 'application/json',
+ ],
+ 'updateCouponCollection' => [
+ 'application/json',
+ ],
+ ];
+
+ /**
+ * @param ClientInterface|null $client
+ * @param Configuration|null $config
+ * @param HeaderSelector|null $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
+ HeaderSelector $selector = null,
+ int $hostIndex = 0
) {
$this->client = $client ?: new Client();
- $this->config = $config ?: new Configuration();
+ $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(int $hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex(): int
+ {
+ return $this->hostIndex;
}
/**
* @return Configuration
*/
- public function getConfig()
+ public function getConfig(): Configuration
{
return $this->config;
}
@@ -92,15 +140,19 @@ public function getConfig()
*
* Create а coupon collection
*
- * @param \Brevo\Client\Model\CreateCouponCollection $createCouponCollection Values to create a coupon collection (required)
+ * @param \Brevo\Client\Models\CreateCouponCollectionRequest $createCouponCollectionRequest Values to create a coupon collection (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCouponCollection'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\InlineResponse2013
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CreateCouponCollection201Response|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function createCouponCollection($createCouponCollection)
+ public function createCouponCollection(
+ \Brevo\Client\Models\CreateCouponCollectionRequest $createCouponCollectionRequest,
+ string $contentType = self::contentTypes['createCouponCollection'][0]
+ ): \Brevo\Client\Models\CreateCouponCollection201Response
{
- list($response) = $this->createCouponCollectionWithHttpInfo($createCouponCollection);
+ list($response) = $this->createCouponCollectionWithHttpInfo($createCouponCollectionRequest, $contentType);
return $response;
}
@@ -109,16 +161,19 @@ public function createCouponCollection($createCouponCollection)
*
* Create а coupon collection
*
- * @param \Brevo\Client\Model\CreateCouponCollection $createCouponCollection Values to create a coupon collection (required)
+ * @param \Brevo\Client\Models\CreateCouponCollectionRequest $createCouponCollectionRequest Values to create a coupon collection (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCouponCollection'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\InlineResponse2013, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CreateCouponCollection201Response|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function createCouponCollectionWithHttpInfo($createCouponCollection)
+ public function createCouponCollectionWithHttpInfo(
+ \Brevo\Client\Models\CreateCouponCollectionRequest $createCouponCollectionRequest,
+ string $contentType = self::contentTypes['createCouponCollection'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\InlineResponse2013';
- $request = $this->createCouponCollectionRequest($createCouponCollection);
+ $request = $this->createCouponCollectionRequest($createCouponCollectionRequest, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -127,34 +182,138 @@ public function createCouponCollectionWithHttpInfo($createCouponCollection)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 201:
+ if (in_array('\Brevo\Client\Models\CreateCouponCollection201Response', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CreateCouponCollection201Response' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CreateCouponCollection201Response', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CreateCouponCollection201Response';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -169,23 +328,23 @@ public function createCouponCollectionWithHttpInfo($createCouponCollection)
case 201:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\InlineResponse2013',
+ '\Brevo\Client\Models\CreateCouponCollection201Response',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 401:
+ case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 400:
+ case 401:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -200,14 +359,18 @@ public function createCouponCollectionWithHttpInfo($createCouponCollection)
*
* Create а coupon collection
*
- * @param \Brevo\Client\Model\CreateCouponCollection $createCouponCollection Values to create a coupon collection (required)
+ * @param \Brevo\Client\Models\CreateCouponCollectionRequest $createCouponCollectionRequest Values to create a coupon collection (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCouponCollection'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createCouponCollectionAsync($createCouponCollection)
+ public function createCouponCollectionAsync(
+ \Brevo\Client\Models\CreateCouponCollectionRequest $createCouponCollectionRequest,
+ string $contentType = self::contentTypes['createCouponCollection'][0]
+ ): PromiseInterface
{
- return $this->createCouponCollectionAsyncWithHttpInfo($createCouponCollection)
+ return $this->createCouponCollectionAsyncWithHttpInfo($createCouponCollectionRequest, $contentType)
->then(
function ($response) {
return $response[0];
@@ -220,25 +383,29 @@ function ($response) {
*
* Create а coupon collection
*
- * @param \Brevo\Client\Model\CreateCouponCollection $createCouponCollection Values to create a coupon collection (required)
+ * @param \Brevo\Client\Models\CreateCouponCollectionRequest $createCouponCollectionRequest Values to create a coupon collection (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCouponCollection'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createCouponCollectionAsyncWithHttpInfo($createCouponCollection)
+ public function createCouponCollectionAsyncWithHttpInfo(
+ $createCouponCollectionRequest,
+ string $contentType = self::contentTypes['createCouponCollection'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\InlineResponse2013';
- $request = $this->createCouponCollectionRequest($createCouponCollection);
+ $returnType = '\Brevo\Client\Models\CreateCouponCollection201Response';
+ $request = $this->createCouponCollectionRequest($createCouponCollectionRequest, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -261,7 +428,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -270,20 +437,26 @@ function ($exception) {
/**
* Create request for operation 'createCouponCollection'
*
- * @param \Brevo\Client\Model\CreateCouponCollection $createCouponCollection Values to create a coupon collection (required)
+ * @param \Brevo\Client\Models\CreateCouponCollectionRequest $createCouponCollectionRequest Values to create a coupon collection (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCouponCollection'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function createCouponCollectionRequest($createCouponCollection)
+ public function createCouponCollectionRequest(
+ $createCouponCollectionRequest,
+ string $contentType = self::contentTypes['createCouponCollection'][0]
+ ): Request
{
- // verify the required parameter 'createCouponCollection' is set
- if ($createCouponCollection === null || (is_array($createCouponCollection) && count($createCouponCollection) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $createCouponCollection when calling createCouponCollection'
+
+ // verify the required parameter 'createCouponCollectionRequest' is set
+ if ($createCouponCollectionRequest === null || (is_array($createCouponCollectionRequest) && count($createCouponCollectionRequest) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $createCouponCollectionRequest when calling createCouponCollection'
);
}
+
$resourcePath = '/couponCollections';
$formParams = [];
$queryParams = [];
@@ -293,56 +466,43 @@ protected function createCouponCollectionRequest($createCouponCollection)
- // body params
- $_tempBody = null;
- if (isset($createCouponCollection)) {
- $_tempBody = $createCouponCollection;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($createCouponCollectionRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createCouponCollectionRequest));
+ } else {
+ $httpBody = $createCouponCollectionRequest;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -368,10 +528,11 @@ protected function createCouponCollectionRequest($createCouponCollection)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -382,15 +543,19 @@ protected function createCouponCollectionRequest($createCouponCollection)
*
* Create coupons for a coupon collection
*
- * @param \Brevo\Client\Model\CreateCoupons $createCoupons Values to create coupons (required)
+ * @param \Brevo\Client\Models\CreateCouponsRequest $createCouponsRequest Values to create coupons (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCoupons'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function createCoupons($createCoupons)
+ public function createCoupons(
+ \Brevo\Client\Models\CreateCouponsRequest $createCouponsRequest,
+ string $contentType = self::contentTypes['createCoupons'][0]
+ ): void
{
- $this->createCouponsWithHttpInfo($createCoupons);
+ $this->createCouponsWithHttpInfo($createCouponsRequest, $contentType);
}
/**
@@ -398,16 +563,19 @@ public function createCoupons($createCoupons)
*
* Create coupons for a coupon collection
*
- * @param \Brevo\Client\Model\CreateCoupons $createCoupons Values to create coupons (required)
+ * @param \Brevo\Client\Models\CreateCouponsRequest $createCouponsRequest Values to create coupons (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCoupons'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function createCouponsWithHttpInfo($createCoupons)
+ public function createCouponsWithHttpInfo(
+ \Brevo\Client\Models\CreateCouponsRequest $createCouponsRequest,
+ string $contentType = self::contentTypes['createCoupons'][0]
+ ): array
{
- $returnType = '';
- $request = $this->createCouponsRequest($createCoupons);
+ $request = $this->createCouponsRequest($createCouponsRequest, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -416,26 +584,21 @@ public function createCouponsWithHttpInfo($createCoupons)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -444,7 +607,7 @@ public function createCouponsWithHttpInfo($createCoupons)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -452,7 +615,7 @@ public function createCouponsWithHttpInfo($createCoupons)
case 401:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -460,7 +623,7 @@ public function createCouponsWithHttpInfo($createCoupons)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -475,14 +638,18 @@ public function createCouponsWithHttpInfo($createCoupons)
*
* Create coupons for a coupon collection
*
- * @param \Brevo\Client\Model\CreateCoupons $createCoupons Values to create coupons (required)
+ * @param \Brevo\Client\Models\CreateCouponsRequest $createCouponsRequest Values to create coupons (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCoupons'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createCouponsAsync($createCoupons)
+ public function createCouponsAsync(
+ \Brevo\Client\Models\CreateCouponsRequest $createCouponsRequest,
+ string $contentType = self::contentTypes['createCoupons'][0]
+ ): PromiseInterface
{
- return $this->createCouponsAsyncWithHttpInfo($createCoupons)
+ return $this->createCouponsAsyncWithHttpInfo($createCouponsRequest, $contentType)
->then(
function ($response) {
return $response[0];
@@ -495,15 +662,20 @@ function ($response) {
*
* Create coupons for a coupon collection
*
- * @param \Brevo\Client\Model\CreateCoupons $createCoupons Values to create coupons (required)
+ * @param \Brevo\Client\Models\CreateCouponsRequest $createCouponsRequest Values to create coupons (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCoupons'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createCouponsAsyncWithHttpInfo($createCoupons)
+ public function createCouponsAsyncWithHttpInfo(
+ $createCouponsRequest,
+ string $contentType = self::contentTypes['createCoupons'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->createCouponsRequest($createCoupons);
+ $request = $this->createCouponsRequest($createCouponsRequest, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -522,7 +694,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -531,20 +703,26 @@ function ($exception) {
/**
* Create request for operation 'createCoupons'
*
- * @param \Brevo\Client\Model\CreateCoupons $createCoupons Values to create coupons (required)
+ * @param \Brevo\Client\Models\CreateCouponsRequest $createCouponsRequest Values to create coupons (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCoupons'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function createCouponsRequest($createCoupons)
+ public function createCouponsRequest(
+ $createCouponsRequest,
+ string $contentType = self::contentTypes['createCoupons'][0]
+ ): Request
{
- // verify the required parameter 'createCoupons' is set
- if ($createCoupons === null || (is_array($createCoupons) && count($createCoupons) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $createCoupons when calling createCoupons'
+
+ // verify the required parameter 'createCouponsRequest' is set
+ if ($createCouponsRequest === null || (is_array($createCouponsRequest) && count($createCouponsRequest) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $createCouponsRequest when calling createCoupons'
);
}
+
$resourcePath = '/coupons';
$formParams = [];
$queryParams = [];
@@ -554,56 +732,43 @@ protected function createCouponsRequest($createCoupons)
- // body params
- $_tempBody = null;
- if (isset($createCoupons)) {
- $_tempBody = $createCoupons;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($createCouponsRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createCouponsRequest));
+ } else {
+ $httpBody = $createCouponsRequest;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -629,10 +794,11 @@ protected function createCouponsRequest($createCoupons)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -644,14 +810,18 @@ protected function createCouponsRequest($createCoupons)
* Get a coupon collection by id
*
* @param string $id Id of the collection to return (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCouponCollection'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetCouponCollection
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetCouponCollection|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function getCouponCollection($id)
+ public function getCouponCollection(
+ string $id,
+ string $contentType = self::contentTypes['getCouponCollection'][0]
+ ): \Brevo\Client\Models\GetCouponCollection
{
- list($response) = $this->getCouponCollectionWithHttpInfo($id);
+ list($response) = $this->getCouponCollectionWithHttpInfo($id, $contentType);
return $response;
}
@@ -661,15 +831,18 @@ public function getCouponCollection($id)
* Get a coupon collection by id
*
* @param string $id Id of the collection to return (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCouponCollection'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetCouponCollection, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetCouponCollection|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getCouponCollectionWithHttpInfo($id)
+ public function getCouponCollectionWithHttpInfo(
+ string $id,
+ string $contentType = self::contentTypes['getCouponCollection'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetCouponCollection';
- $request = $this->getCouponCollectionRequest($id);
+ $request = $this->getCouponCollectionRequest($id, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -678,34 +851,165 @@ public function getCouponCollectionWithHttpInfo($id)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetCouponCollection', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetCouponCollection' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetCouponCollection', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetCouponCollection';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -720,7 +1024,7 @@ public function getCouponCollectionWithHttpInfo($id)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetCouponCollection',
+ '\Brevo\Client\Models\GetCouponCollection',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -728,7 +1032,7 @@ public function getCouponCollectionWithHttpInfo($id)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -736,7 +1040,7 @@ public function getCouponCollectionWithHttpInfo($id)
case 401:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -744,7 +1048,7 @@ public function getCouponCollectionWithHttpInfo($id)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -760,13 +1064,17 @@ public function getCouponCollectionWithHttpInfo($id)
* Get a coupon collection by id
*
* @param string $id Id of the collection to return (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCouponCollection'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getCouponCollectionAsync($id)
+ public function getCouponCollectionAsync(
+ string $id,
+ string $contentType = self::contentTypes['getCouponCollection'][0]
+ ): PromiseInterface
{
- return $this->getCouponCollectionAsyncWithHttpInfo($id)
+ return $this->getCouponCollectionAsyncWithHttpInfo($id, $contentType)
->then(
function ($response) {
return $response[0];
@@ -780,24 +1088,28 @@ function ($response) {
* Get a coupon collection by id
*
* @param string $id Id of the collection to return (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCouponCollection'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getCouponCollectionAsyncWithHttpInfo($id)
+ public function getCouponCollectionAsyncWithHttpInfo(
+ $id,
+ string $contentType = self::contentTypes['getCouponCollection'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetCouponCollection';
- $request = $this->getCouponCollectionRequest($id);
+ $returnType = '\Brevo\Client\Models\GetCouponCollection';
+ $request = $this->getCouponCollectionRequest($id, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -820,7 +1132,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -830,19 +1142,25 @@ function ($exception) {
* Create request for operation 'getCouponCollection'
*
* @param string $id Id of the collection to return (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCouponCollection'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getCouponCollectionRequest($id)
+ public function getCouponCollectionRequest(
+ $id,
+ string $contentType = self::contentTypes['getCouponCollection'][0]
+ ): Request
{
+
// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $id when calling getCouponCollection'
);
}
+
$resourcePath = '/couponCollections/{id}';
$formParams = [];
$queryParams = [];
@@ -851,6 +1169,7 @@ protected function getCouponCollectionRequest($id)
$multipart = false;
+
// path params
if ($id !== null) {
$resourcePath = str_replace(
@@ -860,53 +1179,35 @@ protected function getCouponCollectionRequest($id)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -932,10 +1233,11 @@ protected function getCouponCollectionRequest($id)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -946,17 +1248,25 @@ protected function getCouponCollectionRequest($id)
*
* Get all your coupon collections
*
- * @param int $limit Number of documents returned per page (optional, default to 50)
- * @param int $offset Index of the first document on the page (optional, default to 0)
- * @param string $sort Sort the results by creation time in ascending/descending order (optional, default to desc)
+ * @param int|null $limit Number of documents returned per page (optional, default to 50)
+ * @param int|null $offset Index of the first document on the page (optional, default to 0)
+ * @param string|null $sort Sort the results by creation time in ascending/descending order (optional, default to 'desc')
+ * @param string|null $sortBy The field used to sort coupon collections (optional, default to 'createdAt')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCouponCollections'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetCouponCollection
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetCouponCollection|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function getCouponCollections($limit = '50', $offset = '0', $sort = 'desc')
+ public function getCouponCollections(
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ ?string $sortBy = 'createdAt',
+ string $contentType = self::contentTypes['getCouponCollections'][0]
+ ): \Brevo\Client\Models\GetCouponCollection
{
- list($response) = $this->getCouponCollectionsWithHttpInfo($limit, $offset, $sort);
+ list($response) = $this->getCouponCollectionsWithHttpInfo($limit, $offset, $sort, $sortBy, $contentType);
return $response;
}
@@ -965,18 +1275,25 @@ public function getCouponCollections($limit = '50', $offset = '0', $sort = 'desc
*
* Get all your coupon collections
*
- * @param int $limit Number of documents returned per page (optional, default to 50)
- * @param int $offset Index of the first document on the page (optional, default to 0)
- * @param string $sort Sort the results by creation time in ascending/descending order (optional, default to desc)
+ * @param int|null $limit Number of documents returned per page (optional, default to 50)
+ * @param int|null $offset Index of the first document on the page (optional, default to 0)
+ * @param string|null $sort Sort the results by creation time in ascending/descending order (optional, default to 'desc')
+ * @param string|null $sortBy The field used to sort coupon collections (optional, default to 'createdAt')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCouponCollections'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetCouponCollection, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetCouponCollection|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getCouponCollectionsWithHttpInfo($limit = '50', $offset = '0', $sort = 'desc')
+ public function getCouponCollectionsWithHttpInfo(
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ ?string $sortBy = 'createdAt',
+ string $contentType = self::contentTypes['getCouponCollections'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetCouponCollection';
- $request = $this->getCouponCollectionsRequest($limit, $offset, $sort);
+ $request = $this->getCouponCollectionsRequest($limit, $offset, $sort, $sortBy, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -985,34 +1302,138 @@ public function getCouponCollectionsWithHttpInfo($limit = '50', $offset = '0', $
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetCouponCollection', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetCouponCollection' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetCouponCollection', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetCouponCollection';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1027,7 +1448,7 @@ public function getCouponCollectionsWithHttpInfo($limit = '50', $offset = '0', $
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetCouponCollection',
+ '\Brevo\Client\Models\GetCouponCollection',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1035,7 +1456,7 @@ public function getCouponCollectionsWithHttpInfo($limit = '50', $offset = '0', $
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1043,15 +1464,7 @@ public function getCouponCollectionsWithHttpInfo($limit = '50', $offset = '0', $
case 401:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1066,16 +1479,24 @@ public function getCouponCollectionsWithHttpInfo($limit = '50', $offset = '0', $
*
* Get all your coupon collections
*
- * @param int $limit Number of documents returned per page (optional, default to 50)
- * @param int $offset Index of the first document on the page (optional, default to 0)
- * @param string $sort Sort the results by creation time in ascending/descending order (optional, default to desc)
+ * @param int|null $limit Number of documents returned per page (optional, default to 50)
+ * @param int|null $offset Index of the first document on the page (optional, default to 0)
+ * @param string|null $sort Sort the results by creation time in ascending/descending order (optional, default to 'desc')
+ * @param string|null $sortBy The field used to sort coupon collections (optional, default to 'createdAt')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCouponCollections'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getCouponCollectionsAsync($limit = '50', $offset = '0', $sort = 'desc')
+ public function getCouponCollectionsAsync(
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ ?string $sortBy = 'createdAt',
+ string $contentType = self::contentTypes['getCouponCollections'][0]
+ ): PromiseInterface
{
- return $this->getCouponCollectionsAsyncWithHttpInfo($limit, $offset, $sort)
+ return $this->getCouponCollectionsAsyncWithHttpInfo($limit, $offset, $sort, $sortBy, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1088,27 +1509,35 @@ function ($response) {
*
* Get all your coupon collections
*
- * @param int $limit Number of documents returned per page (optional, default to 50)
- * @param int $offset Index of the first document on the page (optional, default to 0)
- * @param string $sort Sort the results by creation time in ascending/descending order (optional, default to desc)
+ * @param int|null $limit Number of documents returned per page (optional, default to 50)
+ * @param int|null $offset Index of the first document on the page (optional, default to 0)
+ * @param string|null $sort Sort the results by creation time in ascending/descending order (optional, default to 'desc')
+ * @param string|null $sortBy The field used to sort coupon collections (optional, default to 'createdAt')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCouponCollections'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getCouponCollectionsAsyncWithHttpInfo($limit = '50', $offset = '0', $sort = 'desc')
+ public function getCouponCollectionsAsyncWithHttpInfo(
+ $limit = 50,
+ $offset = 0,
+ $sort = 'desc',
+ $sortBy = 'createdAt',
+ string $contentType = self::contentTypes['getCouponCollections'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetCouponCollection';
- $request = $this->getCouponCollectionsRequest($limit, $offset, $sort);
+ $returnType = '\Brevo\Client\Models\GetCouponCollection';
+ $request = $this->getCouponCollectionsRequest($limit, $offset, $sort, $sortBy, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1131,7 +1560,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1140,25 +1569,36 @@ function ($exception) {
/**
* Create request for operation 'getCouponCollections'
*
- * @param int $limit Number of documents returned per page (optional, default to 50)
- * @param int $offset Index of the first document on the page (optional, default to 0)
- * @param string $sort Sort the results by creation time in ascending/descending order (optional, default to desc)
+ * @param int|null $limit Number of documents returned per page (optional, default to 50)
+ * @param int|null $offset Index of the first document on the page (optional, default to 0)
+ * @param string|null $sort Sort the results by creation time in ascending/descending order (optional, default to 'desc')
+ * @param string|null $sortBy The field used to sort coupon collections (optional, default to 'createdAt')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCouponCollections'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getCouponCollectionsRequest($limit = '50', $offset = '0', $sort = 'desc')
+ public function getCouponCollectionsRequest(
+ $limit = 50,
+ $offset = 0,
+ $sort = 'desc',
+ $sortBy = 'createdAt',
+ string $contentType = self::contentTypes['getCouponCollections'][0]
+ ): Request
{
+
if ($limit !== null && $limit > 100) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling CouponsApi.getCouponCollections, must be smaller than or equal to 100.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling CouponsApi.getCouponCollections, must be smaller than or equal to 100.');
}
if ($limit !== null && $limit < 0) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling CouponsApi.getCouponCollections, must be bigger than or equal to 0.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling CouponsApi.getCouponCollections, must be bigger than or equal to 0.');
}
-
+
if ($offset !== null && $offset < 0) {
- throw new \InvalidArgumentException('invalid value for "$offset" when calling CouponsApi.getCouponCollections, must be bigger than or equal to 0.');
+ throw new InvalidArgumentException('invalid value for "$offset" when calling CouponsApi.getCouponCollections, must be bigger than or equal to 0.');
}
+
+
$resourcePath = '/couponCollections';
@@ -1169,66 +1609,73 @@ protected function getCouponCollectionsRequest($limit = '50', $offset = '0', $so
$multipart = false;
// query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sortBy,
+ 'sortBy', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1254,10 +1701,11 @@ protected function getCouponCollectionsRequest($limit = '50', $offset = '0', $so
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1269,15 +1717,20 @@ protected function getCouponCollectionsRequest($limit = '50', $offset = '0', $so
* Update a coupon collection by id
*
* @param string $id Id of the collection to update (required)
- * @param \Brevo\Client\Model\UpdateCouponCollection $updateCouponCollection Values to update the coupon collection (required)
+ * @param \Brevo\Client\Models\UpdateCouponCollectionRequest|null $updateCouponCollectionRequest Values to update the coupon collection (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCouponCollection'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\InlineResponse2002
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\UpdateCouponCollection200Response|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function updateCouponCollection($id, $updateCouponCollection)
+ public function updateCouponCollection(
+ string $id,
+ ?\Brevo\Client\Models\UpdateCouponCollectionRequest $updateCouponCollectionRequest = null,
+ string $contentType = self::contentTypes['updateCouponCollection'][0]
+ ): \Brevo\Client\Models\UpdateCouponCollection200Response
{
- list($response) = $this->updateCouponCollectionWithHttpInfo($id, $updateCouponCollection);
+ list($response) = $this->updateCouponCollectionWithHttpInfo($id, $updateCouponCollectionRequest, $contentType);
return $response;
}
@@ -1287,16 +1740,20 @@ public function updateCouponCollection($id, $updateCouponCollection)
* Update a coupon collection by id
*
* @param string $id Id of the collection to update (required)
- * @param \Brevo\Client\Model\UpdateCouponCollection $updateCouponCollection Values to update the coupon collection (required)
+ * @param \Brevo\Client\Models\UpdateCouponCollectionRequest|null $updateCouponCollectionRequest Values to update the coupon collection (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCouponCollection'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\InlineResponse2002, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\UpdateCouponCollection200Response|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function updateCouponCollectionWithHttpInfo($id, $updateCouponCollection)
+ public function updateCouponCollectionWithHttpInfo(
+ string $id,
+ ?\Brevo\Client\Models\UpdateCouponCollectionRequest $updateCouponCollectionRequest = null,
+ string $contentType = self::contentTypes['updateCouponCollection'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\InlineResponse2002';
- $request = $this->updateCouponCollectionRequest($id, $updateCouponCollection);
+ $request = $this->updateCouponCollectionRequest($id, $updateCouponCollectionRequest, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1305,34 +1762,138 @@ public function updateCouponCollectionWithHttpInfo($id, $updateCouponCollection)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\UpdateCouponCollection200Response', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\UpdateCouponCollection200Response' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\UpdateCouponCollection200Response', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\UpdateCouponCollection200Response';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1347,7 +1908,7 @@ public function updateCouponCollectionWithHttpInfo($id, $updateCouponCollection)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\InlineResponse2002',
+ '\Brevo\Client\Models\UpdateCouponCollection200Response',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1355,7 +1916,7 @@ public function updateCouponCollectionWithHttpInfo($id, $updateCouponCollection)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1363,7 +1924,7 @@ public function updateCouponCollectionWithHttpInfo($id, $updateCouponCollection)
case 401:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1379,14 +1940,19 @@ public function updateCouponCollectionWithHttpInfo($id, $updateCouponCollection)
* Update a coupon collection by id
*
* @param string $id Id of the collection to update (required)
- * @param \Brevo\Client\Model\UpdateCouponCollection $updateCouponCollection Values to update the coupon collection (required)
+ * @param \Brevo\Client\Models\UpdateCouponCollectionRequest|null $updateCouponCollectionRequest Values to update the coupon collection (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCouponCollection'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function updateCouponCollectionAsync($id, $updateCouponCollection)
+ public function updateCouponCollectionAsync(
+ string $id,
+ ?\Brevo\Client\Models\UpdateCouponCollectionRequest $updateCouponCollectionRequest = null,
+ string $contentType = self::contentTypes['updateCouponCollection'][0]
+ ): PromiseInterface
{
- return $this->updateCouponCollectionAsyncWithHttpInfo($id, $updateCouponCollection)
+ return $this->updateCouponCollectionAsyncWithHttpInfo($id, $updateCouponCollectionRequest, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1400,25 +1966,30 @@ function ($response) {
* Update a coupon collection by id
*
* @param string $id Id of the collection to update (required)
- * @param \Brevo\Client\Model\UpdateCouponCollection $updateCouponCollection Values to update the coupon collection (required)
+ * @param \Brevo\Client\Models\UpdateCouponCollectionRequest|null $updateCouponCollectionRequest Values to update the coupon collection (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCouponCollection'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function updateCouponCollectionAsyncWithHttpInfo($id, $updateCouponCollection)
+ public function updateCouponCollectionAsyncWithHttpInfo(
+ $id,
+ $updateCouponCollectionRequest = null,
+ string $contentType = self::contentTypes['updateCouponCollection'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\InlineResponse2002';
- $request = $this->updateCouponCollectionRequest($id, $updateCouponCollection);
+ $returnType = '\Brevo\Client\Models\UpdateCouponCollection200Response';
+ $request = $this->updateCouponCollectionRequest($id, $updateCouponCollectionRequest, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1441,7 +2012,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1451,25 +2022,27 @@ function ($exception) {
* Create request for operation 'updateCouponCollection'
*
* @param string $id Id of the collection to update (required)
- * @param \Brevo\Client\Model\UpdateCouponCollection $updateCouponCollection Values to update the coupon collection (required)
+ * @param \Brevo\Client\Models\UpdateCouponCollectionRequest|null $updateCouponCollectionRequest Values to update the coupon collection (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCouponCollection'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function updateCouponCollectionRequest($id, $updateCouponCollection)
+ public function updateCouponCollectionRequest(
+ $id,
+ $updateCouponCollectionRequest = null,
+ string $contentType = self::contentTypes['updateCouponCollection'][0]
+ ): Request
{
+
// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $id when calling updateCouponCollection'
);
}
- // verify the required parameter 'updateCouponCollection' is set
- if ($updateCouponCollection === null || (is_array($updateCouponCollection) && count($updateCouponCollection) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $updateCouponCollection when calling updateCouponCollection'
- );
- }
+
+
$resourcePath = '/couponCollections/{id}';
$formParams = [];
@@ -1479,6 +2052,7 @@ protected function updateCouponCollectionRequest($id, $updateCouponCollection)
$multipart = false;
+
// path params
if ($id !== null) {
$resourcePath = str_replace(
@@ -1488,56 +2062,42 @@ protected function updateCouponCollectionRequest($id, $updateCouponCollection)
);
}
- // body params
- $_tempBody = null;
- if (isset($updateCouponCollection)) {
- $_tempBody = $updateCouponCollection;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($updateCouponCollectionRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($updateCouponCollectionRequest));
+ } else {
+ $httpBody = $updateCouponCollectionRequest;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1563,10 +2123,11 @@ protected function updateCouponCollectionRequest($id, $updateCouponCollection)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'PATCH',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1578,7 +2139,7 @@ protected function updateCouponCollectionRequest($id, $updateCouponCollection)
* @throws \RuntimeException on file opening failure
* @return array of http client options
*/
- protected function createHttpClientOption()
+ protected function createHttpClientOption(): array
{
$options = [];
if ($this->config->getDebug()) {
diff --git a/lib/Api/DealsApi.php b/lib/Api/DealsApi.php
index 1540c93..25f1222 100644
--- a/lib/Api/DealsApi.php
+++ b/lib/Api/DealsApi.php
@@ -1,39 +1,41 @@
[
+ 'application/json',
+ ],
+ 'crmDealsGet' => [
+ 'application/json',
+ ],
+ 'crmDealsIdDelete' => [
+ 'application/json',
+ ],
+ 'crmDealsIdGet' => [
+ 'application/json',
+ ],
+ 'crmDealsIdPatch' => [
+ 'application/json',
+ ],
+ 'crmDealsImportPost' => [
+ 'multipart/form-data',
+ ],
+ 'crmDealsLinkUnlinkIdPatch' => [
+ 'application/json',
+ ],
+ 'crmDealsPost' => [
+ 'application/json',
+ ],
+ 'crmPipelineDetailsAllGet' => [
+ 'application/json',
+ ],
+ 'crmPipelineDetailsGet' => [
+ 'application/json',
+ ],
+ 'crmPipelineDetailsPipelineIDGet' => [
+ 'application/json',
+ ],
+ ];
+
+ /**
+ * @param ClientInterface|null $client
+ * @param Configuration|null $config
+ * @param HeaderSelector|null $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
+ HeaderSelector $selector = null,
+ int $hostIndex = 0
) {
$this->client = $client ?: new Client();
- $this->config = $config ?: new Configuration();
+ $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(int $hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex(): int
+ {
+ return $this->hostIndex;
}
/**
* @return Configuration
*/
- public function getConfig()
+ public function getConfig(): Configuration
{
return $this->config;
}
@@ -92,14 +158,17 @@ public function getConfig()
*
* Get deal attributes
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmAttributesDealsGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\DealAttributes
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\DealAttributesInner[]
*/
- public function crmAttributesDealsGet()
+ public function crmAttributesDealsGet(
+ string $contentType = self::contentTypes['crmAttributesDealsGet'][0]
+ ): array
{
- list($response) = $this->crmAttributesDealsGetWithHttpInfo();
+ list($response) = $this->crmAttributesDealsGetWithHttpInfo($contentType);
return $response;
}
@@ -108,15 +177,17 @@ public function crmAttributesDealsGet()
*
* Get deal attributes
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmAttributesDealsGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\DealAttributes, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\DealAttributesInner[], HTTP status code, HTTP response headers (array of strings)
*/
- public function crmAttributesDealsGetWithHttpInfo()
+ public function crmAttributesDealsGetWithHttpInfo(
+ string $contentType = self::contentTypes['crmAttributesDealsGet'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\DealAttributes';
- $request = $this->crmAttributesDealsGetRequest();
+ $request = $this->crmAttributesDealsGetRequest($contentType);
try {
$options = $this->createHttpClientOption();
@@ -125,34 +196,84 @@ public function crmAttributesDealsGetWithHttpInfo()
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\DealAttributesInner[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\DealAttributesInner[]' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\DealAttributesInner[]', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\DealAttributesInner[]';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -167,7 +288,7 @@ public function crmAttributesDealsGetWithHttpInfo()
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\DealAttributes',
+ '\Brevo\Client\Models\DealAttributesInner[]',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -182,13 +303,16 @@ public function crmAttributesDealsGetWithHttpInfo()
*
* Get deal attributes
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmAttributesDealsGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmAttributesDealsGetAsync()
+ public function crmAttributesDealsGetAsync(
+ string $contentType = self::contentTypes['crmAttributesDealsGet'][0]
+ ): PromiseInterface
{
- return $this->crmAttributesDealsGetAsyncWithHttpInfo()
+ return $this->crmAttributesDealsGetAsyncWithHttpInfo($contentType)
->then(
function ($response) {
return $response[0];
@@ -201,24 +325,27 @@ function ($response) {
*
* Get deal attributes
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmAttributesDealsGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmAttributesDealsGetAsyncWithHttpInfo()
+ public function crmAttributesDealsGetAsyncWithHttpInfo(
+ string $contentType = self::contentTypes['crmAttributesDealsGet'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\DealAttributes';
- $request = $this->crmAttributesDealsGetRequest();
+ $returnType = '\Brevo\Client\Models\DealAttributesInner[]';
+ $request = $this->crmAttributesDealsGetRequest($contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -241,7 +368,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -250,13 +377,17 @@ function ($exception) {
/**
* Create request for operation 'crmAttributesDealsGet'
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmAttributesDealsGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function crmAttributesDealsGetRequest()
+ public function crmAttributesDealsGetRequest(
+ string $contentType = self::contentTypes['crmAttributesDealsGet'][0]
+ ): Request
{
+
$resourcePath = '/crm/attributes/deals';
$formParams = [];
$queryParams = [];
@@ -266,53 +397,36 @@ protected function crmAttributesDealsGetRequest()
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -338,10 +452,11 @@ protected function crmAttributesDealsGetRequest()
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -352,21 +467,29 @@ protected function crmAttributesDealsGetRequest()
*
* Get all deals
*
- * @param string $filtersAttributesDealName Filter by attributes. If you have filter for owner on your side please send it as `filters[attributes.deal_owner]`.\" (optional)
- * @param string $filtersLinkedCompaniesIds Filter by linked companies ids (optional)
- * @param string $filtersLinkedContactsIds Filter by linked companies ids (optional)
- * @param int $offset Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- * @param string $sortBy The field used to sort field names. (optional)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\DealsList
+ * @param string|null $filtersAttributesDealName Filter by attributes. If you have a filter for the owner on your end, please send it as filters[attributes.deal_owner] and utilize the account email for the filtering. (optional)
+ * @param string|null $filtersLinkedCompaniesIds Filter by linked companies ids (optional)
+ * @param string|null $filtersLinkedContactsIds Filter by linked companies ids (optional)
+ * @param int|null $offset Index of the first document of the page (optional)
+ * @param int|null $limit Number of documents per page (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsGet'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\DealsList|\Brevo\Client\Models\ErrorModel
*/
- public function crmDealsGet($filtersAttributesDealName = null, $filtersLinkedCompaniesIds = null, $filtersLinkedContactsIds = null, $offset = null, $limit = '50', $sort = null, $sortBy = null)
+ public function crmDealsGet(
+ ?string $filtersAttributesDealName = null,
+ ?string $filtersLinkedCompaniesIds = null,
+ ?string $filtersLinkedContactsIds = null,
+ ?int $offset = null,
+ ?int $limit = null,
+ ?string $sort = null,
+ string $contentType = self::contentTypes['crmDealsGet'][0]
+ ): \Brevo\Client\Models\DealsList
{
- list($response) = $this->crmDealsGetWithHttpInfo($filtersAttributesDealName, $filtersLinkedCompaniesIds, $filtersLinkedContactsIds, $offset, $limit, $sort, $sortBy);
+ list($response) = $this->crmDealsGetWithHttpInfo($filtersAttributesDealName, $filtersLinkedCompaniesIds, $filtersLinkedContactsIds, $offset, $limit, $sort, $contentType);
return $response;
}
@@ -375,22 +498,29 @@ public function crmDealsGet($filtersAttributesDealName = null, $filtersLinkedCom
*
* Get all deals
*
- * @param string $filtersAttributesDealName Filter by attributes. If you have filter for owner on your side please send it as `filters[attributes.deal_owner]`.\" (optional)
- * @param string $filtersLinkedCompaniesIds Filter by linked companies ids (optional)
- * @param string $filtersLinkedContactsIds Filter by linked companies ids (optional)
- * @param int $offset Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- * @param string $sortBy The field used to sort field names. (optional)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\DealsList, HTTP status code, HTTP response headers (array of strings)
+ * @param string|null $filtersAttributesDealName Filter by attributes. If you have a filter for the owner on your end, please send it as filters[attributes.deal_owner] and utilize the account email for the filtering. (optional)
+ * @param string|null $filtersLinkedCompaniesIds Filter by linked companies ids (optional)
+ * @param string|null $filtersLinkedContactsIds Filter by linked companies ids (optional)
+ * @param int|null $offset Index of the first document of the page (optional)
+ * @param int|null $limit Number of documents per page (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsGet'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\DealsList|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function crmDealsGetWithHttpInfo($filtersAttributesDealName = null, $filtersLinkedCompaniesIds = null, $filtersLinkedContactsIds = null, $offset = null, $limit = '50', $sort = null, $sortBy = null)
+ public function crmDealsGetWithHttpInfo(
+ ?string $filtersAttributesDealName = null,
+ ?string $filtersLinkedCompaniesIds = null,
+ ?string $filtersLinkedContactsIds = null,
+ ?int $offset = null,
+ ?int $limit = null,
+ ?string $sort = null,
+ string $contentType = self::contentTypes['crmDealsGet'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\DealsList';
- $request = $this->crmDealsGetRequest($filtersAttributesDealName, $filtersLinkedCompaniesIds, $filtersLinkedContactsIds, $offset, $limit, $sort, $sortBy);
+ $request = $this->crmDealsGetRequest($filtersAttributesDealName, $filtersLinkedCompaniesIds, $filtersLinkedContactsIds, $offset, $limit, $sort, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -399,34 +529,111 @@ public function crmDealsGetWithHttpInfo($filtersAttributesDealName = null, $filt
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\DealsList', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\DealsList' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\DealsList', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\DealsList';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -441,7 +648,7 @@ public function crmDealsGetWithHttpInfo($filtersAttributesDealName = null, $filt
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\DealsList',
+ '\Brevo\Client\Models\DealsList',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -449,7 +656,7 @@ public function crmDealsGetWithHttpInfo($filtersAttributesDealName = null, $filt
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -464,20 +671,28 @@ public function crmDealsGetWithHttpInfo($filtersAttributesDealName = null, $filt
*
* Get all deals
*
- * @param string $filtersAttributesDealName Filter by attributes. If you have filter for owner on your side please send it as `filters[attributes.deal_owner]`.\" (optional)
- * @param string $filtersLinkedCompaniesIds Filter by linked companies ids (optional)
- * @param string $filtersLinkedContactsIds Filter by linked companies ids (optional)
- * @param int $offset Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- * @param string $sortBy The field used to sort field names. (optional)
+ * @param string|null $filtersAttributesDealName Filter by attributes. If you have a filter for the owner on your end, please send it as filters[attributes.deal_owner] and utilize the account email for the filtering. (optional)
+ * @param string|null $filtersLinkedCompaniesIds Filter by linked companies ids (optional)
+ * @param string|null $filtersLinkedContactsIds Filter by linked companies ids (optional)
+ * @param int|null $offset Index of the first document of the page (optional)
+ * @param int|null $limit Number of documents per page (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmDealsGetAsync($filtersAttributesDealName = null, $filtersLinkedCompaniesIds = null, $filtersLinkedContactsIds = null, $offset = null, $limit = '50', $sort = null, $sortBy = null)
+ public function crmDealsGetAsync(
+ ?string $filtersAttributesDealName = null,
+ ?string $filtersLinkedCompaniesIds = null,
+ ?string $filtersLinkedContactsIds = null,
+ ?int $offset = null,
+ ?int $limit = null,
+ ?string $sort = null,
+ string $contentType = self::contentTypes['crmDealsGet'][0]
+ ): PromiseInterface
{
- return $this->crmDealsGetAsyncWithHttpInfo($filtersAttributesDealName, $filtersLinkedCompaniesIds, $filtersLinkedContactsIds, $offset, $limit, $sort, $sortBy)
+ return $this->crmDealsGetAsyncWithHttpInfo($filtersAttributesDealName, $filtersLinkedCompaniesIds, $filtersLinkedContactsIds, $offset, $limit, $sort, $contentType)
->then(
function ($response) {
return $response[0];
@@ -490,31 +705,39 @@ function ($response) {
*
* Get all deals
*
- * @param string $filtersAttributesDealName Filter by attributes. If you have filter for owner on your side please send it as `filters[attributes.deal_owner]`.\" (optional)
- * @param string $filtersLinkedCompaniesIds Filter by linked companies ids (optional)
- * @param string $filtersLinkedContactsIds Filter by linked companies ids (optional)
- * @param int $offset Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- * @param string $sortBy The field used to sort field names. (optional)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @param string|null $filtersAttributesDealName Filter by attributes. If you have a filter for the owner on your end, please send it as filters[attributes.deal_owner] and utilize the account email for the filtering. (optional)
+ * @param string|null $filtersLinkedCompaniesIds Filter by linked companies ids (optional)
+ * @param string|null $filtersLinkedContactsIds Filter by linked companies ids (optional)
+ * @param int|null $offset Index of the first document of the page (optional)
+ * @param int|null $limit Number of documents per page (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsGet'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmDealsGetAsyncWithHttpInfo($filtersAttributesDealName = null, $filtersLinkedCompaniesIds = null, $filtersLinkedContactsIds = null, $offset = null, $limit = '50', $sort = null, $sortBy = null)
+ public function crmDealsGetAsyncWithHttpInfo(
+ $filtersAttributesDealName = null,
+ $filtersLinkedCompaniesIds = null,
+ $filtersLinkedContactsIds = null,
+ $offset = null,
+ $limit = null,
+ $sort = null,
+ string $contentType = self::contentTypes['crmDealsGet'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\DealsList';
- $request = $this->crmDealsGetRequest($filtersAttributesDealName, $filtersLinkedCompaniesIds, $filtersLinkedContactsIds, $offset, $limit, $sort, $sortBy);
+ $returnType = '\Brevo\Client\Models\DealsList';
+ $request = $this->crmDealsGetRequest($filtersAttributesDealName, $filtersLinkedCompaniesIds, $filtersLinkedContactsIds, $offset, $limit, $sort, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -537,7 +760,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -546,20 +769,35 @@ function ($exception) {
/**
* Create request for operation 'crmDealsGet'
*
- * @param string $filtersAttributesDealName Filter by attributes. If you have filter for owner on your side please send it as `filters[attributes.deal_owner]`.\" (optional)
- * @param string $filtersLinkedCompaniesIds Filter by linked companies ids (optional)
- * @param string $filtersLinkedContactsIds Filter by linked companies ids (optional)
- * @param int $offset Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- * @param string $sortBy The field used to sort field names. (optional)
+ * @param string|null $filtersAttributesDealName Filter by attributes. If you have a filter for the owner on your end, please send it as filters[attributes.deal_owner] and utilize the account email for the filtering. (optional)
+ * @param string|null $filtersLinkedCompaniesIds Filter by linked companies ids (optional)
+ * @param string|null $filtersLinkedContactsIds Filter by linked companies ids (optional)
+ * @param int|null $offset Index of the first document of the page (optional)
+ * @param int|null $limit Number of documents per page (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function crmDealsGetRequest($filtersAttributesDealName = null, $filtersLinkedCompaniesIds = null, $filtersLinkedContactsIds = null, $offset = null, $limit = '50', $sort = null, $sortBy = null)
+ public function crmDealsGetRequest(
+ $filtersAttributesDealName = null,
+ $filtersLinkedCompaniesIds = null,
+ $filtersLinkedContactsIds = null,
+ $offset = null,
+ $limit = null,
+ $sort = null,
+ string $contentType = self::contentTypes['crmDealsGet'][0]
+ ): Request
{
+
+
+
+
+
+
+
$resourcePath = '/crm/deals';
$formParams = [];
$queryParams = [];
@@ -568,82 +806,91 @@ protected function crmDealsGetRequest($filtersAttributesDealName = null, $filter
$multipart = false;
// query params
- if ($filtersAttributesDealName !== null) {
- $queryParams['filters[attributes.deal_name]'] = ObjectSerializer::toQueryValue($filtersAttributesDealName);
- }
- // query params
- if ($filtersLinkedCompaniesIds !== null) {
- $queryParams['filters[linkedCompaniesIds]'] = ObjectSerializer::toQueryValue($filtersLinkedCompaniesIds);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $filtersAttributesDealName,
+ 'filters[attributes.deal_name]', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($filtersLinkedContactsIds !== null) {
- $queryParams['filters[linkedContactsIds]'] = ObjectSerializer::toQueryValue($filtersLinkedContactsIds);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $filtersLinkedCompaniesIds,
+ 'filters[linkedCompaniesIds]', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $filtersLinkedContactsIds,
+ 'filters[linkedContactsIds]', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($sortBy !== null) {
- $queryParams['sortBy'] = ObjectSerializer::toQueryValue($sortBy);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -669,10 +916,11 @@ protected function crmDealsGetRequest($filtersAttributesDealName = null, $filter
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -684,14 +932,18 @@ protected function crmDealsGetRequest($filtersAttributesDealName = null, $filter
* Delete a deal
*
* @param string $id id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsIdDelete'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function crmDealsIdDelete($id)
+ public function crmDealsIdDelete(
+ string $id,
+ string $contentType = self::contentTypes['crmDealsIdDelete'][0]
+ ): void
{
- $this->crmDealsIdDeleteWithHttpInfo($id);
+ $this->crmDealsIdDeleteWithHttpInfo($id, $contentType);
}
/**
@@ -700,15 +952,18 @@ public function crmDealsIdDelete($id)
* Delete a deal
*
* @param string $id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsIdDelete'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function crmDealsIdDeleteWithHttpInfo($id)
+ public function crmDealsIdDeleteWithHttpInfo(
+ string $id,
+ string $contentType = self::contentTypes['crmDealsIdDelete'][0]
+ ): array
{
- $returnType = '';
- $request = $this->crmDealsIdDeleteRequest($id);
+ $request = $this->crmDealsIdDeleteRequest($id, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -717,26 +972,21 @@ public function crmDealsIdDeleteWithHttpInfo($id)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -745,7 +995,7 @@ public function crmDealsIdDeleteWithHttpInfo($id)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -753,7 +1003,7 @@ public function crmDealsIdDeleteWithHttpInfo($id)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -769,13 +1019,17 @@ public function crmDealsIdDeleteWithHttpInfo($id)
* Delete a deal
*
* @param string $id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsIdDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmDealsIdDeleteAsync($id)
+ public function crmDealsIdDeleteAsync(
+ string $id,
+ string $contentType = self::contentTypes['crmDealsIdDelete'][0]
+ ): PromiseInterface
{
- return $this->crmDealsIdDeleteAsyncWithHttpInfo($id)
+ return $this->crmDealsIdDeleteAsyncWithHttpInfo($id, $contentType)
->then(
function ($response) {
return $response[0];
@@ -789,14 +1043,19 @@ function ($response) {
* Delete a deal
*
* @param string $id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsIdDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmDealsIdDeleteAsyncWithHttpInfo($id)
+ public function crmDealsIdDeleteAsyncWithHttpInfo(
+ $id,
+ string $contentType = self::contentTypes['crmDealsIdDelete'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->crmDealsIdDeleteRequest($id);
+ $request = $this->crmDealsIdDeleteRequest($id, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -815,7 +1074,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -825,19 +1084,25 @@ function ($exception) {
* Create request for operation 'crmDealsIdDelete'
*
* @param string $id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsIdDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function crmDealsIdDeleteRequest($id)
+ public function crmDealsIdDeleteRequest(
+ $id,
+ string $contentType = self::contentTypes['crmDealsIdDelete'][0]
+ ): Request
{
+
// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $id when calling crmDealsIdDelete'
);
}
+
$resourcePath = '/crm/deals/{id}';
$formParams = [];
$queryParams = [];
@@ -846,6 +1111,7 @@ protected function crmDealsIdDeleteRequest($id)
$multipart = false;
+
// path params
if ($id !== null) {
$resourcePath = str_replace(
@@ -855,53 +1121,35 @@ protected function crmDealsIdDeleteRequest($id)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -927,10 +1175,11 @@ protected function crmDealsIdDeleteRequest($id)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -942,14 +1191,18 @@ protected function crmDealsIdDeleteRequest($id)
* Get a deal
*
* @param string $id id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsIdGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\Deal
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\Deal|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function crmDealsIdGet($id)
+ public function crmDealsIdGet(
+ string $id,
+ string $contentType = self::contentTypes['crmDealsIdGet'][0]
+ ): \Brevo\Client\Models\Deal
{
- list($response) = $this->crmDealsIdGetWithHttpInfo($id);
+ list($response) = $this->crmDealsIdGetWithHttpInfo($id, $contentType);
return $response;
}
@@ -959,15 +1212,18 @@ public function crmDealsIdGet($id)
* Get a deal
*
* @param string $id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsIdGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\Deal, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\Deal|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function crmDealsIdGetWithHttpInfo($id)
+ public function crmDealsIdGetWithHttpInfo(
+ string $id,
+ string $contentType = self::contentTypes['crmDealsIdGet'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\Deal';
- $request = $this->crmDealsIdGetRequest($id);
+ $request = $this->crmDealsIdGetRequest($id, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -976,34 +1232,138 @@ public function crmDealsIdGetWithHttpInfo($id)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\Deal', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\Deal' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\Deal', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\Deal';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1018,7 +1378,7 @@ public function crmDealsIdGetWithHttpInfo($id)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\Deal',
+ '\Brevo\Client\Models\Deal',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1026,7 +1386,7 @@ public function crmDealsIdGetWithHttpInfo($id)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1034,7 +1394,7 @@ public function crmDealsIdGetWithHttpInfo($id)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1050,13 +1410,17 @@ public function crmDealsIdGetWithHttpInfo($id)
* Get a deal
*
* @param string $id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsIdGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmDealsIdGetAsync($id)
+ public function crmDealsIdGetAsync(
+ string $id,
+ string $contentType = self::contentTypes['crmDealsIdGet'][0]
+ ): PromiseInterface
{
- return $this->crmDealsIdGetAsyncWithHttpInfo($id)
+ return $this->crmDealsIdGetAsyncWithHttpInfo($id, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1070,24 +1434,28 @@ function ($response) {
* Get a deal
*
* @param string $id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsIdGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmDealsIdGetAsyncWithHttpInfo($id)
+ public function crmDealsIdGetAsyncWithHttpInfo(
+ $id,
+ string $contentType = self::contentTypes['crmDealsIdGet'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\Deal';
- $request = $this->crmDealsIdGetRequest($id);
+ $returnType = '\Brevo\Client\Models\Deal';
+ $request = $this->crmDealsIdGetRequest($id, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1110,7 +1478,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1120,19 +1488,25 @@ function ($exception) {
* Create request for operation 'crmDealsIdGet'
*
* @param string $id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsIdGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function crmDealsIdGetRequest($id)
+ public function crmDealsIdGetRequest(
+ $id,
+ string $contentType = self::contentTypes['crmDealsIdGet'][0]
+ ): Request
{
+
// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $id when calling crmDealsIdGet'
);
}
+
$resourcePath = '/crm/deals/{id}';
$formParams = [];
$queryParams = [];
@@ -1141,6 +1515,7 @@ protected function crmDealsIdGetRequest($id)
$multipart = false;
+
// path params
if ($id !== null) {
$resourcePath = str_replace(
@@ -1150,53 +1525,35 @@ protected function crmDealsIdGetRequest($id)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1222,10 +1579,11 @@ protected function crmDealsIdGetRequest($id)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1237,15 +1595,20 @@ protected function crmDealsIdGetRequest($id)
* Update a deal
*
* @param string $id id (required)
- * @param \Brevo\Client\Model\Body6 $body Updated deal details. (required)
+ * @param \Brevo\Client\Models\CrmDealsIdPatchRequest $crmDealsIdPatchRequest Updated deal details. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsIdPatch'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function crmDealsIdPatch($id, $body)
+ public function crmDealsIdPatch(
+ string $id,
+ \Brevo\Client\Models\CrmDealsIdPatchRequest $crmDealsIdPatchRequest,
+ string $contentType = self::contentTypes['crmDealsIdPatch'][0]
+ ): void
{
- $this->crmDealsIdPatchWithHttpInfo($id, $body);
+ $this->crmDealsIdPatchWithHttpInfo($id, $crmDealsIdPatchRequest, $contentType);
}
/**
@@ -1254,16 +1617,304 @@ public function crmDealsIdPatch($id, $body)
* Update a deal
*
* @param string $id (required)
- * @param \Brevo\Client\Model\Body6 $body Updated deal details. (required)
+ * @param \Brevo\Client\Models\CrmDealsIdPatchRequest $crmDealsIdPatchRequest Updated deal details. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsIdPatch'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function crmDealsIdPatchWithHttpInfo($id, $body)
+ public function crmDealsIdPatchWithHttpInfo(
+ string $id,
+ \Brevo\Client\Models\CrmDealsIdPatchRequest $crmDealsIdPatchRequest,
+ string $contentType = self::contentTypes['crmDealsIdPatch'][0]
+ ): array
+ {
+ $request = $this->crmDealsIdPatchRequest($id, $crmDealsIdPatchRequest, $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();
+
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation crmDealsIdPatchAsync
+ *
+ * Update a deal
+ *
+ * @param string $id (required)
+ * @param \Brevo\Client\Models\CrmDealsIdPatchRequest $crmDealsIdPatchRequest Updated deal details. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsIdPatch'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function crmDealsIdPatchAsync(
+ string $id,
+ \Brevo\Client\Models\CrmDealsIdPatchRequest $crmDealsIdPatchRequest,
+ string $contentType = self::contentTypes['crmDealsIdPatch'][0]
+ ): PromiseInterface
+ {
+ return $this->crmDealsIdPatchAsyncWithHttpInfo($id, $crmDealsIdPatchRequest, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation crmDealsIdPatchAsyncWithHttpInfo
+ *
+ * Update a deal
+ *
+ * @param string $id (required)
+ * @param \Brevo\Client\Models\CrmDealsIdPatchRequest $crmDealsIdPatchRequest Updated deal details. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsIdPatch'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function crmDealsIdPatchAsyncWithHttpInfo(
+ $id,
+ $crmDealsIdPatchRequest,
+ string $contentType = self::contentTypes['crmDealsIdPatch'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->crmDealsIdPatchRequest($id, $body);
+ $request = $this->crmDealsIdPatchRequest($id, $crmDealsIdPatchRequest, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $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 'crmDealsIdPatch'
+ *
+ * @param string $id (required)
+ * @param \Brevo\Client\Models\CrmDealsIdPatchRequest $crmDealsIdPatchRequest Updated deal details. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsIdPatch'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function crmDealsIdPatchRequest(
+ $id,
+ $crmDealsIdPatchRequest,
+ string $contentType = self::contentTypes['crmDealsIdPatch'][0]
+ ): Request
+ {
+
+ // 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 crmDealsIdPatch'
+ );
+ }
+
+ // verify the required parameter 'crmDealsIdPatchRequest' is set
+ if ($crmDealsIdPatchRequest === null || (is_array($crmDealsIdPatchRequest) && count($crmDealsIdPatchRequest) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $crmDealsIdPatchRequest when calling crmDealsIdPatch'
+ );
+ }
+
+
+ $resourcePath = '/crm/deals/{id}';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'id' . '}',
+ ObjectSerializer::toPathValue($id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($crmDealsIdPatchRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($crmDealsIdPatchRequest));
+ } else {
+ $httpBody = $crmDealsIdPatchRequest;
+ }
+ } 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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(
+ 'PATCH',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation crmDealsImportPost
+ *
+ * Import deals(creation and updation)
+ *
+ * @param \SplFileObject|null $file The CSV file to upload.The file should have the first row as the mapping attribute. Some default attribute names are (a) deal_id [brevo mongoID to update deals] (b) associated_contact (c) associated_company (f) any other attribute with internal name (optional)
+ * @param object|null $mapping The mapping options in JSON format. Here is an example of the JSON structure: ```json { \\\"link_entities\\\": true, // Determines whether to link related entities during the import process \\\"unlink_entities\\\": false, // Determines whether to unlink related entities during the import process \\\"update_existing_records\\\": true, // Determines whether to update based on company ID or treat every row as create \\\"unset_empty_attributes\\\": false // Determines whether to unset a specific attribute during update if the values input is blank } ``` (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsImportPost'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CompaniesImportPost200Response|\Brevo\Client\Models\CompaniesImportPost400Response
+ */
+ public function crmDealsImportPost(
+ ?\SplFileObject $file = null,
+ ?array $mapping = null,
+ string $contentType = self::contentTypes['crmDealsImportPost'][0]
+ ): \Brevo\Client\Models\CompaniesImportPost200Response
+ {
+ list($response) = $this->crmDealsImportPostWithHttpInfo($file, $mapping, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation crmDealsImportPostWithHttpInfo
+ *
+ * Import deals(creation and updation)
+ *
+ * @param \SplFileObject|null $file The CSV file to upload.The file should have the first row as the mapping attribute. Some default attribute names are (a) deal_id [brevo mongoID to update deals] (b) associated_contact (c) associated_company (f) any other attribute with internal name (optional)
+ * @param object|null $mapping The mapping options in JSON format. Here is an example of the JSON structure: ```json { \\\"link_entities\\\": true, // Determines whether to link related entities during the import process \\\"unlink_entities\\\": false, // Determines whether to unlink related entities during the import process \\\"update_existing_records\\\": true, // Determines whether to update based on company ID or treat every row as create \\\"unset_empty_attributes\\\": false // Determines whether to unset a specific attribute during update if the values input is blank } ``` (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsImportPost'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CompaniesImportPost200Response|\Brevo\Client\Models\CompaniesImportPost400Response, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function crmDealsImportPostWithHttpInfo(
+ ?\SplFileObject $file = null,
+ ?array $mapping = null,
+ string $contentType = self::contentTypes['crmDealsImportPost'][0]
+ ): array
+ {
+ $request = $this->crmDealsImportPostRequest($file, $mapping, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1272,43 +1923,134 @@ public function crmDealsIdPatchWithHttpInfo($id, $body)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
+ $statusCode = $response->getStatusCode();
+
+
+ switch($statusCode) {
+ case 200:
+ if (in_array('\Brevo\Client\Models\CompaniesImportPost200Response', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CompaniesImportPost200Response' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CompaniesImportPost200Response', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\CompaniesImportPost400Response', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CompaniesImportPost400Response' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CompaniesImportPost400Response', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- return [null, $statusCode, $response->getHeaders()];
+ $returnType = '\Brevo\Client\Models\CompaniesImportPost200Response';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 400:
+ case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\CompaniesImportPost200Response',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 404:
+ case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\CompaniesImportPost400Response',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1319,19 +2061,24 @@ public function crmDealsIdPatchWithHttpInfo($id, $body)
}
/**
- * Operation crmDealsIdPatchAsync
+ * Operation crmDealsImportPostAsync
*
- * Update a deal
+ * Import deals(creation and updation)
*
- * @param string $id (required)
- * @param \Brevo\Client\Model\Body6 $body Updated deal details. (required)
+ * @param \SplFileObject|null $file The CSV file to upload.The file should have the first row as the mapping attribute. Some default attribute names are (a) deal_id [brevo mongoID to update deals] (b) associated_contact (c) associated_company (f) any other attribute with internal name (optional)
+ * @param object|null $mapping The mapping options in JSON format. Here is an example of the JSON structure: ```json { \\\"link_entities\\\": true, // Determines whether to link related entities during the import process \\\"unlink_entities\\\": false, // Determines whether to unlink related entities during the import process \\\"update_existing_records\\\": true, // Determines whether to update based on company ID or treat every row as create \\\"unset_empty_attributes\\\": false // Determines whether to unset a specific attribute during update if the values input is blank } ``` (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsImportPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmDealsIdPatchAsync($id, $body)
+ public function crmDealsImportPostAsync(
+ ?\SplFileObject $file = null,
+ ?array $mapping = null,
+ string $contentType = self::contentTypes['crmDealsImportPost'][0]
+ ): PromiseInterface
{
- return $this->crmDealsIdPatchAsyncWithHttpInfo($id, $body)
+ return $this->crmDealsImportPostAsyncWithHttpInfo($file, $mapping, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1340,26 +2087,45 @@ function ($response) {
}
/**
- * Operation crmDealsIdPatchAsyncWithHttpInfo
+ * Operation crmDealsImportPostAsyncWithHttpInfo
*
- * Update a deal
+ * Import deals(creation and updation)
*
- * @param string $id (required)
- * @param \Brevo\Client\Model\Body6 $body Updated deal details. (required)
+ * @param \SplFileObject|null $file The CSV file to upload.The file should have the first row as the mapping attribute. Some default attribute names are (a) deal_id [brevo mongoID to update deals] (b) associated_contact (c) associated_company (f) any other attribute with internal name (optional)
+ * @param object|null $mapping The mapping options in JSON format. Here is an example of the JSON structure: ```json { \\\"link_entities\\\": true, // Determines whether to link related entities during the import process \\\"unlink_entities\\\": false, // Determines whether to unlink related entities during the import process \\\"update_existing_records\\\": true, // Determines whether to update based on company ID or treat every row as create \\\"unset_empty_attributes\\\": false // Determines whether to unset a specific attribute during update if the values input is blank } ``` (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsImportPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmDealsIdPatchAsyncWithHttpInfo($id, $body)
+ public function crmDealsImportPostAsyncWithHttpInfo(
+ $file = null,
+ $mapping = null,
+ string $contentType = self::contentTypes['crmDealsImportPost'][0]
+ ): PromiseInterface
{
- $returnType = '';
- $request = $this->crmDealsIdPatchRequest($id, $body);
+ $returnType = '\Brevo\Client\Models\CompaniesImportPost200Response';
+ $request = $this->crmDealsImportPostRequest($file, $mapping, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- return [null, $response->getStatusCode(), $response->getHeaders()];
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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();
@@ -1372,37 +2138,33 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
}
/**
- * Create request for operation 'crmDealsIdPatch'
+ * Create request for operation 'crmDealsImportPost'
*
- * @param string $id (required)
- * @param \Brevo\Client\Model\Body6 $body Updated deal details. (required)
+ * @param \SplFileObject|null $file The CSV file to upload.The file should have the first row as the mapping attribute. Some default attribute names are (a) deal_id [brevo mongoID to update deals] (b) associated_contact (c) associated_company (f) any other attribute with internal name (optional)
+ * @param object|null $mapping The mapping options in JSON format. Here is an example of the JSON structure: ```json { \\\"link_entities\\\": true, // Determines whether to link related entities during the import process \\\"unlink_entities\\\": false, // Determines whether to unlink related entities during the import process \\\"update_existing_records\\\": true, // Determines whether to update based on company ID or treat every row as create \\\"unset_empty_attributes\\\": false // Determines whether to unset a specific attribute during update if the values input is blank } ``` (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsImportPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function crmDealsIdPatchRequest($id, $body)
+ public function crmDealsImportPostRequest(
+ $file = null,
+ $mapping = null,
+ string $contentType = self::contentTypes['crmDealsImportPost'][0]
+ ): Request
{
- // 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 crmDealsIdPatch'
- );
- }
- // verify the required parameter 'body' is set
- if ($body === null || (is_array($body) && count($body) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $body when calling crmDealsIdPatch'
- );
- }
- $resourcePath = '/crm/deals/{id}';
+
+
+
+ $resourcePath = '/crm/deals/import';
$formParams = [];
$queryParams = [];
$headerParams = [];
@@ -1410,65 +2172,55 @@ protected function crmDealsIdPatchRequest($id, $body)
$multipart = false;
- // path params
- if ($id !== null) {
- $resourcePath = str_replace(
- '{' . 'id' . '}',
- ObjectSerializer::toPathValue($id),
- $resourcePath
- );
- }
- // body params
- $_tempBody = null;
- if (isset($body)) {
- $_tempBody = $body;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
+ // form params
+ if ($file !== null) {
+ $multipart = true;
+ $formParams['file'] = [];
+ $paramFiles = is_array($file) ? $file : [$file];
+ foreach ($paramFiles as $paramFile) {
+ $formParams['file'][] = $paramFile instanceof \Psr\Http\Message\StreamInterface
+ ? $paramFile
+ : \GuzzleHttp\Psr7\Utils::tryFopen(
+ ObjectSerializer::toFormValue($paramFile),
+ 'rb'
+ );
+ }
+ }
+ // form params
+ if ($mapping !== null) {
+ $formParams['mapping'] = ObjectSerializer::toFormValue($mapping);
}
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1494,10 +2246,11 @@ protected function crmDealsIdPatchRequest($id, $body)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
- 'PATCH',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ 'POST',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1509,15 +2262,20 @@ protected function crmDealsIdPatchRequest($id, $body)
* Link and Unlink a deal with contacts and companies
*
* @param string $id id (required)
- * @param \Brevo\Client\Model\Body7 $body Linked / Unlinked contacts and companies ids. (required)
+ * @param \Brevo\Client\Models\CrmDealsLinkUnlinkIdPatchRequest $crmDealsLinkUnlinkIdPatchRequest Linked / Unlinked contacts and companies ids. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsLinkUnlinkIdPatch'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function crmDealsLinkUnlinkIdPatch($id, $body)
+ public function crmDealsLinkUnlinkIdPatch(
+ string $id,
+ \Brevo\Client\Models\CrmDealsLinkUnlinkIdPatchRequest $crmDealsLinkUnlinkIdPatchRequest,
+ string $contentType = self::contentTypes['crmDealsLinkUnlinkIdPatch'][0]
+ ): void
{
- $this->crmDealsLinkUnlinkIdPatchWithHttpInfo($id, $body);
+ $this->crmDealsLinkUnlinkIdPatchWithHttpInfo($id, $crmDealsLinkUnlinkIdPatchRequest, $contentType);
}
/**
@@ -1526,16 +2284,20 @@ public function crmDealsLinkUnlinkIdPatch($id, $body)
* Link and Unlink a deal with contacts and companies
*
* @param string $id (required)
- * @param \Brevo\Client\Model\Body7 $body Linked / Unlinked contacts and companies ids. (required)
+ * @param \Brevo\Client\Models\CrmDealsLinkUnlinkIdPatchRequest $crmDealsLinkUnlinkIdPatchRequest Linked / Unlinked contacts and companies ids. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsLinkUnlinkIdPatch'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function crmDealsLinkUnlinkIdPatchWithHttpInfo($id, $body)
+ public function crmDealsLinkUnlinkIdPatchWithHttpInfo(
+ string $id,
+ \Brevo\Client\Models\CrmDealsLinkUnlinkIdPatchRequest $crmDealsLinkUnlinkIdPatchRequest,
+ string $contentType = self::contentTypes['crmDealsLinkUnlinkIdPatch'][0]
+ ): array
{
- $returnType = '';
- $request = $this->crmDealsLinkUnlinkIdPatchRequest($id, $body);
+ $request = $this->crmDealsLinkUnlinkIdPatchRequest($id, $crmDealsLinkUnlinkIdPatchRequest, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1544,26 +2306,21 @@ public function crmDealsLinkUnlinkIdPatchWithHttpInfo($id, $body)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -1572,7 +2329,7 @@ public function crmDealsLinkUnlinkIdPatchWithHttpInfo($id, $body)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1588,14 +2345,19 @@ public function crmDealsLinkUnlinkIdPatchWithHttpInfo($id, $body)
* Link and Unlink a deal with contacts and companies
*
* @param string $id (required)
- * @param \Brevo\Client\Model\Body7 $body Linked / Unlinked contacts and companies ids. (required)
+ * @param \Brevo\Client\Models\CrmDealsLinkUnlinkIdPatchRequest $crmDealsLinkUnlinkIdPatchRequest Linked / Unlinked contacts and companies ids. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsLinkUnlinkIdPatch'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmDealsLinkUnlinkIdPatchAsync($id, $body)
+ public function crmDealsLinkUnlinkIdPatchAsync(
+ string $id,
+ \Brevo\Client\Models\CrmDealsLinkUnlinkIdPatchRequest $crmDealsLinkUnlinkIdPatchRequest,
+ string $contentType = self::contentTypes['crmDealsLinkUnlinkIdPatch'][0]
+ ): PromiseInterface
{
- return $this->crmDealsLinkUnlinkIdPatchAsyncWithHttpInfo($id, $body)
+ return $this->crmDealsLinkUnlinkIdPatchAsyncWithHttpInfo($id, $crmDealsLinkUnlinkIdPatchRequest, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1609,15 +2371,21 @@ function ($response) {
* Link and Unlink a deal with contacts and companies
*
* @param string $id (required)
- * @param \Brevo\Client\Model\Body7 $body Linked / Unlinked contacts and companies ids. (required)
+ * @param \Brevo\Client\Models\CrmDealsLinkUnlinkIdPatchRequest $crmDealsLinkUnlinkIdPatchRequest Linked / Unlinked contacts and companies ids. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsLinkUnlinkIdPatch'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmDealsLinkUnlinkIdPatchAsyncWithHttpInfo($id, $body)
+ public function crmDealsLinkUnlinkIdPatchAsyncWithHttpInfo(
+ $id,
+ $crmDealsLinkUnlinkIdPatchRequest,
+ string $contentType = self::contentTypes['crmDealsLinkUnlinkIdPatch'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->crmDealsLinkUnlinkIdPatchRequest($id, $body);
+ $request = $this->crmDealsLinkUnlinkIdPatchRequest($id, $crmDealsLinkUnlinkIdPatchRequest, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -1636,7 +2404,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1646,26 +2414,34 @@ function ($exception) {
* Create request for operation 'crmDealsLinkUnlinkIdPatch'
*
* @param string $id (required)
- * @param \Brevo\Client\Model\Body7 $body Linked / Unlinked contacts and companies ids. (required)
+ * @param \Brevo\Client\Models\CrmDealsLinkUnlinkIdPatchRequest $crmDealsLinkUnlinkIdPatchRequest Linked / Unlinked contacts and companies ids. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsLinkUnlinkIdPatch'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function crmDealsLinkUnlinkIdPatchRequest($id, $body)
+ public function crmDealsLinkUnlinkIdPatchRequest(
+ $id,
+ $crmDealsLinkUnlinkIdPatchRequest,
+ string $contentType = self::contentTypes['crmDealsLinkUnlinkIdPatch'][0]
+ ): Request
{
+
// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $id when calling crmDealsLinkUnlinkIdPatch'
);
}
- // verify the required parameter 'body' is set
- if ($body === null || (is_array($body) && count($body) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $body when calling crmDealsLinkUnlinkIdPatch'
+
+ // verify the required parameter 'crmDealsLinkUnlinkIdPatchRequest' is set
+ if ($crmDealsLinkUnlinkIdPatchRequest === null || (is_array($crmDealsLinkUnlinkIdPatchRequest) && count($crmDealsLinkUnlinkIdPatchRequest) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $crmDealsLinkUnlinkIdPatchRequest when calling crmDealsLinkUnlinkIdPatch'
);
}
+
$resourcePath = '/crm/deals/link-unlink/{id}';
$formParams = [];
$queryParams = [];
@@ -1674,6 +2450,7 @@ protected function crmDealsLinkUnlinkIdPatchRequest($id, $body)
$multipart = false;
+
// path params
if ($id !== null) {
$resourcePath = str_replace(
@@ -1683,56 +2460,42 @@ protected function crmDealsLinkUnlinkIdPatchRequest($id, $body)
);
}
- // body params
- $_tempBody = null;
- if (isset($body)) {
- $_tempBody = $body;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($crmDealsLinkUnlinkIdPatchRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($crmDealsLinkUnlinkIdPatchRequest));
+ } else {
+ $httpBody = $crmDealsLinkUnlinkIdPatchRequest;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1758,10 +2521,11 @@ protected function crmDealsLinkUnlinkIdPatchRequest($id, $body)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'PATCH',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1772,15 +2536,19 @@ protected function crmDealsLinkUnlinkIdPatchRequest($id, $body)
*
* Create a deal
*
- * @param \Brevo\Client\Model\Body5 $body Deal create data. (required)
+ * @param \Brevo\Client\Models\CrmDealsPostRequest $crmDealsPostRequest Deal create data. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsPost'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\InlineResponse2011
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CrmDealsPost201Response
*/
- public function crmDealsPost($body)
+ public function crmDealsPost(
+ \Brevo\Client\Models\CrmDealsPostRequest $crmDealsPostRequest,
+ string $contentType = self::contentTypes['crmDealsPost'][0]
+ ): \Brevo\Client\Models\CrmDealsPost201Response
{
- list($response) = $this->crmDealsPostWithHttpInfo($body);
+ list($response) = $this->crmDealsPostWithHttpInfo($crmDealsPostRequest, $contentType);
return $response;
}
@@ -1789,16 +2557,19 @@ public function crmDealsPost($body)
*
* Create a deal
*
- * @param \Brevo\Client\Model\Body5 $body Deal create data. (required)
+ * @param \Brevo\Client\Models\CrmDealsPostRequest $crmDealsPostRequest Deal create data. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsPost'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\InlineResponse2011, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CrmDealsPost201Response, HTTP status code, HTTP response headers (array of strings)
*/
- public function crmDealsPostWithHttpInfo($body)
+ public function crmDealsPostWithHttpInfo(
+ \Brevo\Client\Models\CrmDealsPostRequest $crmDealsPostRequest,
+ string $contentType = self::contentTypes['crmDealsPost'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\InlineResponse2011';
- $request = $this->crmDealsPostRequest($body);
+ $request = $this->crmDealsPostRequest($crmDealsPostRequest, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1807,34 +2578,84 @@ public function crmDealsPostWithHttpInfo($body)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 201:
+ if (in_array('\Brevo\Client\Models\CrmDealsPost201Response', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CrmDealsPost201Response' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CrmDealsPost201Response', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CrmDealsPost201Response';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1849,7 +2670,7 @@ public function crmDealsPostWithHttpInfo($body)
case 201:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\InlineResponse2011',
+ '\Brevo\Client\Models\CrmDealsPost201Response',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1864,14 +2685,18 @@ public function crmDealsPostWithHttpInfo($body)
*
* Create a deal
*
- * @param \Brevo\Client\Model\Body5 $body Deal create data. (required)
+ * @param \Brevo\Client\Models\CrmDealsPostRequest $crmDealsPostRequest Deal create data. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmDealsPostAsync($body)
+ public function crmDealsPostAsync(
+ \Brevo\Client\Models\CrmDealsPostRequest $crmDealsPostRequest,
+ string $contentType = self::contentTypes['crmDealsPost'][0]
+ ): PromiseInterface
{
- return $this->crmDealsPostAsyncWithHttpInfo($body)
+ return $this->crmDealsPostAsyncWithHttpInfo($crmDealsPostRequest, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1884,25 +2709,29 @@ function ($response) {
*
* Create a deal
*
- * @param \Brevo\Client\Model\Body5 $body Deal create data. (required)
+ * @param \Brevo\Client\Models\CrmDealsPostRequest $crmDealsPostRequest Deal create data. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmDealsPostAsyncWithHttpInfo($body)
+ public function crmDealsPostAsyncWithHttpInfo(
+ $crmDealsPostRequest,
+ string $contentType = self::contentTypes['crmDealsPost'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\InlineResponse2011';
- $request = $this->crmDealsPostRequest($body);
+ $returnType = '\Brevo\Client\Models\CrmDealsPost201Response';
+ $request = $this->crmDealsPostRequest($crmDealsPostRequest, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1925,7 +2754,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1934,20 +2763,26 @@ function ($exception) {
/**
* Create request for operation 'crmDealsPost'
*
- * @param \Brevo\Client\Model\Body5 $body Deal create data. (required)
+ * @param \Brevo\Client\Models\CrmDealsPostRequest $crmDealsPostRequest Deal create data. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmDealsPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function crmDealsPostRequest($body)
+ public function crmDealsPostRequest(
+ $crmDealsPostRequest,
+ string $contentType = self::contentTypes['crmDealsPost'][0]
+ ): Request
{
- // verify the required parameter 'body' is set
- if ($body === null || (is_array($body) && count($body) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $body when calling crmDealsPost'
+
+ // verify the required parameter 'crmDealsPostRequest' is set
+ if ($crmDealsPostRequest === null || (is_array($crmDealsPostRequest) && count($crmDealsPostRequest) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $crmDealsPostRequest when calling crmDealsPost'
);
}
+
$resourcePath = '/crm/deals';
$formParams = [];
$queryParams = [];
@@ -1957,56 +2792,43 @@ protected function crmDealsPostRequest($body)
- // body params
- $_tempBody = null;
- if (isset($body)) {
- $_tempBody = $body;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($crmDealsPostRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($crmDealsPostRequest));
+ } else {
+ $httpBody = $crmDealsPostRequest;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -2032,10 +2854,11 @@ protected function crmDealsPostRequest($body)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -2046,14 +2869,17 @@ protected function crmDealsPostRequest($body)
*
* Get all pipelines
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmPipelineDetailsAllGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\Pipelines
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\Pipeline[]|\Brevo\Client\Models\ErrorModel
*/
- public function crmPipelineDetailsAllGet()
+ public function crmPipelineDetailsAllGet(
+ string $contentType = self::contentTypes['crmPipelineDetailsAllGet'][0]
+ ): array
{
- list($response) = $this->crmPipelineDetailsAllGetWithHttpInfo();
+ list($response) = $this->crmPipelineDetailsAllGetWithHttpInfo($contentType);
return $response;
}
@@ -2062,15 +2888,17 @@ public function crmPipelineDetailsAllGet()
*
* Get all pipelines
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmPipelineDetailsAllGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\Pipelines, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\Pipeline[]|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function crmPipelineDetailsAllGetWithHttpInfo()
+ public function crmPipelineDetailsAllGetWithHttpInfo(
+ string $contentType = self::contentTypes['crmPipelineDetailsAllGet'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\Pipelines';
- $request = $this->crmPipelineDetailsAllGetRequest();
+ $request = $this->crmPipelineDetailsAllGetRequest($contentType);
try {
$options = $this->createHttpClientOption();
@@ -2079,34 +2907,111 @@ public function crmPipelineDetailsAllGetWithHttpInfo()
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\Pipeline[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\Pipeline[]' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\Pipeline[]', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\Pipeline[]';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -2121,7 +3026,7 @@ public function crmPipelineDetailsAllGetWithHttpInfo()
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\Pipelines',
+ '\Brevo\Client\Models\Pipeline[]',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2129,7 +3034,7 @@ public function crmPipelineDetailsAllGetWithHttpInfo()
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2144,13 +3049,16 @@ public function crmPipelineDetailsAllGetWithHttpInfo()
*
* Get all pipelines
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmPipelineDetailsAllGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmPipelineDetailsAllGetAsync()
+ public function crmPipelineDetailsAllGetAsync(
+ string $contentType = self::contentTypes['crmPipelineDetailsAllGet'][0]
+ ): PromiseInterface
{
- return $this->crmPipelineDetailsAllGetAsyncWithHttpInfo()
+ return $this->crmPipelineDetailsAllGetAsyncWithHttpInfo($contentType)
->then(
function ($response) {
return $response[0];
@@ -2163,24 +3071,27 @@ function ($response) {
*
* Get all pipelines
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmPipelineDetailsAllGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmPipelineDetailsAllGetAsyncWithHttpInfo()
+ public function crmPipelineDetailsAllGetAsyncWithHttpInfo(
+ string $contentType = self::contentTypes['crmPipelineDetailsAllGet'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\Pipelines';
- $request = $this->crmPipelineDetailsAllGetRequest();
+ $returnType = '\Brevo\Client\Models\Pipeline[]';
+ $request = $this->crmPipelineDetailsAllGetRequest($contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -2203,7 +3114,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -2212,13 +3123,17 @@ function ($exception) {
/**
* Create request for operation 'crmPipelineDetailsAllGet'
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmPipelineDetailsAllGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function crmPipelineDetailsAllGetRequest()
+ public function crmPipelineDetailsAllGetRequest(
+ string $contentType = self::contentTypes['crmPipelineDetailsAllGet'][0]
+ ): Request
{
+
$resourcePath = '/crm/pipeline/details/all';
$formParams = [];
$queryParams = [];
@@ -2228,53 +3143,36 @@ protected function crmPipelineDetailsAllGetRequest()
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -2300,10 +3198,11 @@ protected function crmPipelineDetailsAllGetRequest()
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -2314,14 +3213,18 @@ protected function crmPipelineDetailsAllGetRequest()
*
* Get pipeline stages
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmPipelineDetailsGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\Pipeline
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\Pipeline
+ * @deprecated
*/
- public function crmPipelineDetailsGet()
+ public function crmPipelineDetailsGet(
+ string $contentType = self::contentTypes['crmPipelineDetailsGet'][0]
+ ): \Brevo\Client\Models\Pipeline
{
- list($response) = $this->crmPipelineDetailsGetWithHttpInfo();
+ list($response) = $this->crmPipelineDetailsGetWithHttpInfo($contentType);
return $response;
}
@@ -2330,15 +3233,18 @@ public function crmPipelineDetailsGet()
*
* Get pipeline stages
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmPipelineDetailsGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\Pipeline, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\Pipeline, HTTP status code, HTTP response headers (array of strings)
+ * @deprecated
*/
- public function crmPipelineDetailsGetWithHttpInfo()
+ public function crmPipelineDetailsGetWithHttpInfo(
+ string $contentType = self::contentTypes['crmPipelineDetailsGet'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\Pipeline';
- $request = $this->crmPipelineDetailsGetRequest();
+ $request = $this->crmPipelineDetailsGetRequest($contentType);
try {
$options = $this->createHttpClientOption();
@@ -2347,34 +3253,84 @@ public function crmPipelineDetailsGetWithHttpInfo()
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\Pipeline', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\Pipeline' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\Pipeline', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\Pipeline';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -2389,7 +3345,7 @@ public function crmPipelineDetailsGetWithHttpInfo()
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\Pipeline',
+ '\Brevo\Client\Models\Pipeline',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2404,13 +3360,17 @@ public function crmPipelineDetailsGetWithHttpInfo()
*
* Get pipeline stages
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmPipelineDetailsGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ * @deprecated
*/
- public function crmPipelineDetailsGetAsync()
+ public function crmPipelineDetailsGetAsync(
+ string $contentType = self::contentTypes['crmPipelineDetailsGet'][0]
+ ): PromiseInterface
{
- return $this->crmPipelineDetailsGetAsyncWithHttpInfo()
+ return $this->crmPipelineDetailsGetAsyncWithHttpInfo($contentType)
->then(
function ($response) {
return $response[0];
@@ -2423,24 +3383,28 @@ function ($response) {
*
* Get pipeline stages
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmPipelineDetailsGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ * @deprecated
*/
- public function crmPipelineDetailsGetAsyncWithHttpInfo()
+ public function crmPipelineDetailsGetAsyncWithHttpInfo(
+ string $contentType = self::contentTypes['crmPipelineDetailsGet'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\Pipeline';
- $request = $this->crmPipelineDetailsGetRequest();
+ $returnType = '\Brevo\Client\Models\Pipeline';
+ $request = $this->crmPipelineDetailsGetRequest($contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -2463,7 +3427,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -2472,13 +3436,18 @@ function ($exception) {
/**
* Create request for operation 'crmPipelineDetailsGet'
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmPipelineDetailsGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
+ * @deprecated
*/
- protected function crmPipelineDetailsGetRequest()
+ public function crmPipelineDetailsGetRequest(
+ string $contentType = self::contentTypes['crmPipelineDetailsGet'][0]
+ ): Request
{
+
$resourcePath = '/crm/pipeline/details';
$formParams = [];
$queryParams = [];
@@ -2488,53 +3457,36 @@ protected function crmPipelineDetailsGetRequest()
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -2560,10 +3512,11 @@ protected function crmPipelineDetailsGetRequest()
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -2575,14 +3528,18 @@ protected function crmPipelineDetailsGetRequest()
* Get a pipeline
*
* @param string $pipelineID pipelineID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmPipelineDetailsPipelineIDGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\Pipelines
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\Pipeline[]|\Brevo\Client\Models\ErrorModel
*/
- public function crmPipelineDetailsPipelineIDGet($pipelineID)
+ public function crmPipelineDetailsPipelineIDGet(
+ string $pipelineID,
+ string $contentType = self::contentTypes['crmPipelineDetailsPipelineIDGet'][0]
+ ): array
{
- list($response) = $this->crmPipelineDetailsPipelineIDGetWithHttpInfo($pipelineID);
+ list($response) = $this->crmPipelineDetailsPipelineIDGetWithHttpInfo($pipelineID, $contentType);
return $response;
}
@@ -2592,15 +3549,18 @@ public function crmPipelineDetailsPipelineIDGet($pipelineID)
* Get a pipeline
*
* @param string $pipelineID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmPipelineDetailsPipelineIDGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\Pipelines, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\Pipeline[]|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function crmPipelineDetailsPipelineIDGetWithHttpInfo($pipelineID)
+ public function crmPipelineDetailsPipelineIDGetWithHttpInfo(
+ string $pipelineID,
+ string $contentType = self::contentTypes['crmPipelineDetailsPipelineIDGet'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\Pipelines';
- $request = $this->crmPipelineDetailsPipelineIDGetRequest($pipelineID);
+ $request = $this->crmPipelineDetailsPipelineIDGetRequest($pipelineID, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -2609,34 +3569,111 @@ public function crmPipelineDetailsPipelineIDGetWithHttpInfo($pipelineID)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\Pipeline[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\Pipeline[]' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\Pipeline[]', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\Pipeline[]';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -2651,7 +3688,7 @@ public function crmPipelineDetailsPipelineIDGetWithHttpInfo($pipelineID)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\Pipelines',
+ '\Brevo\Client\Models\Pipeline[]',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2659,7 +3696,7 @@ public function crmPipelineDetailsPipelineIDGetWithHttpInfo($pipelineID)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2675,13 +3712,17 @@ public function crmPipelineDetailsPipelineIDGetWithHttpInfo($pipelineID)
* Get a pipeline
*
* @param string $pipelineID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmPipelineDetailsPipelineIDGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmPipelineDetailsPipelineIDGetAsync($pipelineID)
+ public function crmPipelineDetailsPipelineIDGetAsync(
+ string $pipelineID,
+ string $contentType = self::contentTypes['crmPipelineDetailsPipelineIDGet'][0]
+ ): PromiseInterface
{
- return $this->crmPipelineDetailsPipelineIDGetAsyncWithHttpInfo($pipelineID)
+ return $this->crmPipelineDetailsPipelineIDGetAsyncWithHttpInfo($pipelineID, $contentType)
->then(
function ($response) {
return $response[0];
@@ -2695,24 +3736,28 @@ function ($response) {
* Get a pipeline
*
* @param string $pipelineID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmPipelineDetailsPipelineIDGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmPipelineDetailsPipelineIDGetAsyncWithHttpInfo($pipelineID)
+ public function crmPipelineDetailsPipelineIDGetAsyncWithHttpInfo(
+ $pipelineID,
+ string $contentType = self::contentTypes['crmPipelineDetailsPipelineIDGet'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\Pipelines';
- $request = $this->crmPipelineDetailsPipelineIDGetRequest($pipelineID);
+ $returnType = '\Brevo\Client\Models\Pipeline[]';
+ $request = $this->crmPipelineDetailsPipelineIDGetRequest($pipelineID, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -2735,7 +3780,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -2745,19 +3790,25 @@ function ($exception) {
* Create request for operation 'crmPipelineDetailsPipelineIDGet'
*
* @param string $pipelineID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmPipelineDetailsPipelineIDGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function crmPipelineDetailsPipelineIDGetRequest($pipelineID)
+ public function crmPipelineDetailsPipelineIDGetRequest(
+ $pipelineID,
+ string $contentType = self::contentTypes['crmPipelineDetailsPipelineIDGet'][0]
+ ): Request
{
+
// verify the required parameter 'pipelineID' is set
if ($pipelineID === null || (is_array($pipelineID) && count($pipelineID) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $pipelineID when calling crmPipelineDetailsPipelineIDGet'
);
}
+
$resourcePath = '/crm/pipeline/details/{pipelineID}';
$formParams = [];
$queryParams = [];
@@ -2766,6 +3817,7 @@ protected function crmPipelineDetailsPipelineIDGetRequest($pipelineID)
$multipart = false;
+
// path params
if ($pipelineID !== null) {
$resourcePath = str_replace(
@@ -2775,53 +3827,35 @@ protected function crmPipelineDetailsPipelineIDGetRequest($pipelineID)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -2847,10 +3881,11 @@ protected function crmPipelineDetailsPipelineIDGetRequest($pipelineID)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -2862,7 +3897,7 @@ protected function crmPipelineDetailsPipelineIDGetRequest($pipelineID)
* @throws \RuntimeException on file opening failure
* @return array of http client options
*/
- protected function createHttpClientOption()
+ protected function createHttpClientOption(): array
{
$options = [];
if ($this->config->getDebug()) {
diff --git a/lib/Api/DomainsApi.php b/lib/Api/DomainsApi.php
index c4ec0d6..8484ea7 100644
--- a/lib/Api/DomainsApi.php
+++ b/lib/Api/DomainsApi.php
@@ -1,39 +1,41 @@
[
+ 'application/json',
+ ],
+ 'createDomain' => [
+ 'application/json',
+ ],
+ 'deleteDomain' => [
+ 'application/json',
+ ],
+ 'getDomainConfiguration' => [
+ 'application/json',
+ ],
+ 'getDomains' => [
+ 'application/json',
+ ],
+ ];
+
+ /**
+ * @param ClientInterface|null $client
+ * @param Configuration|null $config
+ * @param HeaderSelector|null $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
+ HeaderSelector $selector = null,
+ int $hostIndex = 0
) {
$this->client = $client ?: new Client();
- $this->config = $config ?: new Configuration();
+ $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(int $hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex(): int
+ {
+ return $this->hostIndex;
}
/**
* @return Configuration
*/
- public function getConfig()
+ public function getConfig(): Configuration
{
return $this->config;
}
@@ -93,14 +141,18 @@ public function getConfig()
* Authenticate a domain
*
* @param string $domainName Domain name (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['authenticateDomain'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\AuthenticateDomainModel
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\AuthenticateDomainModel|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function authenticateDomain($domainName)
+ public function authenticateDomain(
+ string $domainName,
+ string $contentType = self::contentTypes['authenticateDomain'][0]
+ ): \Brevo\Client\Models\AuthenticateDomainModel
{
- list($response) = $this->authenticateDomainWithHttpInfo($domainName);
+ list($response) = $this->authenticateDomainWithHttpInfo($domainName, $contentType);
return $response;
}
@@ -110,15 +162,18 @@ public function authenticateDomain($domainName)
* Authenticate a domain
*
* @param string $domainName Domain name (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['authenticateDomain'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\AuthenticateDomainModel, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\AuthenticateDomainModel|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function authenticateDomainWithHttpInfo($domainName)
+ public function authenticateDomainWithHttpInfo(
+ string $domainName,
+ string $contentType = self::contentTypes['authenticateDomain'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\AuthenticateDomainModel';
- $request = $this->authenticateDomainRequest($domainName);
+ $request = $this->authenticateDomainRequest($domainName, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -127,34 +182,138 @@ public function authenticateDomainWithHttpInfo($domainName)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\AuthenticateDomainModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\AuthenticateDomainModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\AuthenticateDomainModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\AuthenticateDomainModel';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -169,7 +328,7 @@ public function authenticateDomainWithHttpInfo($domainName)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\AuthenticateDomainModel',
+ '\Brevo\Client\Models\AuthenticateDomainModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -177,7 +336,7 @@ public function authenticateDomainWithHttpInfo($domainName)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -185,7 +344,7 @@ public function authenticateDomainWithHttpInfo($domainName)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -201,13 +360,17 @@ public function authenticateDomainWithHttpInfo($domainName)
* Authenticate a domain
*
* @param string $domainName Domain name (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['authenticateDomain'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function authenticateDomainAsync($domainName)
+ public function authenticateDomainAsync(
+ string $domainName,
+ string $contentType = self::contentTypes['authenticateDomain'][0]
+ ): PromiseInterface
{
- return $this->authenticateDomainAsyncWithHttpInfo($domainName)
+ return $this->authenticateDomainAsyncWithHttpInfo($domainName, $contentType)
->then(
function ($response) {
return $response[0];
@@ -221,24 +384,28 @@ function ($response) {
* Authenticate a domain
*
* @param string $domainName Domain name (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['authenticateDomain'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function authenticateDomainAsyncWithHttpInfo($domainName)
+ public function authenticateDomainAsyncWithHttpInfo(
+ $domainName,
+ string $contentType = self::contentTypes['authenticateDomain'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\AuthenticateDomainModel';
- $request = $this->authenticateDomainRequest($domainName);
+ $returnType = '\Brevo\Client\Models\AuthenticateDomainModel';
+ $request = $this->authenticateDomainRequest($domainName, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -261,7 +428,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -271,19 +438,25 @@ function ($exception) {
* Create request for operation 'authenticateDomain'
*
* @param string $domainName Domain name (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['authenticateDomain'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function authenticateDomainRequest($domainName)
+ public function authenticateDomainRequest(
+ $domainName,
+ string $contentType = self::contentTypes['authenticateDomain'][0]
+ ): Request
{
+
// verify the required parameter 'domainName' is set
if ($domainName === null || (is_array($domainName) && count($domainName) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $domainName when calling authenticateDomain'
);
}
+
$resourcePath = '/senders/domains/{domainName}/authenticate';
$formParams = [];
$queryParams = [];
@@ -292,6 +465,7 @@ protected function authenticateDomainRequest($domainName)
$multipart = false;
+
// path params
if ($domainName !== null) {
$resourcePath = str_replace(
@@ -301,53 +475,35 @@ protected function authenticateDomainRequest($domainName)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -373,10 +529,11 @@ protected function authenticateDomainRequest($domainName)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'PUT',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -387,15 +544,19 @@ protected function authenticateDomainRequest($domainName)
*
* Create a new domain
*
- * @param \Brevo\Client\Model\CreateDomain $domainName domain's name (optional)
+ * @param \Brevo\Client\Models\CreateDomain|null $domain domain's name (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDomain'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\CreateDomainModel
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CreateDomainModel|\Brevo\Client\Models\ErrorModel
*/
- public function createDomain($domainName = null)
+ public function createDomain(
+ ?\Brevo\Client\Models\CreateDomain $domain = null,
+ string $contentType = self::contentTypes['createDomain'][0]
+ ): \Brevo\Client\Models\CreateDomainModel
{
- list($response) = $this->createDomainWithHttpInfo($domainName);
+ list($response) = $this->createDomainWithHttpInfo($domain, $contentType);
return $response;
}
@@ -404,16 +565,19 @@ public function createDomain($domainName = null)
*
* Create a new domain
*
- * @param \Brevo\Client\Model\CreateDomain $domainName domain's name (optional)
+ * @param \Brevo\Client\Models\CreateDomain|null $domain domain's name (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDomain'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\CreateDomainModel, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CreateDomainModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function createDomainWithHttpInfo($domainName = null)
+ public function createDomainWithHttpInfo(
+ ?\Brevo\Client\Models\CreateDomain $domain = null,
+ string $contentType = self::contentTypes['createDomain'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\CreateDomainModel';
- $request = $this->createDomainRequest($domainName);
+ $request = $this->createDomainRequest($domain, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -422,34 +586,111 @@ public function createDomainWithHttpInfo($domainName = null)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\CreateDomainModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CreateDomainModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CreateDomainModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CreateDomainModel';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -464,7 +705,7 @@ public function createDomainWithHttpInfo($domainName = null)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\CreateDomainModel',
+ '\Brevo\Client\Models\CreateDomainModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -472,7 +713,7 @@ public function createDomainWithHttpInfo($domainName = null)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -487,14 +728,18 @@ public function createDomainWithHttpInfo($domainName = null)
*
* Create a new domain
*
- * @param \Brevo\Client\Model\CreateDomain $domainName domain's name (optional)
+ * @param \Brevo\Client\Models\CreateDomain|null $domain domain's name (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDomain'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createDomainAsync($domainName = null)
+ public function createDomainAsync(
+ ?\Brevo\Client\Models\CreateDomain $domain = null,
+ string $contentType = self::contentTypes['createDomain'][0]
+ ): PromiseInterface
{
- return $this->createDomainAsyncWithHttpInfo($domainName)
+ return $this->createDomainAsyncWithHttpInfo($domain, $contentType)
->then(
function ($response) {
return $response[0];
@@ -507,25 +752,29 @@ function ($response) {
*
* Create a new domain
*
- * @param \Brevo\Client\Model\CreateDomain $domainName domain's name (optional)
+ * @param \Brevo\Client\Models\CreateDomain|null $domain domain's name (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDomain'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createDomainAsyncWithHttpInfo($domainName = null)
+ public function createDomainAsyncWithHttpInfo(
+ $domain = null,
+ string $contentType = self::contentTypes['createDomain'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\CreateDomainModel';
- $request = $this->createDomainRequest($domainName);
+ $returnType = '\Brevo\Client\Models\CreateDomainModel';
+ $request = $this->createDomainRequest($domain, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -548,7 +797,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -557,14 +806,20 @@ function ($exception) {
/**
* Create request for operation 'createDomain'
*
- * @param \Brevo\Client\Model\CreateDomain $domainName domain's name (optional)
+ * @param \Brevo\Client\Models\CreateDomain|null $domain domain's name (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDomain'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function createDomainRequest($domainName = null)
+ public function createDomainRequest(
+ $domain = null,
+ string $contentType = self::contentTypes['createDomain'][0]
+ ): Request
{
+
+
$resourcePath = '/senders/domains';
$formParams = [];
$queryParams = [];
@@ -574,56 +829,43 @@ protected function createDomainRequest($domainName = null)
- // body params
- $_tempBody = null;
- if (isset($domainName)) {
- $_tempBody = $domainName;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($domain)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($domain));
+ } else {
+ $httpBody = $domain;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -649,10 +891,11 @@ protected function createDomainRequest($domainName = null)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -664,14 +907,18 @@ protected function createDomainRequest($domainName = null)
* Delete a domain
*
* @param string $domainName Domain name (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDomain'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function deleteDomain($domainName)
+ public function deleteDomain(
+ string $domainName,
+ string $contentType = self::contentTypes['deleteDomain'][0]
+ ): void
{
- $this->deleteDomainWithHttpInfo($domainName);
+ $this->deleteDomainWithHttpInfo($domainName, $contentType);
}
/**
@@ -680,15 +927,18 @@ public function deleteDomain($domainName)
* Delete a domain
*
* @param string $domainName Domain name (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDomain'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function deleteDomainWithHttpInfo($domainName)
+ public function deleteDomainWithHttpInfo(
+ string $domainName,
+ string $contentType = self::contentTypes['deleteDomain'][0]
+ ): array
{
- $returnType = '';
- $request = $this->deleteDomainRequest($domainName);
+ $request = $this->deleteDomainRequest($domainName, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -697,26 +947,21 @@ public function deleteDomainWithHttpInfo($domainName)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -725,7 +970,7 @@ public function deleteDomainWithHttpInfo($domainName)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -733,7 +978,7 @@ public function deleteDomainWithHttpInfo($domainName)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -749,13 +994,17 @@ public function deleteDomainWithHttpInfo($domainName)
* Delete a domain
*
* @param string $domainName Domain name (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDomain'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteDomainAsync($domainName)
+ public function deleteDomainAsync(
+ string $domainName,
+ string $contentType = self::contentTypes['deleteDomain'][0]
+ ): PromiseInterface
{
- return $this->deleteDomainAsyncWithHttpInfo($domainName)
+ return $this->deleteDomainAsyncWithHttpInfo($domainName, $contentType)
->then(
function ($response) {
return $response[0];
@@ -769,14 +1018,19 @@ function ($response) {
* Delete a domain
*
* @param string $domainName Domain name (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDomain'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteDomainAsyncWithHttpInfo($domainName)
+ public function deleteDomainAsyncWithHttpInfo(
+ $domainName,
+ string $contentType = self::contentTypes['deleteDomain'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->deleteDomainRequest($domainName);
+ $request = $this->deleteDomainRequest($domainName, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -795,7 +1049,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -805,19 +1059,25 @@ function ($exception) {
* Create request for operation 'deleteDomain'
*
* @param string $domainName Domain name (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDomain'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function deleteDomainRequest($domainName)
+ public function deleteDomainRequest(
+ $domainName,
+ string $contentType = self::contentTypes['deleteDomain'][0]
+ ): Request
{
+
// verify the required parameter 'domainName' is set
if ($domainName === null || (is_array($domainName) && count($domainName) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $domainName when calling deleteDomain'
);
}
+
$resourcePath = '/senders/domains/{domainName}';
$formParams = [];
$queryParams = [];
@@ -826,6 +1086,7 @@ protected function deleteDomainRequest($domainName)
$multipart = false;
+
// path params
if ($domainName !== null) {
$resourcePath = str_replace(
@@ -835,53 +1096,35 @@ protected function deleteDomainRequest($domainName)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -907,10 +1150,11 @@ protected function deleteDomainRequest($domainName)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -922,14 +1166,18 @@ protected function deleteDomainRequest($domainName)
* Validate domain configuration
*
* @param string $domainName Domain name (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDomainConfiguration'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetDomainConfigurationModel
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetDomainConfigurationModel|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function getDomainConfiguration($domainName)
+ public function getDomainConfiguration(
+ string $domainName,
+ string $contentType = self::contentTypes['getDomainConfiguration'][0]
+ ): \Brevo\Client\Models\GetDomainConfigurationModel
{
- list($response) = $this->getDomainConfigurationWithHttpInfo($domainName);
+ list($response) = $this->getDomainConfigurationWithHttpInfo($domainName, $contentType);
return $response;
}
@@ -939,15 +1187,18 @@ public function getDomainConfiguration($domainName)
* Validate domain configuration
*
* @param string $domainName Domain name (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDomainConfiguration'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetDomainConfigurationModel, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetDomainConfigurationModel|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getDomainConfigurationWithHttpInfo($domainName)
+ public function getDomainConfigurationWithHttpInfo(
+ string $domainName,
+ string $contentType = self::contentTypes['getDomainConfiguration'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetDomainConfigurationModel';
- $request = $this->getDomainConfigurationRequest($domainName);
+ $request = $this->getDomainConfigurationRequest($domainName, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -956,34 +1207,138 @@ public function getDomainConfigurationWithHttpInfo($domainName)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetDomainConfigurationModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetDomainConfigurationModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetDomainConfigurationModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetDomainConfigurationModel';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -998,7 +1353,7 @@ public function getDomainConfigurationWithHttpInfo($domainName)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetDomainConfigurationModel',
+ '\Brevo\Client\Models\GetDomainConfigurationModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1006,7 +1361,7 @@ public function getDomainConfigurationWithHttpInfo($domainName)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1014,7 +1369,7 @@ public function getDomainConfigurationWithHttpInfo($domainName)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1030,13 +1385,17 @@ public function getDomainConfigurationWithHttpInfo($domainName)
* Validate domain configuration
*
* @param string $domainName Domain name (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDomainConfiguration'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getDomainConfigurationAsync($domainName)
+ public function getDomainConfigurationAsync(
+ string $domainName,
+ string $contentType = self::contentTypes['getDomainConfiguration'][0]
+ ): PromiseInterface
{
- return $this->getDomainConfigurationAsyncWithHttpInfo($domainName)
+ return $this->getDomainConfigurationAsyncWithHttpInfo($domainName, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1050,24 +1409,28 @@ function ($response) {
* Validate domain configuration
*
* @param string $domainName Domain name (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDomainConfiguration'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getDomainConfigurationAsyncWithHttpInfo($domainName)
+ public function getDomainConfigurationAsyncWithHttpInfo(
+ $domainName,
+ string $contentType = self::contentTypes['getDomainConfiguration'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetDomainConfigurationModel';
- $request = $this->getDomainConfigurationRequest($domainName);
+ $returnType = '\Brevo\Client\Models\GetDomainConfigurationModel';
+ $request = $this->getDomainConfigurationRequest($domainName, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1090,7 +1453,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1100,19 +1463,25 @@ function ($exception) {
* Create request for operation 'getDomainConfiguration'
*
* @param string $domainName Domain name (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDomainConfiguration'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getDomainConfigurationRequest($domainName)
+ public function getDomainConfigurationRequest(
+ $domainName,
+ string $contentType = self::contentTypes['getDomainConfiguration'][0]
+ ): Request
{
+
// verify the required parameter 'domainName' is set
if ($domainName === null || (is_array($domainName) && count($domainName) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $domainName when calling getDomainConfiguration'
);
}
+
$resourcePath = '/senders/domains/{domainName}';
$formParams = [];
$queryParams = [];
@@ -1121,6 +1490,7 @@ protected function getDomainConfigurationRequest($domainName)
$multipart = false;
+
// path params
if ($domainName !== null) {
$resourcePath = str_replace(
@@ -1130,53 +1500,35 @@ protected function getDomainConfigurationRequest($domainName)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1202,10 +1554,11 @@ protected function getDomainConfigurationRequest($domainName)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1216,14 +1569,17 @@ protected function getDomainConfigurationRequest($domainName)
*
* Get the list of all your domains
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDomains'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetDomainsList
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetDomainsList|\Brevo\Client\Models\ErrorModel
*/
- public function getDomains()
+ public function getDomains(
+ string $contentType = self::contentTypes['getDomains'][0]
+ ): \Brevo\Client\Models\GetDomainsList
{
- list($response) = $this->getDomainsWithHttpInfo();
+ list($response) = $this->getDomainsWithHttpInfo($contentType);
return $response;
}
@@ -1232,15 +1588,17 @@ public function getDomains()
*
* Get the list of all your domains
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDomains'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetDomainsList, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetDomainsList|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getDomainsWithHttpInfo()
+ public function getDomainsWithHttpInfo(
+ string $contentType = self::contentTypes['getDomains'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetDomainsList';
- $request = $this->getDomainsRequest();
+ $request = $this->getDomainsRequest($contentType);
try {
$options = $this->createHttpClientOption();
@@ -1249,34 +1607,111 @@ public function getDomainsWithHttpInfo()
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetDomainsList', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetDomainsList' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetDomainsList', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetDomainsList';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1291,7 +1726,7 @@ public function getDomainsWithHttpInfo()
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetDomainsList',
+ '\Brevo\Client\Models\GetDomainsList',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1299,7 +1734,7 @@ public function getDomainsWithHttpInfo()
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1314,13 +1749,16 @@ public function getDomainsWithHttpInfo()
*
* Get the list of all your domains
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDomains'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getDomainsAsync()
+ public function getDomainsAsync(
+ string $contentType = self::contentTypes['getDomains'][0]
+ ): PromiseInterface
{
- return $this->getDomainsAsyncWithHttpInfo()
+ return $this->getDomainsAsyncWithHttpInfo($contentType)
->then(
function ($response) {
return $response[0];
@@ -1333,24 +1771,27 @@ function ($response) {
*
* Get the list of all your domains
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDomains'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getDomainsAsyncWithHttpInfo()
+ public function getDomainsAsyncWithHttpInfo(
+ string $contentType = self::contentTypes['getDomains'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetDomainsList';
- $request = $this->getDomainsRequest();
+ $returnType = '\Brevo\Client\Models\GetDomainsList';
+ $request = $this->getDomainsRequest($contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1373,7 +1814,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1382,13 +1823,17 @@ function ($exception) {
/**
* Create request for operation 'getDomains'
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDomains'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getDomainsRequest()
+ public function getDomainsRequest(
+ string $contentType = self::contentTypes['getDomains'][0]
+ ): Request
{
+
$resourcePath = '/senders/domains';
$formParams = [];
$queryParams = [];
@@ -1398,53 +1843,36 @@ protected function getDomainsRequest()
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1470,10 +1898,11 @@ protected function getDomainsRequest()
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1485,7 +1914,7 @@ protected function getDomainsRequest()
* @throws \RuntimeException on file opening failure
* @return array of http client options
*/
- protected function createHttpClientOption()
+ protected function createHttpClientOption(): array
{
$options = [];
if ($this->config->getDebug()) {
diff --git a/lib/Api/EcommerceApi.php b/lib/Api/EcommerceApi.php
index d667474..3e17499 100644
--- a/lib/Api/EcommerceApi.php
+++ b/lib/Api/EcommerceApi.php
@@ -1,39 +1,41 @@
[
+ 'application/json',
+ ],
+ 'createOrder' => [
+ 'application/json',
+ ],
+ 'createUpdateBatchCategory' => [
+ 'application/json',
+ ],
+ 'createUpdateBatchProducts' => [
+ 'application/json',
+ ],
+ 'createUpdateCategory' => [
+ 'application/json',
+ ],
+ 'createUpdateProduct' => [
+ 'application/json',
+ ],
+ 'ecommerceActivatePost' => [
+ 'application/json',
+ ],
+ 'ecommerceAttributionMetricsConversionSourceConversionSourceIdGet' => [
+ 'application/json',
+ ],
+ 'ecommerceAttributionMetricsGet' => [
+ 'application/json',
+ ],
+ 'ecommerceAttributionProductsConversionSourceConversionSourceIdGet' => [
+ 'application/json',
+ ],
+ 'ecommerceConfigDisplayCurrencyGet' => [
+ 'application/json',
+ ],
+ 'getCategories' => [
+ 'application/json',
+ ],
+ 'getCategoryInfo' => [
+ 'application/json',
+ ],
+ 'getOrders' => [
+ 'application/json',
+ ],
+ 'getProductInfo' => [
+ 'application/json',
+ ],
+ 'getProducts' => [
+ 'application/json',
+ ],
+ 'setConfigDisplayCurrency' => [
+ 'application/json',
+ ],
+ ];
+
+ /**
+ * @param ClientInterface|null $client
+ * @param Configuration|null $config
+ * @param HeaderSelector|null $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
+ HeaderSelector $selector = null,
+ int $hostIndex = 0
) {
$this->client = $client ?: new Client();
- $this->config = $config ?: new Configuration();
+ $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(int $hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex(): int
+ {
+ return $this->hostIndex;
}
/**
* @return Configuration
*/
- public function getConfig()
+ public function getConfig(): Configuration
{
return $this->config;
}
@@ -92,15 +176,20 @@ public function getConfig()
*
* Create orders in batch
*
- * @param \Brevo\Client\Model\OrderBatch $orderBatch orderBatch (required)
+ * @param \Brevo\Client\Models\OrderBatch $orderBatch orderBatch (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createBatchOrder'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return void
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CreatedBatchId|\Brevo\Client\Models\ErrorModel
*/
- public function createBatchOrder($orderBatch)
+ public function createBatchOrder(
+ \Brevo\Client\Models\OrderBatch $orderBatch,
+ string $contentType = self::contentTypes['createBatchOrder'][0]
+ ): \Brevo\Client\Models\CreatedBatchId
{
- $this->createBatchOrderWithHttpInfo($orderBatch);
+ list($response) = $this->createBatchOrderWithHttpInfo($orderBatch, $contentType);
+ return $response;
}
/**
@@ -108,16 +197,19 @@ public function createBatchOrder($orderBatch)
*
* Create orders in batch
*
- * @param \Brevo\Client\Model\OrderBatch $orderBatch (required)
+ * @param \Brevo\Client\Models\OrderBatch $orderBatch (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createBatchOrder'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CreatedBatchId|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function createBatchOrderWithHttpInfo($orderBatch)
+ public function createBatchOrderWithHttpInfo(
+ \Brevo\Client\Models\OrderBatch $orderBatch,
+ string $contentType = self::contentTypes['createBatchOrder'][0]
+ ): array
{
- $returnType = '';
- $request = $this->createBatchOrderRequest($orderBatch);
+ $request = $this->createBatchOrderRequest($orderBatch, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -126,35 +218,134 @@ public function createBatchOrderWithHttpInfo($orderBatch)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 202:
+ if (in_array('\Brevo\Client\Models\CreatedBatchId', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CreatedBatchId' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CreatedBatchId', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- return [null, $statusCode, $response->getHeaders()];
+ $returnType = '\Brevo\Client\Models\CreatedBatchId';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 202:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\CreatedBatchId',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -169,14 +360,18 @@ public function createBatchOrderWithHttpInfo($orderBatch)
*
* Create orders in batch
*
- * @param \Brevo\Client\Model\OrderBatch $orderBatch (required)
+ * @param \Brevo\Client\Models\OrderBatch $orderBatch (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createBatchOrder'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createBatchOrderAsync($orderBatch)
+ public function createBatchOrderAsync(
+ \Brevo\Client\Models\OrderBatch $orderBatch,
+ string $contentType = self::contentTypes['createBatchOrder'][0]
+ ): PromiseInterface
{
- return $this->createBatchOrderAsyncWithHttpInfo($orderBatch)
+ return $this->createBatchOrderAsyncWithHttpInfo($orderBatch, $contentType)
->then(
function ($response) {
return $response[0];
@@ -189,21 +384,39 @@ function ($response) {
*
* Create orders in batch
*
- * @param \Brevo\Client\Model\OrderBatch $orderBatch (required)
+ * @param \Brevo\Client\Models\OrderBatch $orderBatch (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createBatchOrder'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createBatchOrderAsyncWithHttpInfo($orderBatch)
+ public function createBatchOrderAsyncWithHttpInfo(
+ $orderBatch,
+ string $contentType = self::contentTypes['createBatchOrder'][0]
+ ): PromiseInterface
{
- $returnType = '';
- $request = $this->createBatchOrderRequest($orderBatch);
+ $returnType = '\Brevo\Client\Models\CreatedBatchId';
+ $request = $this->createBatchOrderRequest($orderBatch, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- return [null, $response->getStatusCode(), $response->getHeaders()];
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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();
@@ -216,7 +429,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -225,20 +438,26 @@ function ($exception) {
/**
* Create request for operation 'createBatchOrder'
*
- * @param \Brevo\Client\Model\OrderBatch $orderBatch (required)
+ * @param \Brevo\Client\Models\OrderBatch $orderBatch (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createBatchOrder'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function createBatchOrderRequest($orderBatch)
+ public function createBatchOrderRequest(
+ $orderBatch,
+ string $contentType = self::contentTypes['createBatchOrder'][0]
+ ): Request
{
+
// verify the required parameter 'orderBatch' is set
if ($orderBatch === null || (is_array($orderBatch) && count($orderBatch) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $orderBatch when calling createBatchOrder'
);
}
+
$resourcePath = '/orders/status/batch';
$formParams = [];
$queryParams = [];
@@ -248,56 +467,43 @@ protected function createBatchOrderRequest($orderBatch)
- // body params
- $_tempBody = null;
- if (isset($orderBatch)) {
- $_tempBody = $orderBatch;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($orderBatch)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($orderBatch));
+ } else {
+ $httpBody = $orderBatch;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -323,10 +529,11 @@ protected function createBatchOrderRequest($orderBatch)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -337,15 +544,19 @@ protected function createBatchOrderRequest($orderBatch)
*
* Managing the status of the order
*
- * @param \Brevo\Client\Model\Order $order order (required)
+ * @param \Brevo\Client\Models\Order $order order (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOrder'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function createOrder($order)
+ public function createOrder(
+ \Brevo\Client\Models\Order $order,
+ string $contentType = self::contentTypes['createOrder'][0]
+ ): void
{
- $this->createOrderWithHttpInfo($order);
+ $this->createOrderWithHttpInfo($order, $contentType);
}
/**
@@ -353,16 +564,19 @@ public function createOrder($order)
*
* Managing the status of the order
*
- * @param \Brevo\Client\Model\Order $order (required)
+ * @param \Brevo\Client\Models\Order $order (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOrder'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function createOrderWithHttpInfo($order)
+ public function createOrderWithHttpInfo(
+ \Brevo\Client\Models\Order $order,
+ string $contentType = self::contentTypes['createOrder'][0]
+ ): array
{
- $returnType = '';
- $request = $this->createOrderRequest($order);
+ $request = $this->createOrderRequest($order, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -371,26 +585,21 @@ public function createOrderWithHttpInfo($order)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -399,7 +608,7 @@ public function createOrderWithHttpInfo($order)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -414,14 +623,18 @@ public function createOrderWithHttpInfo($order)
*
* Managing the status of the order
*
- * @param \Brevo\Client\Model\Order $order (required)
+ * @param \Brevo\Client\Models\Order $order (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOrder'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createOrderAsync($order)
+ public function createOrderAsync(
+ \Brevo\Client\Models\Order $order,
+ string $contentType = self::contentTypes['createOrder'][0]
+ ): PromiseInterface
{
- return $this->createOrderAsyncWithHttpInfo($order)
+ return $this->createOrderAsyncWithHttpInfo($order, $contentType)
->then(
function ($response) {
return $response[0];
@@ -434,15 +647,20 @@ function ($response) {
*
* Managing the status of the order
*
- * @param \Brevo\Client\Model\Order $order (required)
+ * @param \Brevo\Client\Models\Order $order (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOrder'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createOrderAsyncWithHttpInfo($order)
+ public function createOrderAsyncWithHttpInfo(
+ $order,
+ string $contentType = self::contentTypes['createOrder'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->createOrderRequest($order);
+ $request = $this->createOrderRequest($order, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -461,7 +679,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -470,20 +688,26 @@ function ($exception) {
/**
* Create request for operation 'createOrder'
*
- * @param \Brevo\Client\Model\Order $order (required)
+ * @param \Brevo\Client\Models\Order $order (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOrder'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function createOrderRequest($order)
+ public function createOrderRequest(
+ $order,
+ string $contentType = self::contentTypes['createOrder'][0]
+ ): Request
{
+
// verify the required parameter 'order' is set
if ($order === null || (is_array($order) && count($order) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $order when calling createOrder'
);
}
+
$resourcePath = '/orders/status';
$formParams = [];
$queryParams = [];
@@ -493,56 +717,43 @@ protected function createOrderRequest($order)
- // body params
- $_tempBody = null;
- if (isset($order)) {
- $_tempBody = $order;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($order)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($order));
+ } else {
+ $httpBody = $order;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -568,10 +779,11 @@ protected function createOrderRequest($order)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -582,15 +794,19 @@ protected function createOrderRequest($order)
*
* Create categories in batch
*
- * @param \Brevo\Client\Model\CreateUpdateBatchCategory $createUpdateBatchCategory Values to create a batch of categories (required)
+ * @param \Brevo\Client\Models\CreateUpdateBatchCategory $createUpdateBatchCategory Values to create a batch of categories (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUpdateBatchCategory'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\CreateUpdateBatchCategoryModel
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CreateUpdateBatchCategoryModel|\Brevo\Client\Models\ErrorModel
*/
- public function createUpdateBatchCategory($createUpdateBatchCategory)
+ public function createUpdateBatchCategory(
+ \Brevo\Client\Models\CreateUpdateBatchCategory $createUpdateBatchCategory,
+ string $contentType = self::contentTypes['createUpdateBatchCategory'][0]
+ ): \Brevo\Client\Models\CreateUpdateBatchCategoryModel
{
- list($response) = $this->createUpdateBatchCategoryWithHttpInfo($createUpdateBatchCategory);
+ list($response) = $this->createUpdateBatchCategoryWithHttpInfo($createUpdateBatchCategory, $contentType);
return $response;
}
@@ -599,16 +815,19 @@ public function createUpdateBatchCategory($createUpdateBatchCategory)
*
* Create categories in batch
*
- * @param \Brevo\Client\Model\CreateUpdateBatchCategory $createUpdateBatchCategory Values to create a batch of categories (required)
+ * @param \Brevo\Client\Models\CreateUpdateBatchCategory $createUpdateBatchCategory Values to create a batch of categories (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUpdateBatchCategory'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\CreateUpdateBatchCategoryModel, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CreateUpdateBatchCategoryModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function createUpdateBatchCategoryWithHttpInfo($createUpdateBatchCategory)
+ public function createUpdateBatchCategoryWithHttpInfo(
+ \Brevo\Client\Models\CreateUpdateBatchCategory $createUpdateBatchCategory,
+ string $contentType = self::contentTypes['createUpdateBatchCategory'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\CreateUpdateBatchCategoryModel';
- $request = $this->createUpdateBatchCategoryRequest($createUpdateBatchCategory);
+ $request = $this->createUpdateBatchCategoryRequest($createUpdateBatchCategory, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -617,34 +836,111 @@ public function createUpdateBatchCategoryWithHttpInfo($createUpdateBatchCategory
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 201:
+ if (in_array('\Brevo\Client\Models\CreateUpdateBatchCategoryModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CreateUpdateBatchCategoryModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CreateUpdateBatchCategoryModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CreateUpdateBatchCategoryModel';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -659,7 +955,7 @@ public function createUpdateBatchCategoryWithHttpInfo($createUpdateBatchCategory
case 201:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\CreateUpdateBatchCategoryModel',
+ '\Brevo\Client\Models\CreateUpdateBatchCategoryModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -667,7 +963,7 @@ public function createUpdateBatchCategoryWithHttpInfo($createUpdateBatchCategory
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -682,14 +978,18 @@ public function createUpdateBatchCategoryWithHttpInfo($createUpdateBatchCategory
*
* Create categories in batch
*
- * @param \Brevo\Client\Model\CreateUpdateBatchCategory $createUpdateBatchCategory Values to create a batch of categories (required)
+ * @param \Brevo\Client\Models\CreateUpdateBatchCategory $createUpdateBatchCategory Values to create a batch of categories (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUpdateBatchCategory'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createUpdateBatchCategoryAsync($createUpdateBatchCategory)
+ public function createUpdateBatchCategoryAsync(
+ \Brevo\Client\Models\CreateUpdateBatchCategory $createUpdateBatchCategory,
+ string $contentType = self::contentTypes['createUpdateBatchCategory'][0]
+ ): PromiseInterface
{
- return $this->createUpdateBatchCategoryAsyncWithHttpInfo($createUpdateBatchCategory)
+ return $this->createUpdateBatchCategoryAsyncWithHttpInfo($createUpdateBatchCategory, $contentType)
->then(
function ($response) {
return $response[0];
@@ -702,25 +1002,29 @@ function ($response) {
*
* Create categories in batch
*
- * @param \Brevo\Client\Model\CreateUpdateBatchCategory $createUpdateBatchCategory Values to create a batch of categories (required)
+ * @param \Brevo\Client\Models\CreateUpdateBatchCategory $createUpdateBatchCategory Values to create a batch of categories (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUpdateBatchCategory'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createUpdateBatchCategoryAsyncWithHttpInfo($createUpdateBatchCategory)
+ public function createUpdateBatchCategoryAsyncWithHttpInfo(
+ $createUpdateBatchCategory,
+ string $contentType = self::contentTypes['createUpdateBatchCategory'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\CreateUpdateBatchCategoryModel';
- $request = $this->createUpdateBatchCategoryRequest($createUpdateBatchCategory);
+ $returnType = '\Brevo\Client\Models\CreateUpdateBatchCategoryModel';
+ $request = $this->createUpdateBatchCategoryRequest($createUpdateBatchCategory, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -743,7 +1047,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -752,20 +1056,26 @@ function ($exception) {
/**
* Create request for operation 'createUpdateBatchCategory'
*
- * @param \Brevo\Client\Model\CreateUpdateBatchCategory $createUpdateBatchCategory Values to create a batch of categories (required)
+ * @param \Brevo\Client\Models\CreateUpdateBatchCategory $createUpdateBatchCategory Values to create a batch of categories (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUpdateBatchCategory'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function createUpdateBatchCategoryRequest($createUpdateBatchCategory)
+ public function createUpdateBatchCategoryRequest(
+ $createUpdateBatchCategory,
+ string $contentType = self::contentTypes['createUpdateBatchCategory'][0]
+ ): Request
{
+
// verify the required parameter 'createUpdateBatchCategory' is set
if ($createUpdateBatchCategory === null || (is_array($createUpdateBatchCategory) && count($createUpdateBatchCategory) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $createUpdateBatchCategory when calling createUpdateBatchCategory'
);
}
+
$resourcePath = '/categories/batch';
$formParams = [];
$queryParams = [];
@@ -775,56 +1085,43 @@ protected function createUpdateBatchCategoryRequest($createUpdateBatchCategory)
- // body params
- $_tempBody = null;
- if (isset($createUpdateBatchCategory)) {
- $_tempBody = $createUpdateBatchCategory;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($createUpdateBatchCategory)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createUpdateBatchCategory));
+ } else {
+ $httpBody = $createUpdateBatchCategory;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -850,10 +1147,11 @@ protected function createUpdateBatchCategoryRequest($createUpdateBatchCategory)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -864,15 +1162,19 @@ protected function createUpdateBatchCategoryRequest($createUpdateBatchCategory)
*
* Create products in batch
*
- * @param \Brevo\Client\Model\CreateUpdateBatchProducts $createUpdateBatchProducts Values to create a batch of products (required)
+ * @param \Brevo\Client\Models\CreateUpdateBatchProducts $createUpdateBatchProducts Values to create a batch of products (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUpdateBatchProducts'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\CreateUpdateBatchProductsModel
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CreateUpdateBatchProductsModel|\Brevo\Client\Models\ErrorModel
*/
- public function createUpdateBatchProducts($createUpdateBatchProducts)
+ public function createUpdateBatchProducts(
+ \Brevo\Client\Models\CreateUpdateBatchProducts $createUpdateBatchProducts,
+ string $contentType = self::contentTypes['createUpdateBatchProducts'][0]
+ ): \Brevo\Client\Models\CreateUpdateBatchProductsModel
{
- list($response) = $this->createUpdateBatchProductsWithHttpInfo($createUpdateBatchProducts);
+ list($response) = $this->createUpdateBatchProductsWithHttpInfo($createUpdateBatchProducts, $contentType);
return $response;
}
@@ -881,16 +1183,19 @@ public function createUpdateBatchProducts($createUpdateBatchProducts)
*
* Create products in batch
*
- * @param \Brevo\Client\Model\CreateUpdateBatchProducts $createUpdateBatchProducts Values to create a batch of products (required)
+ * @param \Brevo\Client\Models\CreateUpdateBatchProducts $createUpdateBatchProducts Values to create a batch of products (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUpdateBatchProducts'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\CreateUpdateBatchProductsModel, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CreateUpdateBatchProductsModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function createUpdateBatchProductsWithHttpInfo($createUpdateBatchProducts)
+ public function createUpdateBatchProductsWithHttpInfo(
+ \Brevo\Client\Models\CreateUpdateBatchProducts $createUpdateBatchProducts,
+ string $contentType = self::contentTypes['createUpdateBatchProducts'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\CreateUpdateBatchProductsModel';
- $request = $this->createUpdateBatchProductsRequest($createUpdateBatchProducts);
+ $request = $this->createUpdateBatchProductsRequest($createUpdateBatchProducts, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -899,34 +1204,111 @@ public function createUpdateBatchProductsWithHttpInfo($createUpdateBatchProducts
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 201:
+ if (in_array('\Brevo\Client\Models\CreateUpdateBatchProductsModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CreateUpdateBatchProductsModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CreateUpdateBatchProductsModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CreateUpdateBatchProductsModel';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -941,7 +1323,7 @@ public function createUpdateBatchProductsWithHttpInfo($createUpdateBatchProducts
case 201:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\CreateUpdateBatchProductsModel',
+ '\Brevo\Client\Models\CreateUpdateBatchProductsModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -949,7 +1331,7 @@ public function createUpdateBatchProductsWithHttpInfo($createUpdateBatchProducts
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -964,14 +1346,18 @@ public function createUpdateBatchProductsWithHttpInfo($createUpdateBatchProducts
*
* Create products in batch
*
- * @param \Brevo\Client\Model\CreateUpdateBatchProducts $createUpdateBatchProducts Values to create a batch of products (required)
+ * @param \Brevo\Client\Models\CreateUpdateBatchProducts $createUpdateBatchProducts Values to create a batch of products (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUpdateBatchProducts'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createUpdateBatchProductsAsync($createUpdateBatchProducts)
+ public function createUpdateBatchProductsAsync(
+ \Brevo\Client\Models\CreateUpdateBatchProducts $createUpdateBatchProducts,
+ string $contentType = self::contentTypes['createUpdateBatchProducts'][0]
+ ): PromiseInterface
{
- return $this->createUpdateBatchProductsAsyncWithHttpInfo($createUpdateBatchProducts)
+ return $this->createUpdateBatchProductsAsyncWithHttpInfo($createUpdateBatchProducts, $contentType)
->then(
function ($response) {
return $response[0];
@@ -984,25 +1370,29 @@ function ($response) {
*
* Create products in batch
*
- * @param \Brevo\Client\Model\CreateUpdateBatchProducts $createUpdateBatchProducts Values to create a batch of products (required)
+ * @param \Brevo\Client\Models\CreateUpdateBatchProducts $createUpdateBatchProducts Values to create a batch of products (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUpdateBatchProducts'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createUpdateBatchProductsAsyncWithHttpInfo($createUpdateBatchProducts)
+ public function createUpdateBatchProductsAsyncWithHttpInfo(
+ $createUpdateBatchProducts,
+ string $contentType = self::contentTypes['createUpdateBatchProducts'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\CreateUpdateBatchProductsModel';
- $request = $this->createUpdateBatchProductsRequest($createUpdateBatchProducts);
+ $returnType = '\Brevo\Client\Models\CreateUpdateBatchProductsModel';
+ $request = $this->createUpdateBatchProductsRequest($createUpdateBatchProducts, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1025,7 +1415,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1034,20 +1424,26 @@ function ($exception) {
/**
* Create request for operation 'createUpdateBatchProducts'
*
- * @param \Brevo\Client\Model\CreateUpdateBatchProducts $createUpdateBatchProducts Values to create a batch of products (required)
+ * @param \Brevo\Client\Models\CreateUpdateBatchProducts $createUpdateBatchProducts Values to create a batch of products (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUpdateBatchProducts'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function createUpdateBatchProductsRequest($createUpdateBatchProducts)
+ public function createUpdateBatchProductsRequest(
+ $createUpdateBatchProducts,
+ string $contentType = self::contentTypes['createUpdateBatchProducts'][0]
+ ): Request
{
+
// verify the required parameter 'createUpdateBatchProducts' is set
if ($createUpdateBatchProducts === null || (is_array($createUpdateBatchProducts) && count($createUpdateBatchProducts) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $createUpdateBatchProducts when calling createUpdateBatchProducts'
);
}
+
$resourcePath = '/products/batch';
$formParams = [];
$queryParams = [];
@@ -1057,56 +1453,43 @@ protected function createUpdateBatchProductsRequest($createUpdateBatchProducts)
- // body params
- $_tempBody = null;
- if (isset($createUpdateBatchProducts)) {
- $_tempBody = $createUpdateBatchProducts;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($createUpdateBatchProducts)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createUpdateBatchProducts));
+ } else {
+ $httpBody = $createUpdateBatchProducts;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1132,10 +1515,11 @@ protected function createUpdateBatchProductsRequest($createUpdateBatchProducts)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1146,15 +1530,19 @@ protected function createUpdateBatchProductsRequest($createUpdateBatchProducts)
*
* Create/Update a category
*
- * @param \Brevo\Client\Model\CreateUpdateCategory $createUpdateCategory Values to create/update a category (required)
+ * @param \Brevo\Client\Models\CreateUpdateCategory $createUpdateCategory Values to create/update a category (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUpdateCategory'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\CreateCategoryModel
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CreateCategoryModel|\Brevo\Client\Models\ErrorModel
*/
- public function createUpdateCategory($createUpdateCategory)
+ public function createUpdateCategory(
+ \Brevo\Client\Models\CreateUpdateCategory $createUpdateCategory,
+ string $contentType = self::contentTypes['createUpdateCategory'][0]
+ ): \Brevo\Client\Models\CreateCategoryModel
{
- list($response) = $this->createUpdateCategoryWithHttpInfo($createUpdateCategory);
+ list($response) = $this->createUpdateCategoryWithHttpInfo($createUpdateCategory, $contentType);
return $response;
}
@@ -1163,16 +1551,19 @@ public function createUpdateCategory($createUpdateCategory)
*
* Create/Update a category
*
- * @param \Brevo\Client\Model\CreateUpdateCategory $createUpdateCategory Values to create/update a category (required)
+ * @param \Brevo\Client\Models\CreateUpdateCategory $createUpdateCategory Values to create/update a category (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUpdateCategory'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\CreateCategoryModel, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CreateCategoryModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function createUpdateCategoryWithHttpInfo($createUpdateCategory)
+ public function createUpdateCategoryWithHttpInfo(
+ \Brevo\Client\Models\CreateUpdateCategory $createUpdateCategory,
+ string $contentType = self::contentTypes['createUpdateCategory'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\CreateCategoryModel';
- $request = $this->createUpdateCategoryRequest($createUpdateCategory);
+ $request = $this->createUpdateCategoryRequest($createUpdateCategory, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1181,34 +1572,111 @@ public function createUpdateCategoryWithHttpInfo($createUpdateCategory)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 201:
+ if (in_array('\Brevo\Client\Models\CreateCategoryModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CreateCategoryModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CreateCategoryModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CreateCategoryModel';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1223,7 +1691,7 @@ public function createUpdateCategoryWithHttpInfo($createUpdateCategory)
case 201:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\CreateCategoryModel',
+ '\Brevo\Client\Models\CreateCategoryModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1231,7 +1699,7 @@ public function createUpdateCategoryWithHttpInfo($createUpdateCategory)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1246,14 +1714,18 @@ public function createUpdateCategoryWithHttpInfo($createUpdateCategory)
*
* Create/Update a category
*
- * @param \Brevo\Client\Model\CreateUpdateCategory $createUpdateCategory Values to create/update a category (required)
+ * @param \Brevo\Client\Models\CreateUpdateCategory $createUpdateCategory Values to create/update a category (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUpdateCategory'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createUpdateCategoryAsync($createUpdateCategory)
+ public function createUpdateCategoryAsync(
+ \Brevo\Client\Models\CreateUpdateCategory $createUpdateCategory,
+ string $contentType = self::contentTypes['createUpdateCategory'][0]
+ ): PromiseInterface
{
- return $this->createUpdateCategoryAsyncWithHttpInfo($createUpdateCategory)
+ return $this->createUpdateCategoryAsyncWithHttpInfo($createUpdateCategory, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1266,25 +1738,29 @@ function ($response) {
*
* Create/Update a category
*
- * @param \Brevo\Client\Model\CreateUpdateCategory $createUpdateCategory Values to create/update a category (required)
+ * @param \Brevo\Client\Models\CreateUpdateCategory $createUpdateCategory Values to create/update a category (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUpdateCategory'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createUpdateCategoryAsyncWithHttpInfo($createUpdateCategory)
+ public function createUpdateCategoryAsyncWithHttpInfo(
+ $createUpdateCategory,
+ string $contentType = self::contentTypes['createUpdateCategory'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\CreateCategoryModel';
- $request = $this->createUpdateCategoryRequest($createUpdateCategory);
+ $returnType = '\Brevo\Client\Models\CreateCategoryModel';
+ $request = $this->createUpdateCategoryRequest($createUpdateCategory, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1307,7 +1783,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1316,20 +1792,26 @@ function ($exception) {
/**
* Create request for operation 'createUpdateCategory'
*
- * @param \Brevo\Client\Model\CreateUpdateCategory $createUpdateCategory Values to create/update a category (required)
+ * @param \Brevo\Client\Models\CreateUpdateCategory $createUpdateCategory Values to create/update a category (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUpdateCategory'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function createUpdateCategoryRequest($createUpdateCategory)
+ public function createUpdateCategoryRequest(
+ $createUpdateCategory,
+ string $contentType = self::contentTypes['createUpdateCategory'][0]
+ ): Request
{
+
// verify the required parameter 'createUpdateCategory' is set
if ($createUpdateCategory === null || (is_array($createUpdateCategory) && count($createUpdateCategory) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $createUpdateCategory when calling createUpdateCategory'
);
}
+
$resourcePath = '/categories';
$formParams = [];
$queryParams = [];
@@ -1339,56 +1821,43 @@ protected function createUpdateCategoryRequest($createUpdateCategory)
- // body params
- $_tempBody = null;
- if (isset($createUpdateCategory)) {
- $_tempBody = $createUpdateCategory;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($createUpdateCategory)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createUpdateCategory));
+ } else {
+ $httpBody = $createUpdateCategory;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1414,10 +1883,11 @@ protected function createUpdateCategoryRequest($createUpdateCategory)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1428,15 +1898,19 @@ protected function createUpdateCategoryRequest($createUpdateCategory)
*
* Create/Update a product
*
- * @param \Brevo\Client\Model\CreateUpdateProduct $createUpdateProduct Values to create/update a product (required)
+ * @param \Brevo\Client\Models\CreateUpdateProduct $createUpdateProduct Values to create/update a product (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUpdateProduct'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\CreateProductModel
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CreateProductModel|\Brevo\Client\Models\ErrorModel
*/
- public function createUpdateProduct($createUpdateProduct)
+ public function createUpdateProduct(
+ \Brevo\Client\Models\CreateUpdateProduct $createUpdateProduct,
+ string $contentType = self::contentTypes['createUpdateProduct'][0]
+ ): \Brevo\Client\Models\CreateProductModel
{
- list($response) = $this->createUpdateProductWithHttpInfo($createUpdateProduct);
+ list($response) = $this->createUpdateProductWithHttpInfo($createUpdateProduct, $contentType);
return $response;
}
@@ -1445,16 +1919,19 @@ public function createUpdateProduct($createUpdateProduct)
*
* Create/Update a product
*
- * @param \Brevo\Client\Model\CreateUpdateProduct $createUpdateProduct Values to create/update a product (required)
+ * @param \Brevo\Client\Models\CreateUpdateProduct $createUpdateProduct Values to create/update a product (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUpdateProduct'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\CreateProductModel, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CreateProductModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function createUpdateProductWithHttpInfo($createUpdateProduct)
+ public function createUpdateProductWithHttpInfo(
+ \Brevo\Client\Models\CreateUpdateProduct $createUpdateProduct,
+ string $contentType = self::contentTypes['createUpdateProduct'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\CreateProductModel';
- $request = $this->createUpdateProductRequest($createUpdateProduct);
+ $request = $this->createUpdateProductRequest($createUpdateProduct, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1463,34 +1940,111 @@ public function createUpdateProductWithHttpInfo($createUpdateProduct)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
+
+ switch($statusCode) {
+ case 201:
+ if (in_array('\Brevo\Client\Models\CreateProductModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CreateProductModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CreateProductModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $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(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CreateProductModel';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1505,7 +2059,7 @@ public function createUpdateProductWithHttpInfo($createUpdateProduct)
case 201:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\CreateProductModel',
+ '\Brevo\Client\Models\CreateProductModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1513,7 +2067,7 @@ public function createUpdateProductWithHttpInfo($createUpdateProduct)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1528,14 +2082,18 @@ public function createUpdateProductWithHttpInfo($createUpdateProduct)
*
* Create/Update a product
*
- * @param \Brevo\Client\Model\CreateUpdateProduct $createUpdateProduct Values to create/update a product (required)
+ * @param \Brevo\Client\Models\CreateUpdateProduct $createUpdateProduct Values to create/update a product (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUpdateProduct'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createUpdateProductAsync($createUpdateProduct)
+ public function createUpdateProductAsync(
+ \Brevo\Client\Models\CreateUpdateProduct $createUpdateProduct,
+ string $contentType = self::contentTypes['createUpdateProduct'][0]
+ ): PromiseInterface
{
- return $this->createUpdateProductAsyncWithHttpInfo($createUpdateProduct)
+ return $this->createUpdateProductAsyncWithHttpInfo($createUpdateProduct, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1548,25 +2106,29 @@ function ($response) {
*
* Create/Update a product
*
- * @param \Brevo\Client\Model\CreateUpdateProduct $createUpdateProduct Values to create/update a product (required)
+ * @param \Brevo\Client\Models\CreateUpdateProduct $createUpdateProduct Values to create/update a product (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUpdateProduct'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createUpdateProductAsyncWithHttpInfo($createUpdateProduct)
+ public function createUpdateProductAsyncWithHttpInfo(
+ $createUpdateProduct,
+ string $contentType = self::contentTypes['createUpdateProduct'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\CreateProductModel';
- $request = $this->createUpdateProductRequest($createUpdateProduct);
+ $returnType = '\Brevo\Client\Models\CreateProductModel';
+ $request = $this->createUpdateProductRequest($createUpdateProduct, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1589,7 +2151,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1598,20 +2160,26 @@ function ($exception) {
/**
* Create request for operation 'createUpdateProduct'
*
- * @param \Brevo\Client\Model\CreateUpdateProduct $createUpdateProduct Values to create/update a product (required)
+ * @param \Brevo\Client\Models\CreateUpdateProduct $createUpdateProduct Values to create/update a product (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUpdateProduct'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function createUpdateProductRequest($createUpdateProduct)
+ public function createUpdateProductRequest(
+ $createUpdateProduct,
+ string $contentType = self::contentTypes['createUpdateProduct'][0]
+ ): Request
{
+
// verify the required parameter 'createUpdateProduct' is set
if ($createUpdateProduct === null || (is_array($createUpdateProduct) && count($createUpdateProduct) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $createUpdateProduct when calling createUpdateProduct'
);
}
+
$resourcePath = '/products';
$formParams = [];
$queryParams = [];
@@ -1621,56 +2189,43 @@ protected function createUpdateProductRequest($createUpdateProduct)
- // body params
- $_tempBody = null;
- if (isset($createUpdateProduct)) {
- $_tempBody = $createUpdateProduct;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($createUpdateProduct)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createUpdateProduct));
+ } else {
+ $httpBody = $createUpdateProduct;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1696,10 +2251,11 @@ protected function createUpdateProductRequest($createUpdateProduct)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1710,14 +2266,17 @@ protected function createUpdateProductRequest($createUpdateProduct)
*
* Activate the eCommerce app
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ecommerceActivatePost'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function ecommerceActivatePost()
+ public function ecommerceActivatePost(
+ string $contentType = self::contentTypes['ecommerceActivatePost'][0]
+ ): void
{
- $this->ecommerceActivatePostWithHttpInfo();
+ $this->ecommerceActivatePostWithHttpInfo($contentType);
}
/**
@@ -1725,15 +2284,17 @@ public function ecommerceActivatePost()
*
* Activate the eCommerce app
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ecommerceActivatePost'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function ecommerceActivatePostWithHttpInfo()
+ public function ecommerceActivatePostWithHttpInfo(
+ string $contentType = self::contentTypes['ecommerceActivatePost'][0]
+ ): array
{
- $returnType = '';
- $request = $this->ecommerceActivatePostRequest();
+ $request = $this->ecommerceActivatePostRequest($contentType);
try {
$options = $this->createHttpClientOption();
@@ -1742,26 +2303,21 @@ public function ecommerceActivatePostWithHttpInfo()
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -1770,7 +2326,7 @@ public function ecommerceActivatePostWithHttpInfo()
case 401:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1778,7 +2334,7 @@ public function ecommerceActivatePostWithHttpInfo()
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1793,13 +2349,16 @@ public function ecommerceActivatePostWithHttpInfo()
*
* Activate the eCommerce app
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ecommerceActivatePost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function ecommerceActivatePostAsync()
+ public function ecommerceActivatePostAsync(
+ string $contentType = self::contentTypes['ecommerceActivatePost'][0]
+ ): PromiseInterface
{
- return $this->ecommerceActivatePostAsyncWithHttpInfo()
+ return $this->ecommerceActivatePostAsyncWithHttpInfo($contentType)
->then(
function ($response) {
return $response[0];
@@ -1812,14 +2371,18 @@ function ($response) {
*
* Activate the eCommerce app
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ecommerceActivatePost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function ecommerceActivatePostAsyncWithHttpInfo()
+ public function ecommerceActivatePostAsyncWithHttpInfo(
+ string $contentType = self::contentTypes['ecommerceActivatePost'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->ecommerceActivatePostRequest();
+ $request = $this->ecommerceActivatePostRequest($contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -1838,7 +2401,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1847,13 +2410,17 @@ function ($exception) {
/**
* Create request for operation 'ecommerceActivatePost'
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ecommerceActivatePost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function ecommerceActivatePostRequest()
+ public function ecommerceActivatePostRequest(
+ string $contentType = self::contentTypes['ecommerceActivatePost'][0]
+ ): Request
{
+
$resourcePath = '/ecommerce/activate';
$formParams = [];
$queryParams = [];
@@ -1863,53 +2430,36 @@ protected function ecommerceActivatePostRequest()
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1935,59 +2485,59 @@ protected function ecommerceActivatePostRequest()
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
}
/**
- * Operation getCategories
+ * Operation ecommerceAttributionMetricsConversionSourceConversionSourceIdGet
*
- * Return all your categories
+ * Get detailed attribution metrics for a single Brevo campaign
*
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param string[] $ids Filter by category ids (optional)
- * @param string $name Filter by category name (optional)
- * @param string $modifiedSince Filter (urlencoded) the categories modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
- * @param string $createdSince Filter (urlencoded) the categories created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string $conversionSource The Brevo campaign type for which data will be retrieved (required)
+ * @param float $conversionSourceId The Brevo campaign id for which data will be retrieved (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ecommerceAttributionMetricsConversionSourceConversionSourceIdGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetCategories
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response|\Brevo\Client\Models\ErrorModel
*/
- public function getCategories($limit = '50', $offset = '0', $sort = 'desc', $ids = null, $name = null, $modifiedSince = null, $createdSince = null)
+ public function ecommerceAttributionMetricsConversionSourceConversionSourceIdGet(
+ string $conversionSource,
+ float $conversionSourceId,
+ string $contentType = self::contentTypes['ecommerceAttributionMetricsConversionSourceConversionSourceIdGet'][0]
+ ): \Brevo\Client\Models\EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response
{
- list($response) = $this->getCategoriesWithHttpInfo($limit, $offset, $sort, $ids, $name, $modifiedSince, $createdSince);
+ list($response) = $this->ecommerceAttributionMetricsConversionSourceConversionSourceIdGetWithHttpInfo($conversionSource, $conversionSourceId, $contentType);
return $response;
}
/**
- * Operation getCategoriesWithHttpInfo
+ * Operation ecommerceAttributionMetricsConversionSourceConversionSourceIdGetWithHttpInfo
*
- * Return all your categories
+ * Get detailed attribution metrics for a single Brevo campaign
*
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param string[] $ids Filter by category ids (optional)
- * @param string $name Filter by category name (optional)
- * @param string $modifiedSince Filter (urlencoded) the categories modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
- * @param string $createdSince Filter (urlencoded) the categories created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string $conversionSource The Brevo campaign type for which data will be retrieved (required)
+ * @param float $conversionSourceId The Brevo campaign id for which data will be retrieved (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ecommerceAttributionMetricsConversionSourceConversionSourceIdGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetCategories, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getCategoriesWithHttpInfo($limit = '50', $offset = '0', $sort = 'desc', $ids = null, $name = null, $modifiedSince = null, $createdSince = null)
+ public function ecommerceAttributionMetricsConversionSourceConversionSourceIdGetWithHttpInfo(
+ string $conversionSource,
+ float $conversionSourceId,
+ string $contentType = self::contentTypes['ecommerceAttributionMetricsConversionSourceConversionSourceIdGet'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetCategories';
- $request = $this->getCategoriesRequest($limit, $offset, $sort, $ids, $name, $modifiedSince, $createdSince);
+ $request = $this->ecommerceAttributionMetricsConversionSourceConversionSourceIdGetRequest($conversionSource, $conversionSourceId, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1996,34 +2546,111 @@ public function getCategoriesWithHttpInfo($limit = '50', $offset = '0', $sort =
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -2038,7 +2665,7 @@ public function getCategoriesWithHttpInfo($limit = '50', $offset = '0', $sort =
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetCategories',
+ '\Brevo\Client\Models\EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2046,7 +2673,7 @@ public function getCategoriesWithHttpInfo($limit = '50', $offset = '0', $sort =
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2057,24 +2684,24 @@ public function getCategoriesWithHttpInfo($limit = '50', $offset = '0', $sort =
}
/**
- * Operation getCategoriesAsync
+ * Operation ecommerceAttributionMetricsConversionSourceConversionSourceIdGetAsync
*
- * Return all your categories
+ * Get detailed attribution metrics for a single Brevo campaign
*
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param string[] $ids Filter by category ids (optional)
- * @param string $name Filter by category name (optional)
- * @param string $modifiedSince Filter (urlencoded) the categories modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
- * @param string $createdSince Filter (urlencoded) the categories created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string $conversionSource The Brevo campaign type for which data will be retrieved (required)
+ * @param float $conversionSourceId The Brevo campaign id for which data will be retrieved (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ecommerceAttributionMetricsConversionSourceConversionSourceIdGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getCategoriesAsync($limit = '50', $offset = '0', $sort = 'desc', $ids = null, $name = null, $modifiedSince = null, $createdSince = null)
+ public function ecommerceAttributionMetricsConversionSourceConversionSourceIdGetAsync(
+ string $conversionSource,
+ float $conversionSourceId,
+ string $contentType = self::contentTypes['ecommerceAttributionMetricsConversionSourceConversionSourceIdGet'][0]
+ ): PromiseInterface
{
- return $this->getCategoriesAsyncWithHttpInfo($limit, $offset, $sort, $ids, $name, $modifiedSince, $createdSince)
+ return $this->ecommerceAttributionMetricsConversionSourceConversionSourceIdGetAsyncWithHttpInfo($conversionSource, $conversionSourceId, $contentType)
->then(
function ($response) {
return $response[0];
@@ -2083,35 +2710,35 @@ function ($response) {
}
/**
- * Operation getCategoriesAsyncWithHttpInfo
+ * Operation ecommerceAttributionMetricsConversionSourceConversionSourceIdGetAsyncWithHttpInfo
*
- * Return all your categories
+ * Get detailed attribution metrics for a single Brevo campaign
*
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param string[] $ids Filter by category ids (optional)
- * @param string $name Filter by category name (optional)
- * @param string $modifiedSince Filter (urlencoded) the categories modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
- * @param string $createdSince Filter (urlencoded) the categories created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string $conversionSource The Brevo campaign type for which data will be retrieved (required)
+ * @param float $conversionSourceId The Brevo campaign id for which data will be retrieved (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ecommerceAttributionMetricsConversionSourceConversionSourceIdGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getCategoriesAsyncWithHttpInfo($limit = '50', $offset = '0', $sort = 'desc', $ids = null, $name = null, $modifiedSince = null, $createdSince = null)
+ public function ecommerceAttributionMetricsConversionSourceConversionSourceIdGetAsyncWithHttpInfo(
+ $conversionSource,
+ $conversionSourceId,
+ string $contentType = self::contentTypes['ecommerceAttributionMetricsConversionSourceConversionSourceIdGet'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetCategories';
- $request = $this->getCategoriesRequest($limit, $offset, $sort, $ids, $name, $modifiedSince, $createdSince);
+ $returnType = '\Brevo\Client\Models\EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response';
+ $request = $this->ecommerceAttributionMetricsConversionSourceConversionSourceIdGetRequest($conversionSource, $conversionSourceId, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -2134,120 +2761,99 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
}
/**
- * Create request for operation 'getCategories'
+ * Create request for operation 'ecommerceAttributionMetricsConversionSourceConversionSourceIdGet'
*
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param string[] $ids Filter by category ids (optional)
- * @param string $name Filter by category name (optional)
- * @param string $modifiedSince Filter (urlencoded) the categories modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
- * @param string $createdSince Filter (urlencoded) the categories created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string $conversionSource The Brevo campaign type for which data will be retrieved (required)
+ * @param float $conversionSourceId The Brevo campaign id for which data will be retrieved (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ecommerceAttributionMetricsConversionSourceConversionSourceIdGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getCategoriesRequest($limit = '50', $offset = '0', $sort = 'desc', $ids = null, $name = null, $modifiedSince = null, $createdSince = null)
+ public function ecommerceAttributionMetricsConversionSourceConversionSourceIdGetRequest(
+ $conversionSource,
+ $conversionSourceId,
+ string $contentType = self::contentTypes['ecommerceAttributionMetricsConversionSourceConversionSourceIdGet'][0]
+ ): Request
{
- if ($limit !== null && $limit > 100) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling EcommerceApi.getCategories, must be smaller than or equal to 100.');
+
+ // verify the required parameter 'conversionSource' is set
+ if ($conversionSource === null || (is_array($conversionSource) && count($conversionSource) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $conversionSource when calling ecommerceAttributionMetricsConversionSourceConversionSourceIdGet'
+ );
+ }
+
+ // verify the required parameter 'conversionSourceId' is set
+ if ($conversionSourceId === null || (is_array($conversionSourceId) && count($conversionSourceId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $conversionSourceId when calling ecommerceAttributionMetricsConversionSourceConversionSourceIdGet'
+ );
}
- $resourcePath = '/categories';
+ $resourcePath = '/ecommerce/attribution/metrics/{conversionSource}/{conversionSourceId}';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
- // query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
- // query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
- // query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
- // query params
- if (is_array($ids)) {
- $queryParams['ids'] = $ids;
- } else
- if ($ids !== null) {
- $queryParams['ids'] = ObjectSerializer::toQueryValue($ids);
- }
- // query params
- if ($name !== null) {
- $queryParams['name'] = ObjectSerializer::toQueryValue($name);
- }
- // query params
- if ($modifiedSince !== null) {
- $queryParams['modifiedSince'] = ObjectSerializer::toQueryValue($modifiedSince);
- }
- // query params
- if ($createdSince !== null) {
- $queryParams['createdSince'] = ObjectSerializer::toQueryValue($createdSince);
- }
-
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
+ // path params
+ if ($conversionSource !== null) {
+ $resourcePath = str_replace(
+ '{' . 'conversionSource' . '}',
+ ObjectSerializer::toPathValue($conversionSource),
+ $resourcePath
);
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
+ }
+ // path params
+ if ($conversionSourceId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'conversionSourceId' . '}',
+ ObjectSerializer::toPathValue($conversionSourceId),
+ $resourcePath
);
}
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -2273,47 +2879,63 @@ protected function getCategoriesRequest($limit = '50', $offset = '0', $sort = 'd
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
}
/**
- * Operation getCategoryInfo
+ * Operation ecommerceAttributionMetricsGet
*
- * Get a category details
+ * Get attribution metrics for one or more Brevo campaigns
*
- * @param string $id Category ID (required)
+ * @param \DateTime|null $periodFrom When getting metrics for a specific period, define the starting datetime in RFC3339 format (optional)
+ * @param \DateTime|null $periodTo When getting metrics for a specific period, define the end datetime in RFC3339 format (optional)
+ * @param float[]|null $emailCampaignId The email campaign id(s) to get metrics for (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ecommerceAttributionMetricsGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetCategoryDetails
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\EcommerceAttributionMetricsGet200Response|\Brevo\Client\Models\ErrorModel
*/
- public function getCategoryInfo($id)
+ public function ecommerceAttributionMetricsGet(
+ ?\DateTime $periodFrom = null,
+ ?\DateTime $periodTo = null,
+ ?array $emailCampaignId = null,
+ string $contentType = self::contentTypes['ecommerceAttributionMetricsGet'][0]
+ ): \Brevo\Client\Models\EcommerceAttributionMetricsGet200Response
{
- list($response) = $this->getCategoryInfoWithHttpInfo($id);
+ list($response) = $this->ecommerceAttributionMetricsGetWithHttpInfo($periodFrom, $periodTo, $emailCampaignId, $contentType);
return $response;
}
/**
- * Operation getCategoryInfoWithHttpInfo
+ * Operation ecommerceAttributionMetricsGetWithHttpInfo
*
- * Get a category details
+ * Get attribution metrics for one or more Brevo campaigns
*
- * @param string $id Category ID (required)
+ * @param \DateTime|null $periodFrom When getting metrics for a specific period, define the starting datetime in RFC3339 format (optional)
+ * @param \DateTime|null $periodTo When getting metrics for a specific period, define the end datetime in RFC3339 format (optional)
+ * @param float[]|null $emailCampaignId The email campaign id(s) to get metrics for (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ecommerceAttributionMetricsGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetCategoryDetails, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\EcommerceAttributionMetricsGet200Response|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getCategoryInfoWithHttpInfo($id)
+ public function ecommerceAttributionMetricsGetWithHttpInfo(
+ ?\DateTime $periodFrom = null,
+ ?\DateTime $periodTo = null,
+ ?array $emailCampaignId = null,
+ string $contentType = self::contentTypes['ecommerceAttributionMetricsGet'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetCategoryDetails';
- $request = $this->getCategoryInfoRequest($id);
+ $request = $this->ecommerceAttributionMetricsGetRequest($periodFrom, $periodTo, $emailCampaignId, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -2322,34 +2944,111 @@ public function getCategoryInfoWithHttpInfo($id)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\EcommerceAttributionMetricsGet200Response', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\EcommerceAttributionMetricsGet200Response' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\EcommerceAttributionMetricsGet200Response', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\EcommerceAttributionMetricsGet200Response';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -2364,7 +3063,7 @@ public function getCategoryInfoWithHttpInfo($id)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetCategoryDetails',
+ '\Brevo\Client\Models\EcommerceAttributionMetricsGet200Response',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2372,15 +3071,7 @@ public function getCategoryInfoWithHttpInfo($id)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2391,18 +3082,26 @@ public function getCategoryInfoWithHttpInfo($id)
}
/**
- * Operation getCategoryInfoAsync
+ * Operation ecommerceAttributionMetricsGetAsync
*
- * Get a category details
+ * Get attribution metrics for one or more Brevo campaigns
*
- * @param string $id Category ID (required)
+ * @param \DateTime|null $periodFrom When getting metrics for a specific period, define the starting datetime in RFC3339 format (optional)
+ * @param \DateTime|null $periodTo When getting metrics for a specific period, define the end datetime in RFC3339 format (optional)
+ * @param float[]|null $emailCampaignId The email campaign id(s) to get metrics for (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ecommerceAttributionMetricsGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getCategoryInfoAsync($id)
+ public function ecommerceAttributionMetricsGetAsync(
+ ?\DateTime $periodFrom = null,
+ ?\DateTime $periodTo = null,
+ ?array $emailCampaignId = null,
+ string $contentType = self::contentTypes['ecommerceAttributionMetricsGet'][0]
+ ): PromiseInterface
{
- return $this->getCategoryInfoAsyncWithHttpInfo($id)
+ return $this->ecommerceAttributionMetricsGetAsyncWithHttpInfo($periodFrom, $periodTo, $emailCampaignId, $contentType)
->then(
function ($response) {
return $response[0];
@@ -2411,29 +3110,37 @@ function ($response) {
}
/**
- * Operation getCategoryInfoAsyncWithHttpInfo
+ * Operation ecommerceAttributionMetricsGetAsyncWithHttpInfo
*
- * Get a category details
+ * Get attribution metrics for one or more Brevo campaigns
*
- * @param string $id Category ID (required)
+ * @param \DateTime|null $periodFrom When getting metrics for a specific period, define the starting datetime in RFC3339 format (optional)
+ * @param \DateTime|null $periodTo When getting metrics for a specific period, define the end datetime in RFC3339 format (optional)
+ * @param float[]|null $emailCampaignId The email campaign id(s) to get metrics for (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ecommerceAttributionMetricsGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getCategoryInfoAsyncWithHttpInfo($id)
+ public function ecommerceAttributionMetricsGetAsyncWithHttpInfo(
+ $periodFrom = null,
+ $periodTo = null,
+ $emailCampaignId = null,
+ string $contentType = self::contentTypes['ecommerceAttributionMetricsGet'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetCategoryDetails';
- $request = $this->getCategoryInfoRequest($id);
+ $returnType = '\Brevo\Client\Models\EcommerceAttributionMetricsGet200Response';
+ $request = $this->ecommerceAttributionMetricsGetRequest($periodFrom, $periodTo, $emailCampaignId, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -2456,93 +3163,101 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
}
/**
- * Create request for operation 'getCategoryInfo'
+ * Create request for operation 'ecommerceAttributionMetricsGet'
*
- * @param string $id Category ID (required)
+ * @param \DateTime|null $periodFrom When getting metrics for a specific period, define the starting datetime in RFC3339 format (optional)
+ * @param \DateTime|null $periodTo When getting metrics for a specific period, define the end datetime in RFC3339 format (optional)
+ * @param float[]|null $emailCampaignId The email campaign id(s) to get metrics for (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ecommerceAttributionMetricsGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getCategoryInfoRequest($id)
+ public function ecommerceAttributionMetricsGetRequest(
+ $periodFrom = null,
+ $periodTo = null,
+ $emailCampaignId = null,
+ string $contentType = self::contentTypes['ecommerceAttributionMetricsGet'][0]
+ ): Request
{
- // 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 getCategoryInfo'
- );
- }
- $resourcePath = '/categories/{id}';
+
+
+
+
+ $resourcePath = '/ecommerce/attribution/metrics';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $periodFrom,
+ 'periodFrom', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $periodTo,
+ 'periodTo', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $emailCampaignId,
+ 'emailCampaignId[]', // param base name
+ 'array', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // path params
- if ($id !== null) {
- $resourcePath = str_replace(
- '{' . 'id' . '}',
- ObjectSerializer::toPathValue($id),
- $resourcePath
- );
- }
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -2568,55 +3283,59 @@ protected function getCategoryInfoRequest($id)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
}
/**
- * Operation getOrders
+ * Operation ecommerceAttributionProductsConversionSourceConversionSourceIdGet
*
- * Get order details
+ * Get attributed product sales for a single Brevo campaign
*
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param string $modifiedSince Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
- * @param string $createdSince Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string $conversionSource The Brevo campaign type for which data will be retrieved (required)
+ * @param float $conversionSourceId The Brevo campaign id for which data will be retrieved (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ecommerceAttributionProductsConversionSourceConversionSourceIdGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetOrders
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response|\Brevo\Client\Models\ErrorModel
*/
- public function getOrders($limit = '50', $offset = '0', $sort = 'desc', $modifiedSince = null, $createdSince = null)
+ public function ecommerceAttributionProductsConversionSourceConversionSourceIdGet(
+ string $conversionSource,
+ float $conversionSourceId,
+ string $contentType = self::contentTypes['ecommerceAttributionProductsConversionSourceConversionSourceIdGet'][0]
+ ): \Brevo\Client\Models\EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response
{
- list($response) = $this->getOrdersWithHttpInfo($limit, $offset, $sort, $modifiedSince, $createdSince);
+ list($response) = $this->ecommerceAttributionProductsConversionSourceConversionSourceIdGetWithHttpInfo($conversionSource, $conversionSourceId, $contentType);
return $response;
}
/**
- * Operation getOrdersWithHttpInfo
+ * Operation ecommerceAttributionProductsConversionSourceConversionSourceIdGetWithHttpInfo
*
- * Get order details
+ * Get attributed product sales for a single Brevo campaign
*
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param string $modifiedSince Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
- * @param string $createdSince Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string $conversionSource The Brevo campaign type for which data will be retrieved (required)
+ * @param float $conversionSourceId The Brevo campaign id for which data will be retrieved (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ecommerceAttributionProductsConversionSourceConversionSourceIdGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetOrders, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getOrdersWithHttpInfo($limit = '50', $offset = '0', $sort = 'desc', $modifiedSince = null, $createdSince = null)
+ public function ecommerceAttributionProductsConversionSourceConversionSourceIdGetWithHttpInfo(
+ string $conversionSource,
+ float $conversionSourceId,
+ string $contentType = self::contentTypes['ecommerceAttributionProductsConversionSourceConversionSourceIdGet'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetOrders';
- $request = $this->getOrdersRequest($limit, $offset, $sort, $modifiedSince, $createdSince);
+ $request = $this->ecommerceAttributionProductsConversionSourceConversionSourceIdGetRequest($conversionSource, $conversionSourceId, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -2625,35 +3344,112 @@ public function getOrdersWithHttpInfo($limit = '50', $offset = '0', $sort = 'des
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
- }
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
}
return [
@@ -2667,7 +3463,7 @@ public function getOrdersWithHttpInfo($limit = '50', $offset = '0', $sort = 'des
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetOrders',
+ '\Brevo\Client\Models\EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2675,7 +3471,7 @@ public function getOrdersWithHttpInfo($limit = '50', $offset = '0', $sort = 'des
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2686,22 +3482,24 @@ public function getOrdersWithHttpInfo($limit = '50', $offset = '0', $sort = 'des
}
/**
- * Operation getOrdersAsync
+ * Operation ecommerceAttributionProductsConversionSourceConversionSourceIdGetAsync
*
- * Get order details
+ * Get attributed product sales for a single Brevo campaign
*
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param string $modifiedSince Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
- * @param string $createdSince Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string $conversionSource The Brevo campaign type for which data will be retrieved (required)
+ * @param float $conversionSourceId The Brevo campaign id for which data will be retrieved (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ecommerceAttributionProductsConversionSourceConversionSourceIdGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getOrdersAsync($limit = '50', $offset = '0', $sort = 'desc', $modifiedSince = null, $createdSince = null)
+ public function ecommerceAttributionProductsConversionSourceConversionSourceIdGetAsync(
+ string $conversionSource,
+ float $conversionSourceId,
+ string $contentType = self::contentTypes['ecommerceAttributionProductsConversionSourceConversionSourceIdGet'][0]
+ ): PromiseInterface
{
- return $this->getOrdersAsyncWithHttpInfo($limit, $offset, $sort, $modifiedSince, $createdSince)
+ return $this->ecommerceAttributionProductsConversionSourceConversionSourceIdGetAsyncWithHttpInfo($conversionSource, $conversionSourceId, $contentType)
->then(
function ($response) {
return $response[0];
@@ -2710,33 +3508,35 @@ function ($response) {
}
/**
- * Operation getOrdersAsyncWithHttpInfo
+ * Operation ecommerceAttributionProductsConversionSourceConversionSourceIdGetAsyncWithHttpInfo
*
- * Get order details
+ * Get attributed product sales for a single Brevo campaign
*
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param string $modifiedSince Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
- * @param string $createdSince Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string $conversionSource The Brevo campaign type for which data will be retrieved (required)
+ * @param float $conversionSourceId The Brevo campaign id for which data will be retrieved (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ecommerceAttributionProductsConversionSourceConversionSourceIdGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getOrdersAsyncWithHttpInfo($limit = '50', $offset = '0', $sort = 'desc', $modifiedSince = null, $createdSince = null)
+ public function ecommerceAttributionProductsConversionSourceConversionSourceIdGetAsyncWithHttpInfo(
+ $conversionSource,
+ $conversionSourceId,
+ string $contentType = self::contentTypes['ecommerceAttributionProductsConversionSourceConversionSourceIdGet'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetOrders';
- $request = $this->getOrdersRequest($limit, $offset, $sort, $modifiedSince, $createdSince);
+ $returnType = '\Brevo\Client\Models\EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response';
+ $request = $this->ecommerceAttributionProductsConversionSourceConversionSourceIdGetRequest($conversionSource, $conversionSourceId, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -2759,107 +3559,99 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
}
/**
- * Create request for operation 'getOrders'
+ * Create request for operation 'ecommerceAttributionProductsConversionSourceConversionSourceIdGet'
*
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param string $modifiedSince Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
- * @param string $createdSince Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string $conversionSource The Brevo campaign type for which data will be retrieved (required)
+ * @param float $conversionSourceId The Brevo campaign id for which data will be retrieved (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ecommerceAttributionProductsConversionSourceConversionSourceIdGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getOrdersRequest($limit = '50', $offset = '0', $sort = 'desc', $modifiedSince = null, $createdSince = null)
+ public function ecommerceAttributionProductsConversionSourceConversionSourceIdGetRequest(
+ $conversionSource,
+ $conversionSourceId,
+ string $contentType = self::contentTypes['ecommerceAttributionProductsConversionSourceConversionSourceIdGet'][0]
+ ): Request
{
- if ($limit !== null && $limit > 100) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling EcommerceApi.getOrders, must be smaller than or equal to 100.');
+
+ // verify the required parameter 'conversionSource' is set
+ if ($conversionSource === null || (is_array($conversionSource) && count($conversionSource) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $conversionSource when calling ecommerceAttributionProductsConversionSourceConversionSourceIdGet'
+ );
+ }
+
+ // verify the required parameter 'conversionSourceId' is set
+ if ($conversionSourceId === null || (is_array($conversionSourceId) && count($conversionSourceId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $conversionSourceId when calling ecommerceAttributionProductsConversionSourceConversionSourceIdGet'
+ );
}
- $resourcePath = '/orders';
+ $resourcePath = '/ecommerce/attribution/products/{conversionSource}/{conversionSourceId}';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
- // query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
- // query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
- // query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
- // query params
- if ($modifiedSince !== null) {
- $queryParams['modifiedSince'] = ObjectSerializer::toQueryValue($modifiedSince);
- }
- // query params
- if ($createdSince !== null) {
- $queryParams['createdSince'] = ObjectSerializer::toQueryValue($createdSince);
- }
-
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
+ // path params
+ if ($conversionSource !== null) {
+ $resourcePath = str_replace(
+ '{' . 'conversionSource' . '}',
+ ObjectSerializer::toPathValue($conversionSource),
+ $resourcePath
);
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
+ }
+ // path params
+ if ($conversionSourceId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'conversionSourceId' . '}',
+ ObjectSerializer::toPathValue($conversionSourceId),
+ $resourcePath
);
}
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -2885,47 +3677,51 @@ protected function getOrdersRequest($limit = '50', $offset = '0', $sort = 'desc'
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
}
/**
- * Operation getProductInfo
+ * Operation ecommerceConfigDisplayCurrencyGet
*
- * Get a product's details
+ * Get the ISO 4217 compliant display currency code for your Brevo account
*
- * @param string $id Product ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ecommerceConfigDisplayCurrencyGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetProductDetails
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function getProductInfo($id)
+ public function ecommerceConfigDisplayCurrencyGet(
+ string $contentType = self::contentTypes['ecommerceConfigDisplayCurrencyGet'][0]
+ ): \Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response
{
- list($response) = $this->getProductInfoWithHttpInfo($id);
+ list($response) = $this->ecommerceConfigDisplayCurrencyGetWithHttpInfo($contentType);
return $response;
}
/**
- * Operation getProductInfoWithHttpInfo
+ * Operation ecommerceConfigDisplayCurrencyGetWithHttpInfo
*
- * Get a product's details
+ * Get the ISO 4217 compliant display currency code for your Brevo account
*
- * @param string $id Product ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ecommerceConfigDisplayCurrencyGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetProductDetails, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getProductInfoWithHttpInfo($id)
+ public function ecommerceConfigDisplayCurrencyGetWithHttpInfo(
+ string $contentType = self::contentTypes['ecommerceConfigDisplayCurrencyGet'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetProductDetails';
- $request = $this->getProductInfoRequest($id);
+ $request = $this->ecommerceConfigDisplayCurrencyGetRequest($contentType);
try {
$options = $this->createHttpClientOption();
@@ -2934,34 +3730,165 @@ public function getProductInfoWithHttpInfo($id)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -2976,7 +3903,7 @@ public function getProductInfoWithHttpInfo($id)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetProductDetails',
+ '\Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2984,15 +3911,23 @@ public function getProductInfoWithHttpInfo($id)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 404:
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -3003,18 +3938,20 @@ public function getProductInfoWithHttpInfo($id)
}
/**
- * Operation getProductInfoAsync
+ * Operation ecommerceConfigDisplayCurrencyGetAsync
*
- * Get a product's details
+ * Get the ISO 4217 compliant display currency code for your Brevo account
*
- * @param string $id Product ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ecommerceConfigDisplayCurrencyGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getProductInfoAsync($id)
+ public function ecommerceConfigDisplayCurrencyGetAsync(
+ string $contentType = self::contentTypes['ecommerceConfigDisplayCurrencyGet'][0]
+ ): PromiseInterface
{
- return $this->getProductInfoAsyncWithHttpInfo($id)
+ return $this->ecommerceConfigDisplayCurrencyGetAsyncWithHttpInfo($contentType)
->then(
function ($response) {
return $response[0];
@@ -3023,29 +3960,31 @@ function ($response) {
}
/**
- * Operation getProductInfoAsyncWithHttpInfo
+ * Operation ecommerceConfigDisplayCurrencyGetAsyncWithHttpInfo
*
- * Get a product's details
+ * Get the ISO 4217 compliant display currency code for your Brevo account
*
- * @param string $id Product ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ecommerceConfigDisplayCurrencyGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getProductInfoAsyncWithHttpInfo($id)
+ public function ecommerceConfigDisplayCurrencyGetAsyncWithHttpInfo(
+ string $contentType = self::contentTypes['ecommerceConfigDisplayCurrencyGet'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetProductDetails';
- $request = $this->getProductInfoRequest($id);
+ $returnType = '\Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response';
+ $request = $this->ecommerceConfigDisplayCurrencyGetRequest($contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -3068,30 +4007,27 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
}
/**
- * Create request for operation 'getProductInfo'
+ * Create request for operation 'ecommerceConfigDisplayCurrencyGet'
*
- * @param string $id Product ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ecommerceConfigDisplayCurrencyGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getProductInfoRequest($id)
+ public function ecommerceConfigDisplayCurrencyGetRequest(
+ string $contentType = self::contentTypes['ecommerceConfigDisplayCurrencyGet'][0]
+ ): Request
{
- // 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 getProductInfo'
- );
- }
- $resourcePath = '/products/{id}';
+
+ $resourcePath = '/ecommerce/config/displayCurrency';
$formParams = [];
$queryParams = [];
$headerParams = [];
@@ -3099,62 +4035,37 @@ protected function getProductInfoRequest($id)
$multipart = false;
- // path params
- if ($id !== null) {
- $resourcePath = str_replace(
- '{' . 'id' . '}',
- ObjectSerializer::toPathValue($id),
- $resourcePath
- );
- }
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -3180,73 +4091,79 @@ protected function getProductInfoRequest($id)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
}
/**
- * Operation getProducts
+ * Operation getCategories
*
- * Return all your products
+ * Return all your categories
*
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param string[] $ids Filter by product ids (optional)
- * @param string $name Filter by product name, minimum 3 characters should be present for search (optional)
- * @param float $priceLte Price filter for products less than and equals to particular amount (optional)
- * @param float $priceGte Price filter for products greater than and equals to particular amount (optional)
- * @param float $priceLt Price filter for products less than particular amount (optional)
- * @param float $priceGt Price filter for products greater than particular amount (optional)
- * @param float $priceEq Price filter for products equals to particular amount (optional)
- * @param float $priceNe Price filter for products not equals to particular amount (optional)
- * @param string[] $categories Filter by category ids (optional)
- * @param string $modifiedSince Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
- * @param string $createdSince Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetProducts
- */
- public function getProducts($limit = '50', $offset = '0', $sort = 'desc', $ids = null, $name = null, $priceLte = null, $priceGte = null, $priceLt = null, $priceGt = null, $priceEq = null, $priceNe = null, $categories = null, $modifiedSince = null, $createdSince = null)
- {
- list($response) = $this->getProductsWithHttpInfo($limit, $offset, $sort, $ids, $name, $priceLte, $priceGte, $priceLt, $priceGt, $priceEq, $priceNe, $categories, $modifiedSince, $createdSince);
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string[]|null $ids Filter by category ids (optional)
+ * @param string|null $name Filter by category name (optional)
+ * @param string|null $modifiedSince Filter (urlencoded) the categories modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string|null $createdSince Filter (urlencoded) the categories created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategories'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetCategories|\Brevo\Client\Models\ErrorModel
+ */
+ public function getCategories(
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ ?array $ids = null,
+ ?string $name = null,
+ ?string $modifiedSince = null,
+ ?string $createdSince = null,
+ string $contentType = self::contentTypes['getCategories'][0]
+ ): \Brevo\Client\Models\GetCategories
+ {
+ list($response) = $this->getCategoriesWithHttpInfo($limit, $offset, $sort, $ids, $name, $modifiedSince, $createdSince, $contentType);
return $response;
}
/**
- * Operation getProductsWithHttpInfo
+ * Operation getCategoriesWithHttpInfo
*
- * Return all your products
+ * Return all your categories
*
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param string[] $ids Filter by product ids (optional)
- * @param string $name Filter by product name, minimum 3 characters should be present for search (optional)
- * @param float $priceLte Price filter for products less than and equals to particular amount (optional)
- * @param float $priceGte Price filter for products greater than and equals to particular amount (optional)
- * @param float $priceLt Price filter for products less than particular amount (optional)
- * @param float $priceGt Price filter for products greater than particular amount (optional)
- * @param float $priceEq Price filter for products equals to particular amount (optional)
- * @param float $priceNe Price filter for products not equals to particular amount (optional)
- * @param string[] $categories Filter by category ids (optional)
- * @param string $modifiedSince Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
- * @param string $createdSince Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetProducts, HTTP status code, HTTP response headers (array of strings)
- */
- public function getProductsWithHttpInfo($limit = '50', $offset = '0', $sort = 'desc', $ids = null, $name = null, $priceLte = null, $priceGte = null, $priceLt = null, $priceGt = null, $priceEq = null, $priceNe = null, $categories = null, $modifiedSince = null, $createdSince = null)
- {
- $returnType = '\Brevo\Client\Model\GetProducts';
- $request = $this->getProductsRequest($limit, $offset, $sort, $ids, $name, $priceLte, $priceGte, $priceLt, $priceGt, $priceEq, $priceNe, $categories, $modifiedSince, $createdSince);
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string[]|null $ids Filter by category ids (optional)
+ * @param string|null $name Filter by category name (optional)
+ * @param string|null $modifiedSince Filter (urlencoded) the categories modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string|null $createdSince Filter (urlencoded) the categories created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategories'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetCategories|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function getCategoriesWithHttpInfo(
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ ?array $ids = null,
+ ?string $name = null,
+ ?string $modifiedSince = null,
+ ?string $createdSince = null,
+ string $contentType = self::contentTypes['getCategories'][0]
+ ): array
+ {
+ $request = $this->getCategoriesRequest($limit, $offset, $sort, $ids, $name, $modifiedSince, $createdSince, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -3255,34 +4172,111 @@ public function getProductsWithHttpInfo($limit = '50', $offset = '0', $sort = 'd
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetCategories', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetCategories' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetCategories', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetCategories';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -3297,7 +4291,7 @@ public function getProductsWithHttpInfo($limit = '50', $offset = '0', $sort = 'd
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetProducts',
+ '\Brevo\Client\Models\GetCategories',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -3305,7 +4299,7 @@ public function getProductsWithHttpInfo($limit = '50', $offset = '0', $sort = 'd
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -3316,31 +4310,34 @@ public function getProductsWithHttpInfo($limit = '50', $offset = '0', $sort = 'd
}
/**
- * Operation getProductsAsync
+ * Operation getCategoriesAsync
*
- * Return all your products
+ * Return all your categories
*
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param string[] $ids Filter by product ids (optional)
- * @param string $name Filter by product name, minimum 3 characters should be present for search (optional)
- * @param float $priceLte Price filter for products less than and equals to particular amount (optional)
- * @param float $priceGte Price filter for products greater than and equals to particular amount (optional)
- * @param float $priceLt Price filter for products less than particular amount (optional)
- * @param float $priceGt Price filter for products greater than particular amount (optional)
- * @param float $priceEq Price filter for products equals to particular amount (optional)
- * @param float $priceNe Price filter for products not equals to particular amount (optional)
- * @param string[] $categories Filter by category ids (optional)
- * @param string $modifiedSince Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
- * @param string $createdSince Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getProductsAsync($limit = '50', $offset = '0', $sort = 'desc', $ids = null, $name = null, $priceLte = null, $priceGte = null, $priceLt = null, $priceGt = null, $priceEq = null, $priceNe = null, $categories = null, $modifiedSince = null, $createdSince = null)
- {
- return $this->getProductsAsyncWithHttpInfo($limit, $offset, $sort, $ids, $name, $priceLte, $priceGte, $priceLt, $priceGt, $priceEq, $priceNe, $categories, $modifiedSince, $createdSince)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string[]|null $ids Filter by category ids (optional)
+ * @param string|null $name Filter by category name (optional)
+ * @param string|null $modifiedSince Filter (urlencoded) the categories modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string|null $createdSince Filter (urlencoded) the categories created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategories'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getCategoriesAsync(
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ ?array $ids = null,
+ ?string $name = null,
+ ?string $modifiedSince = null,
+ ?string $createdSince = null,
+ string $contentType = self::contentTypes['getCategories'][0]
+ ): PromiseInterface
+ {
+ return $this->getCategoriesAsyncWithHttpInfo($limit, $offset, $sort, $ids, $name, $modifiedSince, $createdSince, $contentType)
->then(
function ($response) {
return $response[0];
@@ -3349,42 +4346,45 @@ function ($response) {
}
/**
- * Operation getProductsAsyncWithHttpInfo
+ * Operation getCategoriesAsyncWithHttpInfo
*
- * Return all your products
+ * Return all your categories
*
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param string[] $ids Filter by product ids (optional)
- * @param string $name Filter by product name, minimum 3 characters should be present for search (optional)
- * @param float $priceLte Price filter for products less than and equals to particular amount (optional)
- * @param float $priceGte Price filter for products greater than and equals to particular amount (optional)
- * @param float $priceLt Price filter for products less than particular amount (optional)
- * @param float $priceGt Price filter for products greater than particular amount (optional)
- * @param float $priceEq Price filter for products equals to particular amount (optional)
- * @param float $priceNe Price filter for products not equals to particular amount (optional)
- * @param string[] $categories Filter by category ids (optional)
- * @param string $modifiedSince Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
- * @param string $createdSince Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getProductsAsyncWithHttpInfo($limit = '50', $offset = '0', $sort = 'desc', $ids = null, $name = null, $priceLte = null, $priceGte = null, $priceLt = null, $priceGt = null, $priceEq = null, $priceNe = null, $categories = null, $modifiedSince = null, $createdSince = null)
- {
- $returnType = '\Brevo\Client\Model\GetProducts';
- $request = $this->getProductsRequest($limit, $offset, $sort, $ids, $name, $priceLte, $priceGte, $priceLt, $priceGt, $priceEq, $priceNe, $categories, $modifiedSince, $createdSince);
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string[]|null $ids Filter by category ids (optional)
+ * @param string|null $name Filter by category name (optional)
+ * @param string|null $modifiedSince Filter (urlencoded) the categories modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string|null $createdSince Filter (urlencoded) the categories created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategories'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getCategoriesAsyncWithHttpInfo(
+ $limit = 50,
+ $offset = 0,
+ $sort = 'desc',
+ $ids = null,
+ $name = null,
+ $modifiedSince = null,
+ $createdSince = null,
+ string $contentType = self::contentTypes['getCategories'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\GetCategories';
+ $request = $this->getCategoriesRequest($limit, $offset, $sort, $ids, $name, $modifiedSince, $createdSince, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -3407,41 +4407,51 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
}
/**
- * Create request for operation 'getProducts'
+ * Create request for operation 'getCategories'
+ *
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string[]|null $ids Filter by category ids (optional)
+ * @param string|null $name Filter by category name (optional)
+ * @param string|null $modifiedSince Filter (urlencoded) the categories modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string|null $createdSince Filter (urlencoded) the categories created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategories'] to see the possible values for this operation
*
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param string[] $ids Filter by product ids (optional)
- * @param string $name Filter by product name, minimum 3 characters should be present for search (optional)
- * @param float $priceLte Price filter for products less than and equals to particular amount (optional)
- * @param float $priceGte Price filter for products greater than and equals to particular amount (optional)
- * @param float $priceLt Price filter for products less than particular amount (optional)
- * @param float $priceGt Price filter for products greater than particular amount (optional)
- * @param float $priceEq Price filter for products equals to particular amount (optional)
- * @param float $priceNe Price filter for products not equals to particular amount (optional)
- * @param string[] $categories Filter by category ids (optional)
- * @param string $modifiedSince Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
- * @param string $createdSince Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
- *
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getProductsRequest($limit = '50', $offset = '0', $sort = 'desc', $ids = null, $name = null, $priceLte = null, $priceGte = null, $priceLt = null, $priceGt = null, $priceEq = null, $priceNe = null, $categories = null, $modifiedSince = null, $createdSince = null)
+ public function getCategoriesRequest(
+ $limit = 50,
+ $offset = 0,
+ $sort = 'desc',
+ $ids = null,
+ $name = null,
+ $modifiedSince = null,
+ $createdSince = null,
+ string $contentType = self::contentTypes['getCategories'][0]
+ ): Request
{
- if ($limit !== null && $limit > 1000) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling EcommerceApi.getProducts, must be smaller than or equal to 1000.');
+
+ if ($limit !== null && $limit > 100) {
+ throw new InvalidArgumentException('invalid value for "$limit" when calling EcommerceApi.getCategories, must be smaller than or equal to 100.');
}
+
- $resourcePath = '/products';
+
+
+
+
+
+ $resourcePath = '/categories';
$formParams = [];
$queryParams = [];
$headerParams = [];
@@ -3449,116 +4459,100 @@ protected function getProductsRequest($limit = '50', $offset = '0', $sort = 'des
$multipart = false;
// query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
- // query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
- // query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
- // query params
- if (is_array($ids)) {
- $queryParams['ids'] = $ids;
- } else
- if ($ids !== null) {
- $queryParams['ids'] = ObjectSerializer::toQueryValue($ids);
- }
- // query params
- if ($name !== null) {
- $queryParams['name'] = ObjectSerializer::toQueryValue($name);
- }
- // query params
- if ($priceLte !== null) {
- $queryParams['price[lte]'] = ObjectSerializer::toQueryValue($priceLte);
- }
- // query params
- if ($priceGte !== null) {
- $queryParams['price[gte]'] = ObjectSerializer::toQueryValue($priceGte);
- }
- // query params
- if ($priceLt !== null) {
- $queryParams['price[lt]'] = ObjectSerializer::toQueryValue($priceLt);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($priceGt !== null) {
- $queryParams['price[gt]'] = ObjectSerializer::toQueryValue($priceGt);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($priceEq !== null) {
- $queryParams['price[eq]'] = ObjectSerializer::toQueryValue($priceEq);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($priceNe !== null) {
- $queryParams['price[ne]'] = ObjectSerializer::toQueryValue($priceNe);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $ids,
+ 'ids', // param base name
+ 'array', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if (is_array($categories)) {
- $queryParams['categories'] = $categories;
- } else
- if ($categories !== null) {
- $queryParams['categories'] = ObjectSerializer::toQueryValue($categories);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $name,
+ 'name', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($modifiedSince !== null) {
- $queryParams['modifiedSince'] = ObjectSerializer::toQueryValue($modifiedSince);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $modifiedSince,
+ 'modifiedSince', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($createdSince !== null) {
- $queryParams['createdSince'] = ObjectSerializer::toQueryValue($createdSince);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $createdSince,
+ 'createdSince', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -3584,10 +4578,2242 @@ protected function getProductsRequest($limit = '50', $offset = '0', $sort = 'des
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation getCategoryInfo
+ *
+ * Get a category details
+ *
+ * @param string $id Category ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryInfo'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetCategoryDetails|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
+ */
+ public function getCategoryInfo(
+ string $id,
+ string $contentType = self::contentTypes['getCategoryInfo'][0]
+ ): \Brevo\Client\Models\GetCategoryDetails
+ {
+ list($response) = $this->getCategoryInfoWithHttpInfo($id, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation getCategoryInfoWithHttpInfo
+ *
+ * Get a category details
+ *
+ * @param string $id Category ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryInfo'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetCategoryDetails|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function getCategoryInfoWithHttpInfo(
+ string $id,
+ string $contentType = self::contentTypes['getCategoryInfo'][0]
+ ): array
+ {
+ $request = $this->getCategoryInfoRequest($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 (in_array('\Brevo\Client\Models\GetCategoryDetails', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetCategoryDetails' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetCategoryDetails', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $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 = '\Brevo\Client\Models\GetCategoryDetails';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\GetCategoryDetails',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation getCategoryInfoAsync
+ *
+ * Get a category details
+ *
+ * @param string $id Category ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryInfo'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getCategoryInfoAsync(
+ string $id,
+ string $contentType = self::contentTypes['getCategoryInfo'][0]
+ ): PromiseInterface
+ {
+ return $this->getCategoryInfoAsyncWithHttpInfo($id, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation getCategoryInfoAsyncWithHttpInfo
+ *
+ * Get a category details
+ *
+ * @param string $id Category ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryInfo'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getCategoryInfoAsyncWithHttpInfo(
+ $id,
+ string $contentType = self::contentTypes['getCategoryInfo'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\GetCategoryDetails';
+ $request = $this->getCategoryInfoRequest($id, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'getCategoryInfo'
+ *
+ * @param string $id Category ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryInfo'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function getCategoryInfoRequest(
+ $id,
+ string $contentType = self::contentTypes['getCategoryInfo'][0]
+ ): Request
+ {
+
+ // 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 getCategoryInfo'
+ );
+ }
+
+
+ $resourcePath = '/categories/{id}';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'id' . '}',
+ ObjectSerializer::toPathValue($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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 getOrders
+ *
+ * Get order details
+ *
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string|null $modifiedSince Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string|null $createdSince Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return void
+ */
+ public function getOrders(
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ ?string $modifiedSince = null,
+ ?string $createdSince = null,
+ string $contentType = self::contentTypes['getOrders'][0]
+ ): void
+ {
+ $this->getOrdersWithHttpInfo($limit, $offset, $sort, $modifiedSince, $createdSince, $contentType);
+ }
+
+ /**
+ * Operation getOrdersWithHttpInfo
+ *
+ * Get order details
+ *
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string|null $modifiedSince Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string|null $createdSince Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function getOrdersWithHttpInfo(
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ ?string $modifiedSince = null,
+ ?string $createdSince = null,
+ string $contentType = self::contentTypes['getOrders'][0]
+ ): array
+ {
+ $request = $this->getOrdersRequest($limit, $offset, $sort, $modifiedSince, $createdSince, $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();
+
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation getOrdersAsync
+ *
+ * Get order details
+ *
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string|null $modifiedSince Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string|null $createdSince Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getOrdersAsync(
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ ?string $modifiedSince = null,
+ ?string $createdSince = null,
+ string $contentType = self::contentTypes['getOrders'][0]
+ ): PromiseInterface
+ {
+ return $this->getOrdersAsyncWithHttpInfo($limit, $offset, $sort, $modifiedSince, $createdSince, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation getOrdersAsyncWithHttpInfo
+ *
+ * Get order details
+ *
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string|null $modifiedSince Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string|null $createdSince Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getOrdersAsyncWithHttpInfo(
+ $limit = 50,
+ $offset = 0,
+ $sort = 'desc',
+ $modifiedSince = null,
+ $createdSince = null,
+ string $contentType = self::contentTypes['getOrders'][0]
+ ): PromiseInterface
+ {
+ $returnType = '';
+ $request = $this->getOrdersRequest($limit, $offset, $sort, $modifiedSince, $createdSince, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $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 'getOrders'
+ *
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string|null $modifiedSince Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string|null $createdSince Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function getOrdersRequest(
+ $limit = 50,
+ $offset = 0,
+ $sort = 'desc',
+ $modifiedSince = null,
+ $createdSince = null,
+ string $contentType = self::contentTypes['getOrders'][0]
+ ): Request
+ {
+
+ if ($limit !== null && $limit > 100) {
+ throw new InvalidArgumentException('invalid value for "$limit" when calling EcommerceApi.getOrders, must be smaller than or equal to 100.');
+ }
+
+
+
+
+
+
+ $resourcePath = '/orders';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // 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(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $modifiedSince,
+ 'modifiedSince', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $createdSince,
+ 'createdSince', // 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 getProductInfo
+ *
+ * Get a product's details
+ *
+ * @param string $id Product ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProductInfo'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetProductDetails|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
+ */
+ public function getProductInfo(
+ string $id,
+ string $contentType = self::contentTypes['getProductInfo'][0]
+ ): \Brevo\Client\Models\GetProductDetails
+ {
+ list($response) = $this->getProductInfoWithHttpInfo($id, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation getProductInfoWithHttpInfo
+ *
+ * Get a product's details
+ *
+ * @param string $id Product ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProductInfo'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetProductDetails|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function getProductInfoWithHttpInfo(
+ string $id,
+ string $contentType = self::contentTypes['getProductInfo'][0]
+ ): array
+ {
+ $request = $this->getProductInfoRequest($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 (in_array('\Brevo\Client\Models\GetProductDetails', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetProductDetails' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetProductDetails', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $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 = '\Brevo\Client\Models\GetProductDetails';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\GetProductDetails',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation getProductInfoAsync
+ *
+ * Get a product's details
+ *
+ * @param string $id Product ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProductInfo'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getProductInfoAsync(
+ string $id,
+ string $contentType = self::contentTypes['getProductInfo'][0]
+ ): PromiseInterface
+ {
+ return $this->getProductInfoAsyncWithHttpInfo($id, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation getProductInfoAsyncWithHttpInfo
+ *
+ * Get a product's details
+ *
+ * @param string $id Product ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProductInfo'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getProductInfoAsyncWithHttpInfo(
+ $id,
+ string $contentType = self::contentTypes['getProductInfo'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\GetProductDetails';
+ $request = $this->getProductInfoRequest($id, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'getProductInfo'
+ *
+ * @param string $id Product ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProductInfo'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function getProductInfoRequest(
+ $id,
+ string $contentType = self::contentTypes['getProductInfo'][0]
+ ): Request
+ {
+
+ // 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 getProductInfo'
+ );
+ }
+
+
+ $resourcePath = '/products/{id}';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'id' . '}',
+ ObjectSerializer::toPathValue($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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 getProducts
+ *
+ * Return all your products
+ *
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string[]|null $ids Filter by product ids (optional)
+ * @param string|null $name Filter by product name, minimum 3 characters should be present for search (optional)
+ * @param float|null $priceLte Price filter for products less than and equals to particular amount (optional)
+ * @param float|null $priceGte Price filter for products greater than and equals to particular amount (optional)
+ * @param float|null $priceLt Price filter for products less than particular amount (optional)
+ * @param float|null $priceGt Price filter for products greater than particular amount (optional)
+ * @param float|null $priceEq Price filter for products equals to particular amount (optional)
+ * @param float|null $priceNe Price filter for products not equals to particular amount (optional)
+ * @param string[]|null $categories Filter by product categories (optional)
+ * @param string|null $modifiedSince Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string|null $createdSince Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProducts'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetProducts|\Brevo\Client\Models\ErrorModel
+ */
+ public function getProducts(
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ ?array $ids = null,
+ ?string $name = null,
+ ?float $priceLte = null,
+ ?float $priceGte = null,
+ ?float $priceLt = null,
+ ?float $priceGt = null,
+ ?float $priceEq = null,
+ ?float $priceNe = null,
+ ?array $categories = null,
+ ?string $modifiedSince = null,
+ ?string $createdSince = null,
+ string $contentType = self::contentTypes['getProducts'][0]
+ ): \Brevo\Client\Models\GetProducts
+ {
+ list($response) = $this->getProductsWithHttpInfo($limit, $offset, $sort, $ids, $name, $priceLte, $priceGte, $priceLt, $priceGt, $priceEq, $priceNe, $categories, $modifiedSince, $createdSince, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation getProductsWithHttpInfo
+ *
+ * Return all your products
+ *
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string[]|null $ids Filter by product ids (optional)
+ * @param string|null $name Filter by product name, minimum 3 characters should be present for search (optional)
+ * @param float|null $priceLte Price filter for products less than and equals to particular amount (optional)
+ * @param float|null $priceGte Price filter for products greater than and equals to particular amount (optional)
+ * @param float|null $priceLt Price filter for products less than particular amount (optional)
+ * @param float|null $priceGt Price filter for products greater than particular amount (optional)
+ * @param float|null $priceEq Price filter for products equals to particular amount (optional)
+ * @param float|null $priceNe Price filter for products not equals to particular amount (optional)
+ * @param string[]|null $categories Filter by product categories (optional)
+ * @param string|null $modifiedSince Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string|null $createdSince Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProducts'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetProducts|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function getProductsWithHttpInfo(
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ ?array $ids = null,
+ ?string $name = null,
+ ?float $priceLte = null,
+ ?float $priceGte = null,
+ ?float $priceLt = null,
+ ?float $priceGt = null,
+ ?float $priceEq = null,
+ ?float $priceNe = null,
+ ?array $categories = null,
+ ?string $modifiedSince = null,
+ ?string $createdSince = null,
+ string $contentType = self::contentTypes['getProducts'][0]
+ ): array
+ {
+ $request = $this->getProductsRequest($limit, $offset, $sort, $ids, $name, $priceLte, $priceGte, $priceLt, $priceGt, $priceEq, $priceNe, $categories, $modifiedSince, $createdSince, $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 (in_array('\Brevo\Client\Models\GetProducts', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetProducts' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetProducts', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $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 = '\Brevo\Client\Models\GetProducts';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\GetProducts',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation getProductsAsync
+ *
+ * Return all your products
+ *
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string[]|null $ids Filter by product ids (optional)
+ * @param string|null $name Filter by product name, minimum 3 characters should be present for search (optional)
+ * @param float|null $priceLte Price filter for products less than and equals to particular amount (optional)
+ * @param float|null $priceGte Price filter for products greater than and equals to particular amount (optional)
+ * @param float|null $priceLt Price filter for products less than particular amount (optional)
+ * @param float|null $priceGt Price filter for products greater than particular amount (optional)
+ * @param float|null $priceEq Price filter for products equals to particular amount (optional)
+ * @param float|null $priceNe Price filter for products not equals to particular amount (optional)
+ * @param string[]|null $categories Filter by product categories (optional)
+ * @param string|null $modifiedSince Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string|null $createdSince Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProducts'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getProductsAsync(
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ ?array $ids = null,
+ ?string $name = null,
+ ?float $priceLte = null,
+ ?float $priceGte = null,
+ ?float $priceLt = null,
+ ?float $priceGt = null,
+ ?float $priceEq = null,
+ ?float $priceNe = null,
+ ?array $categories = null,
+ ?string $modifiedSince = null,
+ ?string $createdSince = null,
+ string $contentType = self::contentTypes['getProducts'][0]
+ ): PromiseInterface
+ {
+ return $this->getProductsAsyncWithHttpInfo($limit, $offset, $sort, $ids, $name, $priceLte, $priceGte, $priceLt, $priceGt, $priceEq, $priceNe, $categories, $modifiedSince, $createdSince, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation getProductsAsyncWithHttpInfo
+ *
+ * Return all your products
+ *
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string[]|null $ids Filter by product ids (optional)
+ * @param string|null $name Filter by product name, minimum 3 characters should be present for search (optional)
+ * @param float|null $priceLte Price filter for products less than and equals to particular amount (optional)
+ * @param float|null $priceGte Price filter for products greater than and equals to particular amount (optional)
+ * @param float|null $priceLt Price filter for products less than particular amount (optional)
+ * @param float|null $priceGt Price filter for products greater than particular amount (optional)
+ * @param float|null $priceEq Price filter for products equals to particular amount (optional)
+ * @param float|null $priceNe Price filter for products not equals to particular amount (optional)
+ * @param string[]|null $categories Filter by product categories (optional)
+ * @param string|null $modifiedSince Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string|null $createdSince Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProducts'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getProductsAsyncWithHttpInfo(
+ $limit = 50,
+ $offset = 0,
+ $sort = 'desc',
+ $ids = null,
+ $name = null,
+ $priceLte = null,
+ $priceGte = null,
+ $priceLt = null,
+ $priceGt = null,
+ $priceEq = null,
+ $priceNe = null,
+ $categories = null,
+ $modifiedSince = null,
+ $createdSince = null,
+ string $contentType = self::contentTypes['getProducts'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\GetProducts';
+ $request = $this->getProductsRequest($limit, $offset, $sort, $ids, $name, $priceLte, $priceGte, $priceLt, $priceGt, $priceEq, $priceNe, $categories, $modifiedSince, $createdSince, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'getProducts'
+ *
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string[]|null $ids Filter by product ids (optional)
+ * @param string|null $name Filter by product name, minimum 3 characters should be present for search (optional)
+ * @param float|null $priceLte Price filter for products less than and equals to particular amount (optional)
+ * @param float|null $priceGte Price filter for products greater than and equals to particular amount (optional)
+ * @param float|null $priceLt Price filter for products less than particular amount (optional)
+ * @param float|null $priceGt Price filter for products greater than particular amount (optional)
+ * @param float|null $priceEq Price filter for products equals to particular amount (optional)
+ * @param float|null $priceNe Price filter for products not equals to particular amount (optional)
+ * @param string[]|null $categories Filter by product categories (optional)
+ * @param string|null $modifiedSince Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string|null $createdSince Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProducts'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function getProductsRequest(
+ $limit = 50,
+ $offset = 0,
+ $sort = 'desc',
+ $ids = null,
+ $name = null,
+ $priceLte = null,
+ $priceGte = null,
+ $priceLt = null,
+ $priceGt = null,
+ $priceEq = null,
+ $priceNe = null,
+ $categories = null,
+ $modifiedSince = null,
+ $createdSince = null,
+ string $contentType = self::contentTypes['getProducts'][0]
+ ): Request
+ {
+
+ if ($limit !== null && $limit > 1000) {
+ throw new InvalidArgumentException('invalid value for "$limit" when calling EcommerceApi.getProducts, must be smaller than or equal to 1000.');
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $resourcePath = '/products';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // 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(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $ids,
+ 'ids', // param base name
+ 'array', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $name,
+ 'name', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $priceLte,
+ 'price[lte]', // param base name
+ 'number', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $priceGte,
+ 'price[gte]', // param base name
+ 'number', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $priceLt,
+ 'price[lt]', // param base name
+ 'number', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $priceGt,
+ 'price[gt]', // param base name
+ 'number', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $priceEq,
+ 'price[eq]', // param base name
+ 'number', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $priceNe,
+ 'price[ne]', // param base name
+ 'number', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $categories,
+ 'categories', // param base name
+ 'array', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $modifiedSince,
+ 'modifiedSince', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $createdSince,
+ 'createdSince', // 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 setConfigDisplayCurrency
+ *
+ * Set the ISO 4217 compliant display currency code for your Brevo account
+ *
+ * @param \Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response|null $ecommerceConfigDisplayCurrencyGet200Response set ISO 4217 compliant display currency code payload (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setConfigDisplayCurrency'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
+ */
+ public function setConfigDisplayCurrency(
+ ?\Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response $ecommerceConfigDisplayCurrencyGet200Response = null,
+ string $contentType = self::contentTypes['setConfigDisplayCurrency'][0]
+ ): \Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response
+ {
+ list($response) = $this->setConfigDisplayCurrencyWithHttpInfo($ecommerceConfigDisplayCurrencyGet200Response, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation setConfigDisplayCurrencyWithHttpInfo
+ *
+ * Set the ISO 4217 compliant display currency code for your Brevo account
+ *
+ * @param \Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response|null $ecommerceConfigDisplayCurrencyGet200Response set ISO 4217 compliant display currency code payload (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setConfigDisplayCurrency'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function setConfigDisplayCurrencyWithHttpInfo(
+ ?\Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response $ecommerceConfigDisplayCurrencyGet200Response = null,
+ string $contentType = self::contentTypes['setConfigDisplayCurrency'][0]
+ ): array
+ {
+ $request = $this->setConfigDisplayCurrencyRequest($ecommerceConfigDisplayCurrencyGet200Response, $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 (in_array('\Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $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 = '\Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation setConfigDisplayCurrencyAsync
+ *
+ * Set the ISO 4217 compliant display currency code for your Brevo account
+ *
+ * @param \Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response|null $ecommerceConfigDisplayCurrencyGet200Response set ISO 4217 compliant display currency code payload (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setConfigDisplayCurrency'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function setConfigDisplayCurrencyAsync(
+ ?\Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response $ecommerceConfigDisplayCurrencyGet200Response = null,
+ string $contentType = self::contentTypes['setConfigDisplayCurrency'][0]
+ ): PromiseInterface
+ {
+ return $this->setConfigDisplayCurrencyAsyncWithHttpInfo($ecommerceConfigDisplayCurrencyGet200Response, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation setConfigDisplayCurrencyAsyncWithHttpInfo
+ *
+ * Set the ISO 4217 compliant display currency code for your Brevo account
+ *
+ * @param \Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response|null $ecommerceConfigDisplayCurrencyGet200Response set ISO 4217 compliant display currency code payload (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setConfigDisplayCurrency'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function setConfigDisplayCurrencyAsyncWithHttpInfo(
+ $ecommerceConfigDisplayCurrencyGet200Response = null,
+ string $contentType = self::contentTypes['setConfigDisplayCurrency'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response';
+ $request = $this->setConfigDisplayCurrencyRequest($ecommerceConfigDisplayCurrencyGet200Response, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'setConfigDisplayCurrency'
+ *
+ * @param \Brevo\Client\Models\EcommerceConfigDisplayCurrencyGet200Response|null $ecommerceConfigDisplayCurrencyGet200Response set ISO 4217 compliant display currency code payload (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setConfigDisplayCurrency'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function setConfigDisplayCurrencyRequest(
+ $ecommerceConfigDisplayCurrencyGet200Response = null,
+ string $contentType = self::contentTypes['setConfigDisplayCurrency'][0]
+ ): Request
+ {
+
+
+
+ $resourcePath = '/ecommerce/config/displayCurrency';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($ecommerceConfigDisplayCurrencyGet200Response)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($ecommerceConfigDisplayCurrencyGet200Response));
+ } else {
+ $httpBody = $ecommerceConfigDisplayCurrencyGet200Response;
+ }
+ } 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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
);
@@ -3599,7 +6825,7 @@ protected function getProductsRequest($limit = '50', $offset = '0', $sort = 'des
* @throws \RuntimeException on file opening failure
* @return array of http client options
*/
- protected function createHttpClientOption()
+ protected function createHttpClientOption(): array
{
$options = [];
if ($this->config->getDebug()) {
diff --git a/lib/Api/EmailCampaignsApi.php b/lib/Api/EmailCampaignsApi.php
index f5cec46..c61b998 100644
--- a/lib/Api/EmailCampaignsApi.php
+++ b/lib/Api/EmailCampaignsApi.php
@@ -1,39 +1,41 @@
[
+ 'application/json',
+ ],
+ 'deleteEmailCampaign' => [
+ 'application/json',
+ ],
+ 'emailExportRecipients' => [
+ 'application/json',
+ ],
+ 'getAbTestCampaignResult' => [
+ 'application/json',
+ ],
+ 'getEmailCampaign' => [
+ 'application/json',
+ ],
+ 'getEmailCampaigns' => [
+ 'application/json',
+ ],
+ 'getSharedTemplateUrl' => [
+ 'application/json',
+ ],
+ 'sendEmailCampaignNow' => [
+ 'application/json',
+ ],
+ 'sendReport' => [
+ 'application/json',
+ ],
+ 'sendTestEmail' => [
+ 'application/json',
+ ],
+ 'updateCampaignStatus' => [
+ 'application/json',
+ ],
+ 'updateEmailCampaign' => [
+ 'application/json',
+ ],
+ 'uploadImageToGallery' => [
+ 'application/json',
+ ],
+ ];
+
+ /**
+ * @param ClientInterface|null $client
+ * @param Configuration|null $config
+ * @param HeaderSelector|null $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
+ HeaderSelector $selector = null,
+ int $hostIndex = 0
) {
$this->client = $client ?: new Client();
- $this->config = $config ?: new Configuration();
+ $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(int $hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex(): int
+ {
+ return $this->hostIndex;
}
/**
* @return Configuration
*/
- public function getConfig()
+ public function getConfig(): Configuration
{
return $this->config;
}
@@ -92,15 +164,19 @@ public function getConfig()
*
* Create an email campaign
*
- * @param \Brevo\Client\Model\CreateEmailCampaign $emailCampaigns Values to create a campaign (required)
+ * @param \Brevo\Client\Models\CreateEmailCampaign $createEmailCampaign Values to create a campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmailCampaign'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\CreateModel
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CreateModel|\Brevo\Client\Models\ErrorModel
*/
- public function createEmailCampaign($emailCampaigns)
+ public function createEmailCampaign(
+ \Brevo\Client\Models\CreateEmailCampaign $createEmailCampaign,
+ string $contentType = self::contentTypes['createEmailCampaign'][0]
+ ): \Brevo\Client\Models\CreateModel
{
- list($response) = $this->createEmailCampaignWithHttpInfo($emailCampaigns);
+ list($response) = $this->createEmailCampaignWithHttpInfo($createEmailCampaign, $contentType);
return $response;
}
@@ -109,16 +185,19 @@ public function createEmailCampaign($emailCampaigns)
*
* Create an email campaign
*
- * @param \Brevo\Client\Model\CreateEmailCampaign $emailCampaigns Values to create a campaign (required)
+ * @param \Brevo\Client\Models\CreateEmailCampaign $createEmailCampaign Values to create a campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmailCampaign'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\CreateModel, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CreateModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function createEmailCampaignWithHttpInfo($emailCampaigns)
+ public function createEmailCampaignWithHttpInfo(
+ \Brevo\Client\Models\CreateEmailCampaign $createEmailCampaign,
+ string $contentType = self::contentTypes['createEmailCampaign'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\CreateModel';
- $request = $this->createEmailCampaignRequest($emailCampaigns);
+ $request = $this->createEmailCampaignRequest($createEmailCampaign, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -127,34 +206,111 @@ public function createEmailCampaignWithHttpInfo($emailCampaigns)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 201:
+ if (in_array('\Brevo\Client\Models\CreateModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CreateModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CreateModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CreateModel';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -169,7 +325,7 @@ public function createEmailCampaignWithHttpInfo($emailCampaigns)
case 201:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\CreateModel',
+ '\Brevo\Client\Models\CreateModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -177,7 +333,7 @@ public function createEmailCampaignWithHttpInfo($emailCampaigns)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -192,14 +348,18 @@ public function createEmailCampaignWithHttpInfo($emailCampaigns)
*
* Create an email campaign
*
- * @param \Brevo\Client\Model\CreateEmailCampaign $emailCampaigns Values to create a campaign (required)
+ * @param \Brevo\Client\Models\CreateEmailCampaign $createEmailCampaign Values to create a campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmailCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createEmailCampaignAsync($emailCampaigns)
+ public function createEmailCampaignAsync(
+ \Brevo\Client\Models\CreateEmailCampaign $createEmailCampaign,
+ string $contentType = self::contentTypes['createEmailCampaign'][0]
+ ): PromiseInterface
{
- return $this->createEmailCampaignAsyncWithHttpInfo($emailCampaigns)
+ return $this->createEmailCampaignAsyncWithHttpInfo($createEmailCampaign, $contentType)
->then(
function ($response) {
return $response[0];
@@ -212,25 +372,29 @@ function ($response) {
*
* Create an email campaign
*
- * @param \Brevo\Client\Model\CreateEmailCampaign $emailCampaigns Values to create a campaign (required)
+ * @param \Brevo\Client\Models\CreateEmailCampaign $createEmailCampaign Values to create a campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmailCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createEmailCampaignAsyncWithHttpInfo($emailCampaigns)
+ public function createEmailCampaignAsyncWithHttpInfo(
+ $createEmailCampaign,
+ string $contentType = self::contentTypes['createEmailCampaign'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\CreateModel';
- $request = $this->createEmailCampaignRequest($emailCampaigns);
+ $returnType = '\Brevo\Client\Models\CreateModel';
+ $request = $this->createEmailCampaignRequest($createEmailCampaign, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -253,7 +417,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -262,20 +426,26 @@ function ($exception) {
/**
* Create request for operation 'createEmailCampaign'
*
- * @param \Brevo\Client\Model\CreateEmailCampaign $emailCampaigns Values to create a campaign (required)
+ * @param \Brevo\Client\Models\CreateEmailCampaign $createEmailCampaign Values to create a campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmailCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function createEmailCampaignRequest($emailCampaigns)
+ public function createEmailCampaignRequest(
+ $createEmailCampaign,
+ string $contentType = self::contentTypes['createEmailCampaign'][0]
+ ): Request
{
- // verify the required parameter 'emailCampaigns' is set
- if ($emailCampaigns === null || (is_array($emailCampaigns) && count($emailCampaigns) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $emailCampaigns when calling createEmailCampaign'
+
+ // verify the required parameter 'createEmailCampaign' is set
+ if ($createEmailCampaign === null || (is_array($createEmailCampaign) && count($createEmailCampaign) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $createEmailCampaign when calling createEmailCampaign'
);
}
+
$resourcePath = '/emailCampaigns';
$formParams = [];
$queryParams = [];
@@ -285,56 +455,43 @@ protected function createEmailCampaignRequest($emailCampaigns)
- // body params
- $_tempBody = null;
- if (isset($emailCampaigns)) {
- $_tempBody = $emailCampaigns;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($createEmailCampaign)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createEmailCampaign));
+ } else {
+ $httpBody = $createEmailCampaign;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -360,10 +517,11 @@ protected function createEmailCampaignRequest($emailCampaigns)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -375,14 +533,18 @@ protected function createEmailCampaignRequest($emailCampaigns)
* Delete an email campaign
*
* @param int $campaignId id of the campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteEmailCampaign'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function deleteEmailCampaign($campaignId)
+ public function deleteEmailCampaign(
+ int $campaignId,
+ string $contentType = self::contentTypes['deleteEmailCampaign'][0]
+ ): void
{
- $this->deleteEmailCampaignWithHttpInfo($campaignId);
+ $this->deleteEmailCampaignWithHttpInfo($campaignId, $contentType);
}
/**
@@ -391,15 +553,18 @@ public function deleteEmailCampaign($campaignId)
* Delete an email campaign
*
* @param int $campaignId id of the campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteEmailCampaign'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function deleteEmailCampaignWithHttpInfo($campaignId)
+ public function deleteEmailCampaignWithHttpInfo(
+ int $campaignId,
+ string $contentType = self::contentTypes['deleteEmailCampaign'][0]
+ ): array
{
- $returnType = '';
- $request = $this->deleteEmailCampaignRequest($campaignId);
+ $request = $this->deleteEmailCampaignRequest($campaignId, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -408,43 +573,38 @@ public function deleteEmailCampaignWithHttpInfo($campaignId)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
} catch (ApiException $e) {
switch ($e->getCode()) {
- case 404:
+ case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 400:
+ case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -460,13 +620,17 @@ public function deleteEmailCampaignWithHttpInfo($campaignId)
* Delete an email campaign
*
* @param int $campaignId id of the campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteEmailCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteEmailCampaignAsync($campaignId)
+ public function deleteEmailCampaignAsync(
+ int $campaignId,
+ string $contentType = self::contentTypes['deleteEmailCampaign'][0]
+ ): PromiseInterface
{
- return $this->deleteEmailCampaignAsyncWithHttpInfo($campaignId)
+ return $this->deleteEmailCampaignAsyncWithHttpInfo($campaignId, $contentType)
->then(
function ($response) {
return $response[0];
@@ -480,14 +644,19 @@ function ($response) {
* Delete an email campaign
*
* @param int $campaignId id of the campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteEmailCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteEmailCampaignAsyncWithHttpInfo($campaignId)
+ public function deleteEmailCampaignAsyncWithHttpInfo(
+ $campaignId,
+ string $contentType = self::contentTypes['deleteEmailCampaign'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->deleteEmailCampaignRequest($campaignId);
+ $request = $this->deleteEmailCampaignRequest($campaignId, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -506,7 +675,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -516,19 +685,25 @@ function ($exception) {
* Create request for operation 'deleteEmailCampaign'
*
* @param int $campaignId id of the campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteEmailCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function deleteEmailCampaignRequest($campaignId)
+ public function deleteEmailCampaignRequest(
+ $campaignId,
+ string $contentType = self::contentTypes['deleteEmailCampaign'][0]
+ ): Request
{
+
// verify the required parameter 'campaignId' is set
if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $campaignId when calling deleteEmailCampaign'
);
}
+
$resourcePath = '/emailCampaigns/{campaignId}';
$formParams = [];
$queryParams = [];
@@ -537,6 +712,7 @@ protected function deleteEmailCampaignRequest($campaignId)
$multipart = false;
+
// path params
if ($campaignId !== null) {
$resourcePath = str_replace(
@@ -546,53 +722,35 @@ protected function deleteEmailCampaignRequest($campaignId)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -618,10 +776,11 @@ protected function deleteEmailCampaignRequest($campaignId)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -633,15 +792,20 @@ protected function deleteEmailCampaignRequest($campaignId)
* Export the recipients of an email campaign
*
* @param int $campaignId Id of the campaign (required)
- * @param \Brevo\Client\Model\EmailExportRecipients $recipientExport Values to send for a recipient export request (optional)
+ * @param \Brevo\Client\Models\EmailExportRecipients|null $emailExportRecipients Values to send for a recipient export request (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailExportRecipients'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\CreatedProcessId
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CreatedProcessId|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function emailExportRecipients($campaignId, $recipientExport = null)
+ public function emailExportRecipients(
+ int $campaignId,
+ ?\Brevo\Client\Models\EmailExportRecipients $emailExportRecipients = null,
+ string $contentType = self::contentTypes['emailExportRecipients'][0]
+ ): \Brevo\Client\Models\CreatedProcessId
{
- list($response) = $this->emailExportRecipientsWithHttpInfo($campaignId, $recipientExport);
+ list($response) = $this->emailExportRecipientsWithHttpInfo($campaignId, $emailExportRecipients, $contentType);
return $response;
}
@@ -651,16 +815,20 @@ public function emailExportRecipients($campaignId, $recipientExport = null)
* Export the recipients of an email campaign
*
* @param int $campaignId Id of the campaign (required)
- * @param \Brevo\Client\Model\EmailExportRecipients $recipientExport Values to send for a recipient export request (optional)
+ * @param \Brevo\Client\Models\EmailExportRecipients|null $emailExportRecipients Values to send for a recipient export request (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailExportRecipients'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\CreatedProcessId, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CreatedProcessId|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function emailExportRecipientsWithHttpInfo($campaignId, $recipientExport = null)
+ public function emailExportRecipientsWithHttpInfo(
+ int $campaignId,
+ ?\Brevo\Client\Models\EmailExportRecipients $emailExportRecipients = null,
+ string $contentType = self::contentTypes['emailExportRecipients'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\CreatedProcessId';
- $request = $this->emailExportRecipientsRequest($campaignId, $recipientExport);
+ $request = $this->emailExportRecipientsRequest($campaignId, $emailExportRecipients, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -669,34 +837,138 @@ public function emailExportRecipientsWithHttpInfo($campaignId, $recipientExport
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 202:
+ if (in_array('\Brevo\Client\Models\CreatedProcessId', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CreatedProcessId' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CreatedProcessId', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CreatedProcessId';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -711,7 +983,7 @@ public function emailExportRecipientsWithHttpInfo($campaignId, $recipientExport
case 202:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\CreatedProcessId',
+ '\Brevo\Client\Models\CreatedProcessId',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -719,7 +991,7 @@ public function emailExportRecipientsWithHttpInfo($campaignId, $recipientExport
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -727,7 +999,7 @@ public function emailExportRecipientsWithHttpInfo($campaignId, $recipientExport
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -743,14 +1015,19 @@ public function emailExportRecipientsWithHttpInfo($campaignId, $recipientExport
* Export the recipients of an email campaign
*
* @param int $campaignId Id of the campaign (required)
- * @param \Brevo\Client\Model\EmailExportRecipients $recipientExport Values to send for a recipient export request (optional)
+ * @param \Brevo\Client\Models\EmailExportRecipients|null $emailExportRecipients Values to send for a recipient export request (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailExportRecipients'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function emailExportRecipientsAsync($campaignId, $recipientExport = null)
+ public function emailExportRecipientsAsync(
+ int $campaignId,
+ ?\Brevo\Client\Models\EmailExportRecipients $emailExportRecipients = null,
+ string $contentType = self::contentTypes['emailExportRecipients'][0]
+ ): PromiseInterface
{
- return $this->emailExportRecipientsAsyncWithHttpInfo($campaignId, $recipientExport)
+ return $this->emailExportRecipientsAsyncWithHttpInfo($campaignId, $emailExportRecipients, $contentType)
->then(
function ($response) {
return $response[0];
@@ -764,25 +1041,30 @@ function ($response) {
* Export the recipients of an email campaign
*
* @param int $campaignId Id of the campaign (required)
- * @param \Brevo\Client\Model\EmailExportRecipients $recipientExport Values to send for a recipient export request (optional)
+ * @param \Brevo\Client\Models\EmailExportRecipients|null $emailExportRecipients Values to send for a recipient export request (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailExportRecipients'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function emailExportRecipientsAsyncWithHttpInfo($campaignId, $recipientExport = null)
+ public function emailExportRecipientsAsyncWithHttpInfo(
+ $campaignId,
+ $emailExportRecipients = null,
+ string $contentType = self::contentTypes['emailExportRecipients'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\CreatedProcessId';
- $request = $this->emailExportRecipientsRequest($campaignId, $recipientExport);
+ $returnType = '\Brevo\Client\Models\CreatedProcessId';
+ $request = $this->emailExportRecipientsRequest($campaignId, $emailExportRecipients, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -805,7 +1087,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -815,20 +1097,28 @@ function ($exception) {
* Create request for operation 'emailExportRecipients'
*
* @param int $campaignId Id of the campaign (required)
- * @param \Brevo\Client\Model\EmailExportRecipients $recipientExport Values to send for a recipient export request (optional)
+ * @param \Brevo\Client\Models\EmailExportRecipients|null $emailExportRecipients Values to send for a recipient export request (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailExportRecipients'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function emailExportRecipientsRequest($campaignId, $recipientExport = null)
+ public function emailExportRecipientsRequest(
+ $campaignId,
+ $emailExportRecipients = null,
+ string $contentType = self::contentTypes['emailExportRecipients'][0]
+ ): Request
{
+
// verify the required parameter 'campaignId' is set
if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $campaignId when calling emailExportRecipients'
);
}
+
+
$resourcePath = '/emailCampaigns/{campaignId}/exportRecipients';
$formParams = [];
$queryParams = [];
@@ -837,6 +1127,7 @@ protected function emailExportRecipientsRequest($campaignId, $recipientExport =
$multipart = false;
+
// path params
if ($campaignId !== null) {
$resourcePath = str_replace(
@@ -846,56 +1137,42 @@ protected function emailExportRecipientsRequest($campaignId, $recipientExport =
);
}
- // body params
- $_tempBody = null;
- if (isset($recipientExport)) {
- $_tempBody = $recipientExport;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($emailExportRecipients)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($emailExportRecipients));
+ } else {
+ $httpBody = $emailExportRecipients;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -921,10 +1198,11 @@ protected function emailExportRecipientsRequest($campaignId, $recipientExport =
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -936,14 +1214,18 @@ protected function emailExportRecipientsRequest($campaignId, $recipientExport =
* Get an A/B test email campaign results
*
* @param int $campaignId Id of the A/B test campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAbTestCampaignResult'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\AbTestCampaignResult
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\AbTestCampaignResult|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function getAbTestCampaignResult($campaignId)
+ public function getAbTestCampaignResult(
+ int $campaignId,
+ string $contentType = self::contentTypes['getAbTestCampaignResult'][0]
+ ): \Brevo\Client\Models\AbTestCampaignResult
{
- list($response) = $this->getAbTestCampaignResultWithHttpInfo($campaignId);
+ list($response) = $this->getAbTestCampaignResultWithHttpInfo($campaignId, $contentType);
return $response;
}
@@ -953,15 +1235,18 @@ public function getAbTestCampaignResult($campaignId)
* Get an A/B test email campaign results
*
* @param int $campaignId Id of the A/B test campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAbTestCampaignResult'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\AbTestCampaignResult, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\AbTestCampaignResult|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getAbTestCampaignResultWithHttpInfo($campaignId)
+ public function getAbTestCampaignResultWithHttpInfo(
+ int $campaignId,
+ string $contentType = self::contentTypes['getAbTestCampaignResult'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\AbTestCampaignResult';
- $request = $this->getAbTestCampaignResultRequest($campaignId);
+ $request = $this->getAbTestCampaignResultRequest($campaignId, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -970,34 +1255,138 @@ public function getAbTestCampaignResultWithHttpInfo($campaignId)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\AbTestCampaignResult', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\AbTestCampaignResult' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\AbTestCampaignResult', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\AbTestCampaignResult';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1012,15 +1401,7 @@ public function getAbTestCampaignResultWithHttpInfo($campaignId)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\AbTestCampaignResult',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\AbTestCampaignResult',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1028,15 +1409,15 @@ public function getAbTestCampaignResultWithHttpInfo($campaignId)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 405:
+ case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1052,13 +1433,17 @@ public function getAbTestCampaignResultWithHttpInfo($campaignId)
* Get an A/B test email campaign results
*
* @param int $campaignId Id of the A/B test campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAbTestCampaignResult'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getAbTestCampaignResultAsync($campaignId)
+ public function getAbTestCampaignResultAsync(
+ int $campaignId,
+ string $contentType = self::contentTypes['getAbTestCampaignResult'][0]
+ ): PromiseInterface
{
- return $this->getAbTestCampaignResultAsyncWithHttpInfo($campaignId)
+ return $this->getAbTestCampaignResultAsyncWithHttpInfo($campaignId, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1072,24 +1457,28 @@ function ($response) {
* Get an A/B test email campaign results
*
* @param int $campaignId Id of the A/B test campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAbTestCampaignResult'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getAbTestCampaignResultAsyncWithHttpInfo($campaignId)
+ public function getAbTestCampaignResultAsyncWithHttpInfo(
+ $campaignId,
+ string $contentType = self::contentTypes['getAbTestCampaignResult'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\AbTestCampaignResult';
- $request = $this->getAbTestCampaignResultRequest($campaignId);
+ $returnType = '\Brevo\Client\Models\AbTestCampaignResult';
+ $request = $this->getAbTestCampaignResultRequest($campaignId, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1112,7 +1501,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1122,19 +1511,25 @@ function ($exception) {
* Create request for operation 'getAbTestCampaignResult'
*
* @param int $campaignId Id of the A/B test campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAbTestCampaignResult'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getAbTestCampaignResultRequest($campaignId)
+ public function getAbTestCampaignResultRequest(
+ $campaignId,
+ string $contentType = self::contentTypes['getAbTestCampaignResult'][0]
+ ): Request
{
+
// verify the required parameter 'campaignId' is set
if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $campaignId when calling getAbTestCampaignResult'
);
}
+
$resourcePath = '/emailCampaigns/{campaignId}/abTestCampaignResult';
$formParams = [];
$queryParams = [];
@@ -1143,6 +1538,7 @@ protected function getAbTestCampaignResultRequest($campaignId)
$multipart = false;
+
// path params
if ($campaignId !== null) {
$resourcePath = str_replace(
@@ -1152,53 +1548,35 @@ protected function getAbTestCampaignResultRequest($campaignId)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1224,10 +1602,11 @@ protected function getAbTestCampaignResultRequest($campaignId)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1239,15 +1618,20 @@ protected function getAbTestCampaignResultRequest($campaignId)
* Get an email campaign report
*
* @param int $campaignId Id of the campaign (required)
- * @param string $statistics Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional)
+ * @param string|null $statistics Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmailCampaign'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetEmailCampaign
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetEmailCampaign|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function getEmailCampaign($campaignId, $statistics = null)
+ public function getEmailCampaign(
+ int $campaignId,
+ ?string $statistics = null,
+ string $contentType = self::contentTypes['getEmailCampaign'][0]
+ ): \Brevo\Client\Models\GetEmailCampaign
{
- list($response) = $this->getEmailCampaignWithHttpInfo($campaignId, $statistics);
+ list($response) = $this->getEmailCampaignWithHttpInfo($campaignId, $statistics, $contentType);
return $response;
}
@@ -1257,16 +1641,20 @@ public function getEmailCampaign($campaignId, $statistics = null)
* Get an email campaign report
*
* @param int $campaignId Id of the campaign (required)
- * @param string $statistics Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional)
+ * @param string|null $statistics Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmailCampaign'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetEmailCampaign, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetEmailCampaign|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getEmailCampaignWithHttpInfo($campaignId, $statistics = null)
+ public function getEmailCampaignWithHttpInfo(
+ int $campaignId,
+ ?string $statistics = null,
+ string $contentType = self::contentTypes['getEmailCampaign'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetEmailCampaign';
- $request = $this->getEmailCampaignRequest($campaignId, $statistics);
+ $request = $this->getEmailCampaignRequest($campaignId, $statistics, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1275,34 +1663,138 @@ public function getEmailCampaignWithHttpInfo($campaignId, $statistics = null)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetEmailCampaign', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetEmailCampaign' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetEmailCampaign', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetEmailCampaign';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1317,23 +1809,23 @@ public function getEmailCampaignWithHttpInfo($campaignId, $statistics = null)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetEmailCampaign',
+ '\Brevo\Client\Models\GetEmailCampaign',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 404:
+ case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 400:
+ case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1349,14 +1841,19 @@ public function getEmailCampaignWithHttpInfo($campaignId, $statistics = null)
* Get an email campaign report
*
* @param int $campaignId Id of the campaign (required)
- * @param string $statistics Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional)
+ * @param string|null $statistics Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmailCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getEmailCampaignAsync($campaignId, $statistics = null)
+ public function getEmailCampaignAsync(
+ int $campaignId,
+ ?string $statistics = null,
+ string $contentType = self::contentTypes['getEmailCampaign'][0]
+ ): PromiseInterface
{
- return $this->getEmailCampaignAsyncWithHttpInfo($campaignId, $statistics)
+ return $this->getEmailCampaignAsyncWithHttpInfo($campaignId, $statistics, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1370,25 +1867,30 @@ function ($response) {
* Get an email campaign report
*
* @param int $campaignId Id of the campaign (required)
- * @param string $statistics Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional)
+ * @param string|null $statistics Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmailCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getEmailCampaignAsyncWithHttpInfo($campaignId, $statistics = null)
+ public function getEmailCampaignAsyncWithHttpInfo(
+ $campaignId,
+ $statistics = null,
+ string $contentType = self::contentTypes['getEmailCampaign'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetEmailCampaign';
- $request = $this->getEmailCampaignRequest($campaignId, $statistics);
+ $returnType = '\Brevo\Client\Models\GetEmailCampaign';
+ $request = $this->getEmailCampaignRequest($campaignId, $statistics, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1411,7 +1913,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1421,20 +1923,28 @@ function ($exception) {
* Create request for operation 'getEmailCampaign'
*
* @param int $campaignId Id of the campaign (required)
- * @param string $statistics Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional)
+ * @param string|null $statistics Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmailCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getEmailCampaignRequest($campaignId, $statistics = null)
+ public function getEmailCampaignRequest(
+ $campaignId,
+ $statistics = null,
+ string $contentType = self::contentTypes['getEmailCampaign'][0]
+ ): Request
{
+
// verify the required parameter 'campaignId' is set
if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $campaignId when calling getEmailCampaign'
);
}
+
+
$resourcePath = '/emailCampaigns/{campaignId}';
$formParams = [];
$queryParams = [];
@@ -1443,9 +1953,15 @@ protected function getEmailCampaignRequest($campaignId, $statistics = null)
$multipart = false;
// query params
- if ($statistics !== null) {
- $queryParams['statistics'] = ObjectSerializer::toQueryValue($statistics);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $statistics,
+ 'statistics', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
// path params
if ($campaignId !== null) {
@@ -1456,53 +1972,35 @@ protected function getEmailCampaignRequest($campaignId, $statistics = null)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1528,10 +2026,11 @@ protected function getEmailCampaignRequest($campaignId, $statistics = null)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1542,23 +2041,35 @@ protected function getEmailCampaignRequest($campaignId, $statistics = null)
*
* Return all your created email campaigns
*
- * @param string $type Filter on the type of the campaigns (optional)
- * @param string $status Filter on the status of the campaign (optional)
- * @param string $statistics Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional)
- * @param string $startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
- * @param string $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param bool $excludeHtmlContent Use this flag to exclude htmlContent from the response body. If set to **true**, htmlContent field will be returned as empty string in the response body (optional)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetEmailCampaigns
+ * @param string|null $type Filter on the type of the campaigns (optional)
+ * @param string|null $status Filter on the status of the campaign (optional)
+ * @param string|null $statistics Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response.This option only returns data for events occurred in the last 6 months.For older campaigns, it’s advisable to use the **Get Campaign Report** endpoint. (optional)
+ * @param string|null $startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
+ * @param string|null $endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param bool|null $excludeHtmlContent Use this flag to exclude htmlContent from the response body. If set to **true**, htmlContent field will be returned as empty string in the response body (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmailCampaigns'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetEmailCampaigns|\Brevo\Client\Models\ErrorModel
*/
- public function getEmailCampaigns($type = null, $status = null, $statistics = null, $startDate = null, $endDate = null, $limit = '50', $offset = '0', $sort = 'desc', $excludeHtmlContent = null)
+ public function getEmailCampaigns(
+ ?string $type = null,
+ ?string $status = null,
+ ?string $statistics = null,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ ?bool $excludeHtmlContent = null,
+ string $contentType = self::contentTypes['getEmailCampaigns'][0]
+ ): \Brevo\Client\Models\GetEmailCampaigns
{
- list($response) = $this->getEmailCampaignsWithHttpInfo($type, $status, $statistics, $startDate, $endDate, $limit, $offset, $sort, $excludeHtmlContent);
+ list($response) = $this->getEmailCampaignsWithHttpInfo($type, $status, $statistics, $startDate, $endDate, $limit, $offset, $sort, $excludeHtmlContent, $contentType);
return $response;
}
@@ -1567,24 +2078,35 @@ public function getEmailCampaigns($type = null, $status = null, $statistics = nu
*
* Return all your created email campaigns
*
- * @param string $type Filter on the type of the campaigns (optional)
- * @param string $status Filter on the status of the campaign (optional)
- * @param string $statistics Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional)
- * @param string $startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
- * @param string $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param bool $excludeHtmlContent Use this flag to exclude htmlContent from the response body. If set to **true**, htmlContent field will be returned as empty string in the response body (optional)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetEmailCampaigns, HTTP status code, HTTP response headers (array of strings)
+ * @param string|null $type Filter on the type of the campaigns (optional)
+ * @param string|null $status Filter on the status of the campaign (optional)
+ * @param string|null $statistics Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response.This option only returns data for events occurred in the last 6 months.For older campaigns, it’s advisable to use the **Get Campaign Report** endpoint. (optional)
+ * @param string|null $startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
+ * @param string|null $endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param bool|null $excludeHtmlContent Use this flag to exclude htmlContent from the response body. If set to **true**, htmlContent field will be returned as empty string in the response body (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmailCampaigns'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetEmailCampaigns|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getEmailCampaignsWithHttpInfo($type = null, $status = null, $statistics = null, $startDate = null, $endDate = null, $limit = '50', $offset = '0', $sort = 'desc', $excludeHtmlContent = null)
+ public function getEmailCampaignsWithHttpInfo(
+ ?string $type = null,
+ ?string $status = null,
+ ?string $statistics = null,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ ?bool $excludeHtmlContent = null,
+ string $contentType = self::contentTypes['getEmailCampaigns'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetEmailCampaigns';
- $request = $this->getEmailCampaignsRequest($type, $status, $statistics, $startDate, $endDate, $limit, $offset, $sort, $excludeHtmlContent);
+ $request = $this->getEmailCampaignsRequest($type, $status, $statistics, $startDate, $endDate, $limit, $offset, $sort, $excludeHtmlContent, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1593,34 +2115,111 @@ public function getEmailCampaignsWithHttpInfo($type = null, $status = null, $sta
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetEmailCampaigns', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetEmailCampaigns' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetEmailCampaigns', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetEmailCampaigns';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1635,7 +2234,7 @@ public function getEmailCampaignsWithHttpInfo($type = null, $status = null, $sta
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetEmailCampaigns',
+ '\Brevo\Client\Models\GetEmailCampaigns',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1643,7 +2242,7 @@ public function getEmailCampaignsWithHttpInfo($type = null, $status = null, $sta
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1658,22 +2257,34 @@ public function getEmailCampaignsWithHttpInfo($type = null, $status = null, $sta
*
* Return all your created email campaigns
*
- * @param string $type Filter on the type of the campaigns (optional)
- * @param string $status Filter on the status of the campaign (optional)
- * @param string $statistics Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional)
- * @param string $startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
- * @param string $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param bool $excludeHtmlContent Use this flag to exclude htmlContent from the response body. If set to **true**, htmlContent field will be returned as empty string in the response body (optional)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @param string|null $type Filter on the type of the campaigns (optional)
+ * @param string|null $status Filter on the status of the campaign (optional)
+ * @param string|null $statistics Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response.This option only returns data for events occurred in the last 6 months.For older campaigns, it’s advisable to use the **Get Campaign Report** endpoint. (optional)
+ * @param string|null $startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
+ * @param string|null $endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param bool|null $excludeHtmlContent Use this flag to exclude htmlContent from the response body. If set to **true**, htmlContent field will be returned as empty string in the response body (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmailCampaigns'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getEmailCampaignsAsync($type = null, $status = null, $statistics = null, $startDate = null, $endDate = null, $limit = '50', $offset = '0', $sort = 'desc', $excludeHtmlContent = null)
+ public function getEmailCampaignsAsync(
+ ?string $type = null,
+ ?string $status = null,
+ ?string $statistics = null,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ ?bool $excludeHtmlContent = null,
+ string $contentType = self::contentTypes['getEmailCampaigns'][0]
+ ): PromiseInterface
{
- return $this->getEmailCampaignsAsyncWithHttpInfo($type, $status, $statistics, $startDate, $endDate, $limit, $offset, $sort, $excludeHtmlContent)
+ return $this->getEmailCampaignsAsyncWithHttpInfo($type, $status, $statistics, $startDate, $endDate, $limit, $offset, $sort, $excludeHtmlContent, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1686,33 +2297,45 @@ function ($response) {
*
* Return all your created email campaigns
*
- * @param string $type Filter on the type of the campaigns (optional)
- * @param string $status Filter on the status of the campaign (optional)
- * @param string $statistics Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional)
- * @param string $startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
- * @param string $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param bool $excludeHtmlContent Use this flag to exclude htmlContent from the response body. If set to **true**, htmlContent field will be returned as empty string in the response body (optional)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @param string|null $type Filter on the type of the campaigns (optional)
+ * @param string|null $status Filter on the status of the campaign (optional)
+ * @param string|null $statistics Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response.This option only returns data for events occurred in the last 6 months.For older campaigns, it’s advisable to use the **Get Campaign Report** endpoint. (optional)
+ * @param string|null $startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
+ * @param string|null $endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param bool|null $excludeHtmlContent Use this flag to exclude htmlContent from the response body. If set to **true**, htmlContent field will be returned as empty string in the response body (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmailCampaigns'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getEmailCampaignsAsyncWithHttpInfo($type = null, $status = null, $statistics = null, $startDate = null, $endDate = null, $limit = '50', $offset = '0', $sort = 'desc', $excludeHtmlContent = null)
+ public function getEmailCampaignsAsyncWithHttpInfo(
+ $type = null,
+ $status = null,
+ $statistics = null,
+ $startDate = null,
+ $endDate = null,
+ $limit = 50,
+ $offset = 0,
+ $sort = 'desc',
+ $excludeHtmlContent = null,
+ string $contentType = self::contentTypes['getEmailCampaigns'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetEmailCampaigns';
- $request = $this->getEmailCampaignsRequest($type, $status, $statistics, $startDate, $endDate, $limit, $offset, $sort, $excludeHtmlContent);
+ $returnType = '\Brevo\Client\Models\GetEmailCampaigns';
+ $request = $this->getEmailCampaignsRequest($type, $status, $statistics, $startDate, $endDate, $limit, $offset, $sort, $excludeHtmlContent, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1735,7 +2358,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1744,27 +2367,48 @@ function ($exception) {
/**
* Create request for operation 'getEmailCampaigns'
*
- * @param string $type Filter on the type of the campaigns (optional)
- * @param string $status Filter on the status of the campaign (optional)
- * @param string $statistics Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional)
- * @param string $startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
- * @param string $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param bool $excludeHtmlContent Use this flag to exclude htmlContent from the response body. If set to **true**, htmlContent field will be returned as empty string in the response body (optional)
- *
- * @throws \InvalidArgumentException
+ * @param string|null $type Filter on the type of the campaigns (optional)
+ * @param string|null $status Filter on the status of the campaign (optional)
+ * @param string|null $statistics Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response.This option only returns data for events occurred in the last 6 months.For older campaigns, it’s advisable to use the **Get Campaign Report** endpoint. (optional)
+ * @param string|null $startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
+ * @param string|null $endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param bool|null $excludeHtmlContent Use this flag to exclude htmlContent from the response body. If set to **true**, htmlContent field will be returned as empty string in the response body (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmailCampaigns'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getEmailCampaignsRequest($type = null, $status = null, $statistics = null, $startDate = null, $endDate = null, $limit = '50', $offset = '0', $sort = 'desc', $excludeHtmlContent = null)
+ public function getEmailCampaignsRequest(
+ $type = null,
+ $status = null,
+ $statistics = null,
+ $startDate = null,
+ $endDate = null,
+ $limit = 50,
+ $offset = 0,
+ $sort = 'desc',
+ $excludeHtmlContent = null,
+ string $contentType = self::contentTypes['getEmailCampaigns'][0]
+ ): Request
{
+
+
+
+
+
+
if ($limit !== null && $limit > 100) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling EmailCampaignsApi.getEmailCampaigns, must be smaller than or equal to 100.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling EmailCampaignsApi.getEmailCampaigns, must be smaller than or equal to 100.');
}
if ($limit !== null && $limit < 0) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling EmailCampaignsApi.getEmailCampaigns, must be bigger than or equal to 0.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling EmailCampaignsApi.getEmailCampaigns, must be bigger than or equal to 0.');
}
+
+
+
$resourcePath = '/emailCampaigns';
@@ -1775,90 +2419,118 @@ protected function getEmailCampaignsRequest($type = null, $status = null, $stati
$multipart = false;
// query params
- if ($type !== null) {
- $queryParams['type'] = ObjectSerializer::toQueryValue($type);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $type,
+ 'type', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($status !== null) {
- $queryParams['status'] = ObjectSerializer::toQueryValue($status);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $status,
+ 'status', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($statistics !== null) {
- $queryParams['statistics'] = ObjectSerializer::toQueryValue($statistics);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $statistics,
+ 'statistics', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($startDate !== null) {
- $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $startDate,
+ 'startDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($endDate !== null) {
- $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $endDate,
+ 'endDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($excludeHtmlContent !== null) {
- $queryParams['excludeHtmlContent'] = ObjectSerializer::toQueryValue($excludeHtmlContent);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $excludeHtmlContent,
+ 'excludeHtmlContent', // param base name
+ 'boolean', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1884,10 +2556,11 @@ protected function getEmailCampaignsRequest($type = null, $status = null, $stati
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1899,14 +2572,18 @@ protected function getEmailCampaignsRequest($type = null, $status = null, $stati
* Get a shared template url
*
* @param int $campaignId Id of the campaign or template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSharedTemplateUrl'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetSharedTemplateUrl
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetSharedTemplateUrl|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function getSharedTemplateUrl($campaignId)
+ public function getSharedTemplateUrl(
+ int $campaignId,
+ string $contentType = self::contentTypes['getSharedTemplateUrl'][0]
+ ): \Brevo\Client\Models\GetSharedTemplateUrl
{
- list($response) = $this->getSharedTemplateUrlWithHttpInfo($campaignId);
+ list($response) = $this->getSharedTemplateUrlWithHttpInfo($campaignId, $contentType);
return $response;
}
@@ -1916,15 +2593,18 @@ public function getSharedTemplateUrl($campaignId)
* Get a shared template url
*
* @param int $campaignId Id of the campaign or template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSharedTemplateUrl'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetSharedTemplateUrl, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetSharedTemplateUrl|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getSharedTemplateUrlWithHttpInfo($campaignId)
+ public function getSharedTemplateUrlWithHttpInfo(
+ int $campaignId,
+ string $contentType = self::contentTypes['getSharedTemplateUrl'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetSharedTemplateUrl';
- $request = $this->getSharedTemplateUrlRequest($campaignId);
+ $request = $this->getSharedTemplateUrlRequest($campaignId, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1933,34 +2613,165 @@ public function getSharedTemplateUrlWithHttpInfo($campaignId)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetSharedTemplateUrl', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetSharedTemplateUrl' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetSharedTemplateUrl', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 405:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetSharedTemplateUrl';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1975,7 +2786,15 @@ public function getSharedTemplateUrlWithHttpInfo($campaignId)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetSharedTemplateUrl',
+ '\Brevo\Client\Models\GetSharedTemplateUrl',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1983,15 +2802,15 @@ public function getSharedTemplateUrlWithHttpInfo($campaignId)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 400:
+ case 405:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2007,13 +2826,17 @@ public function getSharedTemplateUrlWithHttpInfo($campaignId)
* Get a shared template url
*
* @param int $campaignId Id of the campaign or template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSharedTemplateUrl'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getSharedTemplateUrlAsync($campaignId)
+ public function getSharedTemplateUrlAsync(
+ int $campaignId,
+ string $contentType = self::contentTypes['getSharedTemplateUrl'][0]
+ ): PromiseInterface
{
- return $this->getSharedTemplateUrlAsyncWithHttpInfo($campaignId)
+ return $this->getSharedTemplateUrlAsyncWithHttpInfo($campaignId, $contentType)
->then(
function ($response) {
return $response[0];
@@ -2027,24 +2850,28 @@ function ($response) {
* Get a shared template url
*
* @param int $campaignId Id of the campaign or template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSharedTemplateUrl'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getSharedTemplateUrlAsyncWithHttpInfo($campaignId)
+ public function getSharedTemplateUrlAsyncWithHttpInfo(
+ $campaignId,
+ string $contentType = self::contentTypes['getSharedTemplateUrl'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetSharedTemplateUrl';
- $request = $this->getSharedTemplateUrlRequest($campaignId);
+ $returnType = '\Brevo\Client\Models\GetSharedTemplateUrl';
+ $request = $this->getSharedTemplateUrlRequest($campaignId, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -2067,7 +2894,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -2077,19 +2904,25 @@ function ($exception) {
* Create request for operation 'getSharedTemplateUrl'
*
* @param int $campaignId Id of the campaign or template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSharedTemplateUrl'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getSharedTemplateUrlRequest($campaignId)
+ public function getSharedTemplateUrlRequest(
+ $campaignId,
+ string $contentType = self::contentTypes['getSharedTemplateUrl'][0]
+ ): Request
{
+
// verify the required parameter 'campaignId' is set
if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $campaignId when calling getSharedTemplateUrl'
);
}
+
$resourcePath = '/emailCampaigns/{campaignId}/sharedUrl';
$formParams = [];
$queryParams = [];
@@ -2098,6 +2931,7 @@ protected function getSharedTemplateUrlRequest($campaignId)
$multipart = false;
+
// path params
if ($campaignId !== null) {
$resourcePath = str_replace(
@@ -2107,53 +2941,35 @@ protected function getSharedTemplateUrlRequest($campaignId)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -2179,10 +2995,11 @@ protected function getSharedTemplateUrlRequest($campaignId)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -2194,14 +3011,18 @@ protected function getSharedTemplateUrlRequest($campaignId)
* Send an email campaign immediately, based on campaignId
*
* @param int $campaignId Id of the campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendEmailCampaignNow'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function sendEmailCampaignNow($campaignId)
+ public function sendEmailCampaignNow(
+ int $campaignId,
+ string $contentType = self::contentTypes['sendEmailCampaignNow'][0]
+ ): void
{
- $this->sendEmailCampaignNowWithHttpInfo($campaignId);
+ $this->sendEmailCampaignNowWithHttpInfo($campaignId, $contentType);
}
/**
@@ -2210,15 +3031,18 @@ public function sendEmailCampaignNow($campaignId)
* Send an email campaign immediately, based on campaignId
*
* @param int $campaignId Id of the campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendEmailCampaignNow'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function sendEmailCampaignNowWithHttpInfo($campaignId)
+ public function sendEmailCampaignNowWithHttpInfo(
+ int $campaignId,
+ string $contentType = self::contentTypes['sendEmailCampaignNow'][0]
+ ): array
{
- $returnType = '';
- $request = $this->sendEmailCampaignNowRequest($campaignId);
+ $request = $this->sendEmailCampaignNowRequest($campaignId, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -2227,26 +3051,21 @@ public function sendEmailCampaignNowWithHttpInfo($campaignId)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -2255,7 +3074,7 @@ public function sendEmailCampaignNowWithHttpInfo($campaignId)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2263,7 +3082,7 @@ public function sendEmailCampaignNowWithHttpInfo($campaignId)
case 402:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2271,7 +3090,7 @@ public function sendEmailCampaignNowWithHttpInfo($campaignId)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2287,13 +3106,17 @@ public function sendEmailCampaignNowWithHttpInfo($campaignId)
* Send an email campaign immediately, based on campaignId
*
* @param int $campaignId Id of the campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendEmailCampaignNow'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function sendEmailCampaignNowAsync($campaignId)
+ public function sendEmailCampaignNowAsync(
+ int $campaignId,
+ string $contentType = self::contentTypes['sendEmailCampaignNow'][0]
+ ): PromiseInterface
{
- return $this->sendEmailCampaignNowAsyncWithHttpInfo($campaignId)
+ return $this->sendEmailCampaignNowAsyncWithHttpInfo($campaignId, $contentType)
->then(
function ($response) {
return $response[0];
@@ -2307,14 +3130,19 @@ function ($response) {
* Send an email campaign immediately, based on campaignId
*
* @param int $campaignId Id of the campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendEmailCampaignNow'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function sendEmailCampaignNowAsyncWithHttpInfo($campaignId)
+ public function sendEmailCampaignNowAsyncWithHttpInfo(
+ $campaignId,
+ string $contentType = self::contentTypes['sendEmailCampaignNow'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->sendEmailCampaignNowRequest($campaignId);
+ $request = $this->sendEmailCampaignNowRequest($campaignId, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -2333,7 +3161,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -2343,19 +3171,25 @@ function ($exception) {
* Create request for operation 'sendEmailCampaignNow'
*
* @param int $campaignId Id of the campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendEmailCampaignNow'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function sendEmailCampaignNowRequest($campaignId)
+ public function sendEmailCampaignNowRequest(
+ $campaignId,
+ string $contentType = self::contentTypes['sendEmailCampaignNow'][0]
+ ): Request
{
+
// verify the required parameter 'campaignId' is set
if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $campaignId when calling sendEmailCampaignNow'
);
}
+
$resourcePath = '/emailCampaigns/{campaignId}/sendNow';
$formParams = [];
$queryParams = [];
@@ -2364,6 +3198,7 @@ protected function sendEmailCampaignNowRequest($campaignId)
$multipart = false;
+
// path params
if ($campaignId !== null) {
$resourcePath = str_replace(
@@ -2373,53 +3208,35 @@ protected function sendEmailCampaignNowRequest($campaignId)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -2445,10 +3262,11 @@ protected function sendEmailCampaignNowRequest($campaignId)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -2460,15 +3278,20 @@ protected function sendEmailCampaignNowRequest($campaignId)
* Send the report of a campaign
*
* @param int $campaignId Id of the campaign (required)
- * @param \Brevo\Client\Model\SendReport $sendReport Values for send a report (required)
+ * @param \Brevo\Client\Models\SendReport $sendReport Values for send a report (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendReport'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function sendReport($campaignId, $sendReport)
+ public function sendReport(
+ int $campaignId,
+ \Brevo\Client\Models\SendReport $sendReport,
+ string $contentType = self::contentTypes['sendReport'][0]
+ ): void
{
- $this->sendReportWithHttpInfo($campaignId, $sendReport);
+ $this->sendReportWithHttpInfo($campaignId, $sendReport, $contentType);
}
/**
@@ -2477,16 +3300,20 @@ public function sendReport($campaignId, $sendReport)
* Send the report of a campaign
*
* @param int $campaignId Id of the campaign (required)
- * @param \Brevo\Client\Model\SendReport $sendReport Values for send a report (required)
+ * @param \Brevo\Client\Models\SendReport $sendReport Values for send a report (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendReport'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function sendReportWithHttpInfo($campaignId, $sendReport)
+ public function sendReportWithHttpInfo(
+ int $campaignId,
+ \Brevo\Client\Models\SendReport $sendReport,
+ string $contentType = self::contentTypes['sendReport'][0]
+ ): array
{
- $returnType = '';
- $request = $this->sendReportRequest($campaignId, $sendReport);
+ $request = $this->sendReportRequest($campaignId, $sendReport, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -2495,26 +3322,21 @@ public function sendReportWithHttpInfo($campaignId, $sendReport)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -2523,7 +3345,7 @@ public function sendReportWithHttpInfo($campaignId, $sendReport)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2531,7 +3353,7 @@ public function sendReportWithHttpInfo($campaignId, $sendReport)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2547,14 +3369,19 @@ public function sendReportWithHttpInfo($campaignId, $sendReport)
* Send the report of a campaign
*
* @param int $campaignId Id of the campaign (required)
- * @param \Brevo\Client\Model\SendReport $sendReport Values for send a report (required)
+ * @param \Brevo\Client\Models\SendReport $sendReport Values for send a report (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendReport'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function sendReportAsync($campaignId, $sendReport)
+ public function sendReportAsync(
+ int $campaignId,
+ \Brevo\Client\Models\SendReport $sendReport,
+ string $contentType = self::contentTypes['sendReport'][0]
+ ): PromiseInterface
{
- return $this->sendReportAsyncWithHttpInfo($campaignId, $sendReport)
+ return $this->sendReportAsyncWithHttpInfo($campaignId, $sendReport, $contentType)
->then(
function ($response) {
return $response[0];
@@ -2568,15 +3395,21 @@ function ($response) {
* Send the report of a campaign
*
* @param int $campaignId Id of the campaign (required)
- * @param \Brevo\Client\Model\SendReport $sendReport Values for send a report (required)
+ * @param \Brevo\Client\Models\SendReport $sendReport Values for send a report (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendReport'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function sendReportAsyncWithHttpInfo($campaignId, $sendReport)
+ public function sendReportAsyncWithHttpInfo(
+ $campaignId,
+ $sendReport,
+ string $contentType = self::contentTypes['sendReport'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->sendReportRequest($campaignId, $sendReport);
+ $request = $this->sendReportRequest($campaignId, $sendReport, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -2595,7 +3428,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -2605,26 +3438,34 @@ function ($exception) {
* Create request for operation 'sendReport'
*
* @param int $campaignId Id of the campaign (required)
- * @param \Brevo\Client\Model\SendReport $sendReport Values for send a report (required)
+ * @param \Brevo\Client\Models\SendReport $sendReport Values for send a report (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendReport'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function sendReportRequest($campaignId, $sendReport)
+ public function sendReportRequest(
+ $campaignId,
+ $sendReport,
+ string $contentType = self::contentTypes['sendReport'][0]
+ ): Request
{
+
// verify the required parameter 'campaignId' is set
if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $campaignId when calling sendReport'
);
}
+
// verify the required parameter 'sendReport' is set
if ($sendReport === null || (is_array($sendReport) && count($sendReport) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $sendReport when calling sendReport'
);
}
+
$resourcePath = '/emailCampaigns/{campaignId}/sendReport';
$formParams = [];
$queryParams = [];
@@ -2633,6 +3474,7 @@ protected function sendReportRequest($campaignId, $sendReport)
$multipart = false;
+
// path params
if ($campaignId !== null) {
$resourcePath = str_replace(
@@ -2642,56 +3484,42 @@ protected function sendReportRequest($campaignId, $sendReport)
);
}
- // body params
- $_tempBody = null;
- if (isset($sendReport)) {
- $_tempBody = $sendReport;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($sendReport)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($sendReport));
+ } else {
+ $httpBody = $sendReport;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -2717,10 +3545,11 @@ protected function sendReportRequest($campaignId, $sendReport)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -2732,15 +3561,20 @@ protected function sendReportRequest($campaignId, $sendReport)
* Send an email campaign to your test list
*
* @param int $campaignId Id of the campaign (required)
- * @param \Brevo\Client\Model\SendTestEmail $emailTo emailTo (required)
+ * @param \Brevo\Client\Models\SendTestEmail $sendTestEmail sendTestEmail (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTestEmail'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function sendTestEmail($campaignId, $emailTo)
+ public function sendTestEmail(
+ int $campaignId,
+ \Brevo\Client\Models\SendTestEmail $sendTestEmail,
+ string $contentType = self::contentTypes['sendTestEmail'][0]
+ ): void
{
- $this->sendTestEmailWithHttpInfo($campaignId, $emailTo);
+ $this->sendTestEmailWithHttpInfo($campaignId, $sendTestEmail, $contentType);
}
/**
@@ -2749,16 +3583,20 @@ public function sendTestEmail($campaignId, $emailTo)
* Send an email campaign to your test list
*
* @param int $campaignId Id of the campaign (required)
- * @param \Brevo\Client\Model\SendTestEmail $emailTo (required)
+ * @param \Brevo\Client\Models\SendTestEmail $sendTestEmail (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTestEmail'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function sendTestEmailWithHttpInfo($campaignId, $emailTo)
+ public function sendTestEmailWithHttpInfo(
+ int $campaignId,
+ \Brevo\Client\Models\SendTestEmail $sendTestEmail,
+ string $contentType = self::contentTypes['sendTestEmail'][0]
+ ): array
{
- $returnType = '';
- $request = $this->sendTestEmailRequest($campaignId, $emailTo);
+ $request = $this->sendTestEmailRequest($campaignId, $sendTestEmail, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -2767,26 +3605,21 @@ public function sendTestEmailWithHttpInfo($campaignId, $emailTo)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -2795,7 +3628,7 @@ public function sendTestEmailWithHttpInfo($campaignId, $emailTo)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\PostSendFailed',
+ '\Brevo\Client\Models\PostSendFailed',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2803,7 +3636,7 @@ public function sendTestEmailWithHttpInfo($campaignId, $emailTo)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\PostSendFailed',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2819,14 +3652,19 @@ public function sendTestEmailWithHttpInfo($campaignId, $emailTo)
* Send an email campaign to your test list
*
* @param int $campaignId Id of the campaign (required)
- * @param \Brevo\Client\Model\SendTestEmail $emailTo (required)
+ * @param \Brevo\Client\Models\SendTestEmail $sendTestEmail (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTestEmail'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function sendTestEmailAsync($campaignId, $emailTo)
+ public function sendTestEmailAsync(
+ int $campaignId,
+ \Brevo\Client\Models\SendTestEmail $sendTestEmail,
+ string $contentType = self::contentTypes['sendTestEmail'][0]
+ ): PromiseInterface
{
- return $this->sendTestEmailAsyncWithHttpInfo($campaignId, $emailTo)
+ return $this->sendTestEmailAsyncWithHttpInfo($campaignId, $sendTestEmail, $contentType)
->then(
function ($response) {
return $response[0];
@@ -2840,15 +3678,21 @@ function ($response) {
* Send an email campaign to your test list
*
* @param int $campaignId Id of the campaign (required)
- * @param \Brevo\Client\Model\SendTestEmail $emailTo (required)
+ * @param \Brevo\Client\Models\SendTestEmail $sendTestEmail (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTestEmail'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function sendTestEmailAsyncWithHttpInfo($campaignId, $emailTo)
+ public function sendTestEmailAsyncWithHttpInfo(
+ $campaignId,
+ $sendTestEmail,
+ string $contentType = self::contentTypes['sendTestEmail'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->sendTestEmailRequest($campaignId, $emailTo);
+ $request = $this->sendTestEmailRequest($campaignId, $sendTestEmail, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -2867,7 +3711,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -2877,26 +3721,34 @@ function ($exception) {
* Create request for operation 'sendTestEmail'
*
* @param int $campaignId Id of the campaign (required)
- * @param \Brevo\Client\Model\SendTestEmail $emailTo (required)
+ * @param \Brevo\Client\Models\SendTestEmail $sendTestEmail (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTestEmail'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function sendTestEmailRequest($campaignId, $emailTo)
+ public function sendTestEmailRequest(
+ $campaignId,
+ $sendTestEmail,
+ string $contentType = self::contentTypes['sendTestEmail'][0]
+ ): Request
{
+
// verify the required parameter 'campaignId' is set
if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $campaignId when calling sendTestEmail'
);
}
- // verify the required parameter 'emailTo' is set
- if ($emailTo === null || (is_array($emailTo) && count($emailTo) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $emailTo when calling sendTestEmail'
+
+ // verify the required parameter 'sendTestEmail' is set
+ if ($sendTestEmail === null || (is_array($sendTestEmail) && count($sendTestEmail) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $sendTestEmail when calling sendTestEmail'
);
}
+
$resourcePath = '/emailCampaigns/{campaignId}/sendTest';
$formParams = [];
$queryParams = [];
@@ -2905,6 +3757,7 @@ protected function sendTestEmailRequest($campaignId, $emailTo)
$multipart = false;
+
// path params
if ($campaignId !== null) {
$resourcePath = str_replace(
@@ -2914,56 +3767,42 @@ protected function sendTestEmailRequest($campaignId, $emailTo)
);
}
- // body params
- $_tempBody = null;
- if (isset($emailTo)) {
- $_tempBody = $emailTo;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($sendTestEmail)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($sendTestEmail));
+ } else {
+ $httpBody = $sendTestEmail;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -2989,10 +3828,11 @@ protected function sendTestEmailRequest($campaignId, $emailTo)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -3004,15 +3844,20 @@ protected function sendTestEmailRequest($campaignId, $emailTo)
* Update an email campaign status
*
* @param int $campaignId Id of the campaign (required)
- * @param \Brevo\Client\Model\UpdateCampaignStatus $status Status of the campaign (required)
+ * @param \Brevo\Client\Models\UpdateCampaignStatus $updateCampaignStatus Status of the campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignStatus'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function updateCampaignStatus($campaignId, $status)
+ public function updateCampaignStatus(
+ int $campaignId,
+ \Brevo\Client\Models\UpdateCampaignStatus $updateCampaignStatus,
+ string $contentType = self::contentTypes['updateCampaignStatus'][0]
+ ): void
{
- $this->updateCampaignStatusWithHttpInfo($campaignId, $status);
+ $this->updateCampaignStatusWithHttpInfo($campaignId, $updateCampaignStatus, $contentType);
}
/**
@@ -3021,16 +3866,20 @@ public function updateCampaignStatus($campaignId, $status)
* Update an email campaign status
*
* @param int $campaignId Id of the campaign (required)
- * @param \Brevo\Client\Model\UpdateCampaignStatus $status Status of the campaign (required)
+ * @param \Brevo\Client\Models\UpdateCampaignStatus $updateCampaignStatus Status of the campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignStatus'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function updateCampaignStatusWithHttpInfo($campaignId, $status)
+ public function updateCampaignStatusWithHttpInfo(
+ int $campaignId,
+ \Brevo\Client\Models\UpdateCampaignStatus $updateCampaignStatus,
+ string $contentType = self::contentTypes['updateCampaignStatus'][0]
+ ): array
{
- $returnType = '';
- $request = $this->updateCampaignStatusRequest($campaignId, $status);
+ $request = $this->updateCampaignStatusRequest($campaignId, $updateCampaignStatus, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -3039,26 +3888,21 @@ public function updateCampaignStatusWithHttpInfo($campaignId, $status)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -3067,7 +3911,7 @@ public function updateCampaignStatusWithHttpInfo($campaignId, $status)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -3075,7 +3919,7 @@ public function updateCampaignStatusWithHttpInfo($campaignId, $status)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -3091,14 +3935,19 @@ public function updateCampaignStatusWithHttpInfo($campaignId, $status)
* Update an email campaign status
*
* @param int $campaignId Id of the campaign (required)
- * @param \Brevo\Client\Model\UpdateCampaignStatus $status Status of the campaign (required)
+ * @param \Brevo\Client\Models\UpdateCampaignStatus $updateCampaignStatus Status of the campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignStatus'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function updateCampaignStatusAsync($campaignId, $status)
+ public function updateCampaignStatusAsync(
+ int $campaignId,
+ \Brevo\Client\Models\UpdateCampaignStatus $updateCampaignStatus,
+ string $contentType = self::contentTypes['updateCampaignStatus'][0]
+ ): PromiseInterface
{
- return $this->updateCampaignStatusAsyncWithHttpInfo($campaignId, $status)
+ return $this->updateCampaignStatusAsyncWithHttpInfo($campaignId, $updateCampaignStatus, $contentType)
->then(
function ($response) {
return $response[0];
@@ -3112,15 +3961,21 @@ function ($response) {
* Update an email campaign status
*
* @param int $campaignId Id of the campaign (required)
- * @param \Brevo\Client\Model\UpdateCampaignStatus $status Status of the campaign (required)
+ * @param \Brevo\Client\Models\UpdateCampaignStatus $updateCampaignStatus Status of the campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignStatus'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function updateCampaignStatusAsyncWithHttpInfo($campaignId, $status)
+ public function updateCampaignStatusAsyncWithHttpInfo(
+ $campaignId,
+ $updateCampaignStatus,
+ string $contentType = self::contentTypes['updateCampaignStatus'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->updateCampaignStatusRequest($campaignId, $status);
+ $request = $this->updateCampaignStatusRequest($campaignId, $updateCampaignStatus, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -3139,7 +3994,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -3149,26 +4004,34 @@ function ($exception) {
* Create request for operation 'updateCampaignStatus'
*
* @param int $campaignId Id of the campaign (required)
- * @param \Brevo\Client\Model\UpdateCampaignStatus $status Status of the campaign (required)
+ * @param \Brevo\Client\Models\UpdateCampaignStatus $updateCampaignStatus Status of the campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignStatus'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function updateCampaignStatusRequest($campaignId, $status)
+ public function updateCampaignStatusRequest(
+ $campaignId,
+ $updateCampaignStatus,
+ string $contentType = self::contentTypes['updateCampaignStatus'][0]
+ ): Request
{
+
// verify the required parameter 'campaignId' is set
if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $campaignId when calling updateCampaignStatus'
);
}
- // verify the required parameter 'status' is set
- if ($status === null || (is_array($status) && count($status) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $status when calling updateCampaignStatus'
+
+ // verify the required parameter 'updateCampaignStatus' is set
+ if ($updateCampaignStatus === null || (is_array($updateCampaignStatus) && count($updateCampaignStatus) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $updateCampaignStatus when calling updateCampaignStatus'
);
}
+
$resourcePath = '/emailCampaigns/{campaignId}/status';
$formParams = [];
$queryParams = [];
@@ -3177,6 +4040,7 @@ protected function updateCampaignStatusRequest($campaignId, $status)
$multipart = false;
+
// path params
if ($campaignId !== null) {
$resourcePath = str_replace(
@@ -3186,56 +4050,42 @@ protected function updateCampaignStatusRequest($campaignId, $status)
);
}
- // body params
- $_tempBody = null;
- if (isset($status)) {
- $_tempBody = $status;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($updateCampaignStatus)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($updateCampaignStatus));
+ } else {
+ $httpBody = $updateCampaignStatus;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -3261,10 +4111,11 @@ protected function updateCampaignStatusRequest($campaignId, $status)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'PUT',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -3276,15 +4127,20 @@ protected function updateCampaignStatusRequest($campaignId, $status)
* Update an email campaign
*
* @param int $campaignId Id of the campaign (required)
- * @param \Brevo\Client\Model\UpdateEmailCampaign $emailCampaign Values to update a campaign (required)
+ * @param \Brevo\Client\Models\UpdateEmailCampaign $updateEmailCampaign Values to update a campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmailCampaign'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function updateEmailCampaign($campaignId, $emailCampaign)
+ public function updateEmailCampaign(
+ int $campaignId,
+ \Brevo\Client\Models\UpdateEmailCampaign $updateEmailCampaign,
+ string $contentType = self::contentTypes['updateEmailCampaign'][0]
+ ): void
{
- $this->updateEmailCampaignWithHttpInfo($campaignId, $emailCampaign);
+ $this->updateEmailCampaignWithHttpInfo($campaignId, $updateEmailCampaign, $contentType);
}
/**
@@ -3293,16 +4149,20 @@ public function updateEmailCampaign($campaignId, $emailCampaign)
* Update an email campaign
*
* @param int $campaignId Id of the campaign (required)
- * @param \Brevo\Client\Model\UpdateEmailCampaign $emailCampaign Values to update a campaign (required)
+ * @param \Brevo\Client\Models\UpdateEmailCampaign $updateEmailCampaign Values to update a campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmailCampaign'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function updateEmailCampaignWithHttpInfo($campaignId, $emailCampaign)
+ public function updateEmailCampaignWithHttpInfo(
+ int $campaignId,
+ \Brevo\Client\Models\UpdateEmailCampaign $updateEmailCampaign,
+ string $contentType = self::contentTypes['updateEmailCampaign'][0]
+ ): array
{
- $returnType = '';
- $request = $this->updateEmailCampaignRequest($campaignId, $emailCampaign);
+ $request = $this->updateEmailCampaignRequest($campaignId, $updateEmailCampaign, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -3311,26 +4171,21 @@ public function updateEmailCampaignWithHttpInfo($campaignId, $emailCampaign)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -3339,7 +4194,7 @@ public function updateEmailCampaignWithHttpInfo($campaignId, $emailCampaign)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -3347,7 +4202,7 @@ public function updateEmailCampaignWithHttpInfo($campaignId, $emailCampaign)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -3363,14 +4218,19 @@ public function updateEmailCampaignWithHttpInfo($campaignId, $emailCampaign)
* Update an email campaign
*
* @param int $campaignId Id of the campaign (required)
- * @param \Brevo\Client\Model\UpdateEmailCampaign $emailCampaign Values to update a campaign (required)
+ * @param \Brevo\Client\Models\UpdateEmailCampaign $updateEmailCampaign Values to update a campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmailCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function updateEmailCampaignAsync($campaignId, $emailCampaign)
+ public function updateEmailCampaignAsync(
+ int $campaignId,
+ \Brevo\Client\Models\UpdateEmailCampaign $updateEmailCampaign,
+ string $contentType = self::contentTypes['updateEmailCampaign'][0]
+ ): PromiseInterface
{
- return $this->updateEmailCampaignAsyncWithHttpInfo($campaignId, $emailCampaign)
+ return $this->updateEmailCampaignAsyncWithHttpInfo($campaignId, $updateEmailCampaign, $contentType)
->then(
function ($response) {
return $response[0];
@@ -3384,15 +4244,21 @@ function ($response) {
* Update an email campaign
*
* @param int $campaignId Id of the campaign (required)
- * @param \Brevo\Client\Model\UpdateEmailCampaign $emailCampaign Values to update a campaign (required)
+ * @param \Brevo\Client\Models\UpdateEmailCampaign $updateEmailCampaign Values to update a campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmailCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function updateEmailCampaignAsyncWithHttpInfo($campaignId, $emailCampaign)
+ public function updateEmailCampaignAsyncWithHttpInfo(
+ $campaignId,
+ $updateEmailCampaign,
+ string $contentType = self::contentTypes['updateEmailCampaign'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->updateEmailCampaignRequest($campaignId, $emailCampaign);
+ $request = $this->updateEmailCampaignRequest($campaignId, $updateEmailCampaign, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -3411,7 +4277,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -3421,26 +4287,34 @@ function ($exception) {
* Create request for operation 'updateEmailCampaign'
*
* @param int $campaignId Id of the campaign (required)
- * @param \Brevo\Client\Model\UpdateEmailCampaign $emailCampaign Values to update a campaign (required)
+ * @param \Brevo\Client\Models\UpdateEmailCampaign $updateEmailCampaign Values to update a campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmailCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function updateEmailCampaignRequest($campaignId, $emailCampaign)
+ public function updateEmailCampaignRequest(
+ $campaignId,
+ $updateEmailCampaign,
+ string $contentType = self::contentTypes['updateEmailCampaign'][0]
+ ): Request
{
+
// verify the required parameter 'campaignId' is set
if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $campaignId when calling updateEmailCampaign'
);
}
- // verify the required parameter 'emailCampaign' is set
- if ($emailCampaign === null || (is_array($emailCampaign) && count($emailCampaign) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $emailCampaign when calling updateEmailCampaign'
+
+ // verify the required parameter 'updateEmailCampaign' is set
+ if ($updateEmailCampaign === null || (is_array($updateEmailCampaign) && count($updateEmailCampaign) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $updateEmailCampaign when calling updateEmailCampaign'
);
}
+
$resourcePath = '/emailCampaigns/{campaignId}';
$formParams = [];
$queryParams = [];
@@ -3449,6 +4323,7 @@ protected function updateEmailCampaignRequest($campaignId, $emailCampaign)
$multipart = false;
+
// path params
if ($campaignId !== null) {
$resourcePath = str_replace(
@@ -3458,56 +4333,42 @@ protected function updateEmailCampaignRequest($campaignId, $emailCampaign)
);
}
- // body params
- $_tempBody = null;
- if (isset($emailCampaign)) {
- $_tempBody = $emailCampaign;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($updateEmailCampaign)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($updateEmailCampaign));
+ } else {
+ $httpBody = $updateEmailCampaign;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -3533,10 +4394,11 @@ protected function updateEmailCampaignRequest($campaignId, $emailCampaign)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'PUT',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -3545,35 +4407,42 @@ protected function updateEmailCampaignRequest($campaignId, $emailCampaign)
/**
* Operation uploadImageToGallery
*
- * Upload an image to your account's image gallery
+ * Upload an image to your account's image gallery
*
- * @param \Brevo\Client\Model\UploadImageToGallery $uploadImage Parameters to upload an image (required)
+ * @param \Brevo\Client\Models\UploadImageToGallery $uploadImageToGallery Parameters to upload an image (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadImageToGallery'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\UploadImageModel
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\UploadImageModel|\Brevo\Client\Models\ErrorModel
*/
- public function uploadImageToGallery($uploadImage)
+ public function uploadImageToGallery(
+ \Brevo\Client\Models\UploadImageToGallery $uploadImageToGallery,
+ string $contentType = self::contentTypes['uploadImageToGallery'][0]
+ ): \Brevo\Client\Models\UploadImageModel
{
- list($response) = $this->uploadImageToGalleryWithHttpInfo($uploadImage);
+ list($response) = $this->uploadImageToGalleryWithHttpInfo($uploadImageToGallery, $contentType);
return $response;
}
/**
* Operation uploadImageToGalleryWithHttpInfo
*
- * Upload an image to your account's image gallery
+ * Upload an image to your account's image gallery
*
- * @param \Brevo\Client\Model\UploadImageToGallery $uploadImage Parameters to upload an image (required)
+ * @param \Brevo\Client\Models\UploadImageToGallery $uploadImageToGallery Parameters to upload an image (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadImageToGallery'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\UploadImageModel, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\UploadImageModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function uploadImageToGalleryWithHttpInfo($uploadImage)
+ public function uploadImageToGalleryWithHttpInfo(
+ \Brevo\Client\Models\UploadImageToGallery $uploadImageToGallery,
+ string $contentType = self::contentTypes['uploadImageToGallery'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\UploadImageModel';
- $request = $this->uploadImageToGalleryRequest($uploadImage);
+ $request = $this->uploadImageToGalleryRequest($uploadImageToGallery, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -3582,34 +4451,111 @@ public function uploadImageToGalleryWithHttpInfo($uploadImage)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 201:
+ if (in_array('\Brevo\Client\Models\UploadImageModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\UploadImageModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\UploadImageModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\UploadImageModel';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -3624,7 +4570,7 @@ public function uploadImageToGalleryWithHttpInfo($uploadImage)
case 201:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\UploadImageModel',
+ '\Brevo\Client\Models\UploadImageModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -3632,7 +4578,7 @@ public function uploadImageToGalleryWithHttpInfo($uploadImage)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -3645,16 +4591,20 @@ public function uploadImageToGalleryWithHttpInfo($uploadImage)
/**
* Operation uploadImageToGalleryAsync
*
- * Upload an image to your account's image gallery
+ * Upload an image to your account's image gallery
*
- * @param \Brevo\Client\Model\UploadImageToGallery $uploadImage Parameters to upload an image (required)
+ * @param \Brevo\Client\Models\UploadImageToGallery $uploadImageToGallery Parameters to upload an image (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadImageToGallery'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function uploadImageToGalleryAsync($uploadImage)
+ public function uploadImageToGalleryAsync(
+ \Brevo\Client\Models\UploadImageToGallery $uploadImageToGallery,
+ string $contentType = self::contentTypes['uploadImageToGallery'][0]
+ ): PromiseInterface
{
- return $this->uploadImageToGalleryAsyncWithHttpInfo($uploadImage)
+ return $this->uploadImageToGalleryAsyncWithHttpInfo($uploadImageToGallery, $contentType)
->then(
function ($response) {
return $response[0];
@@ -3665,27 +4615,31 @@ function ($response) {
/**
* Operation uploadImageToGalleryAsyncWithHttpInfo
*
- * Upload an image to your account's image gallery
+ * Upload an image to your account's image gallery
*
- * @param \Brevo\Client\Model\UploadImageToGallery $uploadImage Parameters to upload an image (required)
+ * @param \Brevo\Client\Models\UploadImageToGallery $uploadImageToGallery Parameters to upload an image (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadImageToGallery'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function uploadImageToGalleryAsyncWithHttpInfo($uploadImage)
+ public function uploadImageToGalleryAsyncWithHttpInfo(
+ $uploadImageToGallery,
+ string $contentType = self::contentTypes['uploadImageToGallery'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\UploadImageModel';
- $request = $this->uploadImageToGalleryRequest($uploadImage);
+ $returnType = '\Brevo\Client\Models\UploadImageModel';
+ $request = $this->uploadImageToGalleryRequest($uploadImageToGallery, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -3708,7 +4662,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -3717,20 +4671,26 @@ function ($exception) {
/**
* Create request for operation 'uploadImageToGallery'
*
- * @param \Brevo\Client\Model\UploadImageToGallery $uploadImage Parameters to upload an image (required)
+ * @param \Brevo\Client\Models\UploadImageToGallery $uploadImageToGallery Parameters to upload an image (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadImageToGallery'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function uploadImageToGalleryRequest($uploadImage)
+ public function uploadImageToGalleryRequest(
+ $uploadImageToGallery,
+ string $contentType = self::contentTypes['uploadImageToGallery'][0]
+ ): Request
{
- // verify the required parameter 'uploadImage' is set
- if ($uploadImage === null || (is_array($uploadImage) && count($uploadImage) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $uploadImage when calling uploadImageToGallery'
+
+ // verify the required parameter 'uploadImageToGallery' is set
+ if ($uploadImageToGallery === null || (is_array($uploadImageToGallery) && count($uploadImageToGallery) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $uploadImageToGallery when calling uploadImageToGallery'
);
}
+
$resourcePath = '/emailCampaigns/images';
$formParams = [];
$queryParams = [];
@@ -3740,56 +4700,43 @@ protected function uploadImageToGalleryRequest($uploadImage)
- // body params
- $_tempBody = null;
- if (isset($uploadImage)) {
- $_tempBody = $uploadImage;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($uploadImageToGallery)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($uploadImageToGallery));
+ } else {
+ $httpBody = $uploadImageToGallery;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -3815,10 +4762,11 @@ protected function uploadImageToGalleryRequest($uploadImage)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -3830,7 +4778,7 @@ protected function uploadImageToGalleryRequest($uploadImage)
* @throws \RuntimeException on file opening failure
* @return array of http client options
*/
- protected function createHttpClientOption()
+ protected function createHttpClientOption(): array
{
$options = [];
if ($this->config->getDebug()) {
diff --git a/lib/Api/EventApi.php b/lib/Api/EventApi.php
new file mode 100644
index 0000000..d9c4c66
--- /dev/null
+++ b/lib/Api/EventApi.php
@@ -0,0 +1,402 @@
+ [
+ 'application/json',
+ ],
+ ];
+
+ /**
+ * @param ClientInterface|null $client
+ * @param Configuration|null $config
+ * @param HeaderSelector|null $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(int $hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex(): int
+ {
+ return $this->hostIndex;
+ }
+
+ /**
+ * @return Configuration
+ */
+ public function getConfig(): Configuration
+ {
+ return $this->config;
+ }
+
+ /**
+ * Operation createEvent
+ *
+ * Create an event
+ *
+ * @param \Brevo\Client\Models\Event $event event (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEvent'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return void
+ */
+ public function createEvent(
+ \Brevo\Client\Models\Event $event,
+ string $contentType = self::contentTypes['createEvent'][0]
+ ): void
+ {
+ $this->createEventWithHttpInfo($event, $contentType);
+ }
+
+ /**
+ * Operation createEventWithHttpInfo
+ *
+ * Create an event
+ *
+ * @param \Brevo\Client\Models\Event $event (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEvent'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function createEventWithHttpInfo(
+ \Brevo\Client\Models\Event $event,
+ string $contentType = self::contentTypes['createEvent'][0]
+ ): array
+ {
+ $request = $this->createEventRequest($event, $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();
+
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation createEventAsync
+ *
+ * Create an event
+ *
+ * @param \Brevo\Client\Models\Event $event (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEvent'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function createEventAsync(
+ \Brevo\Client\Models\Event $event,
+ string $contentType = self::contentTypes['createEvent'][0]
+ ): PromiseInterface
+ {
+ return $this->createEventAsyncWithHttpInfo($event, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation createEventAsyncWithHttpInfo
+ *
+ * Create an event
+ *
+ * @param \Brevo\Client\Models\Event $event (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEvent'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function createEventAsyncWithHttpInfo(
+ $event,
+ string $contentType = self::contentTypes['createEvent'][0]
+ ): PromiseInterface
+ {
+ $returnType = '';
+ $request = $this->createEventRequest($event, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $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 'createEvent'
+ *
+ * @param \Brevo\Client\Models\Event $event (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEvent'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function createEventRequest(
+ $event,
+ string $contentType = self::contentTypes['createEvent'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'event' is set
+ if ($event === null || (is_array($event) && count($event) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $event when calling createEvent'
+ );
+ }
+
+
+ $resourcePath = '/events';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($event)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($event));
+ } else {
+ $httpBody = $event;
+ }
+ } 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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
+ );
+ }
+
+ /**
+ * Create http client option
+ *
+ * @throws \RuntimeException on file opening failure
+ * @return array of http client options
+ */
+ protected function createHttpClientOption(): array
+ {
+ $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/EventsApi.php b/lib/Api/EventsApi.php
deleted file mode 100644
index 88a81c4..0000000
--- a/lib/Api/EventsApi.php
+++ /dev/null
@@ -1,361 +0,0 @@
-client = $client ?: new Client();
- $this->config = $config ?: new Configuration();
- $this->headerSelector = $selector ?: new HeaderSelector();
- }
-
- /**
- * @return Configuration
- */
- public function getConfig()
- {
- return $this->config;
- }
-
- /**
- * Operation createEvent
- *
- * Create an event
- *
- * @param \Brevo\Client\Model\Event $event event (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return void
- */
- public function createEvent($event)
- {
- $this->createEventWithHttpInfo($event);
- }
-
- /**
- * Operation createEventWithHttpInfo
- *
- * Create an event
- *
- * @param \Brevo\Client\Model\Event $event (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of null, HTTP status code, HTTP response headers (array of strings)
- */
- public function createEventWithHttpInfo($event)
- {
- $returnType = '';
- $request = $this->createEventRequest($event);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- return [null, $statusCode, $response->getHeaders()];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 401:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation createEventAsync
- *
- * Create an event
- *
- * @param \Brevo\Client\Model\Event $event (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function createEventAsync($event)
- {
- return $this->createEventAsyncWithHttpInfo($event)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation createEventAsyncWithHttpInfo
- *
- * Create an event
- *
- * @param \Brevo\Client\Model\Event $event (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function createEventAsyncWithHttpInfo($event)
- {
- $returnType = '';
- $request = $this->createEventRequest($event);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- return [null, $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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'createEvent'
- *
- * @param \Brevo\Client\Model\Event $event (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function createEventRequest($event)
- {
- // verify the required parameter 'event' is set
- if ($event === null || (is_array($event) && count($event) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $event when calling createEvent'
- );
- }
-
- $resourcePath = '/events';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
-
- // body params
- $_tempBody = null;
- if (isset($event)) {
- $_tempBody = $event;
- }
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'POST',
- $this->config->getHost() . $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/ExternalFeedsApi.php b/lib/Api/ExternalFeedsApi.php
index 3970d76..e91800a 100644
--- a/lib/Api/ExternalFeedsApi.php
+++ b/lib/Api/ExternalFeedsApi.php
@@ -1,39 +1,41 @@
[
+ 'application/json',
+ ],
+ 'deleteExternalFeed' => [
+ 'application/json',
+ ],
+ 'getAllExternalFeeds' => [
+ 'application/json',
+ ],
+ 'getExternalFeedByUUID' => [
+ 'application/json',
+ ],
+ 'updateExternalFeed' => [
+ 'application/json',
+ ],
+ ];
+
+ /**
+ * @param ClientInterface|null $client
+ * @param Configuration|null $config
+ * @param HeaderSelector|null $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
+ HeaderSelector $selector = null,
+ int $hostIndex = 0
) {
$this->client = $client ?: new Client();
- $this->config = $config ?: new Configuration();
+ $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(int $hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex(): int
+ {
+ return $this->hostIndex;
}
/**
* @return Configuration
*/
- public function getConfig()
+ public function getConfig(): Configuration
{
return $this->config;
}
@@ -92,15 +140,19 @@ public function getConfig()
*
* Create an external feed
*
- * @param \Brevo\Client\Model\CreateExternalFeed $createExternalFeed Values to create a feed (required)
+ * @param \Brevo\Client\Models\CreateExternalFeed $createExternalFeed Values to create a feed (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createExternalFeed'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\InlineResponse2015
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CreateExternalFeed201Response|\Brevo\Client\Models\ErrorModel
*/
- public function createExternalFeed($createExternalFeed)
+ public function createExternalFeed(
+ \Brevo\Client\Models\CreateExternalFeed $createExternalFeed,
+ string $contentType = self::contentTypes['createExternalFeed'][0]
+ ): \Brevo\Client\Models\CreateExternalFeed201Response
{
- list($response) = $this->createExternalFeedWithHttpInfo($createExternalFeed);
+ list($response) = $this->createExternalFeedWithHttpInfo($createExternalFeed, $contentType);
return $response;
}
@@ -109,16 +161,19 @@ public function createExternalFeed($createExternalFeed)
*
* Create an external feed
*
- * @param \Brevo\Client\Model\CreateExternalFeed $createExternalFeed Values to create a feed (required)
+ * @param \Brevo\Client\Models\CreateExternalFeed $createExternalFeed Values to create a feed (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createExternalFeed'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\InlineResponse2015, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CreateExternalFeed201Response|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function createExternalFeedWithHttpInfo($createExternalFeed)
+ public function createExternalFeedWithHttpInfo(
+ \Brevo\Client\Models\CreateExternalFeed $createExternalFeed,
+ string $contentType = self::contentTypes['createExternalFeed'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\InlineResponse2015';
- $request = $this->createExternalFeedRequest($createExternalFeed);
+ $request = $this->createExternalFeedRequest($createExternalFeed, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -127,34 +182,111 @@ public function createExternalFeedWithHttpInfo($createExternalFeed)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 201:
+ if (in_array('\Brevo\Client\Models\CreateExternalFeed201Response', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CreateExternalFeed201Response' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CreateExternalFeed201Response', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CreateExternalFeed201Response';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -169,7 +301,7 @@ public function createExternalFeedWithHttpInfo($createExternalFeed)
case 201:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\InlineResponse2015',
+ '\Brevo\Client\Models\CreateExternalFeed201Response',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -177,7 +309,7 @@ public function createExternalFeedWithHttpInfo($createExternalFeed)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -192,14 +324,18 @@ public function createExternalFeedWithHttpInfo($createExternalFeed)
*
* Create an external feed
*
- * @param \Brevo\Client\Model\CreateExternalFeed $createExternalFeed Values to create a feed (required)
+ * @param \Brevo\Client\Models\CreateExternalFeed $createExternalFeed Values to create a feed (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createExternalFeed'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createExternalFeedAsync($createExternalFeed)
+ public function createExternalFeedAsync(
+ \Brevo\Client\Models\CreateExternalFeed $createExternalFeed,
+ string $contentType = self::contentTypes['createExternalFeed'][0]
+ ): PromiseInterface
{
- return $this->createExternalFeedAsyncWithHttpInfo($createExternalFeed)
+ return $this->createExternalFeedAsyncWithHttpInfo($createExternalFeed, $contentType)
->then(
function ($response) {
return $response[0];
@@ -212,25 +348,29 @@ function ($response) {
*
* Create an external feed
*
- * @param \Brevo\Client\Model\CreateExternalFeed $createExternalFeed Values to create a feed (required)
+ * @param \Brevo\Client\Models\CreateExternalFeed $createExternalFeed Values to create a feed (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createExternalFeed'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createExternalFeedAsyncWithHttpInfo($createExternalFeed)
+ public function createExternalFeedAsyncWithHttpInfo(
+ $createExternalFeed,
+ string $contentType = self::contentTypes['createExternalFeed'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\InlineResponse2015';
- $request = $this->createExternalFeedRequest($createExternalFeed);
+ $returnType = '\Brevo\Client\Models\CreateExternalFeed201Response';
+ $request = $this->createExternalFeedRequest($createExternalFeed, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -253,7 +393,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -262,20 +402,26 @@ function ($exception) {
/**
* Create request for operation 'createExternalFeed'
*
- * @param \Brevo\Client\Model\CreateExternalFeed $createExternalFeed Values to create a feed (required)
+ * @param \Brevo\Client\Models\CreateExternalFeed $createExternalFeed Values to create a feed (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createExternalFeed'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function createExternalFeedRequest($createExternalFeed)
+ public function createExternalFeedRequest(
+ $createExternalFeed,
+ string $contentType = self::contentTypes['createExternalFeed'][0]
+ ): Request
{
+
// verify the required parameter 'createExternalFeed' is set
if ($createExternalFeed === null || (is_array($createExternalFeed) && count($createExternalFeed) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $createExternalFeed when calling createExternalFeed'
);
}
+
$resourcePath = '/feeds';
$formParams = [];
$queryParams = [];
@@ -285,56 +431,43 @@ protected function createExternalFeedRequest($createExternalFeed)
- // body params
- $_tempBody = null;
- if (isset($createExternalFeed)) {
- $_tempBody = $createExternalFeed;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($createExternalFeed)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createExternalFeed));
+ } else {
+ $httpBody = $createExternalFeed;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -360,10 +493,11 @@ protected function createExternalFeedRequest($createExternalFeed)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -375,14 +509,18 @@ protected function createExternalFeedRequest($createExternalFeed)
* Delete an external feed
*
* @param string $uuid UUID of the feed to delete (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteExternalFeed'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function deleteExternalFeed($uuid)
+ public function deleteExternalFeed(
+ string $uuid,
+ string $contentType = self::contentTypes['deleteExternalFeed'][0]
+ ): void
{
- $this->deleteExternalFeedWithHttpInfo($uuid);
+ $this->deleteExternalFeedWithHttpInfo($uuid, $contentType);
}
/**
@@ -391,15 +529,18 @@ public function deleteExternalFeed($uuid)
* Delete an external feed
*
* @param string $uuid UUID of the feed to delete (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteExternalFeed'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function deleteExternalFeedWithHttpInfo($uuid)
+ public function deleteExternalFeedWithHttpInfo(
+ string $uuid,
+ string $contentType = self::contentTypes['deleteExternalFeed'][0]
+ ): array
{
- $returnType = '';
- $request = $this->deleteExternalFeedRequest($uuid);
+ $request = $this->deleteExternalFeedRequest($uuid, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -408,26 +549,21 @@ public function deleteExternalFeedWithHttpInfo($uuid)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -436,7 +572,7 @@ public function deleteExternalFeedWithHttpInfo($uuid)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -444,7 +580,7 @@ public function deleteExternalFeedWithHttpInfo($uuid)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -460,13 +596,17 @@ public function deleteExternalFeedWithHttpInfo($uuid)
* Delete an external feed
*
* @param string $uuid UUID of the feed to delete (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteExternalFeed'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteExternalFeedAsync($uuid)
+ public function deleteExternalFeedAsync(
+ string $uuid,
+ string $contentType = self::contentTypes['deleteExternalFeed'][0]
+ ): PromiseInterface
{
- return $this->deleteExternalFeedAsyncWithHttpInfo($uuid)
+ return $this->deleteExternalFeedAsyncWithHttpInfo($uuid, $contentType)
->then(
function ($response) {
return $response[0];
@@ -480,14 +620,19 @@ function ($response) {
* Delete an external feed
*
* @param string $uuid UUID of the feed to delete (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteExternalFeed'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteExternalFeedAsyncWithHttpInfo($uuid)
+ public function deleteExternalFeedAsyncWithHttpInfo(
+ $uuid,
+ string $contentType = self::contentTypes['deleteExternalFeed'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->deleteExternalFeedRequest($uuid);
+ $request = $this->deleteExternalFeedRequest($uuid, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -506,7 +651,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -516,19 +661,25 @@ function ($exception) {
* Create request for operation 'deleteExternalFeed'
*
* @param string $uuid UUID of the feed to delete (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteExternalFeed'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function deleteExternalFeedRequest($uuid)
+ public function deleteExternalFeedRequest(
+ $uuid,
+ string $contentType = self::contentTypes['deleteExternalFeed'][0]
+ ): Request
{
+
// verify the required parameter 'uuid' is set
if ($uuid === null || (is_array($uuid) && count($uuid) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $uuid when calling deleteExternalFeed'
);
}
+
$resourcePath = '/feeds/{uuid}';
$formParams = [];
$queryParams = [];
@@ -537,6 +688,7 @@ protected function deleteExternalFeedRequest($uuid)
$multipart = false;
+
// path params
if ($uuid !== null) {
$resourcePath = str_replace(
@@ -546,53 +698,35 @@ protected function deleteExternalFeedRequest($uuid)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -618,10 +752,11 @@ protected function deleteExternalFeedRequest($uuid)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -632,21 +767,31 @@ protected function deleteExternalFeedRequest($uuid)
*
* Fetch all external feeds
*
- * @param string $search Can be used to filter records by search keyword on feed name (optional)
- * @param \DateTime $startDate Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older than current date. (optional)
- * @param \DateTime $endDate Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed. (optional, default to desc)
- * @param string $authType Filter the records by `authType` of the feed. (optional)
- * @param int $limit Number of documents returned per page. (optional, default to 50)
- * @param int $offset Index of the first document on the page. (optional, default to 0)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetAllExternalFeeds
+ * @param string|null $search Can be used to filter records by search keyword on feed name (optional)
+ * @param \DateTime|null $startDate Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older than current date. (optional)
+ * @param \DateTime|null $endDate Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed. (optional, default to 'desc')
+ * @param string|null $authType Filter the records by `authType` of the feed. (optional)
+ * @param int|null $limit Number of documents returned per page. (optional, default to 50)
+ * @param int|null $offset Index of the first document on the page. (optional, default to 0)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllExternalFeeds'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetAllExternalFeeds|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function getAllExternalFeeds($search = null, $startDate = null, $endDate = null, $sort = 'desc', $authType = null, $limit = '50', $offset = '0')
+ public function getAllExternalFeeds(
+ ?string $search = null,
+ ?\DateTime $startDate = null,
+ ?\DateTime $endDate = null,
+ ?string $sort = 'desc',
+ ?string $authType = null,
+ ?int $limit = 50,
+ ?int $offset = 0,
+ string $contentType = self::contentTypes['getAllExternalFeeds'][0]
+ ): \Brevo\Client\Models\GetAllExternalFeeds
{
- list($response) = $this->getAllExternalFeedsWithHttpInfo($search, $startDate, $endDate, $sort, $authType, $limit, $offset);
+ list($response) = $this->getAllExternalFeedsWithHttpInfo($search, $startDate, $endDate, $sort, $authType, $limit, $offset, $contentType);
return $response;
}
@@ -655,22 +800,31 @@ public function getAllExternalFeeds($search = null, $startDate = null, $endDate
*
* Fetch all external feeds
*
- * @param string $search Can be used to filter records by search keyword on feed name (optional)
- * @param \DateTime $startDate Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older than current date. (optional)
- * @param \DateTime $endDate Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed. (optional, default to desc)
- * @param string $authType Filter the records by `authType` of the feed. (optional)
- * @param int $limit Number of documents returned per page. (optional, default to 50)
- * @param int $offset Index of the first document on the page. (optional, default to 0)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetAllExternalFeeds, HTTP status code, HTTP response headers (array of strings)
+ * @param string|null $search Can be used to filter records by search keyword on feed name (optional)
+ * @param \DateTime|null $startDate Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older than current date. (optional)
+ * @param \DateTime|null $endDate Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed. (optional, default to 'desc')
+ * @param string|null $authType Filter the records by `authType` of the feed. (optional)
+ * @param int|null $limit Number of documents returned per page. (optional, default to 50)
+ * @param int|null $offset Index of the first document on the page. (optional, default to 0)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllExternalFeeds'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetAllExternalFeeds|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getAllExternalFeedsWithHttpInfo($search = null, $startDate = null, $endDate = null, $sort = 'desc', $authType = null, $limit = '50', $offset = '0')
+ public function getAllExternalFeedsWithHttpInfo(
+ ?string $search = null,
+ ?\DateTime $startDate = null,
+ ?\DateTime $endDate = null,
+ ?string $sort = 'desc',
+ ?string $authType = null,
+ ?int $limit = 50,
+ ?int $offset = 0,
+ string $contentType = self::contentTypes['getAllExternalFeeds'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetAllExternalFeeds';
- $request = $this->getAllExternalFeedsRequest($search, $startDate, $endDate, $sort, $authType, $limit, $offset);
+ $request = $this->getAllExternalFeedsRequest($search, $startDate, $endDate, $sort, $authType, $limit, $offset, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -679,34 +833,138 @@ public function getAllExternalFeedsWithHttpInfo($search = null, $startDate = nul
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetAllExternalFeeds', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetAllExternalFeeds' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetAllExternalFeeds', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetAllExternalFeeds';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -721,7 +979,7 @@ public function getAllExternalFeedsWithHttpInfo($search = null, $startDate = nul
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetAllExternalFeeds',
+ '\Brevo\Client\Models\GetAllExternalFeeds',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -729,7 +987,7 @@ public function getAllExternalFeedsWithHttpInfo($search = null, $startDate = nul
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -737,7 +995,7 @@ public function getAllExternalFeedsWithHttpInfo($search = null, $startDate = nul
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -752,20 +1010,30 @@ public function getAllExternalFeedsWithHttpInfo($search = null, $startDate = nul
*
* Fetch all external feeds
*
- * @param string $search Can be used to filter records by search keyword on feed name (optional)
- * @param \DateTime $startDate Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older than current date. (optional)
- * @param \DateTime $endDate Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed. (optional, default to desc)
- * @param string $authType Filter the records by `authType` of the feed. (optional)
- * @param int $limit Number of documents returned per page. (optional, default to 50)
- * @param int $offset Index of the first document on the page. (optional, default to 0)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @param string|null $search Can be used to filter records by search keyword on feed name (optional)
+ * @param \DateTime|null $startDate Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older than current date. (optional)
+ * @param \DateTime|null $endDate Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed. (optional, default to 'desc')
+ * @param string|null $authType Filter the records by `authType` of the feed. (optional)
+ * @param int|null $limit Number of documents returned per page. (optional, default to 50)
+ * @param int|null $offset Index of the first document on the page. (optional, default to 0)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllExternalFeeds'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getAllExternalFeedsAsync($search = null, $startDate = null, $endDate = null, $sort = 'desc', $authType = null, $limit = '50', $offset = '0')
+ public function getAllExternalFeedsAsync(
+ ?string $search = null,
+ ?\DateTime $startDate = null,
+ ?\DateTime $endDate = null,
+ ?string $sort = 'desc',
+ ?string $authType = null,
+ ?int $limit = 50,
+ ?int $offset = 0,
+ string $contentType = self::contentTypes['getAllExternalFeeds'][0]
+ ): PromiseInterface
{
- return $this->getAllExternalFeedsAsyncWithHttpInfo($search, $startDate, $endDate, $sort, $authType, $limit, $offset)
+ return $this->getAllExternalFeedsAsyncWithHttpInfo($search, $startDate, $endDate, $sort, $authType, $limit, $offset, $contentType)
->then(
function ($response) {
return $response[0];
@@ -778,31 +1046,41 @@ function ($response) {
*
* Fetch all external feeds
*
- * @param string $search Can be used to filter records by search keyword on feed name (optional)
- * @param \DateTime $startDate Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older than current date. (optional)
- * @param \DateTime $endDate Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed. (optional, default to desc)
- * @param string $authType Filter the records by `authType` of the feed. (optional)
- * @param int $limit Number of documents returned per page. (optional, default to 50)
- * @param int $offset Index of the first document on the page. (optional, default to 0)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @param string|null $search Can be used to filter records by search keyword on feed name (optional)
+ * @param \DateTime|null $startDate Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older than current date. (optional)
+ * @param \DateTime|null $endDate Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed. (optional, default to 'desc')
+ * @param string|null $authType Filter the records by `authType` of the feed. (optional)
+ * @param int|null $limit Number of documents returned per page. (optional, default to 50)
+ * @param int|null $offset Index of the first document on the page. (optional, default to 0)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllExternalFeeds'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getAllExternalFeedsAsyncWithHttpInfo($search = null, $startDate = null, $endDate = null, $sort = 'desc', $authType = null, $limit = '50', $offset = '0')
+ public function getAllExternalFeedsAsyncWithHttpInfo(
+ $search = null,
+ $startDate = null,
+ $endDate = null,
+ $sort = 'desc',
+ $authType = null,
+ $limit = 50,
+ $offset = 0,
+ string $contentType = self::contentTypes['getAllExternalFeeds'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetAllExternalFeeds';
- $request = $this->getAllExternalFeedsRequest($search, $startDate, $endDate, $sort, $authType, $limit, $offset);
+ $returnType = '\Brevo\Client\Models\GetAllExternalFeeds';
+ $request = $this->getAllExternalFeedsRequest($search, $startDate, $endDate, $sort, $authType, $limit, $offset, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -825,7 +1103,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -834,25 +1112,42 @@ function ($exception) {
/**
* Create request for operation 'getAllExternalFeeds'
*
- * @param string $search Can be used to filter records by search keyword on feed name (optional)
- * @param \DateTime $startDate Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older than current date. (optional)
- * @param \DateTime $endDate Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed. (optional, default to desc)
- * @param string $authType Filter the records by `authType` of the feed. (optional)
- * @param int $limit Number of documents returned per page. (optional, default to 50)
- * @param int $offset Index of the first document on the page. (optional, default to 0)
+ * @param string|null $search Can be used to filter records by search keyword on feed name (optional)
+ * @param \DateTime|null $startDate Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older than current date. (optional)
+ * @param \DateTime|null $endDate Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed. (optional, default to 'desc')
+ * @param string|null $authType Filter the records by `authType` of the feed. (optional)
+ * @param int|null $limit Number of documents returned per page. (optional, default to 50)
+ * @param int|null $offset Index of the first document on the page. (optional, default to 0)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllExternalFeeds'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getAllExternalFeedsRequest($search = null, $startDate = null, $endDate = null, $sort = 'desc', $authType = null, $limit = '50', $offset = '0')
+ public function getAllExternalFeedsRequest(
+ $search = null,
+ $startDate = null,
+ $endDate = null,
+ $sort = 'desc',
+ $authType = null,
+ $limit = 50,
+ $offset = 0,
+ string $contentType = self::contentTypes['getAllExternalFeeds'][0]
+ ): Request
{
+
+
+
+
+
+
if ($limit !== null && $limit > 500) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling ExternalFeedsApi.getAllExternalFeeds, must be smaller than or equal to 500.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling ExternalFeedsApi.getAllExternalFeeds, must be smaller than or equal to 500.');
}
if ($limit !== null && $limit < 0) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling ExternalFeedsApi.getAllExternalFeeds, must be bigger than or equal to 0.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling ExternalFeedsApi.getAllExternalFeeds, must be bigger than or equal to 0.');
}
+
$resourcePath = '/feeds';
@@ -863,82 +1158,100 @@ protected function getAllExternalFeedsRequest($search = null, $startDate = null,
$multipart = false;
// query params
- if ($search !== null) {
- $queryParams['search'] = ObjectSerializer::toQueryValue($search);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $search,
+ 'search', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($startDate !== null) {
- $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $startDate,
+ 'startDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($endDate !== null) {
- $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $endDate,
+ 'endDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($authType !== null) {
- $queryParams['authType'] = ObjectSerializer::toQueryValue($authType);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $authType,
+ 'authType', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -964,10 +1277,11 @@ protected function getAllExternalFeedsRequest($search = null, $startDate = null,
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -979,14 +1293,18 @@ protected function getAllExternalFeedsRequest($search = null, $startDate = null,
* Get an external feed by UUID
*
* @param string $uuid UUID of the feed to fetch (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getExternalFeedByUUID'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetExternalFeedByUUID
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetExternalFeedByUUID|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function getExternalFeedByUUID($uuid)
+ public function getExternalFeedByUUID(
+ string $uuid,
+ string $contentType = self::contentTypes['getExternalFeedByUUID'][0]
+ ): \Brevo\Client\Models\GetExternalFeedByUUID
{
- list($response) = $this->getExternalFeedByUUIDWithHttpInfo($uuid);
+ list($response) = $this->getExternalFeedByUUIDWithHttpInfo($uuid, $contentType);
return $response;
}
@@ -996,15 +1314,18 @@ public function getExternalFeedByUUID($uuid)
* Get an external feed by UUID
*
* @param string $uuid UUID of the feed to fetch (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getExternalFeedByUUID'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetExternalFeedByUUID, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetExternalFeedByUUID|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getExternalFeedByUUIDWithHttpInfo($uuid)
+ public function getExternalFeedByUUIDWithHttpInfo(
+ string $uuid,
+ string $contentType = self::contentTypes['getExternalFeedByUUID'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetExternalFeedByUUID';
- $request = $this->getExternalFeedByUUIDRequest($uuid);
+ $request = $this->getExternalFeedByUUIDRequest($uuid, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1013,34 +1334,138 @@ public function getExternalFeedByUUIDWithHttpInfo($uuid)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetExternalFeedByUUID', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetExternalFeedByUUID' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetExternalFeedByUUID', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetExternalFeedByUUID';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1055,7 +1480,7 @@ public function getExternalFeedByUUIDWithHttpInfo($uuid)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetExternalFeedByUUID',
+ '\Brevo\Client\Models\GetExternalFeedByUUID',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1063,7 +1488,7 @@ public function getExternalFeedByUUIDWithHttpInfo($uuid)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1071,7 +1496,7 @@ public function getExternalFeedByUUIDWithHttpInfo($uuid)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1087,13 +1512,17 @@ public function getExternalFeedByUUIDWithHttpInfo($uuid)
* Get an external feed by UUID
*
* @param string $uuid UUID of the feed to fetch (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getExternalFeedByUUID'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getExternalFeedByUUIDAsync($uuid)
+ public function getExternalFeedByUUIDAsync(
+ string $uuid,
+ string $contentType = self::contentTypes['getExternalFeedByUUID'][0]
+ ): PromiseInterface
{
- return $this->getExternalFeedByUUIDAsyncWithHttpInfo($uuid)
+ return $this->getExternalFeedByUUIDAsyncWithHttpInfo($uuid, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1107,24 +1536,28 @@ function ($response) {
* Get an external feed by UUID
*
* @param string $uuid UUID of the feed to fetch (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getExternalFeedByUUID'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getExternalFeedByUUIDAsyncWithHttpInfo($uuid)
+ public function getExternalFeedByUUIDAsyncWithHttpInfo(
+ $uuid,
+ string $contentType = self::contentTypes['getExternalFeedByUUID'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetExternalFeedByUUID';
- $request = $this->getExternalFeedByUUIDRequest($uuid);
+ $returnType = '\Brevo\Client\Models\GetExternalFeedByUUID';
+ $request = $this->getExternalFeedByUUIDRequest($uuid, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1147,7 +1580,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1157,19 +1590,25 @@ function ($exception) {
* Create request for operation 'getExternalFeedByUUID'
*
* @param string $uuid UUID of the feed to fetch (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getExternalFeedByUUID'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getExternalFeedByUUIDRequest($uuid)
+ public function getExternalFeedByUUIDRequest(
+ $uuid,
+ string $contentType = self::contentTypes['getExternalFeedByUUID'][0]
+ ): Request
{
+
// verify the required parameter 'uuid' is set
if ($uuid === null || (is_array($uuid) && count($uuid) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $uuid when calling getExternalFeedByUUID'
);
}
+
$resourcePath = '/feeds/{uuid}';
$formParams = [];
$queryParams = [];
@@ -1178,6 +1617,7 @@ protected function getExternalFeedByUUIDRequest($uuid)
$multipart = false;
+
// path params
if ($uuid !== null) {
$resourcePath = str_replace(
@@ -1187,53 +1627,35 @@ protected function getExternalFeedByUUIDRequest($uuid)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1259,10 +1681,11 @@ protected function getExternalFeedByUUIDRequest($uuid)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1274,15 +1697,20 @@ protected function getExternalFeedByUUIDRequest($uuid)
* Update an external feed
*
* @param string $uuid UUID of the feed to update (required)
- * @param \Brevo\Client\Model\UpdateExternalFeed $updateExternalFeed Values to update a feed (required)
+ * @param \Brevo\Client\Models\UpdateExternalFeed $updateExternalFeed Values to update a feed (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateExternalFeed'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function updateExternalFeed($uuid, $updateExternalFeed)
+ public function updateExternalFeed(
+ string $uuid,
+ \Brevo\Client\Models\UpdateExternalFeed $updateExternalFeed,
+ string $contentType = self::contentTypes['updateExternalFeed'][0]
+ ): void
{
- $this->updateExternalFeedWithHttpInfo($uuid, $updateExternalFeed);
+ $this->updateExternalFeedWithHttpInfo($uuid, $updateExternalFeed, $contentType);
}
/**
@@ -1291,16 +1719,20 @@ public function updateExternalFeed($uuid, $updateExternalFeed)
* Update an external feed
*
* @param string $uuid UUID of the feed to update (required)
- * @param \Brevo\Client\Model\UpdateExternalFeed $updateExternalFeed Values to update a feed (required)
+ * @param \Brevo\Client\Models\UpdateExternalFeed $updateExternalFeed Values to update a feed (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateExternalFeed'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function updateExternalFeedWithHttpInfo($uuid, $updateExternalFeed)
+ public function updateExternalFeedWithHttpInfo(
+ string $uuid,
+ \Brevo\Client\Models\UpdateExternalFeed $updateExternalFeed,
+ string $contentType = self::contentTypes['updateExternalFeed'][0]
+ ): array
{
- $returnType = '';
- $request = $this->updateExternalFeedRequest($uuid, $updateExternalFeed);
+ $request = $this->updateExternalFeedRequest($uuid, $updateExternalFeed, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1309,26 +1741,21 @@ public function updateExternalFeedWithHttpInfo($uuid, $updateExternalFeed)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -1337,7 +1764,7 @@ public function updateExternalFeedWithHttpInfo($uuid, $updateExternalFeed)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1345,7 +1772,7 @@ public function updateExternalFeedWithHttpInfo($uuid, $updateExternalFeed)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1361,14 +1788,19 @@ public function updateExternalFeedWithHttpInfo($uuid, $updateExternalFeed)
* Update an external feed
*
* @param string $uuid UUID of the feed to update (required)
- * @param \Brevo\Client\Model\UpdateExternalFeed $updateExternalFeed Values to update a feed (required)
+ * @param \Brevo\Client\Models\UpdateExternalFeed $updateExternalFeed Values to update a feed (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateExternalFeed'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function updateExternalFeedAsync($uuid, $updateExternalFeed)
+ public function updateExternalFeedAsync(
+ string $uuid,
+ \Brevo\Client\Models\UpdateExternalFeed $updateExternalFeed,
+ string $contentType = self::contentTypes['updateExternalFeed'][0]
+ ): PromiseInterface
{
- return $this->updateExternalFeedAsyncWithHttpInfo($uuid, $updateExternalFeed)
+ return $this->updateExternalFeedAsyncWithHttpInfo($uuid, $updateExternalFeed, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1382,15 +1814,21 @@ function ($response) {
* Update an external feed
*
* @param string $uuid UUID of the feed to update (required)
- * @param \Brevo\Client\Model\UpdateExternalFeed $updateExternalFeed Values to update a feed (required)
+ * @param \Brevo\Client\Models\UpdateExternalFeed $updateExternalFeed Values to update a feed (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateExternalFeed'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function updateExternalFeedAsyncWithHttpInfo($uuid, $updateExternalFeed)
+ public function updateExternalFeedAsyncWithHttpInfo(
+ $uuid,
+ $updateExternalFeed,
+ string $contentType = self::contentTypes['updateExternalFeed'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->updateExternalFeedRequest($uuid, $updateExternalFeed);
+ $request = $this->updateExternalFeedRequest($uuid, $updateExternalFeed, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -1409,7 +1847,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1419,26 +1857,34 @@ function ($exception) {
* Create request for operation 'updateExternalFeed'
*
* @param string $uuid UUID of the feed to update (required)
- * @param \Brevo\Client\Model\UpdateExternalFeed $updateExternalFeed Values to update a feed (required)
+ * @param \Brevo\Client\Models\UpdateExternalFeed $updateExternalFeed Values to update a feed (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateExternalFeed'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function updateExternalFeedRequest($uuid, $updateExternalFeed)
+ public function updateExternalFeedRequest(
+ $uuid,
+ $updateExternalFeed,
+ string $contentType = self::contentTypes['updateExternalFeed'][0]
+ ): Request
{
+
// verify the required parameter 'uuid' is set
if ($uuid === null || (is_array($uuid) && count($uuid) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $uuid when calling updateExternalFeed'
);
}
+
// verify the required parameter 'updateExternalFeed' is set
if ($updateExternalFeed === null || (is_array($updateExternalFeed) && count($updateExternalFeed) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $updateExternalFeed when calling updateExternalFeed'
);
}
+
$resourcePath = '/feeds/{uuid}';
$formParams = [];
$queryParams = [];
@@ -1447,6 +1893,7 @@ protected function updateExternalFeedRequest($uuid, $updateExternalFeed)
$multipart = false;
+
// path params
if ($uuid !== null) {
$resourcePath = str_replace(
@@ -1456,56 +1903,42 @@ protected function updateExternalFeedRequest($uuid, $updateExternalFeed)
);
}
- // body params
- $_tempBody = null;
- if (isset($updateExternalFeed)) {
- $_tempBody = $updateExternalFeed;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($updateExternalFeed)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($updateExternalFeed));
+ } else {
+ $httpBody = $updateExternalFeed;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1531,10 +1964,11 @@ protected function updateExternalFeedRequest($uuid, $updateExternalFeed)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'PUT',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1546,7 +1980,7 @@ protected function updateExternalFeedRequest($uuid, $updateExternalFeed)
* @throws \RuntimeException on file opening failure
* @return array of http client options
*/
- protected function createHttpClientOption()
+ protected function createHttpClientOption(): array
{
$options = [];
if ($this->config->getDebug()) {
diff --git a/lib/Api/FilesApi.php b/lib/Api/FilesApi.php
index ee1f190..df08e63 100644
--- a/lib/Api/FilesApi.php
+++ b/lib/Api/FilesApi.php
@@ -1,39 +1,41 @@
[
+ 'application/json',
+ ],
+ 'crmFilesIdDataGet' => [
+ 'application/json',
+ ],
+ 'crmFilesIdDelete' => [
+ 'application/json',
+ ],
+ 'crmFilesIdGet' => [
+ 'application/json',
+ ],
+ 'crmFilesPost' => [
+ 'multipart/form-data',
+ ],
+ ];
+
+ /**
+ * @param ClientInterface|null $client
+ * @param Configuration|null $config
+ * @param HeaderSelector|null $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
+ HeaderSelector $selector = null,
+ int $hostIndex = 0
) {
$this->client = $client ?: new Client();
- $this->config = $config ?: new Configuration();
+ $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(int $hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex(): int
+ {
+ return $this->hostIndex;
}
/**
* @return Configuration
*/
- public function getConfig()
+ public function getConfig(): Configuration
{
return $this->config;
}
@@ -92,21 +140,31 @@ public function getConfig()
*
* Get all files
*
- * @param string $entity Filter by file entity type (optional)
- * @param string $entityIds Filter by file entity IDs (optional)
- * @param int $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
- * @param int $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
- * @param int $offset Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\FileList
+ * @param string|null $entity Filter by file entity type (optional)
+ * @param string|null $entityIds Filter by file entity IDs (optional)
+ * @param int|null $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
+ * @param int|null $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
+ * @param int|null $offset Index of the first document of the page (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param string|null $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmFilesGet'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\FileData[]|\Brevo\Client\Models\ErrorModel
*/
- public function crmFilesGet($entity = null, $entityIds = null, $dateFrom = null, $dateTo = null, $offset = null, $limit = '50', $sort = null)
+ public function crmFilesGet(
+ ?string $entity = null,
+ ?string $entityIds = null,
+ ?int $dateFrom = null,
+ ?int $dateTo = null,
+ ?int $offset = null,
+ ?int $limit = 50,
+ ?string $sort = null,
+ string $contentType = self::contentTypes['crmFilesGet'][0]
+ ): array
{
- list($response) = $this->crmFilesGetWithHttpInfo($entity, $entityIds, $dateFrom, $dateTo, $offset, $limit, $sort);
+ list($response) = $this->crmFilesGetWithHttpInfo($entity, $entityIds, $dateFrom, $dateTo, $offset, $limit, $sort, $contentType);
return $response;
}
@@ -115,22 +173,31 @@ public function crmFilesGet($entity = null, $entityIds = null, $dateFrom = null,
*
* Get all files
*
- * @param string $entity Filter by file entity type (optional)
- * @param string $entityIds Filter by file entity IDs (optional)
- * @param int $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
- * @param int $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
- * @param int $offset Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\FileList, HTTP status code, HTTP response headers (array of strings)
+ * @param string|null $entity Filter by file entity type (optional)
+ * @param string|null $entityIds Filter by file entity IDs (optional)
+ * @param int|null $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
+ * @param int|null $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
+ * @param int|null $offset Index of the first document of the page (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param string|null $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmFilesGet'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\FileData[]|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function crmFilesGetWithHttpInfo($entity = null, $entityIds = null, $dateFrom = null, $dateTo = null, $offset = null, $limit = '50', $sort = null)
+ public function crmFilesGetWithHttpInfo(
+ ?string $entity = null,
+ ?string $entityIds = null,
+ ?int $dateFrom = null,
+ ?int $dateTo = null,
+ ?int $offset = null,
+ ?int $limit = 50,
+ ?string $sort = null,
+ string $contentType = self::contentTypes['crmFilesGet'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\FileList';
- $request = $this->crmFilesGetRequest($entity, $entityIds, $dateFrom, $dateTo, $offset, $limit, $sort);
+ $request = $this->crmFilesGetRequest($entity, $entityIds, $dateFrom, $dateTo, $offset, $limit, $sort, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -139,34 +206,111 @@ public function crmFilesGetWithHttpInfo($entity = null, $entityIds = null, $date
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\FileData[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\FileData[]' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\FileData[]', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\FileData[]';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -181,7 +325,7 @@ public function crmFilesGetWithHttpInfo($entity = null, $entityIds = null, $date
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\FileList',
+ '\Brevo\Client\Models\FileData[]',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -189,7 +333,7 @@ public function crmFilesGetWithHttpInfo($entity = null, $entityIds = null, $date
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -204,20 +348,30 @@ public function crmFilesGetWithHttpInfo($entity = null, $entityIds = null, $date
*
* Get all files
*
- * @param string $entity Filter by file entity type (optional)
- * @param string $entityIds Filter by file entity IDs (optional)
- * @param int $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
- * @param int $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
- * @param int $offset Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @param string|null $entity Filter by file entity type (optional)
+ * @param string|null $entityIds Filter by file entity IDs (optional)
+ * @param int|null $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
+ * @param int|null $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
+ * @param int|null $offset Index of the first document of the page (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param string|null $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmFilesGet'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmFilesGetAsync($entity = null, $entityIds = null, $dateFrom = null, $dateTo = null, $offset = null, $limit = '50', $sort = null)
+ public function crmFilesGetAsync(
+ ?string $entity = null,
+ ?string $entityIds = null,
+ ?int $dateFrom = null,
+ ?int $dateTo = null,
+ ?int $offset = null,
+ ?int $limit = 50,
+ ?string $sort = null,
+ string $contentType = self::contentTypes['crmFilesGet'][0]
+ ): PromiseInterface
{
- return $this->crmFilesGetAsyncWithHttpInfo($entity, $entityIds, $dateFrom, $dateTo, $offset, $limit, $sort)
+ return $this->crmFilesGetAsyncWithHttpInfo($entity, $entityIds, $dateFrom, $dateTo, $offset, $limit, $sort, $contentType)
->then(
function ($response) {
return $response[0];
@@ -230,31 +384,41 @@ function ($response) {
*
* Get all files
*
- * @param string $entity Filter by file entity type (optional)
- * @param string $entityIds Filter by file entity IDs (optional)
- * @param int $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
- * @param int $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
- * @param int $offset Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @param string|null $entity Filter by file entity type (optional)
+ * @param string|null $entityIds Filter by file entity IDs (optional)
+ * @param int|null $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
+ * @param int|null $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
+ * @param int|null $offset Index of the first document of the page (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param string|null $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmFilesGet'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmFilesGetAsyncWithHttpInfo($entity = null, $entityIds = null, $dateFrom = null, $dateTo = null, $offset = null, $limit = '50', $sort = null)
+ public function crmFilesGetAsyncWithHttpInfo(
+ $entity = null,
+ $entityIds = null,
+ $dateFrom = null,
+ $dateTo = null,
+ $offset = null,
+ $limit = 50,
+ $sort = null,
+ string $contentType = self::contentTypes['crmFilesGet'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\FileList';
- $request = $this->crmFilesGetRequest($entity, $entityIds, $dateFrom, $dateTo, $offset, $limit, $sort);
+ $returnType = '\Brevo\Client\Models\FileData[]';
+ $request = $this->crmFilesGetRequest($entity, $entityIds, $dateFrom, $dateTo, $offset, $limit, $sort, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -277,7 +441,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -286,20 +450,38 @@ function ($exception) {
/**
* Create request for operation 'crmFilesGet'
*
- * @param string $entity Filter by file entity type (optional)
- * @param string $entityIds Filter by file entity IDs (optional)
- * @param int $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
- * @param int $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
- * @param int $offset Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
+ * @param string|null $entity Filter by file entity type (optional)
+ * @param string|null $entityIds Filter by file entity IDs (optional)
+ * @param int|null $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
+ * @param int|null $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
+ * @param int|null $offset Index of the first document of the page (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param string|null $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmFilesGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function crmFilesGetRequest($entity = null, $entityIds = null, $dateFrom = null, $dateTo = null, $offset = null, $limit = '50', $sort = null)
+ public function crmFilesGetRequest(
+ $entity = null,
+ $entityIds = null,
+ $dateFrom = null,
+ $dateTo = null,
+ $offset = null,
+ $limit = 50,
+ $sort = null,
+ string $contentType = self::contentTypes['crmFilesGet'][0]
+ ): Request
{
+
+
+
+
+
+
+
+
$resourcePath = '/crm/files';
$formParams = [];
$queryParams = [];
@@ -308,82 +490,100 @@ protected function crmFilesGetRequest($entity = null, $entityIds = null, $dateFr
$multipart = false;
// query params
- if ($entity !== null) {
- $queryParams['entity'] = ObjectSerializer::toQueryValue($entity);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $entity,
+ 'entity', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($entityIds !== null) {
- $queryParams['entityIds'] = ObjectSerializer::toQueryValue($entityIds);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $entityIds,
+ 'entityIds', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($dateFrom !== null) {
- $queryParams['dateFrom'] = ObjectSerializer::toQueryValue($dateFrom);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $dateFrom,
+ 'dateFrom', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($dateTo !== null) {
- $queryParams['dateTo'] = ObjectSerializer::toQueryValue($dateTo);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $dateTo,
+ 'dateTo', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -409,10 +609,11 @@ protected function crmFilesGetRequest($entity = null, $entityIds = null, $dateFr
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -424,14 +625,18 @@ protected function crmFilesGetRequest($entity = null, $entityIds = null, $dateFr
* Get file details
*
* @param string $id File id to get file data. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmFilesIdDataGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\FileData
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\FileData|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function crmFilesIdDataGet($id)
+ public function crmFilesIdDataGet(
+ string $id,
+ string $contentType = self::contentTypes['crmFilesIdDataGet'][0]
+ ): \Brevo\Client\Models\FileData
{
- list($response) = $this->crmFilesIdDataGetWithHttpInfo($id);
+ list($response) = $this->crmFilesIdDataGetWithHttpInfo($id, $contentType);
return $response;
}
@@ -441,15 +646,18 @@ public function crmFilesIdDataGet($id)
* Get file details
*
* @param string $id File id to get file data. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmFilesIdDataGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\FileData, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\FileData|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function crmFilesIdDataGetWithHttpInfo($id)
+ public function crmFilesIdDataGetWithHttpInfo(
+ string $id,
+ string $contentType = self::contentTypes['crmFilesIdDataGet'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\FileData';
- $request = $this->crmFilesIdDataGetRequest($id);
+ $request = $this->crmFilesIdDataGetRequest($id, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -458,34 +666,138 @@ public function crmFilesIdDataGetWithHttpInfo($id)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\FileData', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\FileData' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\FileData', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\FileData';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -500,7 +812,7 @@ public function crmFilesIdDataGetWithHttpInfo($id)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\FileData',
+ '\Brevo\Client\Models\FileData',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -508,7 +820,7 @@ public function crmFilesIdDataGetWithHttpInfo($id)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -516,7 +828,7 @@ public function crmFilesIdDataGetWithHttpInfo($id)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -532,13 +844,17 @@ public function crmFilesIdDataGetWithHttpInfo($id)
* Get file details
*
* @param string $id File id to get file data. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmFilesIdDataGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmFilesIdDataGetAsync($id)
+ public function crmFilesIdDataGetAsync(
+ string $id,
+ string $contentType = self::contentTypes['crmFilesIdDataGet'][0]
+ ): PromiseInterface
{
- return $this->crmFilesIdDataGetAsyncWithHttpInfo($id)
+ return $this->crmFilesIdDataGetAsyncWithHttpInfo($id, $contentType)
->then(
function ($response) {
return $response[0];
@@ -552,24 +868,28 @@ function ($response) {
* Get file details
*
* @param string $id File id to get file data. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmFilesIdDataGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmFilesIdDataGetAsyncWithHttpInfo($id)
+ public function crmFilesIdDataGetAsyncWithHttpInfo(
+ $id,
+ string $contentType = self::contentTypes['crmFilesIdDataGet'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\FileData';
- $request = $this->crmFilesIdDataGetRequest($id);
+ $returnType = '\Brevo\Client\Models\FileData';
+ $request = $this->crmFilesIdDataGetRequest($id, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -592,7 +912,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -602,19 +922,25 @@ function ($exception) {
* Create request for operation 'crmFilesIdDataGet'
*
* @param string $id File id to get file data. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmFilesIdDataGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function crmFilesIdDataGetRequest($id)
+ public function crmFilesIdDataGetRequest(
+ $id,
+ string $contentType = self::contentTypes['crmFilesIdDataGet'][0]
+ ): Request
{
+
// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $id when calling crmFilesIdDataGet'
);
}
+
$resourcePath = '/crm/files/{id}/data';
$formParams = [];
$queryParams = [];
@@ -623,6 +949,7 @@ protected function crmFilesIdDataGetRequest($id)
$multipart = false;
+
// path params
if ($id !== null) {
$resourcePath = str_replace(
@@ -632,53 +959,35 @@ protected function crmFilesIdDataGetRequest($id)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -704,10 +1013,11 @@ protected function crmFilesIdDataGetRequest($id)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -719,14 +1029,18 @@ protected function crmFilesIdDataGetRequest($id)
* Delete a file
*
* @param string $id File id to delete. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmFilesIdDelete'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function crmFilesIdDelete($id)
+ public function crmFilesIdDelete(
+ string $id,
+ string $contentType = self::contentTypes['crmFilesIdDelete'][0]
+ ): void
{
- $this->crmFilesIdDeleteWithHttpInfo($id);
+ $this->crmFilesIdDeleteWithHttpInfo($id, $contentType);
}
/**
@@ -735,15 +1049,18 @@ public function crmFilesIdDelete($id)
* Delete a file
*
* @param string $id File id to delete. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmFilesIdDelete'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function crmFilesIdDeleteWithHttpInfo($id)
+ public function crmFilesIdDeleteWithHttpInfo(
+ string $id,
+ string $contentType = self::contentTypes['crmFilesIdDelete'][0]
+ ): array
{
- $returnType = '';
- $request = $this->crmFilesIdDeleteRequest($id);
+ $request = $this->crmFilesIdDeleteRequest($id, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -752,26 +1069,21 @@ public function crmFilesIdDeleteWithHttpInfo($id)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -780,7 +1092,7 @@ public function crmFilesIdDeleteWithHttpInfo($id)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -788,7 +1100,7 @@ public function crmFilesIdDeleteWithHttpInfo($id)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -804,13 +1116,17 @@ public function crmFilesIdDeleteWithHttpInfo($id)
* Delete a file
*
* @param string $id File id to delete. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmFilesIdDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmFilesIdDeleteAsync($id)
+ public function crmFilesIdDeleteAsync(
+ string $id,
+ string $contentType = self::contentTypes['crmFilesIdDelete'][0]
+ ): PromiseInterface
{
- return $this->crmFilesIdDeleteAsyncWithHttpInfo($id)
+ return $this->crmFilesIdDeleteAsyncWithHttpInfo($id, $contentType)
->then(
function ($response) {
return $response[0];
@@ -824,14 +1140,19 @@ function ($response) {
* Delete a file
*
* @param string $id File id to delete. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmFilesIdDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmFilesIdDeleteAsyncWithHttpInfo($id)
+ public function crmFilesIdDeleteAsyncWithHttpInfo(
+ $id,
+ string $contentType = self::contentTypes['crmFilesIdDelete'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->crmFilesIdDeleteRequest($id);
+ $request = $this->crmFilesIdDeleteRequest($id, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -850,7 +1171,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -860,19 +1181,25 @@ function ($exception) {
* Create request for operation 'crmFilesIdDelete'
*
* @param string $id File id to delete. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmFilesIdDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function crmFilesIdDeleteRequest($id)
+ public function crmFilesIdDeleteRequest(
+ $id,
+ string $contentType = self::contentTypes['crmFilesIdDelete'][0]
+ ): Request
{
+
// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $id when calling crmFilesIdDelete'
);
}
+
$resourcePath = '/crm/files/{id}';
$formParams = [];
$queryParams = [];
@@ -881,6 +1208,7 @@ protected function crmFilesIdDeleteRequest($id)
$multipart = false;
+
// path params
if ($id !== null) {
$resourcePath = str_replace(
@@ -890,53 +1218,35 @@ protected function crmFilesIdDeleteRequest($id)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -962,10 +1272,11 @@ protected function crmFilesIdDeleteRequest($id)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -977,14 +1288,18 @@ protected function crmFilesIdDeleteRequest($id)
* Download a file
*
* @param string $id File id to download. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmFilesIdGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\FileDownloadableLink
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\FileDownloadableLink|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function crmFilesIdGet($id)
+ public function crmFilesIdGet(
+ string $id,
+ string $contentType = self::contentTypes['crmFilesIdGet'][0]
+ ): \Brevo\Client\Models\FileDownloadableLink
{
- list($response) = $this->crmFilesIdGetWithHttpInfo($id);
+ list($response) = $this->crmFilesIdGetWithHttpInfo($id, $contentType);
return $response;
}
@@ -994,15 +1309,18 @@ public function crmFilesIdGet($id)
* Download a file
*
* @param string $id File id to download. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmFilesIdGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\FileDownloadableLink, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\FileDownloadableLink|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function crmFilesIdGetWithHttpInfo($id)
+ public function crmFilesIdGetWithHttpInfo(
+ string $id,
+ string $contentType = self::contentTypes['crmFilesIdGet'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\FileDownloadableLink';
- $request = $this->crmFilesIdGetRequest($id);
+ $request = $this->crmFilesIdGetRequest($id, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1011,34 +1329,138 @@ public function crmFilesIdGetWithHttpInfo($id)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\FileDownloadableLink', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\FileDownloadableLink' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\FileDownloadableLink', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\FileDownloadableLink';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1053,7 +1475,7 @@ public function crmFilesIdGetWithHttpInfo($id)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\FileDownloadableLink',
+ '\Brevo\Client\Models\FileDownloadableLink',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1061,7 +1483,7 @@ public function crmFilesIdGetWithHttpInfo($id)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1069,7 +1491,7 @@ public function crmFilesIdGetWithHttpInfo($id)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1085,13 +1507,17 @@ public function crmFilesIdGetWithHttpInfo($id)
* Download a file
*
* @param string $id File id to download. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmFilesIdGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmFilesIdGetAsync($id)
+ public function crmFilesIdGetAsync(
+ string $id,
+ string $contentType = self::contentTypes['crmFilesIdGet'][0]
+ ): PromiseInterface
{
- return $this->crmFilesIdGetAsyncWithHttpInfo($id)
+ return $this->crmFilesIdGetAsyncWithHttpInfo($id, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1105,24 +1531,28 @@ function ($response) {
* Download a file
*
* @param string $id File id to download. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmFilesIdGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmFilesIdGetAsyncWithHttpInfo($id)
+ public function crmFilesIdGetAsyncWithHttpInfo(
+ $id,
+ string $contentType = self::contentTypes['crmFilesIdGet'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\FileDownloadableLink';
- $request = $this->crmFilesIdGetRequest($id);
+ $returnType = '\Brevo\Client\Models\FileDownloadableLink';
+ $request = $this->crmFilesIdGetRequest($id, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1145,7 +1575,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1155,19 +1585,25 @@ function ($exception) {
* Create request for operation 'crmFilesIdGet'
*
* @param string $id File id to download. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmFilesIdGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function crmFilesIdGetRequest($id)
+ public function crmFilesIdGetRequest(
+ $id,
+ string $contentType = self::contentTypes['crmFilesIdGet'][0]
+ ): Request
{
+
// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $id when calling crmFilesIdGet'
);
}
+
$resourcePath = '/crm/files/{id}';
$formParams = [];
$queryParams = [];
@@ -1176,6 +1612,7 @@ protected function crmFilesIdGetRequest($id)
$multipart = false;
+
// path params
if ($id !== null) {
$resourcePath = str_replace(
@@ -1185,53 +1622,35 @@ protected function crmFilesIdGetRequest($id)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1257,10 +1676,11 @@ protected function crmFilesIdGetRequest($id)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1272,17 +1692,24 @@ protected function crmFilesIdGetRequest($id)
* Upload a file
*
* @param \SplFileObject $file File data to create a file. (required)
- * @param string $dealId Deal id linked to a file (optional)
- * @param int $contactId Contact id linked to a file (optional)
- * @param string $companyId Company id linked to a file (optional)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\FileData
+ * @param string|null $dealId dealId (optional)
+ * @param int|null $contactId contactId (optional)
+ * @param string|null $companyId companyId (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmFilesPost'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\FileData|\Brevo\Client\Models\ErrorModel
*/
- public function crmFilesPost($file, $dealId = null, $contactId = null, $companyId = null)
+ public function crmFilesPost(
+ \SplFileObject $file,
+ ?string $dealId = null,
+ ?int $contactId = null,
+ ?string $companyId = null,
+ string $contentType = self::contentTypes['crmFilesPost'][0]
+ ): \Brevo\Client\Models\FileData
{
- list($response) = $this->crmFilesPostWithHttpInfo($file, $dealId, $contactId, $companyId);
+ list($response) = $this->crmFilesPostWithHttpInfo($file, $dealId, $contactId, $companyId, $contentType);
return $response;
}
@@ -1292,18 +1719,24 @@ public function crmFilesPost($file, $dealId = null, $contactId = null, $companyI
* Upload a file
*
* @param \SplFileObject $file File data to create a file. (required)
- * @param string $dealId Deal id linked to a file (optional)
- * @param int $contactId Contact id linked to a file (optional)
- * @param string $companyId Company id linked to a file (optional)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\FileData, HTTP status code, HTTP response headers (array of strings)
+ * @param string|null $dealId (optional)
+ * @param int|null $contactId (optional)
+ * @param string|null $companyId (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmFilesPost'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\FileData|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function crmFilesPostWithHttpInfo($file, $dealId = null, $contactId = null, $companyId = null)
+ public function crmFilesPostWithHttpInfo(
+ \SplFileObject $file,
+ ?string $dealId = null,
+ ?int $contactId = null,
+ ?string $companyId = null,
+ string $contentType = self::contentTypes['crmFilesPost'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\FileData';
- $request = $this->crmFilesPostRequest($file, $dealId, $contactId, $companyId);
+ $request = $this->crmFilesPostRequest($file, $dealId, $contactId, $companyId, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1312,34 +1745,111 @@ public function crmFilesPostWithHttpInfo($file, $dealId = null, $contactId = nul
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 201:
+ if (in_array('\Brevo\Client\Models\FileData', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\FileData' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\FileData', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\FileData';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1354,7 +1864,7 @@ public function crmFilesPostWithHttpInfo($file, $dealId = null, $contactId = nul
case 201:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\FileData',
+ '\Brevo\Client\Models\FileData',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1362,7 +1872,7 @@ public function crmFilesPostWithHttpInfo($file, $dealId = null, $contactId = nul
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1378,16 +1888,23 @@ public function crmFilesPostWithHttpInfo($file, $dealId = null, $contactId = nul
* Upload a file
*
* @param \SplFileObject $file File data to create a file. (required)
- * @param string $dealId Deal id linked to a file (optional)
- * @param int $contactId Contact id linked to a file (optional)
- * @param string $companyId Company id linked to a file (optional)
+ * @param string|null $dealId (optional)
+ * @param int|null $contactId (optional)
+ * @param string|null $companyId (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmFilesPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmFilesPostAsync($file, $dealId = null, $contactId = null, $companyId = null)
+ public function crmFilesPostAsync(
+ \SplFileObject $file,
+ ?string $dealId = null,
+ ?int $contactId = null,
+ ?string $companyId = null,
+ string $contentType = self::contentTypes['crmFilesPost'][0]
+ ): PromiseInterface
{
- return $this->crmFilesPostAsyncWithHttpInfo($file, $dealId, $contactId, $companyId)
+ return $this->crmFilesPostAsyncWithHttpInfo($file, $dealId, $contactId, $companyId, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1401,27 +1918,34 @@ function ($response) {
* Upload a file
*
* @param \SplFileObject $file File data to create a file. (required)
- * @param string $dealId Deal id linked to a file (optional)
- * @param int $contactId Contact id linked to a file (optional)
- * @param string $companyId Company id linked to a file (optional)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @param string|null $dealId (optional)
+ * @param int|null $contactId (optional)
+ * @param string|null $companyId (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmFilesPost'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmFilesPostAsyncWithHttpInfo($file, $dealId = null, $contactId = null, $companyId = null)
+ public function crmFilesPostAsyncWithHttpInfo(
+ $file,
+ $dealId = null,
+ $contactId = null,
+ $companyId = null,
+ string $contentType = self::contentTypes['crmFilesPost'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\FileData';
- $request = $this->crmFilesPostRequest($file, $dealId, $contactId, $companyId);
+ $returnType = '\Brevo\Client\Models\FileData';
+ $request = $this->crmFilesPostRequest($file, $dealId, $contactId, $companyId, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1444,7 +1968,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1454,22 +1978,34 @@ function ($exception) {
* Create request for operation 'crmFilesPost'
*
* @param \SplFileObject $file File data to create a file. (required)
- * @param string $dealId Deal id linked to a file (optional)
- * @param int $contactId Contact id linked to a file (optional)
- * @param string $companyId Company id linked to a file (optional)
+ * @param string|null $dealId (optional)
+ * @param int|null $contactId (optional)
+ * @param string|null $companyId (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmFilesPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function crmFilesPostRequest($file, $dealId = null, $contactId = null, $companyId = null)
+ public function crmFilesPostRequest(
+ $file,
+ $dealId = null,
+ $contactId = null,
+ $companyId = null,
+ string $contentType = self::contentTypes['crmFilesPost'][0]
+ ): Request
{
+
// verify the required parameter 'file' is set
if ($file === null || (is_array($file) && count($file) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $file when calling crmFilesPost'
);
}
+
+
+
+
$resourcePath = '/crm/files';
$formParams = [];
$queryParams = [];
@@ -1479,10 +2015,20 @@ protected function crmFilesPostRequest($file, $dealId = null, $contactId = null,
+
// form params
if ($file !== null) {
$multipart = true;
- $formParams['file'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($file), 'rb');
+ $formParams['file'] = [];
+ $paramFiles = is_array($file) ? $file : [$file];
+ foreach ($paramFiles as $paramFile) {
+ $formParams['file'][] = $paramFile instanceof \Psr\Http\Message\StreamInterface
+ ? $paramFile
+ : \GuzzleHttp\Psr7\Utils::tryFopen(
+ ObjectSerializer::toFormValue($paramFile),
+ 'rb'
+ );
+ }
}
// form params
if ($dealId !== null) {
@@ -1496,53 +2042,35 @@ protected function crmFilesPostRequest($file, $dealId = null, $contactId = null,
if ($companyId !== null) {
$formParams['companyId'] = ObjectSerializer::toFormValue($companyId);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['multipart/form-data']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1568,10 +2096,11 @@ protected function crmFilesPostRequest($file, $dealId = null, $contactId = null,
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1583,7 +2112,7 @@ protected function crmFilesPostRequest($file, $dealId = null, $contactId = null,
* @throws \RuntimeException on file opening failure
* @return array of http client options
*/
- protected function createHttpClientOption()
+ protected function createHttpClientOption(): array
{
$options = [];
if ($this->config->getDebug()) {
diff --git a/lib/Api/FoldersApi.php b/lib/Api/FoldersApi.php
deleted file mode 100644
index 80d50fb..0000000
--- a/lib/Api/FoldersApi.php
+++ /dev/null
@@ -1,1852 +0,0 @@
-client = $client ?: new Client();
- $this->config = $config ?: new Configuration();
- $this->headerSelector = $selector ?: new HeaderSelector();
- }
-
- /**
- * @return Configuration
- */
- public function getConfig()
- {
- return $this->config;
- }
-
- /**
- * Operation createFolder
- *
- * Create a folder
- *
- * @param \Brevo\Client\Model\CreateUpdateFolder $createFolder Name of the folder (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\CreateModel
- */
- public function createFolder($createFolder)
- {
- list($response) = $this->createFolderWithHttpInfo($createFolder);
- return $response;
- }
-
- /**
- * Operation createFolderWithHttpInfo
- *
- * Create a folder
- *
- * @param \Brevo\Client\Model\CreateUpdateFolder $createFolder Name of the folder (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\CreateModel, HTTP status code, HTTP response headers (array of strings)
- */
- public function createFolderWithHttpInfo($createFolder)
- {
- $returnType = '\Brevo\Client\Model\CreateModel';
- $request = $this->createFolderRequest($createFolder);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
-
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 201:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\CreateModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation createFolderAsync
- *
- * Create a folder
- *
- * @param \Brevo\Client\Model\CreateUpdateFolder $createFolder Name of the folder (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function createFolderAsync($createFolder)
- {
- return $this->createFolderAsyncWithHttpInfo($createFolder)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation createFolderAsyncWithHttpInfo
- *
- * Create a folder
- *
- * @param \Brevo\Client\Model\CreateUpdateFolder $createFolder Name of the folder (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function createFolderAsyncWithHttpInfo($createFolder)
- {
- $returnType = '\Brevo\Client\Model\CreateModel';
- $request = $this->createFolderRequest($createFolder);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- 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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'createFolder'
- *
- * @param \Brevo\Client\Model\CreateUpdateFolder $createFolder Name of the folder (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function createFolderRequest($createFolder)
- {
- // verify the required parameter 'createFolder' is set
- if ($createFolder === null || (is_array($createFolder) && count($createFolder) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $createFolder when calling createFolder'
- );
- }
-
- $resourcePath = '/contacts/folders';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
-
- // body params
- $_tempBody = null;
- if (isset($createFolder)) {
- $_tempBody = $createFolder;
- }
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation deleteFolder
- *
- * Delete a folder (and all its lists)
- *
- * @param int $folderId Id of the folder (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return void
- */
- public function deleteFolder($folderId)
- {
- $this->deleteFolderWithHttpInfo($folderId);
- }
-
- /**
- * Operation deleteFolderWithHttpInfo
- *
- * Delete a folder (and all its lists)
- *
- * @param int $folderId Id of the folder (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of null, HTTP status code, HTTP response headers (array of strings)
- */
- public function deleteFolderWithHttpInfo($folderId)
- {
- $returnType = '';
- $request = $this->deleteFolderRequest($folderId);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- return [null, $statusCode, $response->getHeaders()];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation deleteFolderAsync
- *
- * Delete a folder (and all its lists)
- *
- * @param int $folderId Id of the folder (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function deleteFolderAsync($folderId)
- {
- return $this->deleteFolderAsyncWithHttpInfo($folderId)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation deleteFolderAsyncWithHttpInfo
- *
- * Delete a folder (and all its lists)
- *
- * @param int $folderId Id of the folder (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function deleteFolderAsyncWithHttpInfo($folderId)
- {
- $returnType = '';
- $request = $this->deleteFolderRequest($folderId);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- return [null, $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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'deleteFolder'
- *
- * @param int $folderId Id of the folder (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function deleteFolderRequest($folderId)
- {
- // verify the required parameter 'folderId' is set
- if ($folderId === null || (is_array($folderId) && count($folderId) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $folderId when calling deleteFolder'
- );
- }
-
- $resourcePath = '/contacts/folders/{folderId}';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
- // path params
- if ($folderId !== null) {
- $resourcePath = str_replace(
- '{' . 'folderId' . '}',
- ObjectSerializer::toPathValue($folderId),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation getFolder
- *
- * Returns a folder's details
- *
- * @param int $folderId id of the folder (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetFolder
- */
- public function getFolder($folderId)
- {
- list($response) = $this->getFolderWithHttpInfo($folderId);
- return $response;
- }
-
- /**
- * Operation getFolderWithHttpInfo
- *
- * Returns a folder's details
- *
- * @param int $folderId id of the folder (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetFolder, HTTP status code, HTTP response headers (array of strings)
- */
- public function getFolderWithHttpInfo($folderId)
- {
- $returnType = '\Brevo\Client\Model\GetFolder';
- $request = $this->getFolderRequest($folderId);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
-
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 200:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\GetFolder',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation getFolderAsync
- *
- * Returns a folder's details
- *
- * @param int $folderId id of the folder (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getFolderAsync($folderId)
- {
- return $this->getFolderAsyncWithHttpInfo($folderId)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation getFolderAsyncWithHttpInfo
- *
- * Returns a folder's details
- *
- * @param int $folderId id of the folder (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getFolderAsyncWithHttpInfo($folderId)
- {
- $returnType = '\Brevo\Client\Model\GetFolder';
- $request = $this->getFolderRequest($folderId);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- 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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'getFolder'
- *
- * @param int $folderId id of the folder (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function getFolderRequest($folderId)
- {
- // verify the required parameter 'folderId' is set
- if ($folderId === null || (is_array($folderId) && count($folderId) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $folderId when calling getFolder'
- );
- }
-
- $resourcePath = '/contacts/folders/{folderId}';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
- // path params
- if ($folderId !== null) {
- $resourcePath = str_replace(
- '{' . 'folderId' . '}',
- ObjectSerializer::toPathValue($folderId),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation getFolderLists
- *
- * Get lists in a folder
- *
- * @param int $folderId Id of the folder (required)
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetFolderLists
- */
- public function getFolderLists($folderId, $limit = '10', $offset = '0', $sort = 'desc')
- {
- list($response) = $this->getFolderListsWithHttpInfo($folderId, $limit, $offset, $sort);
- return $response;
- }
-
- /**
- * Operation getFolderListsWithHttpInfo
- *
- * Get lists in a folder
- *
- * @param int $folderId Id of the folder (required)
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetFolderLists, HTTP status code, HTTP response headers (array of strings)
- */
- public function getFolderListsWithHttpInfo($folderId, $limit = '10', $offset = '0', $sort = 'desc')
- {
- $returnType = '\Brevo\Client\Model\GetFolderLists';
- $request = $this->getFolderListsRequest($folderId, $limit, $offset, $sort);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
-
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 200:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\GetFolderLists',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation getFolderListsAsync
- *
- * Get lists in a folder
- *
- * @param int $folderId Id of the folder (required)
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getFolderListsAsync($folderId, $limit = '10', $offset = '0', $sort = 'desc')
- {
- return $this->getFolderListsAsyncWithHttpInfo($folderId, $limit, $offset, $sort)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation getFolderListsAsyncWithHttpInfo
- *
- * Get lists in a folder
- *
- * @param int $folderId Id of the folder (required)
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getFolderListsAsyncWithHttpInfo($folderId, $limit = '10', $offset = '0', $sort = 'desc')
- {
- $returnType = '\Brevo\Client\Model\GetFolderLists';
- $request = $this->getFolderListsRequest($folderId, $limit, $offset, $sort);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- 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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'getFolderLists'
- *
- * @param int $folderId Id of the folder (required)
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function getFolderListsRequest($folderId, $limit = '10', $offset = '0', $sort = 'desc')
- {
- // verify the required parameter 'folderId' is set
- if ($folderId === null || (is_array($folderId) && count($folderId) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $folderId when calling getFolderLists'
- );
- }
- if ($limit !== null && $limit > 50) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling FoldersApi.getFolderLists, must be smaller than or equal to 50.');
- }
-
-
- $resourcePath = '/contacts/folders/{folderId}/lists';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
- // query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
- // query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
- // query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
-
- // path params
- if ($folderId !== null) {
- $resourcePath = str_replace(
- '{' . 'folderId' . '}',
- ObjectSerializer::toPathValue($folderId),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation getFolders
- *
- * Get all folders
- *
- * @param int $limit Number of documents per page (required)
- * @param int $offset Index of the first document of the page (required)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetFolders
- */
- public function getFolders($limit, $offset, $sort = 'desc')
- {
- list($response) = $this->getFoldersWithHttpInfo($limit, $offset, $sort);
- return $response;
- }
-
- /**
- * Operation getFoldersWithHttpInfo
- *
- * Get all folders
- *
- * @param int $limit Number of documents per page (required)
- * @param int $offset Index of the first document of the page (required)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetFolders, HTTP status code, HTTP response headers (array of strings)
- */
- public function getFoldersWithHttpInfo($limit, $offset, $sort = 'desc')
- {
- $returnType = '\Brevo\Client\Model\GetFolders';
- $request = $this->getFoldersRequest($limit, $offset, $sort);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
-
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 200:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\GetFolders',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation getFoldersAsync
- *
- * Get all folders
- *
- * @param int $limit Number of documents per page (required)
- * @param int $offset Index of the first document of the page (required)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getFoldersAsync($limit, $offset, $sort = 'desc')
- {
- return $this->getFoldersAsyncWithHttpInfo($limit, $offset, $sort)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation getFoldersAsyncWithHttpInfo
- *
- * Get all folders
- *
- * @param int $limit Number of documents per page (required)
- * @param int $offset Index of the first document of the page (required)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getFoldersAsyncWithHttpInfo($limit, $offset, $sort = 'desc')
- {
- $returnType = '\Brevo\Client\Model\GetFolders';
- $request = $this->getFoldersRequest($limit, $offset, $sort);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- 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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'getFolders'
- *
- * @param int $limit Number of documents per page (required)
- * @param int $offset Index of the first document of the page (required)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function getFoldersRequest($limit, $offset, $sort = 'desc')
- {
- // verify the required parameter 'limit' is set
- if ($limit === null || (is_array($limit) && count($limit) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $limit when calling getFolders'
- );
- }
- if ($limit > 50) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling FoldersApi.getFolders, must be smaller than or equal to 50.');
- }
-
- // verify the required parameter 'offset' is set
- if ($offset === null || (is_array($offset) && count($offset) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $offset when calling getFolders'
- );
- }
-
- $resourcePath = '/contacts/folders';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
- // query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
- // query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
- // query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
-
-
- // body params
- $_tempBody = null;
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation updateFolder
- *
- * Update a folder
- *
- * @param int $folderId Id of the folder (required)
- * @param \Brevo\Client\Model\CreateUpdateFolder $updateFolder Name of the folder (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return void
- */
- public function updateFolder($folderId, $updateFolder)
- {
- $this->updateFolderWithHttpInfo($folderId, $updateFolder);
- }
-
- /**
- * Operation updateFolderWithHttpInfo
- *
- * Update a folder
- *
- * @param int $folderId Id of the folder (required)
- * @param \Brevo\Client\Model\CreateUpdateFolder $updateFolder Name of the folder (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of null, HTTP status code, HTTP response headers (array of strings)
- */
- public function updateFolderWithHttpInfo($folderId, $updateFolder)
- {
- $returnType = '';
- $request = $this->updateFolderRequest($folderId, $updateFolder);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- return [null, $statusCode, $response->getHeaders()];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation updateFolderAsync
- *
- * Update a folder
- *
- * @param int $folderId Id of the folder (required)
- * @param \Brevo\Client\Model\CreateUpdateFolder $updateFolder Name of the folder (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function updateFolderAsync($folderId, $updateFolder)
- {
- return $this->updateFolderAsyncWithHttpInfo($folderId, $updateFolder)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation updateFolderAsyncWithHttpInfo
- *
- * Update a folder
- *
- * @param int $folderId Id of the folder (required)
- * @param \Brevo\Client\Model\CreateUpdateFolder $updateFolder Name of the folder (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function updateFolderAsyncWithHttpInfo($folderId, $updateFolder)
- {
- $returnType = '';
- $request = $this->updateFolderRequest($folderId, $updateFolder);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- return [null, $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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'updateFolder'
- *
- * @param int $folderId Id of the folder (required)
- * @param \Brevo\Client\Model\CreateUpdateFolder $updateFolder Name of the folder (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function updateFolderRequest($folderId, $updateFolder)
- {
- // verify the required parameter 'folderId' is set
- if ($folderId === null || (is_array($folderId) && count($folderId) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $folderId when calling updateFolder'
- );
- }
- // verify the required parameter 'updateFolder' is set
- if ($updateFolder === null || (is_array($updateFolder) && count($updateFolder) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $updateFolder when calling updateFolder'
- );
- }
-
- $resourcePath = '/contacts/folders/{folderId}';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
- // path params
- if ($folderId !== null) {
- $resourcePath = str_replace(
- '{' . 'folderId' . '}',
- ObjectSerializer::toPathValue($folderId),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
- if (isset($updateFolder)) {
- $_tempBody = $updateFolder;
- }
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'PUT',
- $this->config->getHost() . $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/InboundParsingApi.php b/lib/Api/InboundParsingApi.php
index 865dd15..54733a5 100644
--- a/lib/Api/InboundParsingApi.php
+++ b/lib/Api/InboundParsingApi.php
@@ -1,39 +1,41 @@
[
+ 'application/json',
+ ],
+ 'getInboundEmailEvents' => [
+ 'application/json',
+ ],
+ 'getInboundEmailEventsByUuid' => [
+ 'application/json',
+ ],
+ ];
+
+ /**
+ * @param ClientInterface|null $client
+ * @param Configuration|null $config
+ * @param HeaderSelector|null $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
+ HeaderSelector $selector = null,
+ int $hostIndex = 0
) {
$this->client = $client ?: new Client();
- $this->config = $config ?: new Configuration();
+ $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(int $hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex(): int
+ {
+ return $this->hostIndex;
}
/**
* @return Configuration
*/
- public function getConfig()
+ public function getConfig(): Configuration
{
return $this->config;
}
@@ -93,14 +135,18 @@ public function getConfig()
* Retrieve inbound attachment with download token.
*
* @param string $downloadToken Token to fetch a particular attachment (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInboundEmailAttachment'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \SplFileObject
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \SplFileObject|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function getInboundEmailAttachment($downloadToken)
+ public function getInboundEmailAttachment(
+ string $downloadToken,
+ string $contentType = self::contentTypes['getInboundEmailAttachment'][0]
+ ): \SplFileObject
{
- list($response) = $this->getInboundEmailAttachmentWithHttpInfo($downloadToken);
+ list($response) = $this->getInboundEmailAttachmentWithHttpInfo($downloadToken, $contentType);
return $response;
}
@@ -110,15 +156,18 @@ public function getInboundEmailAttachment($downloadToken)
* Retrieve inbound attachment with download token.
*
* @param string $downloadToken Token to fetch a particular attachment (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInboundEmailAttachment'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \SplFileObject|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getInboundEmailAttachmentWithHttpInfo($downloadToken)
+ public function getInboundEmailAttachmentWithHttpInfo(
+ string $downloadToken,
+ string $contentType = self::contentTypes['getInboundEmailAttachment'][0]
+ ): array
{
- $returnType = '\SplFileObject';
- $request = $this->getInboundEmailAttachmentRequest($downloadToken);
+ $request = $this->getInboundEmailAttachmentRequest($downloadToken, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -127,34 +176,138 @@ public function getInboundEmailAttachmentWithHttpInfo($downloadToken)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\SplFileObject', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\SplFileObject' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\SplFileObject', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\SplFileObject';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -177,7 +330,7 @@ public function getInboundEmailAttachmentWithHttpInfo($downloadToken)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -185,7 +338,7 @@ public function getInboundEmailAttachmentWithHttpInfo($downloadToken)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -201,13 +354,17 @@ public function getInboundEmailAttachmentWithHttpInfo($downloadToken)
* Retrieve inbound attachment with download token.
*
* @param string $downloadToken Token to fetch a particular attachment (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInboundEmailAttachment'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getInboundEmailAttachmentAsync($downloadToken)
+ public function getInboundEmailAttachmentAsync(
+ string $downloadToken,
+ string $contentType = self::contentTypes['getInboundEmailAttachment'][0]
+ ): PromiseInterface
{
- return $this->getInboundEmailAttachmentAsyncWithHttpInfo($downloadToken)
+ return $this->getInboundEmailAttachmentAsyncWithHttpInfo($downloadToken, $contentType)
->then(
function ($response) {
return $response[0];
@@ -221,24 +378,28 @@ function ($response) {
* Retrieve inbound attachment with download token.
*
* @param string $downloadToken Token to fetch a particular attachment (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInboundEmailAttachment'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getInboundEmailAttachmentAsyncWithHttpInfo($downloadToken)
+ public function getInboundEmailAttachmentAsyncWithHttpInfo(
+ $downloadToken,
+ string $contentType = self::contentTypes['getInboundEmailAttachment'][0]
+ ): PromiseInterface
{
$returnType = '\SplFileObject';
- $request = $this->getInboundEmailAttachmentRequest($downloadToken);
+ $request = $this->getInboundEmailAttachmentRequest($downloadToken, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -261,7 +422,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -271,19 +432,25 @@ function ($exception) {
* Create request for operation 'getInboundEmailAttachment'
*
* @param string $downloadToken Token to fetch a particular attachment (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInboundEmailAttachment'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getInboundEmailAttachmentRequest($downloadToken)
+ public function getInboundEmailAttachmentRequest(
+ $downloadToken,
+ string $contentType = self::contentTypes['getInboundEmailAttachment'][0]
+ ): Request
{
+
// verify the required parameter 'downloadToken' is set
if ($downloadToken === null || (is_array($downloadToken) && count($downloadToken) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $downloadToken when calling getInboundEmailAttachment'
);
}
+
$resourcePath = '/inbound/attachments/{downloadToken}';
$formParams = [];
$queryParams = [];
@@ -292,6 +459,7 @@ protected function getInboundEmailAttachmentRequest($downloadToken)
$multipart = false;
+
// path params
if ($downloadToken !== null) {
$resourcePath = str_replace(
@@ -301,53 +469,35 @@ protected function getInboundEmailAttachmentRequest($downloadToken)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/octet-stream', 'application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -373,10 +523,11 @@ protected function getInboundEmailAttachmentRequest($downloadToken)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -387,20 +538,29 @@ protected function getInboundEmailAttachmentRequest($downloadToken)
*
* Get the list of all the events for the received emails.
*
- * @param string $sender Email address of the sender. (optional)
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- * @param int $limit Number of documents returned per page (optional, default to 100)
- * @param int $offset Index of the first document on the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation (optional, default to desc)
+ * @param string|null $sender Email address of the sender. (optional)
+ * @param string|null $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
+ * @param string|null $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
+ * @param int|null $limit Number of documents returned per page (optional, default to 100)
+ * @param int|null $offset Index of the first document on the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInboundEmailEvents'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetInboundEmailEvents
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetInboundEmailEvents|\Brevo\Client\Models\ErrorModel
*/
- public function getInboundEmailEvents($sender = null, $startDate = null, $endDate = null, $limit = '100', $offset = '0', $sort = 'desc')
+ public function getInboundEmailEvents(
+ ?string $sender = null,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $limit = 100,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getInboundEmailEvents'][0]
+ ): \Brevo\Client\Models\GetInboundEmailEvents
{
- list($response) = $this->getInboundEmailEventsWithHttpInfo($sender, $startDate, $endDate, $limit, $offset, $sort);
+ list($response) = $this->getInboundEmailEventsWithHttpInfo($sender, $startDate, $endDate, $limit, $offset, $sort, $contentType);
return $response;
}
@@ -409,21 +569,29 @@ public function getInboundEmailEvents($sender = null, $startDate = null, $endDat
*
* Get the list of all the events for the received emails.
*
- * @param string $sender Email address of the sender. (optional)
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- * @param int $limit Number of documents returned per page (optional, default to 100)
- * @param int $offset Index of the first document on the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation (optional, default to desc)
+ * @param string|null $sender Email address of the sender. (optional)
+ * @param string|null $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
+ * @param string|null $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
+ * @param int|null $limit Number of documents returned per page (optional, default to 100)
+ * @param int|null $offset Index of the first document on the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInboundEmailEvents'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetInboundEmailEvents, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetInboundEmailEvents|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getInboundEmailEventsWithHttpInfo($sender = null, $startDate = null, $endDate = null, $limit = '100', $offset = '0', $sort = 'desc')
+ public function getInboundEmailEventsWithHttpInfo(
+ ?string $sender = null,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $limit = 100,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getInboundEmailEvents'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetInboundEmailEvents';
- $request = $this->getInboundEmailEventsRequest($sender, $startDate, $endDate, $limit, $offset, $sort);
+ $request = $this->getInboundEmailEventsRequest($sender, $startDate, $endDate, $limit, $offset, $sort, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -432,34 +600,111 @@ public function getInboundEmailEventsWithHttpInfo($sender = null, $startDate = n
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetInboundEmailEvents', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetInboundEmailEvents' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetInboundEmailEvents', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetInboundEmailEvents';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -474,7 +719,7 @@ public function getInboundEmailEventsWithHttpInfo($sender = null, $startDate = n
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetInboundEmailEvents',
+ '\Brevo\Client\Models\GetInboundEmailEvents',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -482,7 +727,7 @@ public function getInboundEmailEventsWithHttpInfo($sender = null, $startDate = n
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -497,19 +742,28 @@ public function getInboundEmailEventsWithHttpInfo($sender = null, $startDate = n
*
* Get the list of all the events for the received emails.
*
- * @param string $sender Email address of the sender. (optional)
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- * @param int $limit Number of documents returned per page (optional, default to 100)
- * @param int $offset Index of the first document on the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation (optional, default to desc)
+ * @param string|null $sender Email address of the sender. (optional)
+ * @param string|null $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
+ * @param string|null $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
+ * @param int|null $limit Number of documents returned per page (optional, default to 100)
+ * @param int|null $offset Index of the first document on the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInboundEmailEvents'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getInboundEmailEventsAsync($sender = null, $startDate = null, $endDate = null, $limit = '100', $offset = '0', $sort = 'desc')
+ public function getInboundEmailEventsAsync(
+ ?string $sender = null,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $limit = 100,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getInboundEmailEvents'][0]
+ ): PromiseInterface
{
- return $this->getInboundEmailEventsAsyncWithHttpInfo($sender, $startDate, $endDate, $limit, $offset, $sort)
+ return $this->getInboundEmailEventsAsyncWithHttpInfo($sender, $startDate, $endDate, $limit, $offset, $sort, $contentType)
->then(
function ($response) {
return $response[0];
@@ -522,30 +776,39 @@ function ($response) {
*
* Get the list of all the events for the received emails.
*
- * @param string $sender Email address of the sender. (optional)
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- * @param int $limit Number of documents returned per page (optional, default to 100)
- * @param int $offset Index of the first document on the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation (optional, default to desc)
+ * @param string|null $sender Email address of the sender. (optional)
+ * @param string|null $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
+ * @param string|null $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
+ * @param int|null $limit Number of documents returned per page (optional, default to 100)
+ * @param int|null $offset Index of the first document on the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInboundEmailEvents'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getInboundEmailEventsAsyncWithHttpInfo($sender = null, $startDate = null, $endDate = null, $limit = '100', $offset = '0', $sort = 'desc')
+ public function getInboundEmailEventsAsyncWithHttpInfo(
+ $sender = null,
+ $startDate = null,
+ $endDate = null,
+ $limit = 100,
+ $offset = 0,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getInboundEmailEvents'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetInboundEmailEvents';
- $request = $this->getInboundEmailEventsRequest($sender, $startDate, $endDate, $limit, $offset, $sort);
+ $returnType = '\Brevo\Client\Models\GetInboundEmailEvents';
+ $request = $this->getInboundEmailEventsRequest($sender, $startDate, $endDate, $limit, $offset, $sort, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -568,7 +831,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -577,24 +840,39 @@ function ($exception) {
/**
* Create request for operation 'getInboundEmailEvents'
*
- * @param string $sender Email address of the sender. (optional)
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- * @param int $limit Number of documents returned per page (optional, default to 100)
- * @param int $offset Index of the first document on the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation (optional, default to desc)
+ * @param string|null $sender Email address of the sender. (optional)
+ * @param string|null $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
+ * @param string|null $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
+ * @param int|null $limit Number of documents returned per page (optional, default to 100)
+ * @param int|null $offset Index of the first document on the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInboundEmailEvents'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getInboundEmailEventsRequest($sender = null, $startDate = null, $endDate = null, $limit = '100', $offset = '0', $sort = 'desc')
+ public function getInboundEmailEventsRequest(
+ $sender = null,
+ $startDate = null,
+ $endDate = null,
+ $limit = 100,
+ $offset = 0,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getInboundEmailEvents'][0]
+ ): Request
{
+
+
+
+
if ($limit !== null && $limit > 500) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling InboundParsingApi.getInboundEmailEvents, must be smaller than or equal to 500.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling InboundParsingApi.getInboundEmailEvents, must be smaller than or equal to 500.');
}
if ($limit !== null && $limit < 0) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling InboundParsingApi.getInboundEmailEvents, must be bigger than or equal to 0.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling InboundParsingApi.getInboundEmailEvents, must be bigger than or equal to 0.');
}
+
+
$resourcePath = '/inbound/events';
@@ -605,78 +883,91 @@ protected function getInboundEmailEventsRequest($sender = null, $startDate = nul
$multipart = false;
// query params
- if ($sender !== null) {
- $queryParams['sender'] = ObjectSerializer::toQueryValue($sender);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sender,
+ 'sender', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($startDate !== null) {
- $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $startDate,
+ 'startDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($endDate !== null) {
- $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $endDate,
+ 'endDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -702,10 +993,11 @@ protected function getInboundEmailEventsRequest($sender = null, $startDate = nul
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -717,14 +1009,18 @@ protected function getInboundEmailEventsRequest($sender = null, $startDate = nul
* Fetch all events history for one particular received email.
*
* @param string $uuid UUID to fetch events specific to recieved email (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInboundEmailEventsByUuid'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetInboundEmailEventsByUuid
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetInboundEmailEventsByUuid|\Brevo\Client\Models\ErrorModel
*/
- public function getInboundEmailEventsByUuid($uuid)
+ public function getInboundEmailEventsByUuid(
+ string $uuid,
+ string $contentType = self::contentTypes['getInboundEmailEventsByUuid'][0]
+ ): \Brevo\Client\Models\GetInboundEmailEventsByUuid
{
- list($response) = $this->getInboundEmailEventsByUuidWithHttpInfo($uuid);
+ list($response) = $this->getInboundEmailEventsByUuidWithHttpInfo($uuid, $contentType);
return $response;
}
@@ -734,15 +1030,18 @@ public function getInboundEmailEventsByUuid($uuid)
* Fetch all events history for one particular received email.
*
* @param string $uuid UUID to fetch events specific to recieved email (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInboundEmailEventsByUuid'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetInboundEmailEventsByUuid, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetInboundEmailEventsByUuid|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getInboundEmailEventsByUuidWithHttpInfo($uuid)
+ public function getInboundEmailEventsByUuidWithHttpInfo(
+ string $uuid,
+ string $contentType = self::contentTypes['getInboundEmailEventsByUuid'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetInboundEmailEventsByUuid';
- $request = $this->getInboundEmailEventsByUuidRequest($uuid);
+ $request = $this->getInboundEmailEventsByUuidRequest($uuid, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -751,34 +1050,111 @@ public function getInboundEmailEventsByUuidWithHttpInfo($uuid)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetInboundEmailEventsByUuid', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetInboundEmailEventsByUuid' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetInboundEmailEventsByUuid', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetInboundEmailEventsByUuid';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -793,7 +1169,7 @@ public function getInboundEmailEventsByUuidWithHttpInfo($uuid)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetInboundEmailEventsByUuid',
+ '\Brevo\Client\Models\GetInboundEmailEventsByUuid',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -801,7 +1177,7 @@ public function getInboundEmailEventsByUuidWithHttpInfo($uuid)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -817,13 +1193,17 @@ public function getInboundEmailEventsByUuidWithHttpInfo($uuid)
* Fetch all events history for one particular received email.
*
* @param string $uuid UUID to fetch events specific to recieved email (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInboundEmailEventsByUuid'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getInboundEmailEventsByUuidAsync($uuid)
+ public function getInboundEmailEventsByUuidAsync(
+ string $uuid,
+ string $contentType = self::contentTypes['getInboundEmailEventsByUuid'][0]
+ ): PromiseInterface
{
- return $this->getInboundEmailEventsByUuidAsyncWithHttpInfo($uuid)
+ return $this->getInboundEmailEventsByUuidAsyncWithHttpInfo($uuid, $contentType)
->then(
function ($response) {
return $response[0];
@@ -837,24 +1217,28 @@ function ($response) {
* Fetch all events history for one particular received email.
*
* @param string $uuid UUID to fetch events specific to recieved email (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInboundEmailEventsByUuid'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getInboundEmailEventsByUuidAsyncWithHttpInfo($uuid)
+ public function getInboundEmailEventsByUuidAsyncWithHttpInfo(
+ $uuid,
+ string $contentType = self::contentTypes['getInboundEmailEventsByUuid'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetInboundEmailEventsByUuid';
- $request = $this->getInboundEmailEventsByUuidRequest($uuid);
+ $returnType = '\Brevo\Client\Models\GetInboundEmailEventsByUuid';
+ $request = $this->getInboundEmailEventsByUuidRequest($uuid, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -877,7 +1261,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -887,19 +1271,25 @@ function ($exception) {
* Create request for operation 'getInboundEmailEventsByUuid'
*
* @param string $uuid UUID to fetch events specific to recieved email (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInboundEmailEventsByUuid'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getInboundEmailEventsByUuidRequest($uuid)
+ public function getInboundEmailEventsByUuidRequest(
+ $uuid,
+ string $contentType = self::contentTypes['getInboundEmailEventsByUuid'][0]
+ ): Request
{
+
// verify the required parameter 'uuid' is set
if ($uuid === null || (is_array($uuid) && count($uuid) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $uuid when calling getInboundEmailEventsByUuid'
);
}
+
$resourcePath = '/inbound/events/{uuid}';
$formParams = [];
$queryParams = [];
@@ -908,6 +1298,7 @@ protected function getInboundEmailEventsByUuidRequest($uuid)
$multipart = false;
+
// path params
if ($uuid !== null) {
$resourcePath = str_replace(
@@ -917,53 +1308,35 @@ protected function getInboundEmailEventsByUuidRequest($uuid)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -989,10 +1362,11 @@ protected function getInboundEmailEventsByUuidRequest($uuid)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1004,7 +1378,7 @@ protected function getInboundEmailEventsByUuidRequest($uuid)
* @throws \RuntimeException on file opening failure
* @return array of http client options
*/
- protected function createHttpClientOption()
+ protected function createHttpClientOption(): array
{
$options = [];
if ($this->config->getDebug()) {
diff --git a/lib/Api/ListsApi.php b/lib/Api/ListsApi.php
deleted file mode 100644
index da332bd..0000000
--- a/lib/Api/ListsApi.php
+++ /dev/null
@@ -1,2793 +0,0 @@
-client = $client ?: new Client();
- $this->config = $config ?: new Configuration();
- $this->headerSelector = $selector ?: new HeaderSelector();
- }
-
- /**
- * @return Configuration
- */
- public function getConfig()
- {
- return $this->config;
- }
-
- /**
- * Operation addContactToList
- *
- * Add existing contacts to a list
- *
- * @param int $listId Id of the list (required)
- * @param \Brevo\Client\Model\AddContactToList $contactEmails Emails addresses OR IDs of the contacts (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\PostContactInfo
- */
- public function addContactToList($listId, $contactEmails)
- {
- list($response) = $this->addContactToListWithHttpInfo($listId, $contactEmails);
- return $response;
- }
-
- /**
- * Operation addContactToListWithHttpInfo
- *
- * Add existing contacts to a list
- *
- * @param int $listId Id of the list (required)
- * @param \Brevo\Client\Model\AddContactToList $contactEmails Emails addresses OR IDs of the contacts (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\PostContactInfo, HTTP status code, HTTP response headers (array of strings)
- */
- public function addContactToListWithHttpInfo($listId, $contactEmails)
- {
- $returnType = '\Brevo\Client\Model\PostContactInfo';
- $request = $this->addContactToListRequest($listId, $contactEmails);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
-
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 201:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\PostContactInfo',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation addContactToListAsync
- *
- * Add existing contacts to a list
- *
- * @param int $listId Id of the list (required)
- * @param \Brevo\Client\Model\AddContactToList $contactEmails Emails addresses OR IDs of the contacts (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function addContactToListAsync($listId, $contactEmails)
- {
- return $this->addContactToListAsyncWithHttpInfo($listId, $contactEmails)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation addContactToListAsyncWithHttpInfo
- *
- * Add existing contacts to a list
- *
- * @param int $listId Id of the list (required)
- * @param \Brevo\Client\Model\AddContactToList $contactEmails Emails addresses OR IDs of the contacts (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function addContactToListAsyncWithHttpInfo($listId, $contactEmails)
- {
- $returnType = '\Brevo\Client\Model\PostContactInfo';
- $request = $this->addContactToListRequest($listId, $contactEmails);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- 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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'addContactToList'
- *
- * @param int $listId Id of the list (required)
- * @param \Brevo\Client\Model\AddContactToList $contactEmails Emails addresses OR IDs of the contacts (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function addContactToListRequest($listId, $contactEmails)
- {
- // verify the required parameter 'listId' is set
- if ($listId === null || (is_array($listId) && count($listId) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $listId when calling addContactToList'
- );
- }
- // verify the required parameter 'contactEmails' is set
- if ($contactEmails === null || (is_array($contactEmails) && count($contactEmails) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $contactEmails when calling addContactToList'
- );
- }
-
- $resourcePath = '/contacts/lists/{listId}/contacts/add';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
- // path params
- if ($listId !== null) {
- $resourcePath = str_replace(
- '{' . 'listId' . '}',
- ObjectSerializer::toPathValue($listId),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
- if (isset($contactEmails)) {
- $_tempBody = $contactEmails;
- }
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation createList
- *
- * Create a list
- *
- * @param \Brevo\Client\Model\CreateList $createList Values to create a list (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\CreateModel
- */
- public function createList($createList)
- {
- list($response) = $this->createListWithHttpInfo($createList);
- return $response;
- }
-
- /**
- * Operation createListWithHttpInfo
- *
- * Create a list
- *
- * @param \Brevo\Client\Model\CreateList $createList Values to create a list (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\CreateModel, HTTP status code, HTTP response headers (array of strings)
- */
- public function createListWithHttpInfo($createList)
- {
- $returnType = '\Brevo\Client\Model\CreateModel';
- $request = $this->createListRequest($createList);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
-
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 201:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\CreateModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation createListAsync
- *
- * Create a list
- *
- * @param \Brevo\Client\Model\CreateList $createList Values to create a list (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function createListAsync($createList)
- {
- return $this->createListAsyncWithHttpInfo($createList)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation createListAsyncWithHttpInfo
- *
- * Create a list
- *
- * @param \Brevo\Client\Model\CreateList $createList Values to create a list (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function createListAsyncWithHttpInfo($createList)
- {
- $returnType = '\Brevo\Client\Model\CreateModel';
- $request = $this->createListRequest($createList);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- 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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'createList'
- *
- * @param \Brevo\Client\Model\CreateList $createList Values to create a list (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function createListRequest($createList)
- {
- // verify the required parameter 'createList' is set
- if ($createList === null || (is_array($createList) && count($createList) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $createList when calling createList'
- );
- }
-
- $resourcePath = '/contacts/lists';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
-
- // body params
- $_tempBody = null;
- if (isset($createList)) {
- $_tempBody = $createList;
- }
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation deleteList
- *
- * Delete a list
- *
- * @param int $listId Id of the list (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return void
- */
- public function deleteList($listId)
- {
- $this->deleteListWithHttpInfo($listId);
- }
-
- /**
- * Operation deleteListWithHttpInfo
- *
- * Delete a list
- *
- * @param int $listId Id of the list (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of null, HTTP status code, HTTP response headers (array of strings)
- */
- public function deleteListWithHttpInfo($listId)
- {
- $returnType = '';
- $request = $this->deleteListRequest($listId);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- return [null, $statusCode, $response->getHeaders()];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation deleteListAsync
- *
- * Delete a list
- *
- * @param int $listId Id of the list (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function deleteListAsync($listId)
- {
- return $this->deleteListAsyncWithHttpInfo($listId)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation deleteListAsyncWithHttpInfo
- *
- * Delete a list
- *
- * @param int $listId Id of the list (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function deleteListAsyncWithHttpInfo($listId)
- {
- $returnType = '';
- $request = $this->deleteListRequest($listId);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- return [null, $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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'deleteList'
- *
- * @param int $listId Id of the list (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function deleteListRequest($listId)
- {
- // verify the required parameter 'listId' is set
- if ($listId === null || (is_array($listId) && count($listId) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $listId when calling deleteList'
- );
- }
-
- $resourcePath = '/contacts/lists/{listId}';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
- // path params
- if ($listId !== null) {
- $resourcePath = str_replace(
- '{' . 'listId' . '}',
- ObjectSerializer::toPathValue($listId),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation getContactsFromList
- *
- * Get contacts in a list
- *
- * @param int $listId Id of the list (required)
- * @param string $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetContacts
- */
- public function getContactsFromList($listId, $modifiedSince = null, $limit = '50', $offset = '0', $sort = 'desc')
- {
- list($response) = $this->getContactsFromListWithHttpInfo($listId, $modifiedSince, $limit, $offset, $sort);
- return $response;
- }
-
- /**
- * Operation getContactsFromListWithHttpInfo
- *
- * Get contacts in a list
- *
- * @param int $listId Id of the list (required)
- * @param string $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetContacts, HTTP status code, HTTP response headers (array of strings)
- */
- public function getContactsFromListWithHttpInfo($listId, $modifiedSince = null, $limit = '50', $offset = '0', $sort = 'desc')
- {
- $returnType = '\Brevo\Client\Model\GetContacts';
- $request = $this->getContactsFromListRequest($listId, $modifiedSince, $limit, $offset, $sort);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
-
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 200:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\GetContacts',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation getContactsFromListAsync
- *
- * Get contacts in a list
- *
- * @param int $listId Id of the list (required)
- * @param string $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getContactsFromListAsync($listId, $modifiedSince = null, $limit = '50', $offset = '0', $sort = 'desc')
- {
- return $this->getContactsFromListAsyncWithHttpInfo($listId, $modifiedSince, $limit, $offset, $sort)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation getContactsFromListAsyncWithHttpInfo
- *
- * Get contacts in a list
- *
- * @param int $listId Id of the list (required)
- * @param string $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getContactsFromListAsyncWithHttpInfo($listId, $modifiedSince = null, $limit = '50', $offset = '0', $sort = 'desc')
- {
- $returnType = '\Brevo\Client\Model\GetContacts';
- $request = $this->getContactsFromListRequest($listId, $modifiedSince, $limit, $offset, $sort);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- 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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'getContactsFromList'
- *
- * @param int $listId Id of the list (required)
- * @param string $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function getContactsFromListRequest($listId, $modifiedSince = null, $limit = '50', $offset = '0', $sort = 'desc')
- {
- // verify the required parameter 'listId' is set
- if ($listId === null || (is_array($listId) && count($listId) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $listId when calling getContactsFromList'
- );
- }
- if ($limit !== null && $limit > 500) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling ListsApi.getContactsFromList, must be smaller than or equal to 500.');
- }
-
-
- $resourcePath = '/contacts/lists/{listId}/contacts';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
- // query params
- if ($modifiedSince !== null) {
- $queryParams['modifiedSince'] = ObjectSerializer::toQueryValue($modifiedSince);
- }
- // query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
- // query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
- // query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
-
- // path params
- if ($listId !== null) {
- $resourcePath = str_replace(
- '{' . 'listId' . '}',
- ObjectSerializer::toPathValue($listId),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation getFolderLists
- *
- * Get lists in a folder
- *
- * @param int $folderId Id of the folder (required)
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetFolderLists
- */
- public function getFolderLists($folderId, $limit = '10', $offset = '0', $sort = 'desc')
- {
- list($response) = $this->getFolderListsWithHttpInfo($folderId, $limit, $offset, $sort);
- return $response;
- }
-
- /**
- * Operation getFolderListsWithHttpInfo
- *
- * Get lists in a folder
- *
- * @param int $folderId Id of the folder (required)
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetFolderLists, HTTP status code, HTTP response headers (array of strings)
- */
- public function getFolderListsWithHttpInfo($folderId, $limit = '10', $offset = '0', $sort = 'desc')
- {
- $returnType = '\Brevo\Client\Model\GetFolderLists';
- $request = $this->getFolderListsRequest($folderId, $limit, $offset, $sort);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
-
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 200:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\GetFolderLists',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation getFolderListsAsync
- *
- * Get lists in a folder
- *
- * @param int $folderId Id of the folder (required)
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getFolderListsAsync($folderId, $limit = '10', $offset = '0', $sort = 'desc')
- {
- return $this->getFolderListsAsyncWithHttpInfo($folderId, $limit, $offset, $sort)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation getFolderListsAsyncWithHttpInfo
- *
- * Get lists in a folder
- *
- * @param int $folderId Id of the folder (required)
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getFolderListsAsyncWithHttpInfo($folderId, $limit = '10', $offset = '0', $sort = 'desc')
- {
- $returnType = '\Brevo\Client\Model\GetFolderLists';
- $request = $this->getFolderListsRequest($folderId, $limit, $offset, $sort);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- 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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'getFolderLists'
- *
- * @param int $folderId Id of the folder (required)
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function getFolderListsRequest($folderId, $limit = '10', $offset = '0', $sort = 'desc')
- {
- // verify the required parameter 'folderId' is set
- if ($folderId === null || (is_array($folderId) && count($folderId) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $folderId when calling getFolderLists'
- );
- }
- if ($limit !== null && $limit > 50) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling ListsApi.getFolderLists, must be smaller than or equal to 50.');
- }
-
-
- $resourcePath = '/contacts/folders/{folderId}/lists';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
- // query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
- // query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
- // query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
-
- // path params
- if ($folderId !== null) {
- $resourcePath = str_replace(
- '{' . 'folderId' . '}',
- ObjectSerializer::toPathValue($folderId),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation getList
- *
- * Get a list's details
- *
- * @param int $listId Id of the list (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetExtendedList
- */
- public function getList($listId)
- {
- list($response) = $this->getListWithHttpInfo($listId);
- return $response;
- }
-
- /**
- * Operation getListWithHttpInfo
- *
- * Get a list's details
- *
- * @param int $listId Id of the list (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetExtendedList, HTTP status code, HTTP response headers (array of strings)
- */
- public function getListWithHttpInfo($listId)
- {
- $returnType = '\Brevo\Client\Model\GetExtendedList';
- $request = $this->getListRequest($listId);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
-
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 200:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\GetExtendedList',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation getListAsync
- *
- * Get a list's details
- *
- * @param int $listId Id of the list (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getListAsync($listId)
- {
- return $this->getListAsyncWithHttpInfo($listId)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation getListAsyncWithHttpInfo
- *
- * Get a list's details
- *
- * @param int $listId Id of the list (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getListAsyncWithHttpInfo($listId)
- {
- $returnType = '\Brevo\Client\Model\GetExtendedList';
- $request = $this->getListRequest($listId);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- 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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'getList'
- *
- * @param int $listId Id of the list (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function getListRequest($listId)
- {
- // verify the required parameter 'listId' is set
- if ($listId === null || (is_array($listId) && count($listId) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $listId when calling getList'
- );
- }
-
- $resourcePath = '/contacts/lists/{listId}';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
- // path params
- if ($listId !== null) {
- $resourcePath = str_replace(
- '{' . 'listId' . '}',
- ObjectSerializer::toPathValue($listId),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation getLists
- *
- * Get all the lists
- *
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetLists
- */
- public function getLists($limit = '10', $offset = '0', $sort = 'desc')
- {
- list($response) = $this->getListsWithHttpInfo($limit, $offset, $sort);
- return $response;
- }
-
- /**
- * Operation getListsWithHttpInfo
- *
- * Get all the lists
- *
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetLists, HTTP status code, HTTP response headers (array of strings)
- */
- public function getListsWithHttpInfo($limit = '10', $offset = '0', $sort = 'desc')
- {
- $returnType = '\Brevo\Client\Model\GetLists';
- $request = $this->getListsRequest($limit, $offset, $sort);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
-
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 200:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\GetLists',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation getListsAsync
- *
- * Get all the lists
- *
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getListsAsync($limit = '10', $offset = '0', $sort = 'desc')
- {
- return $this->getListsAsyncWithHttpInfo($limit, $offset, $sort)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation getListsAsyncWithHttpInfo
- *
- * Get all the lists
- *
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getListsAsyncWithHttpInfo($limit = '10', $offset = '0', $sort = 'desc')
- {
- $returnType = '\Brevo\Client\Model\GetLists';
- $request = $this->getListsRequest($limit, $offset, $sort);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- 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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'getLists'
- *
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function getListsRequest($limit = '10', $offset = '0', $sort = 'desc')
- {
- if ($limit !== null && $limit > 50) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling ListsApi.getLists, must be smaller than or equal to 50.');
- }
-
-
- $resourcePath = '/contacts/lists';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
- // query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
- // query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
- // query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
-
-
- // body params
- $_tempBody = null;
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation removeContactFromList
- *
- * Delete a contact from a list
- *
- * @param int $listId Id of the list (required)
- * @param \Brevo\Client\Model\RemoveContactFromList $contactEmails Emails addresses OR IDs of the contacts (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\PostContactInfo
- */
- public function removeContactFromList($listId, $contactEmails)
- {
- list($response) = $this->removeContactFromListWithHttpInfo($listId, $contactEmails);
- return $response;
- }
-
- /**
- * Operation removeContactFromListWithHttpInfo
- *
- * Delete a contact from a list
- *
- * @param int $listId Id of the list (required)
- * @param \Brevo\Client\Model\RemoveContactFromList $contactEmails Emails addresses OR IDs of the contacts (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\PostContactInfo, HTTP status code, HTTP response headers (array of strings)
- */
- public function removeContactFromListWithHttpInfo($listId, $contactEmails)
- {
- $returnType = '\Brevo\Client\Model\PostContactInfo';
- $request = $this->removeContactFromListRequest($listId, $contactEmails);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
-
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 201:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\PostContactInfo',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation removeContactFromListAsync
- *
- * Delete a contact from a list
- *
- * @param int $listId Id of the list (required)
- * @param \Brevo\Client\Model\RemoveContactFromList $contactEmails Emails addresses OR IDs of the contacts (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function removeContactFromListAsync($listId, $contactEmails)
- {
- return $this->removeContactFromListAsyncWithHttpInfo($listId, $contactEmails)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation removeContactFromListAsyncWithHttpInfo
- *
- * Delete a contact from a list
- *
- * @param int $listId Id of the list (required)
- * @param \Brevo\Client\Model\RemoveContactFromList $contactEmails Emails addresses OR IDs of the contacts (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function removeContactFromListAsyncWithHttpInfo($listId, $contactEmails)
- {
- $returnType = '\Brevo\Client\Model\PostContactInfo';
- $request = $this->removeContactFromListRequest($listId, $contactEmails);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- 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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'removeContactFromList'
- *
- * @param int $listId Id of the list (required)
- * @param \Brevo\Client\Model\RemoveContactFromList $contactEmails Emails addresses OR IDs of the contacts (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function removeContactFromListRequest($listId, $contactEmails)
- {
- // verify the required parameter 'listId' is set
- if ($listId === null || (is_array($listId) && count($listId) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $listId when calling removeContactFromList'
- );
- }
- // verify the required parameter 'contactEmails' is set
- if ($contactEmails === null || (is_array($contactEmails) && count($contactEmails) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $contactEmails when calling removeContactFromList'
- );
- }
-
- $resourcePath = '/contacts/lists/{listId}/contacts/remove';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
- // path params
- if ($listId !== null) {
- $resourcePath = str_replace(
- '{' . 'listId' . '}',
- ObjectSerializer::toPathValue($listId),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
- if (isset($contactEmails)) {
- $_tempBody = $contactEmails;
- }
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation updateList
- *
- * Update a list
- *
- * @param int $listId Id of the list (required)
- * @param \Brevo\Client\Model\UpdateList $updateList Values to update a list (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return void
- */
- public function updateList($listId, $updateList)
- {
- $this->updateListWithHttpInfo($listId, $updateList);
- }
-
- /**
- * Operation updateListWithHttpInfo
- *
- * Update a list
- *
- * @param int $listId Id of the list (required)
- * @param \Brevo\Client\Model\UpdateList $updateList Values to update a list (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of null, HTTP status code, HTTP response headers (array of strings)
- */
- public function updateListWithHttpInfo($listId, $updateList)
- {
- $returnType = '';
- $request = $this->updateListRequest($listId, $updateList);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- return [null, $statusCode, $response->getHeaders()];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation updateListAsync
- *
- * Update a list
- *
- * @param int $listId Id of the list (required)
- * @param \Brevo\Client\Model\UpdateList $updateList Values to update a list (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function updateListAsync($listId, $updateList)
- {
- return $this->updateListAsyncWithHttpInfo($listId, $updateList)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation updateListAsyncWithHttpInfo
- *
- * Update a list
- *
- * @param int $listId Id of the list (required)
- * @param \Brevo\Client\Model\UpdateList $updateList Values to update a list (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function updateListAsyncWithHttpInfo($listId, $updateList)
- {
- $returnType = '';
- $request = $this->updateListRequest($listId, $updateList);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- return [null, $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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'updateList'
- *
- * @param int $listId Id of the list (required)
- * @param \Brevo\Client\Model\UpdateList $updateList Values to update a list (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function updateListRequest($listId, $updateList)
- {
- // verify the required parameter 'listId' is set
- if ($listId === null || (is_array($listId) && count($listId) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $listId when calling updateList'
- );
- }
- // verify the required parameter 'updateList' is set
- if ($updateList === null || (is_array($updateList) && count($updateList) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $updateList when calling updateList'
- );
- }
-
- $resourcePath = '/contacts/lists/{listId}';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
- // path params
- if ($listId !== null) {
- $resourcePath = str_replace(
- '{' . 'listId' . '}',
- ObjectSerializer::toPathValue($listId),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
- if (isset($updateList)) {
- $_tempBody = $updateList;
- }
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'PUT',
- $this->config->getHost() . $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/MasterAccountApi.php b/lib/Api/MasterAccountApi.php
index 8de81eb..b6e2b43 100644
--- a/lib/Api/MasterAccountApi.php
+++ b/lib/Api/MasterAccountApi.php
@@ -1,39 +1,41 @@
[
+ 'application/json',
+ ],
+ 'corporateGroupIdGet' => [
+ 'application/json',
+ ],
+ 'corporateGroupIdPut' => [
+ 'application/json',
+ ],
+ 'corporateGroupPost' => [
+ 'application/json',
+ ],
+ 'corporateGroupUnlinkGroupIdSubAccountsPut' => [
+ 'application/json',
+ ],
+ 'corporateIpGet' => [
+ 'application/json',
+ ],
+ 'corporateMasterAccountGet' => [
+ 'application/json',
+ ],
+ 'corporateSsoTokenPost' => [
+ 'application/json',
+ ],
+ 'corporateSubAccountGet' => [
+ 'application/json',
+ ],
+ 'corporateSubAccountIdApplicationsTogglePut' => [
+ 'application/json',
+ ],
+ 'corporateSubAccountIdDelete' => [
+ 'application/json',
+ ],
+ 'corporateSubAccountIdGet' => [
+ 'application/json',
+ ],
+ 'corporateSubAccountIdPlanPut' => [
+ 'application/json',
+ ],
+ 'corporateSubAccountIpAssociatePost' => [
+ 'application/json',
+ ],
+ 'corporateSubAccountIpDissociatePut' => [
+ 'application/json',
+ ],
+ 'corporateSubAccountKeyPost' => [
+ 'application/json',
+ ],
+ 'corporateSubAccountPost' => [
+ 'application/json',
+ ],
+ 'corporateSubAccountSsoTokenPost' => [
+ 'application/json',
+ ],
+ 'corporateUserEmailPermissionsPut' => [
+ 'application/json',
+ ],
+ 'corporateUserInvitationActionEmailPut' => [
+ 'application/json',
+ ],
+ 'corporateUserRevokeEmailDelete' => [
+ 'application/json',
+ ],
+ 'getAccountActivity_0' => [
+ 'application/json',
+ ],
+ 'getCorporateInvitedUsersList' => [
+ 'application/json',
+ ],
+ 'getCorporateUserPermission' => [
+ 'application/json',
+ ],
+ 'getSubAccountGroups' => [
+ 'application/json',
+ ],
+ 'inviteAdminUser' => [
+ 'application/json',
+ ],
+ ];
+
+ /**
+ * @param ClientInterface|null $client
+ * @param Configuration|null $config
+ * @param HeaderSelector|null $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
+ HeaderSelector $selector = null,
+ int $hostIndex = 0
) {
$this->client = $client ?: new Client();
- $this->config = $config ?: new Configuration();
+ $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(int $hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex(): int
+ {
+ return $this->hostIndex;
}
/**
* @return Configuration
*/
- public function getConfig()
+ public function getConfig(): Configuration
{
return $this->config;
}
/**
- * Operation corporateGroupIdPut
+ * Operation corporateGroupIdDelete
*
- * Update a group of sub-accounts
+ * Delete a group
*
* @param string $id Id of the group (required)
- * @param \Brevo\Client\Model\Body1 $body Group details to be updated. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateGroupIdDelete'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function corporateGroupIdPut($id, $body)
+ public function corporateGroupIdDelete(
+ string $id,
+ string $contentType = self::contentTypes['corporateGroupIdDelete'][0]
+ ): void
{
- $this->corporateGroupIdPutWithHttpInfo($id, $body);
+ $this->corporateGroupIdDeleteWithHttpInfo($id, $contentType);
}
/**
- * Operation corporateGroupIdPutWithHttpInfo
+ * Operation corporateGroupIdDeleteWithHttpInfo
*
- * Update a group of sub-accounts
+ * Delete a group
*
* @param string $id Id of the group (required)
- * @param \Brevo\Client\Model\Body1 $body Group details to be updated. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateGroupIdDelete'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function corporateGroupIdPutWithHttpInfo($id, $body)
+ public function corporateGroupIdDeleteWithHttpInfo(
+ string $id,
+ string $contentType = self::contentTypes['corporateGroupIdDelete'][0]
+ ): array
{
- $returnType = '';
- $request = $this->corporateGroupIdPutRequest($id, $body);
+ $request = $this->corporateGroupIdDeleteRequest($id, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -128,26 +244,21 @@ public function corporateGroupIdPutWithHttpInfo($id, $body)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -156,7 +267,7 @@ public function corporateGroupIdPutWithHttpInfo($id, $body)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -167,19 +278,22 @@ public function corporateGroupIdPutWithHttpInfo($id, $body)
}
/**
- * Operation corporateGroupIdPutAsync
+ * Operation corporateGroupIdDeleteAsync
*
- * Update a group of sub-accounts
+ * Delete a group
*
* @param string $id Id of the group (required)
- * @param \Brevo\Client\Model\Body1 $body Group details to be updated. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateGroupIdDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function corporateGroupIdPutAsync($id, $body)
+ public function corporateGroupIdDeleteAsync(
+ string $id,
+ string $contentType = self::contentTypes['corporateGroupIdDelete'][0]
+ ): PromiseInterface
{
- return $this->corporateGroupIdPutAsyncWithHttpInfo($id, $body)
+ return $this->corporateGroupIdDeleteAsyncWithHttpInfo($id, $contentType)
->then(
function ($response) {
return $response[0];
@@ -188,20 +302,24 @@ function ($response) {
}
/**
- * Operation corporateGroupIdPutAsyncWithHttpInfo
+ * Operation corporateGroupIdDeleteAsyncWithHttpInfo
*
- * Update a group of sub-accounts
+ * Delete a group
*
* @param string $id Id of the group (required)
- * @param \Brevo\Client\Model\Body1 $body Group details to be updated. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateGroupIdDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function corporateGroupIdPutAsyncWithHttpInfo($id, $body)
+ public function corporateGroupIdDeleteAsyncWithHttpInfo(
+ $id,
+ string $contentType = self::contentTypes['corporateGroupIdDelete'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->corporateGroupIdPutRequest($id, $body);
+ $request = $this->corporateGroupIdDeleteRequest($id, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -220,36 +338,35 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
}
/**
- * Create request for operation 'corporateGroupIdPut'
+ * Create request for operation 'corporateGroupIdDelete'
*
* @param string $id Id of the group (required)
- * @param \Brevo\Client\Model\Body1 $body Group details to be updated. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateGroupIdDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function corporateGroupIdPutRequest($id, $body)
+ public function corporateGroupIdDeleteRequest(
+ $id,
+ string $contentType = self::contentTypes['corporateGroupIdDelete'][0]
+ ): Request
{
+
// 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 corporateGroupIdPut'
- );
- }
- // verify the required parameter 'body' is set
- if ($body === null || (is_array($body) && count($body) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $body when calling corporateGroupIdPut'
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $id when calling corporateGroupIdDelete'
);
}
+
$resourcePath = '/corporate/group/{id}';
$formParams = [];
$queryParams = [];
@@ -258,6 +375,7 @@ protected function corporateGroupIdPutRequest($id, $body)
$multipart = false;
+
// path params
if ($id !== null) {
$resourcePath = str_replace(
@@ -267,56 +385,35 @@ protected function corporateGroupIdPutRequest($id, $body)
);
}
- // body params
- $_tempBody = null;
- if (isset($body)) {
- $_tempBody = $body;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -342,47 +439,55 @@ protected function corporateGroupIdPutRequest($id, $body)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
- 'PUT',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ 'DELETE',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
}
/**
- * Operation corporateGroupPost
+ * Operation corporateGroupIdGet
*
- * Create a new group of sub-accounts
+ * GET a group details
*
- * @param \Brevo\Client\Model\Body $body Group details to be created. (required)
+ * @param string $id Id of the group of sub-organization (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateGroupIdGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\InlineResponse201
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CorporateGroupDetailsResponse
*/
- public function corporateGroupPost($body)
+ public function corporateGroupIdGet(
+ string $id,
+ string $contentType = self::contentTypes['corporateGroupIdGet'][0]
+ ): \Brevo\Client\Models\CorporateGroupDetailsResponse
{
- list($response) = $this->corporateGroupPostWithHttpInfo($body);
+ list($response) = $this->corporateGroupIdGetWithHttpInfo($id, $contentType);
return $response;
}
/**
- * Operation corporateGroupPostWithHttpInfo
+ * Operation corporateGroupIdGetWithHttpInfo
*
- * Create a new group of sub-accounts
+ * GET a group details
*
- * @param \Brevo\Client\Model\Body $body Group details to be created. (required)
+ * @param string $id Id of the group of sub-organization (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateGroupIdGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\InlineResponse201, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CorporateGroupDetailsResponse, HTTP status code, HTTP response headers (array of strings)
*/
- public function corporateGroupPostWithHttpInfo($body)
+ public function corporateGroupIdGetWithHttpInfo(
+ string $id,
+ string $contentType = self::contentTypes['corporateGroupIdGet'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\InlineResponse201';
- $request = $this->corporateGroupPostRequest($body);
+ $request = $this->corporateGroupIdGetRequest($id, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -391,34 +496,84 @@ public function corporateGroupPostWithHttpInfo($body)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\CorporateGroupDetailsResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CorporateGroupDetailsResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CorporateGroupDetailsResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CorporateGroupDetailsResponse';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -430,18 +585,10 @@ public function corporateGroupPostWithHttpInfo($body)
} catch (ApiException $e) {
switch ($e->getCode()) {
- case 201:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\InlineResponse201',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
+ case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\CorporateGroupDetailsResponse',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -452,18 +599,22 @@ public function corporateGroupPostWithHttpInfo($body)
}
/**
- * Operation corporateGroupPostAsync
+ * Operation corporateGroupIdGetAsync
*
- * Create a new group of sub-accounts
+ * GET a group details
*
- * @param \Brevo\Client\Model\Body $body Group details to be created. (required)
+ * @param string $id Id of the group of sub-organization (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateGroupIdGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function corporateGroupPostAsync($body)
+ public function corporateGroupIdGetAsync(
+ string $id,
+ string $contentType = self::contentTypes['corporateGroupIdGet'][0]
+ ): PromiseInterface
{
- return $this->corporateGroupPostAsyncWithHttpInfo($body)
+ return $this->corporateGroupIdGetAsyncWithHttpInfo($id, $contentType)
->then(
function ($response) {
return $response[0];
@@ -472,29 +623,33 @@ function ($response) {
}
/**
- * Operation corporateGroupPostAsyncWithHttpInfo
+ * Operation corporateGroupIdGetAsyncWithHttpInfo
*
- * Create a new group of sub-accounts
+ * GET a group details
*
- * @param \Brevo\Client\Model\Body $body Group details to be created. (required)
+ * @param string $id Id of the group of sub-organization (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateGroupIdGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function corporateGroupPostAsyncWithHttpInfo($body)
+ public function corporateGroupIdGetAsyncWithHttpInfo(
+ $id,
+ string $contentType = self::contentTypes['corporateGroupIdGet'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\InlineResponse201';
- $request = $this->corporateGroupPostRequest($body);
+ $returnType = '\Brevo\Client\Models\CorporateGroupDetailsResponse';
+ $request = $this->corporateGroupIdGetRequest($id, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -517,30 +672,36 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
}
/**
- * Create request for operation 'corporateGroupPost'
+ * Create request for operation 'corporateGroupIdGet'
*
- * @param \Brevo\Client\Model\Body $body Group details to be created. (required)
+ * @param string $id Id of the group of sub-organization (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateGroupIdGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function corporateGroupPostRequest($body)
+ public function corporateGroupIdGetRequest(
+ $id,
+ string $contentType = self::contentTypes['corporateGroupIdGet'][0]
+ ): Request
{
- // verify the required parameter 'body' is set
- if ($body === null || (is_array($body) && count($body) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $body when calling corporateGroupPost'
+
+ // 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 corporateGroupIdGet'
);
}
- $resourcePath = '/corporate/group';
+
+ $resourcePath = '/corporate/group/{id}';
$formParams = [];
$queryParams = [];
$headerParams = [];
@@ -549,56 +710,44 @@ protected function corporateGroupPostRequest($body)
- // body params
- $_tempBody = null;
- if (isset($body)) {
- $_tempBody = $body;
- }
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
+ // path params
+ if ($id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'id' . '}',
+ ObjectSerializer::toPathValue($id),
+ $resourcePath
);
}
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -624,45 +773,58 @@ protected function corporateGroupPostRequest($body)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
- 'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ 'GET',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
}
/**
- * Operation corporateMasterAccountGet
+ * Operation corporateGroupIdPut
*
- * Get the details of requested master account
+ * Update a group of sub-accounts
*
+ * @param string $id Id of the group (required)
+ * @param \Brevo\Client\Models\CorporateGroupIdPutRequest $corporateGroupIdPutRequest Group details to be updated. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateGroupIdPut'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\MasterDetailsResponse
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return void
*/
- public function corporateMasterAccountGet()
+ public function corporateGroupIdPut(
+ string $id,
+ \Brevo\Client\Models\CorporateGroupIdPutRequest $corporateGroupIdPutRequest,
+ string $contentType = self::contentTypes['corporateGroupIdPut'][0]
+ ): void
{
- list($response) = $this->corporateMasterAccountGetWithHttpInfo();
- return $response;
+ $this->corporateGroupIdPutWithHttpInfo($id, $corporateGroupIdPutRequest, $contentType);
}
/**
- * Operation corporateMasterAccountGetWithHttpInfo
+ * Operation corporateGroupIdPutWithHttpInfo
*
- * Get the details of requested master account
+ * Update a group of sub-accounts
*
+ * @param string $id Id of the group (required)
+ * @param \Brevo\Client\Models\CorporateGroupIdPutRequest $corporateGroupIdPutRequest Group details to be updated. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateGroupIdPut'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\MasterDetailsResponse, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function corporateMasterAccountGetWithHttpInfo()
+ public function corporateGroupIdPutWithHttpInfo(
+ string $id,
+ \Brevo\Client\Models\CorporateGroupIdPutRequest $corporateGroupIdPutRequest,
+ string $contentType = self::contentTypes['corporateGroupIdPut'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\MasterDetailsResponse';
- $request = $this->corporateMasterAccountGetRequest();
+ $request = $this->corporateGroupIdPutRequest($id, $corporateGroupIdPutRequest, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -671,57 +833,30 @@ public function corporateMasterAccountGetWithHttpInfo()
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
);
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
+ } catch (ConnectException $e) {
throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
+ $statusCode = $response->getStatusCode();
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
+
+ return [null, $statusCode, $response->getHeaders()];
} catch (ApiException $e) {
switch ($e->getCode()) {
- case 200:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\MasterDetailsResponse',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -732,17 +867,24 @@ public function corporateMasterAccountGetWithHttpInfo()
}
/**
- * Operation corporateMasterAccountGetAsync
+ * Operation corporateGroupIdPutAsync
*
- * Get the details of requested master account
+ * Update a group of sub-accounts
*
+ * @param string $id Id of the group (required)
+ * @param \Brevo\Client\Models\CorporateGroupIdPutRequest $corporateGroupIdPutRequest Group details to be updated. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateGroupIdPut'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function corporateMasterAccountGetAsync()
+ public function corporateGroupIdPutAsync(
+ string $id,
+ \Brevo\Client\Models\CorporateGroupIdPutRequest $corporateGroupIdPutRequest,
+ string $contentType = self::contentTypes['corporateGroupIdPut'][0]
+ ): PromiseInterface
{
- return $this->corporateMasterAccountGetAsyncWithHttpInfo()
+ return $this->corporateGroupIdPutAsyncWithHttpInfo($id, $corporateGroupIdPutRequest, $contentType)
->then(
function ($response) {
return $response[0];
@@ -751,38 +893,32 @@ function ($response) {
}
/**
- * Operation corporateMasterAccountGetAsyncWithHttpInfo
+ * Operation corporateGroupIdPutAsyncWithHttpInfo
*
- * Get the details of requested master account
+ * Update a group of sub-accounts
*
+ * @param string $id Id of the group (required)
+ * @param \Brevo\Client\Models\CorporateGroupIdPutRequest $corporateGroupIdPutRequest Group details to be updated. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateGroupIdPut'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function corporateMasterAccountGetAsyncWithHttpInfo()
+ public function corporateGroupIdPutAsyncWithHttpInfo(
+ $id,
+ $corporateGroupIdPutRequest,
+ string $contentType = self::contentTypes['corporateGroupIdPut'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\MasterDetailsResponse';
- $request = $this->corporateMasterAccountGetRequest();
+ $returnType = '';
+ $request = $this->corporateGroupIdPutRequest($id, $corporateGroupIdPutRequest, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
-
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
+ return [null, $response->getStatusCode(), $response->getHeaders()];
},
function ($exception) {
$response = $exception->getResponse();
@@ -795,23 +931,45 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
}
/**
- * Create request for operation 'corporateMasterAccountGet'
+ * Create request for operation 'corporateGroupIdPut'
*
+ * @param string $id Id of the group (required)
+ * @param \Brevo\Client\Models\CorporateGroupIdPutRequest $corporateGroupIdPutRequest Group details to be updated. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateGroupIdPut'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function corporateMasterAccountGetRequest()
+ public function corporateGroupIdPutRequest(
+ $id,
+ $corporateGroupIdPutRequest,
+ string $contentType = self::contentTypes['corporateGroupIdPut'][0]
+ ): Request
{
- $resourcePath = '/corporate/masterAccount';
+ // 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 corporateGroupIdPut'
+ );
+ }
+
+ // verify the required parameter 'corporateGroupIdPutRequest' is set
+ if ($corporateGroupIdPutRequest === null || (is_array($corporateGroupIdPutRequest) && count($corporateGroupIdPutRequest) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $corporateGroupIdPutRequest when calling corporateGroupIdPut'
+ );
+ }
+
+
+ $resourcePath = '/corporate/group/{id}';
$formParams = [];
$queryParams = [];
$headerParams = [];
@@ -820,53 +978,51 @@ protected function corporateMasterAccountGetRequest()
- // body params
- $_tempBody = null;
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
+ // path params
+ if ($id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'id' . '}',
+ ObjectSerializer::toPathValue($id),
+ $resourcePath
);
}
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($corporateGroupIdPutRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($corporateGroupIdPutRequest));
+ } else {
+ $httpBody = $corporateGroupIdPutRequest;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -892,49 +1048,55 @@ protected function corporateMasterAccountGetRequest()
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
- 'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ 'PUT',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
}
/**
- * Operation corporateSubAccountGet
+ * Operation corporateGroupPost
*
- * Get the list of all the sub-accounts of the master account.
+ * Create a group of sub-accounts
*
- * @param int $offset Index of the first sub-account in the page (required)
- * @param int $limit Number of sub-accounts to be displayed on each page (required)
+ * @param \Brevo\Client\Models\CorporateGroupPostRequest|null $corporateGroupPostRequest corporateGroupPostRequest (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateGroupPost'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\SubAccountsResponse
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CorporateGroupPost201Response|\Brevo\Client\Models\ErrorModel
*/
- public function corporateSubAccountGet($offset, $limit)
+ public function corporateGroupPost(
+ ?\Brevo\Client\Models\CorporateGroupPostRequest $corporateGroupPostRequest = null,
+ string $contentType = self::contentTypes['corporateGroupPost'][0]
+ ): \Brevo\Client\Models\CorporateGroupPost201Response
{
- list($response) = $this->corporateSubAccountGetWithHttpInfo($offset, $limit);
+ list($response) = $this->corporateGroupPostWithHttpInfo($corporateGroupPostRequest, $contentType);
return $response;
}
/**
- * Operation corporateSubAccountGetWithHttpInfo
+ * Operation corporateGroupPostWithHttpInfo
*
- * Get the list of all the sub-accounts of the master account.
+ * Create a group of sub-accounts
*
- * @param int $offset Index of the first sub-account in the page (required)
- * @param int $limit Number of sub-accounts to be displayed on each page (required)
+ * @param \Brevo\Client\Models\CorporateGroupPostRequest|null $corporateGroupPostRequest (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateGroupPost'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\SubAccountsResponse, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CorporateGroupPost201Response|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function corporateSubAccountGetWithHttpInfo($offset, $limit)
+ public function corporateGroupPostWithHttpInfo(
+ ?\Brevo\Client\Models\CorporateGroupPostRequest $corporateGroupPostRequest = null,
+ string $contentType = self::contentTypes['corporateGroupPost'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\SubAccountsResponse';
- $request = $this->corporateSubAccountGetRequest($offset, $limit);
+ $request = $this->corporateGroupPostRequest($corporateGroupPostRequest, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -943,34 +1105,111 @@ public function corporateSubAccountGetWithHttpInfo($offset, $limit)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 201:
+ if (in_array('\Brevo\Client\Models\CorporateGroupPost201Response', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CorporateGroupPost201Response' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CorporateGroupPost201Response', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CorporateGroupPost201Response';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -982,10 +1221,10 @@ public function corporateSubAccountGetWithHttpInfo($offset, $limit)
} catch (ApiException $e) {
switch ($e->getCode()) {
- case 200:
+ case 201:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\SubAccountsResponse',
+ '\Brevo\Client\Models\CorporateGroupPost201Response',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -993,7 +1232,7 @@ public function corporateSubAccountGetWithHttpInfo($offset, $limit)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1004,19 +1243,22 @@ public function corporateSubAccountGetWithHttpInfo($offset, $limit)
}
/**
- * Operation corporateSubAccountGetAsync
+ * Operation corporateGroupPostAsync
*
- * Get the list of all the sub-accounts of the master account.
+ * Create a group of sub-accounts
*
- * @param int $offset Index of the first sub-account in the page (required)
- * @param int $limit Number of sub-accounts to be displayed on each page (required)
+ * @param \Brevo\Client\Models\CorporateGroupPostRequest|null $corporateGroupPostRequest (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateGroupPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function corporateSubAccountGetAsync($offset, $limit)
+ public function corporateGroupPostAsync(
+ ?\Brevo\Client\Models\CorporateGroupPostRequest $corporateGroupPostRequest = null,
+ string $contentType = self::contentTypes['corporateGroupPost'][0]
+ ): PromiseInterface
{
- return $this->corporateSubAccountGetAsyncWithHttpInfo($offset, $limit)
+ return $this->corporateGroupPostAsyncWithHttpInfo($corporateGroupPostRequest, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1025,30 +1267,33 @@ function ($response) {
}
/**
- * Operation corporateSubAccountGetAsyncWithHttpInfo
+ * Operation corporateGroupPostAsyncWithHttpInfo
*
- * Get the list of all the sub-accounts of the master account.
+ * Create a group of sub-accounts
*
- * @param int $offset Index of the first sub-account in the page (required)
- * @param int $limit Number of sub-accounts to be displayed on each page (required)
+ * @param \Brevo\Client\Models\CorporateGroupPostRequest|null $corporateGroupPostRequest (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateGroupPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function corporateSubAccountGetAsyncWithHttpInfo($offset, $limit)
+ public function corporateGroupPostAsyncWithHttpInfo(
+ $corporateGroupPostRequest = null,
+ string $contentType = self::contentTypes['corporateGroupPost'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\SubAccountsResponse';
- $request = $this->corporateSubAccountGetRequest($offset, $limit);
+ $returnType = '\Brevo\Client\Models\CorporateGroupPost201Response';
+ $request = $this->corporateGroupPostRequest($corporateGroupPostRequest, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1071,100 +1316,75 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
}
/**
- * Create request for operation 'corporateSubAccountGet'
+ * Create request for operation 'corporateGroupPost'
*
- * @param int $offset Index of the first sub-account in the page (required)
- * @param int $limit Number of sub-accounts to be displayed on each page (required)
+ * @param \Brevo\Client\Models\CorporateGroupPostRequest|null $corporateGroupPostRequest (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateGroupPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function corporateSubAccountGetRequest($offset, $limit)
+ public function corporateGroupPostRequest(
+ $corporateGroupPostRequest = null,
+ string $contentType = self::contentTypes['corporateGroupPost'][0]
+ ): Request
{
- // verify the required parameter 'offset' is set
- if ($offset === null || (is_array($offset) && count($offset) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $offset when calling corporateSubAccountGet'
- );
- }
- // verify the required parameter 'limit' is set
- if ($limit === null || (is_array($limit) && count($limit) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $limit when calling corporateSubAccountGet'
- );
- }
- $resourcePath = '/corporate/subAccount';
+
+
+ $resourcePath = '/corporate/group';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
- // query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
- // query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($corporateGroupPostRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($corporateGroupPostRequest));
+ } else {
+ $httpBody = $corporateGroupPostRequest;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1190,48 +1410,58 @@ protected function corporateSubAccountGetRequest($offset, $limit)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
- 'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ 'POST',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
}
/**
- * Operation corporateSubAccountIdApplicationsTogglePut
+ * Operation corporateGroupUnlinkGroupIdSubAccountsPut
*
- * Enable/disable sub-account application(s)
+ * Delete sub-account from group
*
- * @param int $id Id of the sub-account organization (mandatory) (required)
- * @param \Brevo\Client\Model\SubAccountAppsToggleRequest $toggleApplications List of applications to activate or deactivate on a sub-account (required)
+ * @param string $groupId Group id (required)
+ * @param \Brevo\Client\Models\CorporateGroupUnlinkGroupIdSubAccountsPutRequest $corporateGroupUnlinkGroupIdSubAccountsPutRequest List of sub-account ids (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateGroupUnlinkGroupIdSubAccountsPut'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function corporateSubAccountIdApplicationsTogglePut($id, $toggleApplications)
+ public function corporateGroupUnlinkGroupIdSubAccountsPut(
+ string $groupId,
+ \Brevo\Client\Models\CorporateGroupUnlinkGroupIdSubAccountsPutRequest $corporateGroupUnlinkGroupIdSubAccountsPutRequest,
+ string $contentType = self::contentTypes['corporateGroupUnlinkGroupIdSubAccountsPut'][0]
+ ): void
{
- $this->corporateSubAccountIdApplicationsTogglePutWithHttpInfo($id, $toggleApplications);
+ $this->corporateGroupUnlinkGroupIdSubAccountsPutWithHttpInfo($groupId, $corporateGroupUnlinkGroupIdSubAccountsPutRequest, $contentType);
}
/**
- * Operation corporateSubAccountIdApplicationsTogglePutWithHttpInfo
+ * Operation corporateGroupUnlinkGroupIdSubAccountsPutWithHttpInfo
*
- * Enable/disable sub-account application(s)
+ * Delete sub-account from group
*
- * @param int $id Id of the sub-account organization (mandatory) (required)
- * @param \Brevo\Client\Model\SubAccountAppsToggleRequest $toggleApplications List of applications to activate or deactivate on a sub-account (required)
+ * @param string $groupId Group id (required)
+ * @param \Brevo\Client\Models\CorporateGroupUnlinkGroupIdSubAccountsPutRequest $corporateGroupUnlinkGroupIdSubAccountsPutRequest List of sub-account ids (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateGroupUnlinkGroupIdSubAccountsPut'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function corporateSubAccountIdApplicationsTogglePutWithHttpInfo($id, $toggleApplications)
+ public function corporateGroupUnlinkGroupIdSubAccountsPutWithHttpInfo(
+ string $groupId,
+ \Brevo\Client\Models\CorporateGroupUnlinkGroupIdSubAccountsPutRequest $corporateGroupUnlinkGroupIdSubAccountsPutRequest,
+ string $contentType = self::contentTypes['corporateGroupUnlinkGroupIdSubAccountsPut'][0]
+ ): array
{
- $returnType = '';
- $request = $this->corporateSubAccountIdApplicationsTogglePutRequest($id, $toggleApplications);
+ $request = $this->corporateGroupUnlinkGroupIdSubAccountsPutRequest($groupId, $corporateGroupUnlinkGroupIdSubAccountsPutRequest, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1240,26 +1470,21 @@ public function corporateSubAccountIdApplicationsTogglePutWithHttpInfo($id, $tog
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -1268,15 +1493,7 @@ public function corporateSubAccountIdApplicationsTogglePutWithHttpInfo($id, $tog
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 403:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1287,19 +1504,24 @@ public function corporateSubAccountIdApplicationsTogglePutWithHttpInfo($id, $tog
}
/**
- * Operation corporateSubAccountIdApplicationsTogglePutAsync
+ * Operation corporateGroupUnlinkGroupIdSubAccountsPutAsync
*
- * Enable/disable sub-account application(s)
+ * Delete sub-account from group
*
- * @param int $id Id of the sub-account organization (mandatory) (required)
- * @param \Brevo\Client\Model\SubAccountAppsToggleRequest $toggleApplications List of applications to activate or deactivate on a sub-account (required)
+ * @param string $groupId Group id (required)
+ * @param \Brevo\Client\Models\CorporateGroupUnlinkGroupIdSubAccountsPutRequest $corporateGroupUnlinkGroupIdSubAccountsPutRequest List of sub-account ids (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateGroupUnlinkGroupIdSubAccountsPut'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function corporateSubAccountIdApplicationsTogglePutAsync($id, $toggleApplications)
+ public function corporateGroupUnlinkGroupIdSubAccountsPutAsync(
+ string $groupId,
+ \Brevo\Client\Models\CorporateGroupUnlinkGroupIdSubAccountsPutRequest $corporateGroupUnlinkGroupIdSubAccountsPutRequest,
+ string $contentType = self::contentTypes['corporateGroupUnlinkGroupIdSubAccountsPut'][0]
+ ): PromiseInterface
{
- return $this->corporateSubAccountIdApplicationsTogglePutAsyncWithHttpInfo($id, $toggleApplications)
+ return $this->corporateGroupUnlinkGroupIdSubAccountsPutAsyncWithHttpInfo($groupId, $corporateGroupUnlinkGroupIdSubAccountsPutRequest, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1308,20 +1530,26 @@ function ($response) {
}
/**
- * Operation corporateSubAccountIdApplicationsTogglePutAsyncWithHttpInfo
+ * Operation corporateGroupUnlinkGroupIdSubAccountsPutAsyncWithHttpInfo
*
- * Enable/disable sub-account application(s)
+ * Delete sub-account from group
*
- * @param int $id Id of the sub-account organization (mandatory) (required)
- * @param \Brevo\Client\Model\SubAccountAppsToggleRequest $toggleApplications List of applications to activate or deactivate on a sub-account (required)
+ * @param string $groupId Group id (required)
+ * @param \Brevo\Client\Models\CorporateGroupUnlinkGroupIdSubAccountsPutRequest $corporateGroupUnlinkGroupIdSubAccountsPutRequest List of sub-account ids (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateGroupUnlinkGroupIdSubAccountsPut'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function corporateSubAccountIdApplicationsTogglePutAsyncWithHttpInfo($id, $toggleApplications)
+ public function corporateGroupUnlinkGroupIdSubAccountsPutAsyncWithHttpInfo(
+ $groupId,
+ $corporateGroupUnlinkGroupIdSubAccountsPutRequest,
+ string $contentType = self::contentTypes['corporateGroupUnlinkGroupIdSubAccountsPut'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->corporateSubAccountIdApplicationsTogglePutRequest($id, $toggleApplications);
+ $request = $this->corporateGroupUnlinkGroupIdSubAccountsPutRequest($groupId, $corporateGroupUnlinkGroupIdSubAccountsPutRequest, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -1340,37 +1568,45 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
}
/**
- * Create request for operation 'corporateSubAccountIdApplicationsTogglePut'
+ * Create request for operation 'corporateGroupUnlinkGroupIdSubAccountsPut'
*
- * @param int $id Id of the sub-account organization (mandatory) (required)
- * @param \Brevo\Client\Model\SubAccountAppsToggleRequest $toggleApplications List of applications to activate or deactivate on a sub-account (required)
+ * @param string $groupId Group id (required)
+ * @param \Brevo\Client\Models\CorporateGroupUnlinkGroupIdSubAccountsPutRequest $corporateGroupUnlinkGroupIdSubAccountsPutRequest List of sub-account ids (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateGroupUnlinkGroupIdSubAccountsPut'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function corporateSubAccountIdApplicationsTogglePutRequest($id, $toggleApplications)
+ public function corporateGroupUnlinkGroupIdSubAccountsPutRequest(
+ $groupId,
+ $corporateGroupUnlinkGroupIdSubAccountsPutRequest,
+ string $contentType = self::contentTypes['corporateGroupUnlinkGroupIdSubAccountsPut'][0]
+ ): Request
{
- // 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 corporateSubAccountIdApplicationsTogglePut'
+
+ // verify the required parameter 'groupId' is set
+ if ($groupId === null || (is_array($groupId) && count($groupId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $groupId when calling corporateGroupUnlinkGroupIdSubAccountsPut'
);
}
- // verify the required parameter 'toggleApplications' is set
- if ($toggleApplications === null || (is_array($toggleApplications) && count($toggleApplications) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $toggleApplications when calling corporateSubAccountIdApplicationsTogglePut'
+
+ // verify the required parameter 'corporateGroupUnlinkGroupIdSubAccountsPutRequest' is set
+ if ($corporateGroupUnlinkGroupIdSubAccountsPutRequest === null || (is_array($corporateGroupUnlinkGroupIdSubAccountsPutRequest) && count($corporateGroupUnlinkGroupIdSubAccountsPutRequest) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $corporateGroupUnlinkGroupIdSubAccountsPutRequest when calling corporateGroupUnlinkGroupIdSubAccountsPut'
);
}
- $resourcePath = '/corporate/subAccount/{id}/applications/toggle';
+
+ $resourcePath = '/corporate/group/unlink/{groupId}/subAccounts';
$formParams = [];
$queryParams = [];
$headerParams = [];
@@ -1378,65 +1614,52 @@ protected function corporateSubAccountIdApplicationsTogglePutRequest($id, $toggl
$multipart = false;
+
// path params
- if ($id !== null) {
+ if ($groupId !== null) {
$resourcePath = str_replace(
- '{' . 'id' . '}',
- ObjectSerializer::toPathValue($id),
+ '{' . 'groupId' . '}',
+ ObjectSerializer::toPathValue($groupId),
$resourcePath
);
}
- // body params
- $_tempBody = null;
- if (isset($toggleApplications)) {
- $_tempBody = $toggleApplications;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($corporateGroupUnlinkGroupIdSubAccountsPutRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($corporateGroupUnlinkGroupIdSubAccountsPutRequest));
+ } else {
+ $httpBody = $corporateGroupUnlinkGroupIdSubAccountsPutRequest;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1462,46 +1685,51 @@ protected function corporateSubAccountIdApplicationsTogglePutRequest($id, $toggl
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'PUT',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
}
/**
- * Operation corporateSubAccountIdDelete
+ * Operation corporateIpGet
*
- * Delete a sub-account
+ * List of all IPs
*
- * @param int $id Id of the sub-account organization to be deleted (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateIpGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return void
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CorporateIpGet200ResponseInner[]
*/
- public function corporateSubAccountIdDelete($id)
+ public function corporateIpGet(
+ string $contentType = self::contentTypes['corporateIpGet'][0]
+ ): array
{
- $this->corporateSubAccountIdDeleteWithHttpInfo($id);
+ list($response) = $this->corporateIpGetWithHttpInfo($contentType);
+ return $response;
}
/**
- * Operation corporateSubAccountIdDeleteWithHttpInfo
+ * Operation corporateIpGetWithHttpInfo
*
- * Delete a sub-account
+ * List of all IPs
*
- * @param int $id Id of the sub-account organization to be deleted (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateIpGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CorporateIpGet200ResponseInner[], HTTP status code, HTTP response headers (array of strings)
*/
- public function corporateSubAccountIdDeleteWithHttpInfo($id)
+ public function corporateIpGetWithHttpInfo(
+ string $contentType = self::contentTypes['corporateIpGet'][0]
+ ): array
{
- $returnType = '';
- $request = $this->corporateSubAccountIdDeleteRequest($id);
+ $request = $this->corporateIpGetRequest($contentType);
try {
$options = $this->createHttpClientOption();
@@ -1510,49 +1738,123 @@ public function corporateSubAccountIdDeleteWithHttpInfo($id)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\CorporateIpGet200ResponseInner[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CorporateIpGet200ResponseInner[]' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CorporateIpGet200ResponseInner[]', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- return [null, $statusCode, $response->getHeaders()];
+ $returnType = '\Brevo\Client\Models\CorporateIpGet200ResponseInner[]';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\CorporateIpGet200ResponseInner[]',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
}
throw $e;
}
}
/**
- * Operation corporateSubAccountIdDeleteAsync
+ * Operation corporateIpGetAsync
*
- * Delete a sub-account
+ * List of all IPs
*
- * @param int $id Id of the sub-account organization to be deleted (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateIpGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function corporateSubAccountIdDeleteAsync($id)
+ public function corporateIpGetAsync(
+ string $contentType = self::contentTypes['corporateIpGet'][0]
+ ): PromiseInterface
{
- return $this->corporateSubAccountIdDeleteAsyncWithHttpInfo($id)
+ return $this->corporateIpGetAsyncWithHttpInfo($contentType)
->then(
function ($response) {
return $response[0];
@@ -1561,25 +1863,41 @@ function ($response) {
}
/**
- * Operation corporateSubAccountIdDeleteAsyncWithHttpInfo
+ * Operation corporateIpGetAsyncWithHttpInfo
*
- * Delete a sub-account
+ * List of all IPs
*
- * @param int $id Id of the sub-account organization to be deleted (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateIpGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function corporateSubAccountIdDeleteAsyncWithHttpInfo($id)
+ public function corporateIpGetAsyncWithHttpInfo(
+ string $contentType = self::contentTypes['corporateIpGet'][0]
+ ): PromiseInterface
{
- $returnType = '';
- $request = $this->corporateSubAccountIdDeleteRequest($id);
+ $returnType = '\Brevo\Client\Models\CorporateIpGet200ResponseInner[]';
+ $request = $this->corporateIpGetRequest($contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- return [null, $response->getStatusCode(), $response->getHeaders()];
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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();
@@ -1592,30 +1910,27 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
}
/**
- * Create request for operation 'corporateSubAccountIdDelete'
+ * Create request for operation 'corporateIpGet'
*
- * @param int $id Id of the sub-account organization to be deleted (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateIpGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function corporateSubAccountIdDeleteRequest($id)
+ public function corporateIpGetRequest(
+ string $contentType = self::contentTypes['corporateIpGet'][0]
+ ): Request
{
- // 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 corporateSubAccountIdDelete'
- );
- }
- $resourcePath = '/corporate/subAccount/{id}';
+
+ $resourcePath = '/corporate/ip';
$formParams = [];
$queryParams = [];
$headerParams = [];
@@ -1623,62 +1938,37 @@ protected function corporateSubAccountIdDeleteRequest($id)
$multipart = false;
- // path params
- if ($id !== null) {
- $resourcePath = str_replace(
- '{' . 'id' . '}',
- ObjectSerializer::toPathValue($id),
- $resourcePath
- );
- }
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1704,47 +1994,51 @@ protected function corporateSubAccountIdDeleteRequest($id)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
- 'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ 'GET',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
}
/**
- * Operation corporateSubAccountIdGet
+ * Operation corporateMasterAccountGet
*
- * Get sub-account details
+ * Get the details of requested master account
*
- * @param int $id Id of the sub-account organization (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateMasterAccountGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\SubAccountDetailsResponse
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\MasterDetailsResponse|\Brevo\Client\Models\ErrorModel
*/
- public function corporateSubAccountIdGet($id)
+ public function corporateMasterAccountGet(
+ string $contentType = self::contentTypes['corporateMasterAccountGet'][0]
+ ): \Brevo\Client\Models\MasterDetailsResponse
{
- list($response) = $this->corporateSubAccountIdGetWithHttpInfo($id);
+ list($response) = $this->corporateMasterAccountGetWithHttpInfo($contentType);
return $response;
}
/**
- * Operation corporateSubAccountIdGetWithHttpInfo
+ * Operation corporateMasterAccountGetWithHttpInfo
*
- * Get sub-account details
+ * Get the details of requested master account
*
- * @param int $id Id of the sub-account organization (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateMasterAccountGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\SubAccountDetailsResponse, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\MasterDetailsResponse|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function corporateSubAccountIdGetWithHttpInfo($id)
+ public function corporateMasterAccountGetWithHttpInfo(
+ string $contentType = self::contentTypes['corporateMasterAccountGet'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\SubAccountDetailsResponse';
- $request = $this->corporateSubAccountIdGetRequest($id);
+ $request = $this->corporateMasterAccountGetRequest($contentType);
try {
$options = $this->createHttpClientOption();
@@ -1753,34 +2047,111 @@ public function corporateSubAccountIdGetWithHttpInfo($id)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\MasterDetailsResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\MasterDetailsResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\MasterDetailsResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\MasterDetailsResponse';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1795,7 +2166,15 @@ public function corporateSubAccountIdGetWithHttpInfo($id)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\SubAccountDetailsResponse',
+ '\Brevo\Client\Models\MasterDetailsResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1806,18 +2185,20 @@ public function corporateSubAccountIdGetWithHttpInfo($id)
}
/**
- * Operation corporateSubAccountIdGetAsync
+ * Operation corporateMasterAccountGetAsync
*
- * Get sub-account details
+ * Get the details of requested master account
*
- * @param int $id Id of the sub-account organization (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateMasterAccountGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function corporateSubAccountIdGetAsync($id)
+ public function corporateMasterAccountGetAsync(
+ string $contentType = self::contentTypes['corporateMasterAccountGet'][0]
+ ): PromiseInterface
{
- return $this->corporateSubAccountIdGetAsyncWithHttpInfo($id)
+ return $this->corporateMasterAccountGetAsyncWithHttpInfo($contentType)
->then(
function ($response) {
return $response[0];
@@ -1826,29 +2207,31 @@ function ($response) {
}
/**
- * Operation corporateSubAccountIdGetAsyncWithHttpInfo
+ * Operation corporateMasterAccountGetAsyncWithHttpInfo
*
- * Get sub-account details
+ * Get the details of requested master account
*
- * @param int $id Id of the sub-account organization (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateMasterAccountGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function corporateSubAccountIdGetAsyncWithHttpInfo($id)
+ public function corporateMasterAccountGetAsyncWithHttpInfo(
+ string $contentType = self::contentTypes['corporateMasterAccountGet'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\SubAccountDetailsResponse';
- $request = $this->corporateSubAccountIdGetRequest($id);
+ $returnType = '\Brevo\Client\Models\MasterDetailsResponse';
+ $request = $this->corporateMasterAccountGetRequest($contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1871,30 +2254,27 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
}
/**
- * Create request for operation 'corporateSubAccountIdGet'
+ * Create request for operation 'corporateMasterAccountGet'
*
- * @param int $id Id of the sub-account organization (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateMasterAccountGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function corporateSubAccountIdGetRequest($id)
+ public function corporateMasterAccountGetRequest(
+ string $contentType = self::contentTypes['corporateMasterAccountGet'][0]
+ ): Request
{
- // 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 corporateSubAccountIdGet'
- );
- }
- $resourcePath = '/corporate/subAccount/{id}';
+
+ $resourcePath = '/corporate/masterAccount';
$formParams = [];
$queryParams = [];
$headerParams = [];
@@ -1902,62 +2282,37 @@ protected function corporateSubAccountIdGetRequest($id)
$multipart = false;
- // path params
- if ($id !== null) {
- $resourcePath = str_replace(
- '{' . 'id' . '}',
- ObjectSerializer::toPathValue($id),
- $resourcePath
- );
- }
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1983,48 +2338,55 @@ protected function corporateSubAccountIdGetRequest($id)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
}
/**
- * Operation corporateSubAccountIdPlanPut
+ * Operation corporateSsoTokenPost
*
- * Update sub-account plan
+ * Generate SSO token to access admin account
*
- * @param int $id Id of the sub-account organization (required)
- * @param \Brevo\Client\Model\SubAccountUpdatePlanRequest $updatePlanDetails Values to update a sub-account plan (required)
+ * @param \Brevo\Client\Models\CorporateSsoTokenPostRequest|null $corporateSsoTokenPostRequest corporateSsoTokenPostRequest (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSsoTokenPost'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return void
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetSsoToken|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function corporateSubAccountIdPlanPut($id, $updatePlanDetails)
+ public function corporateSsoTokenPost(
+ ?\Brevo\Client\Models\CorporateSsoTokenPostRequest $corporateSsoTokenPostRequest = null,
+ string $contentType = self::contentTypes['corporateSsoTokenPost'][0]
+ ): \Brevo\Client\Models\GetSsoToken
{
- $this->corporateSubAccountIdPlanPutWithHttpInfo($id, $updatePlanDetails);
+ list($response) = $this->corporateSsoTokenPostWithHttpInfo($corporateSsoTokenPostRequest, $contentType);
+ return $response;
}
/**
- * Operation corporateSubAccountIdPlanPutWithHttpInfo
+ * Operation corporateSsoTokenPostWithHttpInfo
*
- * Update sub-account plan
+ * Generate SSO token to access admin account
*
- * @param int $id Id of the sub-account organization (required)
- * @param \Brevo\Client\Model\SubAccountUpdatePlanRequest $updatePlanDetails Values to update a sub-account plan (required)
+ * @param \Brevo\Client\Models\CorporateSsoTokenPostRequest|null $corporateSsoTokenPostRequest (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSsoTokenPost'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetSsoToken|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function corporateSubAccountIdPlanPutWithHttpInfo($id, $updatePlanDetails)
+ public function corporateSsoTokenPostWithHttpInfo(
+ ?\Brevo\Client\Models\CorporateSsoTokenPostRequest $corporateSsoTokenPostRequest = null,
+ string $contentType = self::contentTypes['corporateSsoTokenPost'][0]
+ ): array
{
- $returnType = '';
- $request = $this->corporateSubAccountIdPlanPutRequest($id, $updatePlanDetails);
+ $request = $this->corporateSsoTokenPostRequest($corporateSsoTokenPostRequest, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -2033,35 +2395,161 @@ public function corporateSubAccountIdPlanPutWithHttpInfo($id, $updatePlanDetails
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetSsoToken', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetSsoToken' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetSsoToken', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- return [null, $statusCode, $response->getHeaders()];
+ $returnType = '\Brevo\Client\Models\GetSsoToken';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\GetSsoToken',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2069,7 +2557,7 @@ public function corporateSubAccountIdPlanPutWithHttpInfo($id, $updatePlanDetails
case 403:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2080,19 +2568,22 @@ public function corporateSubAccountIdPlanPutWithHttpInfo($id, $updatePlanDetails
}
/**
- * Operation corporateSubAccountIdPlanPutAsync
+ * Operation corporateSsoTokenPostAsync
*
- * Update sub-account plan
+ * Generate SSO token to access admin account
*
- * @param int $id Id of the sub-account organization (required)
- * @param \Brevo\Client\Model\SubAccountUpdatePlanRequest $updatePlanDetails Values to update a sub-account plan (required)
+ * @param \Brevo\Client\Models\CorporateSsoTokenPostRequest|null $corporateSsoTokenPostRequest (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSsoTokenPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function corporateSubAccountIdPlanPutAsync($id, $updatePlanDetails)
+ public function corporateSsoTokenPostAsync(
+ ?\Brevo\Client\Models\CorporateSsoTokenPostRequest $corporateSsoTokenPostRequest = null,
+ string $contentType = self::contentTypes['corporateSsoTokenPost'][0]
+ ): PromiseInterface
{
- return $this->corporateSubAccountIdPlanPutAsyncWithHttpInfo($id, $updatePlanDetails)
+ return $this->corporateSsoTokenPostAsyncWithHttpInfo($corporateSsoTokenPostRequest, $contentType)
->then(
function ($response) {
return $response[0];
@@ -2101,26 +2592,43 @@ function ($response) {
}
/**
- * Operation corporateSubAccountIdPlanPutAsyncWithHttpInfo
+ * Operation corporateSsoTokenPostAsyncWithHttpInfo
*
- * Update sub-account plan
+ * Generate SSO token to access admin account
*
- * @param int $id Id of the sub-account organization (required)
- * @param \Brevo\Client\Model\SubAccountUpdatePlanRequest $updatePlanDetails Values to update a sub-account plan (required)
+ * @param \Brevo\Client\Models\CorporateSsoTokenPostRequest|null $corporateSsoTokenPostRequest (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSsoTokenPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function corporateSubAccountIdPlanPutAsyncWithHttpInfo($id, $updatePlanDetails)
+ public function corporateSsoTokenPostAsyncWithHttpInfo(
+ $corporateSsoTokenPostRequest = null,
+ string $contentType = self::contentTypes['corporateSsoTokenPost'][0]
+ ): PromiseInterface
{
- $returnType = '';
- $request = $this->corporateSubAccountIdPlanPutRequest($id, $updatePlanDetails);
+ $returnType = '\Brevo\Client\Models\GetSsoToken';
+ $request = $this->corporateSsoTokenPostRequest($corporateSsoTokenPostRequest, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- return [null, $response->getStatusCode(), $response->getHeaders()];
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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();
@@ -2133,37 +2641,30 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
}
/**
- * Create request for operation 'corporateSubAccountIdPlanPut'
+ * Create request for operation 'corporateSsoTokenPost'
*
- * @param int $id Id of the sub-account organization (required)
- * @param \Brevo\Client\Model\SubAccountUpdatePlanRequest $updatePlanDetails Values to update a sub-account plan (required)
+ * @param \Brevo\Client\Models\CorporateSsoTokenPostRequest|null $corporateSsoTokenPostRequest (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSsoTokenPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function corporateSubAccountIdPlanPutRequest($id, $updatePlanDetails)
+ public function corporateSsoTokenPostRequest(
+ $corporateSsoTokenPostRequest = null,
+ string $contentType = self::contentTypes['corporateSsoTokenPost'][0]
+ ): Request
{
- // 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 corporateSubAccountIdPlanPut'
- );
- }
- // verify the required parameter 'updatePlanDetails' is set
- if ($updatePlanDetails === null || (is_array($updatePlanDetails) && count($updatePlanDetails) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $updatePlanDetails when calling corporateSubAccountIdPlanPut'
- );
- }
- $resourcePath = '/corporate/subAccount/{id}/plan';
+
+
+ $resourcePath = '/corporate/ssoToken';
$formParams = [];
$queryParams = [];
$headerParams = [];
@@ -2171,65 +2672,44 @@ protected function corporateSubAccountIdPlanPutRequest($id, $updatePlanDetails)
$multipart = false;
- // path params
- if ($id !== null) {
- $resourcePath = str_replace(
- '{' . 'id' . '}',
- ObjectSerializer::toPathValue($id),
- $resourcePath
- );
- }
- // body params
- $_tempBody = null;
- if (isset($updatePlanDetails)) {
- $_tempBody = $updatePlanDetails;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($corporateSsoTokenPostRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($corporateSsoTokenPostRequest));
+ } else {
+ $httpBody = $corporateSsoTokenPostRequest;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -2255,47 +2735,59 @@ protected function corporateSubAccountIdPlanPutRequest($id, $updatePlanDetails)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
- 'PUT',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ 'POST',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
}
/**
- * Operation corporateSubAccountKeyPost
+ * Operation corporateSubAccountGet
*
- * Create an API key for a sub-account
+ * Get the list of all the sub-accounts of the master account.
*
- * @param \Brevo\Client\Model\CreateApiKeyRequest $createApiKeyRequest Values to generate API key for sub-account (required)
+ * @param int $offset Index of the first sub-account in the page (required)
+ * @param int $limit Number of sub-accounts to be displayed on each page (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\CreateApiKeyResponse
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\SubAccountsResponse|\Brevo\Client\Models\ErrorModel
*/
- public function corporateSubAccountKeyPost($createApiKeyRequest)
+ public function corporateSubAccountGet(
+ int $offset,
+ int $limit,
+ string $contentType = self::contentTypes['corporateSubAccountGet'][0]
+ ): \Brevo\Client\Models\SubAccountsResponse
{
- list($response) = $this->corporateSubAccountKeyPostWithHttpInfo($createApiKeyRequest);
+ list($response) = $this->corporateSubAccountGetWithHttpInfo($offset, $limit, $contentType);
return $response;
}
/**
- * Operation corporateSubAccountKeyPostWithHttpInfo
+ * Operation corporateSubAccountGetWithHttpInfo
*
- * Create an API key for a sub-account
+ * Get the list of all the sub-accounts of the master account.
*
- * @param \Brevo\Client\Model\CreateApiKeyRequest $createApiKeyRequest Values to generate API key for sub-account (required)
+ * @param int $offset Index of the first sub-account in the page (required)
+ * @param int $limit Number of sub-accounts to be displayed on each page (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\CreateApiKeyResponse, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\SubAccountsResponse|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function corporateSubAccountKeyPostWithHttpInfo($createApiKeyRequest)
+ public function corporateSubAccountGetWithHttpInfo(
+ int $offset,
+ int $limit,
+ string $contentType = self::contentTypes['corporateSubAccountGet'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\CreateApiKeyResponse';
- $request = $this->corporateSubAccountKeyPostRequest($createApiKeyRequest);
+ $request = $this->corporateSubAccountGetRequest($offset, $limit, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -2304,34 +2796,111 @@ public function corporateSubAccountKeyPostWithHttpInfo($createApiKeyRequest)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\SubAccountsResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\SubAccountsResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\SubAccountsResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\SubAccountsResponse';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -2343,10 +2912,10 @@ public function corporateSubAccountKeyPostWithHttpInfo($createApiKeyRequest)
} catch (ApiException $e) {
switch ($e->getCode()) {
- case 201:
+ case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\CreateApiKeyResponse',
+ '\Brevo\Client\Models\SubAccountsResponse',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2354,7 +2923,7 @@ public function corporateSubAccountKeyPostWithHttpInfo($createApiKeyRequest)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2365,18 +2934,24 @@ public function corporateSubAccountKeyPostWithHttpInfo($createApiKeyRequest)
}
/**
- * Operation corporateSubAccountKeyPostAsync
+ * Operation corporateSubAccountGetAsync
*
- * Create an API key for a sub-account
+ * Get the list of all the sub-accounts of the master account.
*
- * @param \Brevo\Client\Model\CreateApiKeyRequest $createApiKeyRequest Values to generate API key for sub-account (required)
+ * @param int $offset Index of the first sub-account in the page (required)
+ * @param int $limit Number of sub-accounts to be displayed on each page (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function corporateSubAccountKeyPostAsync($createApiKeyRequest)
+ public function corporateSubAccountGetAsync(
+ int $offset,
+ int $limit,
+ string $contentType = self::contentTypes['corporateSubAccountGet'][0]
+ ): PromiseInterface
{
- return $this->corporateSubAccountKeyPostAsyncWithHttpInfo($createApiKeyRequest)
+ return $this->corporateSubAccountGetAsyncWithHttpInfo($offset, $limit, $contentType)
->then(
function ($response) {
return $response[0];
@@ -2385,29 +2960,35 @@ function ($response) {
}
/**
- * Operation corporateSubAccountKeyPostAsyncWithHttpInfo
+ * Operation corporateSubAccountGetAsyncWithHttpInfo
*
- * Create an API key for a sub-account
+ * Get the list of all the sub-accounts of the master account.
*
- * @param \Brevo\Client\Model\CreateApiKeyRequest $createApiKeyRequest Values to generate API key for sub-account (required)
+ * @param int $offset Index of the first sub-account in the page (required)
+ * @param int $limit Number of sub-accounts to be displayed on each page (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function corporateSubAccountKeyPostAsyncWithHttpInfo($createApiKeyRequest)
+ public function corporateSubAccountGetAsyncWithHttpInfo(
+ $offset,
+ $limit,
+ string $contentType = self::contentTypes['corporateSubAccountGet'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\CreateApiKeyResponse';
- $request = $this->corporateSubAccountKeyPostRequest($createApiKeyRequest);
+ $returnType = '\Brevo\Client\Models\SubAccountsResponse';
+ $request = $this->corporateSubAccountGetRequest($offset, $limit, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -2430,30 +3011,3250 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
}
/**
- * Create request for operation 'corporateSubAccountKeyPost'
+ * Create request for operation 'corporateSubAccountGet'
*
- * @param \Brevo\Client\Model\CreateApiKeyRequest $createApiKeyRequest Values to generate API key for sub-account (required)
+ * @param int $offset Index of the first sub-account in the page (required)
+ * @param int $limit Number of sub-accounts to be displayed on each page (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function corporateSubAccountKeyPostRequest($createApiKeyRequest)
+ public function corporateSubAccountGetRequest(
+ $offset,
+ $limit,
+ string $contentType = self::contentTypes['corporateSubAccountGet'][0]
+ ): Request
{
- // verify the required parameter 'createApiKeyRequest' is set
- if ($createApiKeyRequest === null || (is_array($createApiKeyRequest) && count($createApiKeyRequest) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $createApiKeyRequest when calling corporateSubAccountKeyPost'
+
+ // verify the required parameter 'offset' is set
+ if ($offset === null || (is_array($offset) && count($offset) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $offset when calling corporateSubAccountGet'
+ );
+ }
+
+ // verify the required parameter 'limit' is set
+ if ($limit === null || (is_array($limit) && count($limit) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $limit when calling corporateSubAccountGet'
+ );
+ }
+
+
+ $resourcePath = '/corporate/subAccount';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ true // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ true // 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 corporateSubAccountIdApplicationsTogglePut
+ *
+ * Enable/disable sub-account application(s)
+ *
+ * @param int $id Id of the sub-account organization (mandatory) (required)
+ * @param \Brevo\Client\Models\SubAccountAppsToggleRequest $subAccountAppsToggleRequest List of applications to activate or deactivate on a sub-account (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountIdApplicationsTogglePut'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return void
+ */
+ public function corporateSubAccountIdApplicationsTogglePut(
+ int $id,
+ \Brevo\Client\Models\SubAccountAppsToggleRequest $subAccountAppsToggleRequest,
+ string $contentType = self::contentTypes['corporateSubAccountIdApplicationsTogglePut'][0]
+ ): void
+ {
+ $this->corporateSubAccountIdApplicationsTogglePutWithHttpInfo($id, $subAccountAppsToggleRequest, $contentType);
+ }
+
+ /**
+ * Operation corporateSubAccountIdApplicationsTogglePutWithHttpInfo
+ *
+ * Enable/disable sub-account application(s)
+ *
+ * @param int $id Id of the sub-account organization (mandatory) (required)
+ * @param \Brevo\Client\Models\SubAccountAppsToggleRequest $subAccountAppsToggleRequest List of applications to activate or deactivate on a sub-account (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountIdApplicationsTogglePut'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function corporateSubAccountIdApplicationsTogglePutWithHttpInfo(
+ int $id,
+ \Brevo\Client\Models\SubAccountAppsToggleRequest $subAccountAppsToggleRequest,
+ string $contentType = self::contentTypes['corporateSubAccountIdApplicationsTogglePut'][0]
+ ): array
+ {
+ $request = $this->corporateSubAccountIdApplicationsTogglePutRequest($id, $subAccountAppsToggleRequest, $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();
+
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation corporateSubAccountIdApplicationsTogglePutAsync
+ *
+ * Enable/disable sub-account application(s)
+ *
+ * @param int $id Id of the sub-account organization (mandatory) (required)
+ * @param \Brevo\Client\Models\SubAccountAppsToggleRequest $subAccountAppsToggleRequest List of applications to activate or deactivate on a sub-account (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountIdApplicationsTogglePut'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function corporateSubAccountIdApplicationsTogglePutAsync(
+ int $id,
+ \Brevo\Client\Models\SubAccountAppsToggleRequest $subAccountAppsToggleRequest,
+ string $contentType = self::contentTypes['corporateSubAccountIdApplicationsTogglePut'][0]
+ ): PromiseInterface
+ {
+ return $this->corporateSubAccountIdApplicationsTogglePutAsyncWithHttpInfo($id, $subAccountAppsToggleRequest, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation corporateSubAccountIdApplicationsTogglePutAsyncWithHttpInfo
+ *
+ * Enable/disable sub-account application(s)
+ *
+ * @param int $id Id of the sub-account organization (mandatory) (required)
+ * @param \Brevo\Client\Models\SubAccountAppsToggleRequest $subAccountAppsToggleRequest List of applications to activate or deactivate on a sub-account (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountIdApplicationsTogglePut'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function corporateSubAccountIdApplicationsTogglePutAsyncWithHttpInfo(
+ $id,
+ $subAccountAppsToggleRequest,
+ string $contentType = self::contentTypes['corporateSubAccountIdApplicationsTogglePut'][0]
+ ): PromiseInterface
+ {
+ $returnType = '';
+ $request = $this->corporateSubAccountIdApplicationsTogglePutRequest($id, $subAccountAppsToggleRequest, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $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 'corporateSubAccountIdApplicationsTogglePut'
+ *
+ * @param int $id Id of the sub-account organization (mandatory) (required)
+ * @param \Brevo\Client\Models\SubAccountAppsToggleRequest $subAccountAppsToggleRequest List of applications to activate or deactivate on a sub-account (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountIdApplicationsTogglePut'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function corporateSubAccountIdApplicationsTogglePutRequest(
+ $id,
+ $subAccountAppsToggleRequest,
+ string $contentType = self::contentTypes['corporateSubAccountIdApplicationsTogglePut'][0]
+ ): Request
+ {
+
+ // 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 corporateSubAccountIdApplicationsTogglePut'
+ );
+ }
+
+ // verify the required parameter 'subAccountAppsToggleRequest' is set
+ if ($subAccountAppsToggleRequest === null || (is_array($subAccountAppsToggleRequest) && count($subAccountAppsToggleRequest) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $subAccountAppsToggleRequest when calling corporateSubAccountIdApplicationsTogglePut'
+ );
+ }
+
+
+ $resourcePath = '/corporate/subAccount/{id}/applications/toggle';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'id' . '}',
+ ObjectSerializer::toPathValue($id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($subAccountAppsToggleRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($subAccountAppsToggleRequest));
+ } else {
+ $httpBody = $subAccountAppsToggleRequest;
+ }
+ } 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 corporateSubAccountIdDelete
+ *
+ * Delete a sub-account
+ *
+ * @param int $id Id of the sub-account organization to be deleted (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountIdDelete'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return void
+ */
+ public function corporateSubAccountIdDelete(
+ int $id,
+ string $contentType = self::contentTypes['corporateSubAccountIdDelete'][0]
+ ): void
+ {
+ $this->corporateSubAccountIdDeleteWithHttpInfo($id, $contentType);
+ }
+
+ /**
+ * Operation corporateSubAccountIdDeleteWithHttpInfo
+ *
+ * Delete a sub-account
+ *
+ * @param int $id Id of the sub-account organization to be deleted (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountIdDelete'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function corporateSubAccountIdDeleteWithHttpInfo(
+ int $id,
+ string $contentType = self::contentTypes['corporateSubAccountIdDelete'][0]
+ ): array
+ {
+ $request = $this->corporateSubAccountIdDeleteRequest($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();
+
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation corporateSubAccountIdDeleteAsync
+ *
+ * Delete a sub-account
+ *
+ * @param int $id Id of the sub-account organization to be deleted (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountIdDelete'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function corporateSubAccountIdDeleteAsync(
+ int $id,
+ string $contentType = self::contentTypes['corporateSubAccountIdDelete'][0]
+ ): PromiseInterface
+ {
+ return $this->corporateSubAccountIdDeleteAsyncWithHttpInfo($id, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation corporateSubAccountIdDeleteAsyncWithHttpInfo
+ *
+ * Delete a sub-account
+ *
+ * @param int $id Id of the sub-account organization to be deleted (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountIdDelete'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function corporateSubAccountIdDeleteAsyncWithHttpInfo(
+ $id,
+ string $contentType = self::contentTypes['corporateSubAccountIdDelete'][0]
+ ): PromiseInterface
+ {
+ $returnType = '';
+ $request = $this->corporateSubAccountIdDeleteRequest($id, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $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 'corporateSubAccountIdDelete'
+ *
+ * @param int $id Id of the sub-account organization to be deleted (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountIdDelete'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function corporateSubAccountIdDeleteRequest(
+ $id,
+ string $contentType = self::contentTypes['corporateSubAccountIdDelete'][0]
+ ): Request
+ {
+
+ // 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 corporateSubAccountIdDelete'
+ );
+ }
+
+
+ $resourcePath = '/corporate/subAccount/{id}';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'id' . '}',
+ ObjectSerializer::toPathValue($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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 corporateSubAccountIdGet
+ *
+ * Get sub-account details
+ *
+ * @param int $id Id of the sub-account organization (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountIdGet'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\SubAccountDetailsResponse|\Brevo\Client\Models\ErrorModel
+ */
+ public function corporateSubAccountIdGet(
+ int $id,
+ string $contentType = self::contentTypes['corporateSubAccountIdGet'][0]
+ ): \Brevo\Client\Models\SubAccountDetailsResponse
+ {
+ list($response) = $this->corporateSubAccountIdGetWithHttpInfo($id, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation corporateSubAccountIdGetWithHttpInfo
+ *
+ * Get sub-account details
+ *
+ * @param int $id Id of the sub-account organization (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountIdGet'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\SubAccountDetailsResponse|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function corporateSubAccountIdGetWithHttpInfo(
+ int $id,
+ string $contentType = self::contentTypes['corporateSubAccountIdGet'][0]
+ ): array
+ {
+ $request = $this->corporateSubAccountIdGetRequest($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 (in_array('\Brevo\Client\Models\SubAccountDetailsResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\SubAccountDetailsResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\SubAccountDetailsResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $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 = '\Brevo\Client\Models\SubAccountDetailsResponse';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\SubAccountDetailsResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation corporateSubAccountIdGetAsync
+ *
+ * Get sub-account details
+ *
+ * @param int $id Id of the sub-account organization (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountIdGet'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function corporateSubAccountIdGetAsync(
+ int $id,
+ string $contentType = self::contentTypes['corporateSubAccountIdGet'][0]
+ ): PromiseInterface
+ {
+ return $this->corporateSubAccountIdGetAsyncWithHttpInfo($id, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation corporateSubAccountIdGetAsyncWithHttpInfo
+ *
+ * Get sub-account details
+ *
+ * @param int $id Id of the sub-account organization (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountIdGet'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function corporateSubAccountIdGetAsyncWithHttpInfo(
+ $id,
+ string $contentType = self::contentTypes['corporateSubAccountIdGet'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\SubAccountDetailsResponse';
+ $request = $this->corporateSubAccountIdGetRequest($id, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'corporateSubAccountIdGet'
+ *
+ * @param int $id Id of the sub-account organization (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountIdGet'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function corporateSubAccountIdGetRequest(
+ $id,
+ string $contentType = self::contentTypes['corporateSubAccountIdGet'][0]
+ ): Request
+ {
+
+ // 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 corporateSubAccountIdGet'
+ );
+ }
+
+
+ $resourcePath = '/corporate/subAccount/{id}';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'id' . '}',
+ ObjectSerializer::toPathValue($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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 corporateSubAccountIdPlanPut
+ *
+ * Update sub-account plan
+ *
+ * @param int $id Id of the sub-account organization (required)
+ * @param \Brevo\Client\Models\SubAccountUpdatePlanRequest $subAccountUpdatePlanRequest Values to update a sub-account plan (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountIdPlanPut'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return void
+ */
+ public function corporateSubAccountIdPlanPut(
+ int $id,
+ \Brevo\Client\Models\SubAccountUpdatePlanRequest $subAccountUpdatePlanRequest,
+ string $contentType = self::contentTypes['corporateSubAccountIdPlanPut'][0]
+ ): void
+ {
+ $this->corporateSubAccountIdPlanPutWithHttpInfo($id, $subAccountUpdatePlanRequest, $contentType);
+ }
+
+ /**
+ * Operation corporateSubAccountIdPlanPutWithHttpInfo
+ *
+ * Update sub-account plan
+ *
+ * @param int $id Id of the sub-account organization (required)
+ * @param \Brevo\Client\Models\SubAccountUpdatePlanRequest $subAccountUpdatePlanRequest Values to update a sub-account plan (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountIdPlanPut'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function corporateSubAccountIdPlanPutWithHttpInfo(
+ int $id,
+ \Brevo\Client\Models\SubAccountUpdatePlanRequest $subAccountUpdatePlanRequest,
+ string $contentType = self::contentTypes['corporateSubAccountIdPlanPut'][0]
+ ): array
+ {
+ $request = $this->corporateSubAccountIdPlanPutRequest($id, $subAccountUpdatePlanRequest, $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();
+
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation corporateSubAccountIdPlanPutAsync
+ *
+ * Update sub-account plan
+ *
+ * @param int $id Id of the sub-account organization (required)
+ * @param \Brevo\Client\Models\SubAccountUpdatePlanRequest $subAccountUpdatePlanRequest Values to update a sub-account plan (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountIdPlanPut'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function corporateSubAccountIdPlanPutAsync(
+ int $id,
+ \Brevo\Client\Models\SubAccountUpdatePlanRequest $subAccountUpdatePlanRequest,
+ string $contentType = self::contentTypes['corporateSubAccountIdPlanPut'][0]
+ ): PromiseInterface
+ {
+ return $this->corporateSubAccountIdPlanPutAsyncWithHttpInfo($id, $subAccountUpdatePlanRequest, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation corporateSubAccountIdPlanPutAsyncWithHttpInfo
+ *
+ * Update sub-account plan
+ *
+ * @param int $id Id of the sub-account organization (required)
+ * @param \Brevo\Client\Models\SubAccountUpdatePlanRequest $subAccountUpdatePlanRequest Values to update a sub-account plan (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountIdPlanPut'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function corporateSubAccountIdPlanPutAsyncWithHttpInfo(
+ $id,
+ $subAccountUpdatePlanRequest,
+ string $contentType = self::contentTypes['corporateSubAccountIdPlanPut'][0]
+ ): PromiseInterface
+ {
+ $returnType = '';
+ $request = $this->corporateSubAccountIdPlanPutRequest($id, $subAccountUpdatePlanRequest, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $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 'corporateSubAccountIdPlanPut'
+ *
+ * @param int $id Id of the sub-account organization (required)
+ * @param \Brevo\Client\Models\SubAccountUpdatePlanRequest $subAccountUpdatePlanRequest Values to update a sub-account plan (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountIdPlanPut'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function corporateSubAccountIdPlanPutRequest(
+ $id,
+ $subAccountUpdatePlanRequest,
+ string $contentType = self::contentTypes['corporateSubAccountIdPlanPut'][0]
+ ): Request
+ {
+
+ // 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 corporateSubAccountIdPlanPut'
+ );
+ }
+
+ // verify the required parameter 'subAccountUpdatePlanRequest' is set
+ if ($subAccountUpdatePlanRequest === null || (is_array($subAccountUpdatePlanRequest) && count($subAccountUpdatePlanRequest) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $subAccountUpdatePlanRequest when calling corporateSubAccountIdPlanPut'
+ );
+ }
+
+
+ $resourcePath = '/corporate/subAccount/{id}/plan';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'id' . '}',
+ ObjectSerializer::toPathValue($id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($subAccountUpdatePlanRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($subAccountUpdatePlanRequest));
+ } else {
+ $httpBody = $subAccountUpdatePlanRequest;
+ }
+ } 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 corporateSubAccountIpAssociatePost
+ *
+ * Associate an IP to sub-accounts
+ *
+ * @param \Brevo\Client\Models\CorporateSubAccountIpAssociatePostRequest|null $corporateSubAccountIpAssociatePostRequest corporateSubAccountIpAssociatePostRequest (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountIpAssociatePost'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return object|\Brevo\Client\Models\ErrorModel
+ */
+ public function corporateSubAccountIpAssociatePost(
+ ?\Brevo\Client\Models\CorporateSubAccountIpAssociatePostRequest $corporateSubAccountIpAssociatePostRequest = null,
+ string $contentType = self::contentTypes['corporateSubAccountIpAssociatePost'][0]
+ ): object
+ {
+ list($response) = $this->corporateSubAccountIpAssociatePostWithHttpInfo($corporateSubAccountIpAssociatePostRequest, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation corporateSubAccountIpAssociatePostWithHttpInfo
+ *
+ * Associate an IP to sub-accounts
+ *
+ * @param \Brevo\Client\Models\CorporateSubAccountIpAssociatePostRequest|null $corporateSubAccountIpAssociatePostRequest (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountIpAssociatePost'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of object|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function corporateSubAccountIpAssociatePostWithHttpInfo(
+ ?\Brevo\Client\Models\CorporateSubAccountIpAssociatePostRequest $corporateSubAccountIpAssociatePostRequest = null,
+ string $contentType = self::contentTypes['corporateSubAccountIpAssociatePost'][0]
+ ): array
+ {
+ $request = $this->corporateSubAccountIpAssociatePostRequest($corporateSubAccountIpAssociatePostRequest, $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 201:
+ if (in_array('object', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('object' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, 'object', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $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 = 'object';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 201:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ 'object',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation corporateSubAccountIpAssociatePostAsync
+ *
+ * Associate an IP to sub-accounts
+ *
+ * @param \Brevo\Client\Models\CorporateSubAccountIpAssociatePostRequest|null $corporateSubAccountIpAssociatePostRequest (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountIpAssociatePost'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function corporateSubAccountIpAssociatePostAsync(
+ ?\Brevo\Client\Models\CorporateSubAccountIpAssociatePostRequest $corporateSubAccountIpAssociatePostRequest = null,
+ string $contentType = self::contentTypes['corporateSubAccountIpAssociatePost'][0]
+ ): PromiseInterface
+ {
+ return $this->corporateSubAccountIpAssociatePostAsyncWithHttpInfo($corporateSubAccountIpAssociatePostRequest, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation corporateSubAccountIpAssociatePostAsyncWithHttpInfo
+ *
+ * Associate an IP to sub-accounts
+ *
+ * @param \Brevo\Client\Models\CorporateSubAccountIpAssociatePostRequest|null $corporateSubAccountIpAssociatePostRequest (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountIpAssociatePost'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function corporateSubAccountIpAssociatePostAsyncWithHttpInfo(
+ $corporateSubAccountIpAssociatePostRequest = null,
+ string $contentType = self::contentTypes['corporateSubAccountIpAssociatePost'][0]
+ ): PromiseInterface
+ {
+ $returnType = 'object';
+ $request = $this->corporateSubAccountIpAssociatePostRequest($corporateSubAccountIpAssociatePostRequest, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'corporateSubAccountIpAssociatePost'
+ *
+ * @param \Brevo\Client\Models\CorporateSubAccountIpAssociatePostRequest|null $corporateSubAccountIpAssociatePostRequest (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountIpAssociatePost'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function corporateSubAccountIpAssociatePostRequest(
+ $corporateSubAccountIpAssociatePostRequest = null,
+ string $contentType = self::contentTypes['corporateSubAccountIpAssociatePost'][0]
+ ): Request
+ {
+
+
+
+ $resourcePath = '/corporate/subAccount/ip/associate';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($corporateSubAccountIpAssociatePostRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($corporateSubAccountIpAssociatePostRequest));
+ } else {
+ $httpBody = $corporateSubAccountIpAssociatePostRequest;
+ }
+ } 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 corporateSubAccountIpDissociatePut
+ *
+ * Dissociate an IP to sub-accounts
+ *
+ * @param \Brevo\Client\Models\CorporateSubAccountIpDissociatePutRequest|null $corporateSubAccountIpDissociatePutRequest corporateSubAccountIpDissociatePutRequest (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountIpDissociatePut'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return void
+ */
+ public function corporateSubAccountIpDissociatePut(
+ ?\Brevo\Client\Models\CorporateSubAccountIpDissociatePutRequest $corporateSubAccountIpDissociatePutRequest = null,
+ string $contentType = self::contentTypes['corporateSubAccountIpDissociatePut'][0]
+ ): void
+ {
+ $this->corporateSubAccountIpDissociatePutWithHttpInfo($corporateSubAccountIpDissociatePutRequest, $contentType);
+ }
+
+ /**
+ * Operation corporateSubAccountIpDissociatePutWithHttpInfo
+ *
+ * Dissociate an IP to sub-accounts
+ *
+ * @param \Brevo\Client\Models\CorporateSubAccountIpDissociatePutRequest|null $corporateSubAccountIpDissociatePutRequest (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountIpDissociatePut'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function corporateSubAccountIpDissociatePutWithHttpInfo(
+ ?\Brevo\Client\Models\CorporateSubAccountIpDissociatePutRequest $corporateSubAccountIpDissociatePutRequest = null,
+ string $contentType = self::contentTypes['corporateSubAccountIpDissociatePut'][0]
+ ): array
+ {
+ $request = $this->corporateSubAccountIpDissociatePutRequest($corporateSubAccountIpDissociatePutRequest, $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();
+
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation corporateSubAccountIpDissociatePutAsync
+ *
+ * Dissociate an IP to sub-accounts
+ *
+ * @param \Brevo\Client\Models\CorporateSubAccountIpDissociatePutRequest|null $corporateSubAccountIpDissociatePutRequest (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountIpDissociatePut'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function corporateSubAccountIpDissociatePutAsync(
+ ?\Brevo\Client\Models\CorporateSubAccountIpDissociatePutRequest $corporateSubAccountIpDissociatePutRequest = null,
+ string $contentType = self::contentTypes['corporateSubAccountIpDissociatePut'][0]
+ ): PromiseInterface
+ {
+ return $this->corporateSubAccountIpDissociatePutAsyncWithHttpInfo($corporateSubAccountIpDissociatePutRequest, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation corporateSubAccountIpDissociatePutAsyncWithHttpInfo
+ *
+ * Dissociate an IP to sub-accounts
+ *
+ * @param \Brevo\Client\Models\CorporateSubAccountIpDissociatePutRequest|null $corporateSubAccountIpDissociatePutRequest (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountIpDissociatePut'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function corporateSubAccountIpDissociatePutAsyncWithHttpInfo(
+ $corporateSubAccountIpDissociatePutRequest = null,
+ string $contentType = self::contentTypes['corporateSubAccountIpDissociatePut'][0]
+ ): PromiseInterface
+ {
+ $returnType = '';
+ $request = $this->corporateSubAccountIpDissociatePutRequest($corporateSubAccountIpDissociatePutRequest, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $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 'corporateSubAccountIpDissociatePut'
+ *
+ * @param \Brevo\Client\Models\CorporateSubAccountIpDissociatePutRequest|null $corporateSubAccountIpDissociatePutRequest (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountIpDissociatePut'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function corporateSubAccountIpDissociatePutRequest(
+ $corporateSubAccountIpDissociatePutRequest = null,
+ string $contentType = self::contentTypes['corporateSubAccountIpDissociatePut'][0]
+ ): Request
+ {
+
+
+
+ $resourcePath = '/corporate/subAccount/ip/dissociate';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($corporateSubAccountIpDissociatePutRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($corporateSubAccountIpDissociatePutRequest));
+ } else {
+ $httpBody = $corporateSubAccountIpDissociatePutRequest;
+ }
+ } 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 corporateSubAccountKeyPost
+ *
+ * Create an API key for a sub-account
+ *
+ * @param \Brevo\Client\Models\CorporateSubAccountKeyPostRequest|null $corporateSubAccountKeyPostRequest corporateSubAccountKeyPostRequest (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountKeyPost'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CreateApiKeyResponse|\Brevo\Client\Models\ErrorModel
+ */
+ public function corporateSubAccountKeyPost(
+ ?\Brevo\Client\Models\CorporateSubAccountKeyPostRequest $corporateSubAccountKeyPostRequest = null,
+ string $contentType = self::contentTypes['corporateSubAccountKeyPost'][0]
+ ): \Brevo\Client\Models\CreateApiKeyResponse
+ {
+ list($response) = $this->corporateSubAccountKeyPostWithHttpInfo($corporateSubAccountKeyPostRequest, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation corporateSubAccountKeyPostWithHttpInfo
+ *
+ * Create an API key for a sub-account
+ *
+ * @param \Brevo\Client\Models\CorporateSubAccountKeyPostRequest|null $corporateSubAccountKeyPostRequest (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountKeyPost'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CreateApiKeyResponse|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function corporateSubAccountKeyPostWithHttpInfo(
+ ?\Brevo\Client\Models\CorporateSubAccountKeyPostRequest $corporateSubAccountKeyPostRequest = null,
+ string $contentType = self::contentTypes['corporateSubAccountKeyPost'][0]
+ ): array
+ {
+ $request = $this->corporateSubAccountKeyPostRequest($corporateSubAccountKeyPostRequest, $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 201:
+ if (in_array('\Brevo\Client\Models\CreateApiKeyResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CreateApiKeyResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CreateApiKeyResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $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 = '\Brevo\Client\Models\CreateApiKeyResponse';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 201:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\CreateApiKeyResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation corporateSubAccountKeyPostAsync
+ *
+ * Create an API key for a sub-account
+ *
+ * @param \Brevo\Client\Models\CorporateSubAccountKeyPostRequest|null $corporateSubAccountKeyPostRequest (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountKeyPost'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function corporateSubAccountKeyPostAsync(
+ ?\Brevo\Client\Models\CorporateSubAccountKeyPostRequest $corporateSubAccountKeyPostRequest = null,
+ string $contentType = self::contentTypes['corporateSubAccountKeyPost'][0]
+ ): PromiseInterface
+ {
+ return $this->corporateSubAccountKeyPostAsyncWithHttpInfo($corporateSubAccountKeyPostRequest, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation corporateSubAccountKeyPostAsyncWithHttpInfo
+ *
+ * Create an API key for a sub-account
+ *
+ * @param \Brevo\Client\Models\CorporateSubAccountKeyPostRequest|null $corporateSubAccountKeyPostRequest (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountKeyPost'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function corporateSubAccountKeyPostAsyncWithHttpInfo(
+ $corporateSubAccountKeyPostRequest = null,
+ string $contentType = self::contentTypes['corporateSubAccountKeyPost'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\CreateApiKeyResponse';
+ $request = $this->corporateSubAccountKeyPostRequest($corporateSubAccountKeyPostRequest, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'corporateSubAccountKeyPost'
+ *
+ * @param \Brevo\Client\Models\CorporateSubAccountKeyPostRequest|null $corporateSubAccountKeyPostRequest (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountKeyPost'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function corporateSubAccountKeyPostRequest(
+ $corporateSubAccountKeyPostRequest = null,
+ string $contentType = self::contentTypes['corporateSubAccountKeyPost'][0]
+ ): Request
+ {
+
+
+
+ $resourcePath = '/corporate/subAccount/key';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($corporateSubAccountKeyPostRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($corporateSubAccountKeyPostRequest));
+ } else {
+ $httpBody = $corporateSubAccountKeyPostRequest;
+ }
+ } 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 corporateSubAccountPost
+ *
+ * Create a new sub-account under a master account.
+ *
+ * @param \Brevo\Client\Models\CreateSubAccount $createSubAccount Request body with sub-account organization name (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountPost'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CreateSubAccountResponse|\Brevo\Client\Models\ErrorModel
+ */
+ public function corporateSubAccountPost(
+ \Brevo\Client\Models\CreateSubAccount $createSubAccount,
+ string $contentType = self::contentTypes['corporateSubAccountPost'][0]
+ ): \Brevo\Client\Models\CreateSubAccountResponse
+ {
+ list($response) = $this->corporateSubAccountPostWithHttpInfo($createSubAccount, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation corporateSubAccountPostWithHttpInfo
+ *
+ * Create a new sub-account under a master account.
+ *
+ * @param \Brevo\Client\Models\CreateSubAccount $createSubAccount Request body with sub-account organization name (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountPost'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CreateSubAccountResponse|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function corporateSubAccountPostWithHttpInfo(
+ \Brevo\Client\Models\CreateSubAccount $createSubAccount,
+ string $contentType = self::contentTypes['corporateSubAccountPost'][0]
+ ): array
+ {
+ $request = $this->corporateSubAccountPostRequest($createSubAccount, $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 201:
+ if (in_array('\Brevo\Client\Models\CreateSubAccountResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CreateSubAccountResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CreateSubAccountResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $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 = '\Brevo\Client\Models\CreateSubAccountResponse';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 201:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\CreateSubAccountResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation corporateSubAccountPostAsync
+ *
+ * Create a new sub-account under a master account.
+ *
+ * @param \Brevo\Client\Models\CreateSubAccount $createSubAccount Request body with sub-account organization name (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountPost'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function corporateSubAccountPostAsync(
+ \Brevo\Client\Models\CreateSubAccount $createSubAccount,
+ string $contentType = self::contentTypes['corporateSubAccountPost'][0]
+ ): PromiseInterface
+ {
+ return $this->corporateSubAccountPostAsyncWithHttpInfo($createSubAccount, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation corporateSubAccountPostAsyncWithHttpInfo
+ *
+ * Create a new sub-account under a master account.
+ *
+ * @param \Brevo\Client\Models\CreateSubAccount $createSubAccount Request body with sub-account organization name (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountPost'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function corporateSubAccountPostAsyncWithHttpInfo(
+ $createSubAccount,
+ string $contentType = self::contentTypes['corporateSubAccountPost'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\CreateSubAccountResponse';
+ $request = $this->corporateSubAccountPostRequest($createSubAccount, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'corporateSubAccountPost'
+ *
+ * @param \Brevo\Client\Models\CreateSubAccount $createSubAccount Request body with sub-account organization name (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountPost'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function corporateSubAccountPostRequest(
+ $createSubAccount,
+ string $contentType = self::contentTypes['corporateSubAccountPost'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'createSubAccount' is set
+ if ($createSubAccount === null || (is_array($createSubAccount) && count($createSubAccount) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $createSubAccount when calling corporateSubAccountPost'
+ );
+ }
+
+
+ $resourcePath = '/corporate/subAccount';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($createSubAccount)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createSubAccount));
+ } else {
+ $httpBody = $createSubAccount;
+ }
+ } 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 corporateSubAccountSsoTokenPost
+ *
+ * Generate SSO token to access sub-account
+ *
+ * @param \Brevo\Client\Models\CorporateSubAccountSsoTokenPostRequest|null $corporateSubAccountSsoTokenPostRequest corporateSubAccountSsoTokenPostRequest (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountSsoTokenPost'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetSsoToken|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
+ */
+ public function corporateSubAccountSsoTokenPost(
+ ?\Brevo\Client\Models\CorporateSubAccountSsoTokenPostRequest $corporateSubAccountSsoTokenPostRequest = null,
+ string $contentType = self::contentTypes['corporateSubAccountSsoTokenPost'][0]
+ ): \Brevo\Client\Models\GetSsoToken
+ {
+ list($response) = $this->corporateSubAccountSsoTokenPostWithHttpInfo($corporateSubAccountSsoTokenPostRequest, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation corporateSubAccountSsoTokenPostWithHttpInfo
+ *
+ * Generate SSO token to access sub-account
+ *
+ * @param \Brevo\Client\Models\CorporateSubAccountSsoTokenPostRequest|null $corporateSubAccountSsoTokenPostRequest (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountSsoTokenPost'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetSsoToken|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function corporateSubAccountSsoTokenPostWithHttpInfo(
+ ?\Brevo\Client\Models\CorporateSubAccountSsoTokenPostRequest $corporateSubAccountSsoTokenPostRequest = null,
+ string $contentType = self::contentTypes['corporateSubAccountSsoTokenPost'][0]
+ ): array
+ {
+ $request = $this->corporateSubAccountSsoTokenPostRequest($corporateSubAccountSsoTokenPostRequest, $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 (in_array('\Brevo\Client\Models\GetSsoToken', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetSsoToken' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetSsoToken', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $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 = '\Brevo\Client\Models\GetSsoToken';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\GetSsoToken',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation corporateSubAccountSsoTokenPostAsync
+ *
+ * Generate SSO token to access sub-account
+ *
+ * @param \Brevo\Client\Models\CorporateSubAccountSsoTokenPostRequest|null $corporateSubAccountSsoTokenPostRequest (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountSsoTokenPost'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function corporateSubAccountSsoTokenPostAsync(
+ ?\Brevo\Client\Models\CorporateSubAccountSsoTokenPostRequest $corporateSubAccountSsoTokenPostRequest = null,
+ string $contentType = self::contentTypes['corporateSubAccountSsoTokenPost'][0]
+ ): PromiseInterface
+ {
+ return $this->corporateSubAccountSsoTokenPostAsyncWithHttpInfo($corporateSubAccountSsoTokenPostRequest, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation corporateSubAccountSsoTokenPostAsyncWithHttpInfo
+ *
+ * Generate SSO token to access sub-account
+ *
+ * @param \Brevo\Client\Models\CorporateSubAccountSsoTokenPostRequest|null $corporateSubAccountSsoTokenPostRequest (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountSsoTokenPost'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function corporateSubAccountSsoTokenPostAsyncWithHttpInfo(
+ $corporateSubAccountSsoTokenPostRequest = null,
+ string $contentType = self::contentTypes['corporateSubAccountSsoTokenPost'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\GetSsoToken';
+ $request = $this->corporateSubAccountSsoTokenPostRequest($corporateSubAccountSsoTokenPostRequest, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'corporateSubAccountSsoTokenPost'
+ *
+ * @param \Brevo\Client\Models\CorporateSubAccountSsoTokenPostRequest|null $corporateSubAccountSsoTokenPostRequest (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateSubAccountSsoTokenPost'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function corporateSubAccountSsoTokenPostRequest(
+ $corporateSubAccountSsoTokenPostRequest = null,
+ string $contentType = self::contentTypes['corporateSubAccountSsoTokenPost'][0]
+ ): Request
+ {
+
+
+
+ $resourcePath = '/corporate/subAccount/ssoToken';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($corporateSubAccountSsoTokenPostRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($corporateSubAccountSsoTokenPostRequest));
+ } else {
+ $httpBody = $corporateSubAccountSsoTokenPostRequest;
+ }
+ } 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 corporateUserEmailPermissionsPut
+ *
+ * Change admin user permissions
+ *
+ * @param string $email Email address of Admin user (required)
+ * @param \Brevo\Client\Models\CorporateUserEmailPermissionsPutRequest $corporateUserEmailPermissionsPutRequest Values to update an admin user permissions (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateUserEmailPermissionsPut'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return void
+ */
+ public function corporateUserEmailPermissionsPut(
+ string $email,
+ \Brevo\Client\Models\CorporateUserEmailPermissionsPutRequest $corporateUserEmailPermissionsPutRequest,
+ string $contentType = self::contentTypes['corporateUserEmailPermissionsPut'][0]
+ ): void
+ {
+ $this->corporateUserEmailPermissionsPutWithHttpInfo($email, $corporateUserEmailPermissionsPutRequest, $contentType);
+ }
+
+ /**
+ * Operation corporateUserEmailPermissionsPutWithHttpInfo
+ *
+ * Change admin user permissions
+ *
+ * @param string $email Email address of Admin user (required)
+ * @param \Brevo\Client\Models\CorporateUserEmailPermissionsPutRequest $corporateUserEmailPermissionsPutRequest Values to update an admin user permissions (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateUserEmailPermissionsPut'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function corporateUserEmailPermissionsPutWithHttpInfo(
+ string $email,
+ \Brevo\Client\Models\CorporateUserEmailPermissionsPutRequest $corporateUserEmailPermissionsPutRequest,
+ string $contentType = self::contentTypes['corporateUserEmailPermissionsPut'][0]
+ ): array
+ {
+ $request = $this->corporateUserEmailPermissionsPutRequest($email, $corporateUserEmailPermissionsPutRequest, $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();
+
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation corporateUserEmailPermissionsPutAsync
+ *
+ * Change admin user permissions
+ *
+ * @param string $email Email address of Admin user (required)
+ * @param \Brevo\Client\Models\CorporateUserEmailPermissionsPutRequest $corporateUserEmailPermissionsPutRequest Values to update an admin user permissions (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateUserEmailPermissionsPut'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function corporateUserEmailPermissionsPutAsync(
+ string $email,
+ \Brevo\Client\Models\CorporateUserEmailPermissionsPutRequest $corporateUserEmailPermissionsPutRequest,
+ string $contentType = self::contentTypes['corporateUserEmailPermissionsPut'][0]
+ ): PromiseInterface
+ {
+ return $this->corporateUserEmailPermissionsPutAsyncWithHttpInfo($email, $corporateUserEmailPermissionsPutRequest, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation corporateUserEmailPermissionsPutAsyncWithHttpInfo
+ *
+ * Change admin user permissions
+ *
+ * @param string $email Email address of Admin user (required)
+ * @param \Brevo\Client\Models\CorporateUserEmailPermissionsPutRequest $corporateUserEmailPermissionsPutRequest Values to update an admin user permissions (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateUserEmailPermissionsPut'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function corporateUserEmailPermissionsPutAsyncWithHttpInfo(
+ $email,
+ $corporateUserEmailPermissionsPutRequest,
+ string $contentType = self::contentTypes['corporateUserEmailPermissionsPut'][0]
+ ): PromiseInterface
+ {
+ $returnType = '';
+ $request = $this->corporateUserEmailPermissionsPutRequest($email, $corporateUserEmailPermissionsPutRequest, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $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 'corporateUserEmailPermissionsPut'
+ *
+ * @param string $email Email address of Admin user (required)
+ * @param \Brevo\Client\Models\CorporateUserEmailPermissionsPutRequest $corporateUserEmailPermissionsPutRequest Values to update an admin user permissions (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateUserEmailPermissionsPut'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function corporateUserEmailPermissionsPutRequest(
+ $email,
+ $corporateUserEmailPermissionsPutRequest,
+ string $contentType = self::contentTypes['corporateUserEmailPermissionsPut'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'email' is set
+ if ($email === null || (is_array($email) && count($email) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $email when calling corporateUserEmailPermissionsPut'
+ );
+ }
+
+ // verify the required parameter 'corporateUserEmailPermissionsPutRequest' is set
+ if ($corporateUserEmailPermissionsPutRequest === null || (is_array($corporateUserEmailPermissionsPutRequest) && count($corporateUserEmailPermissionsPutRequest) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $corporateUserEmailPermissionsPutRequest when calling corporateUserEmailPermissionsPut'
);
}
- $resourcePath = '/corporate/subAccount/key';
+
+ $resourcePath = '/corporate/user/{email}/permissions';
$formParams = [];
$queryParams = [];
$headerParams = [];
@@ -2462,56 +6263,51 @@ protected function corporateSubAccountKeyPostRequest($createApiKeyRequest)
- // body params
- $_tempBody = null;
- if (isset($createApiKeyRequest)) {
- $_tempBody = $createApiKeyRequest;
- }
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
+ // path params
+ if ($email !== null) {
+ $resourcePath = str_replace(
+ '{' . 'email' . '}',
+ ObjectSerializer::toPathValue($email),
+ $resourcePath
);
}
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($corporateUserEmailPermissionsPutRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($corporateUserEmailPermissionsPutRequest));
+ } else {
+ $httpBody = $corporateUserEmailPermissionsPutRequest;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -2537,47 +6333,59 @@ protected function corporateSubAccountKeyPostRequest($createApiKeyRequest)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
- 'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ 'PUT',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
}
/**
- * Operation corporateSubAccountPost
+ * Operation corporateUserInvitationActionEmailPut
*
- * Create a new sub-account under a master account.
+ * Resend / cancel admin user invitation
*
- * @param \Brevo\Client\Model\CreateSubAccount $subAccountCreate values to create new sub-account (required)
+ * @param string $action Action to be performed (cancel / resend) (required)
+ * @param string $email Email address of the recipient (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateUserInvitationActionEmailPut'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\CreateSubAccountResponse
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CorporateUserInvitationActionEmailPut200Response|\Brevo\Client\Models\ErrorModel
*/
- public function corporateSubAccountPost($subAccountCreate)
+ public function corporateUserInvitationActionEmailPut(
+ string $action,
+ string $email,
+ string $contentType = self::contentTypes['corporateUserInvitationActionEmailPut'][0]
+ ): \Brevo\Client\Models\CorporateUserInvitationActionEmailPut200Response
{
- list($response) = $this->corporateSubAccountPostWithHttpInfo($subAccountCreate);
+ list($response) = $this->corporateUserInvitationActionEmailPutWithHttpInfo($action, $email, $contentType);
return $response;
}
/**
- * Operation corporateSubAccountPostWithHttpInfo
+ * Operation corporateUserInvitationActionEmailPutWithHttpInfo
*
- * Create a new sub-account under a master account.
+ * Resend / cancel admin user invitation
*
- * @param \Brevo\Client\Model\CreateSubAccount $subAccountCreate values to create new sub-account (required)
+ * @param string $action Action to be performed (cancel / resend) (required)
+ * @param string $email Email address of the recipient (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateUserInvitationActionEmailPut'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\CreateSubAccountResponse, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CorporateUserInvitationActionEmailPut200Response|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function corporateSubAccountPostWithHttpInfo($subAccountCreate)
+ public function corporateUserInvitationActionEmailPutWithHttpInfo(
+ string $action,
+ string $email,
+ string $contentType = self::contentTypes['corporateUserInvitationActionEmailPut'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\CreateSubAccountResponse';
- $request = $this->corporateSubAccountPostRequest($subAccountCreate);
+ $request = $this->corporateUserInvitationActionEmailPutRequest($action, $email, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -2586,34 +6394,111 @@ public function corporateSubAccountPostWithHttpInfo($subAccountCreate)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\CorporateUserInvitationActionEmailPut200Response', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CorporateUserInvitationActionEmailPut200Response' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CorporateUserInvitationActionEmailPut200Response', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CorporateUserInvitationActionEmailPut200Response';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -2625,10 +6510,10 @@ public function corporateSubAccountPostWithHttpInfo($subAccountCreate)
} catch (ApiException $e) {
switch ($e->getCode()) {
- case 201:
+ case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\CreateSubAccountResponse',
+ '\Brevo\Client\Models\CorporateUserInvitationActionEmailPut200Response',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2636,7 +6521,7 @@ public function corporateSubAccountPostWithHttpInfo($subAccountCreate)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2647,18 +6532,24 @@ public function corporateSubAccountPostWithHttpInfo($subAccountCreate)
}
/**
- * Operation corporateSubAccountPostAsync
+ * Operation corporateUserInvitationActionEmailPutAsync
*
- * Create a new sub-account under a master account.
+ * Resend / cancel admin user invitation
*
- * @param \Brevo\Client\Model\CreateSubAccount $subAccountCreate values to create new sub-account (required)
+ * @param string $action Action to be performed (cancel / resend) (required)
+ * @param string $email Email address of the recipient (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateUserInvitationActionEmailPut'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function corporateSubAccountPostAsync($subAccountCreate)
+ public function corporateUserInvitationActionEmailPutAsync(
+ string $action,
+ string $email,
+ string $contentType = self::contentTypes['corporateUserInvitationActionEmailPut'][0]
+ ): PromiseInterface
{
- return $this->corporateSubAccountPostAsyncWithHttpInfo($subAccountCreate)
+ return $this->corporateUserInvitationActionEmailPutAsyncWithHttpInfo($action, $email, $contentType)
->then(
function ($response) {
return $response[0];
@@ -2667,29 +6558,35 @@ function ($response) {
}
/**
- * Operation corporateSubAccountPostAsyncWithHttpInfo
+ * Operation corporateUserInvitationActionEmailPutAsyncWithHttpInfo
*
- * Create a new sub-account under a master account.
+ * Resend / cancel admin user invitation
*
- * @param \Brevo\Client\Model\CreateSubAccount $subAccountCreate values to create new sub-account (required)
+ * @param string $action Action to be performed (cancel / resend) (required)
+ * @param string $email Email address of the recipient (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateUserInvitationActionEmailPut'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function corporateSubAccountPostAsyncWithHttpInfo($subAccountCreate)
+ public function corporateUserInvitationActionEmailPutAsyncWithHttpInfo(
+ $action,
+ $email,
+ string $contentType = self::contentTypes['corporateUserInvitationActionEmailPut'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\CreateSubAccountResponse';
- $request = $this->corporateSubAccountPostRequest($subAccountCreate);
+ $returnType = '\Brevo\Client\Models\CorporateUserInvitationActionEmailPut200Response';
+ $request = $this->corporateUserInvitationActionEmailPutRequest($action, $email, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -2712,30 +6609,45 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
}
/**
- * Create request for operation 'corporateSubAccountPost'
+ * Create request for operation 'corporateUserInvitationActionEmailPut'
*
- * @param \Brevo\Client\Model\CreateSubAccount $subAccountCreate values to create new sub-account (required)
+ * @param string $action Action to be performed (cancel / resend) (required)
+ * @param string $email Email address of the recipient (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateUserInvitationActionEmailPut'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function corporateSubAccountPostRequest($subAccountCreate)
+ public function corporateUserInvitationActionEmailPutRequest(
+ $action,
+ $email,
+ string $contentType = self::contentTypes['corporateUserInvitationActionEmailPut'][0]
+ ): Request
{
- // verify the required parameter 'subAccountCreate' is set
- if ($subAccountCreate === null || (is_array($subAccountCreate) && count($subAccountCreate) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $subAccountCreate when calling corporateSubAccountPost'
+
+ // verify the required parameter 'action' is set
+ if ($action === null || (is_array($action) && count($action) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $action when calling corporateUserInvitationActionEmailPut'
);
}
- $resourcePath = '/corporate/subAccount';
+ // verify the required parameter 'email' is set
+ if ($email === null || (is_array($email) && count($email) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $email when calling corporateUserInvitationActionEmailPut'
+ );
+ }
+
+
+ $resourcePath = '/corporate/user/invitation/{action}/{email}';
$formParams = [];
$queryParams = [];
$headerParams = [];
@@ -2744,56 +6656,52 @@ protected function corporateSubAccountPostRequest($subAccountCreate)
- // body params
- $_tempBody = null;
- if (isset($subAccountCreate)) {
- $_tempBody = $subAccountCreate;
- }
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
+ // path params
+ if ($action !== null) {
+ $resourcePath = str_replace(
+ '{' . 'action' . '}',
+ ObjectSerializer::toPathValue($action),
+ $resourcePath
);
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
+ }
+ // path params
+ if ($email !== null) {
+ $resourcePath = str_replace(
+ '{' . 'email' . '}',
+ ObjectSerializer::toPathValue($email),
+ $resourcePath
);
}
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -2819,47 +6727,54 @@ protected function corporateSubAccountPostRequest($subAccountCreate)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
- 'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ 'PUT',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
}
/**
- * Operation corporateSubAccountSsoTokenPost
+ * Operation corporateUserRevokeEmailDelete
*
- * Generate SSO token to access Brevo
+ * Revoke an admin user
*
- * @param \Brevo\Client\Model\SsoTokenRequest $ssoTokenRequest Values to generate SSO token for sub-account (required)
+ * @param string $email Email of the invited user (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateUserRevokeEmailDelete'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetSsoToken
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return void
*/
- public function corporateSubAccountSsoTokenPost($ssoTokenRequest)
+ public function corporateUserRevokeEmailDelete(
+ string $email,
+ string $contentType = self::contentTypes['corporateUserRevokeEmailDelete'][0]
+ ): void
{
- list($response) = $this->corporateSubAccountSsoTokenPostWithHttpInfo($ssoTokenRequest);
- return $response;
+ $this->corporateUserRevokeEmailDeleteWithHttpInfo($email, $contentType);
}
/**
- * Operation corporateSubAccountSsoTokenPostWithHttpInfo
+ * Operation corporateUserRevokeEmailDeleteWithHttpInfo
*
- * Generate SSO token to access Brevo
+ * Revoke an admin user
*
- * @param \Brevo\Client\Model\SsoTokenRequest $ssoTokenRequest Values to generate SSO token for sub-account (required)
+ * @param string $email Email of the invited user (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateUserRevokeEmailDelete'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetSsoToken, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function corporateSubAccountSsoTokenPostWithHttpInfo($ssoTokenRequest)
+ public function corporateUserRevokeEmailDeleteWithHttpInfo(
+ string $email,
+ string $contentType = self::contentTypes['corporateUserRevokeEmailDelete'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetSsoToken';
- $request = $this->corporateSubAccountSsoTokenPostRequest($ssoTokenRequest);
+ $request = $this->corporateUserRevokeEmailDeleteRequest($email, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -2868,65 +6783,30 @@ public function corporateSubAccountSsoTokenPostWithHttpInfo($ssoTokenRequest)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
);
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
+ } catch (ConnectException $e) {
throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
+ $statusCode = $response->getStatusCode();
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
+
+ return [null, $statusCode, $response->getHeaders()];
} catch (ApiException $e) {
switch ($e->getCode()) {
- case 200:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\GetSsoToken',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 403:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2937,18 +6817,22 @@ public function corporateSubAccountSsoTokenPostWithHttpInfo($ssoTokenRequest)
}
/**
- * Operation corporateSubAccountSsoTokenPostAsync
+ * Operation corporateUserRevokeEmailDeleteAsync
*
- * Generate SSO token to access Brevo
+ * Revoke an admin user
*
- * @param \Brevo\Client\Model\SsoTokenRequest $ssoTokenRequest Values to generate SSO token for sub-account (required)
+ * @param string $email Email of the invited user (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateUserRevokeEmailDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function corporateSubAccountSsoTokenPostAsync($ssoTokenRequest)
+ public function corporateUserRevokeEmailDeleteAsync(
+ string $email,
+ string $contentType = self::contentTypes['corporateUserRevokeEmailDelete'][0]
+ ): PromiseInterface
{
- return $this->corporateSubAccountSsoTokenPostAsyncWithHttpInfo($ssoTokenRequest)
+ return $this->corporateUserRevokeEmailDeleteAsyncWithHttpInfo($email, $contentType)
->then(
function ($response) {
return $response[0];
@@ -2957,39 +6841,30 @@ function ($response) {
}
/**
- * Operation corporateSubAccountSsoTokenPostAsyncWithHttpInfo
+ * Operation corporateUserRevokeEmailDeleteAsyncWithHttpInfo
*
- * Generate SSO token to access Brevo
+ * Revoke an admin user
*
- * @param \Brevo\Client\Model\SsoTokenRequest $ssoTokenRequest Values to generate SSO token for sub-account (required)
+ * @param string $email Email of the invited user (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateUserRevokeEmailDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function corporateSubAccountSsoTokenPostAsyncWithHttpInfo($ssoTokenRequest)
+ public function corporateUserRevokeEmailDeleteAsyncWithHttpInfo(
+ $email,
+ string $contentType = self::contentTypes['corporateUserRevokeEmailDelete'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetSsoToken';
- $request = $this->corporateSubAccountSsoTokenPostRequest($ssoTokenRequest);
+ $returnType = '';
+ $request = $this->corporateUserRevokeEmailDeleteRequest($email, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
-
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
+ return [null, $response->getStatusCode(), $response->getHeaders()];
},
function ($exception) {
$response = $exception->getResponse();
@@ -3002,30 +6877,36 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
}
/**
- * Create request for operation 'corporateSubAccountSsoTokenPost'
+ * Create request for operation 'corporateUserRevokeEmailDelete'
*
- * @param \Brevo\Client\Model\SsoTokenRequest $ssoTokenRequest Values to generate SSO token for sub-account (required)
+ * @param string $email Email of the invited user (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['corporateUserRevokeEmailDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function corporateSubAccountSsoTokenPostRequest($ssoTokenRequest)
+ public function corporateUserRevokeEmailDeleteRequest(
+ $email,
+ string $contentType = self::contentTypes['corporateUserRevokeEmailDelete'][0]
+ ): Request
{
- // verify the required parameter 'ssoTokenRequest' is set
- if ($ssoTokenRequest === null || (is_array($ssoTokenRequest) && count($ssoTokenRequest) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $ssoTokenRequest when calling corporateSubAccountSsoTokenPost'
+
+ // verify the required parameter 'email' is set
+ if ($email === null || (is_array($email) && count($email) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $email when calling corporateUserRevokeEmailDelete'
);
}
- $resourcePath = '/corporate/subAccount/ssoToken';
+
+ $resourcePath = '/corporate/user/revoke/{email}';
$formParams = [];
$queryParams = [];
$headerParams = [];
@@ -3034,56 +6915,44 @@ protected function corporateSubAccountSsoTokenPostRequest($ssoTokenRequest)
- // body params
- $_tempBody = null;
- if (isset($ssoTokenRequest)) {
- $_tempBody = $ssoTokenRequest;
- }
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
+ // path params
+ if ($email !== null) {
+ $resourcePath = str_replace(
+ '{' . 'email' . '}',
+ ObjectSerializer::toPathValue($email),
+ $resourcePath
);
}
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -3109,46 +6978,67 @@ protected function corporateSubAccountSsoTokenPostRequest($ssoTokenRequest)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
- 'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ 'DELETE',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
}
/**
- * Operation corporateUserRevokeEmailDelete
+ * Operation getAccountActivity_0
*
- * Revoke an admin user
+ * Get user activity logs
*
- * @param string $email Email of the invited user (required)
+ * @param string|null $startDate Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search. (optional)
+ * @param string|null $endDate Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 10)
+ * @param int|null $offset Index of the first document in the page. (optional, default to 0)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAccountActivity_0'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return void
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetAccountActivity|\Brevo\Client\Models\ErrorModel
*/
- public function corporateUserRevokeEmailDelete($email)
+ public function getAccountActivity_0(
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $limit = 10,
+ ?int $offset = 0,
+ string $contentType = self::contentTypes['getAccountActivity_0'][0]
+ ): \Brevo\Client\Models\GetAccountActivity
{
- $this->corporateUserRevokeEmailDeleteWithHttpInfo($email);
+ list($response) = $this->getAccountActivity_0WithHttpInfo($startDate, $endDate, $limit, $offset, $contentType);
+ return $response;
}
/**
- * Operation corporateUserRevokeEmailDeleteWithHttpInfo
+ * Operation getAccountActivity_0WithHttpInfo
*
- * Revoke an admin user
+ * Get user activity logs
*
- * @param string $email Email of the invited user (required)
+ * @param string|null $startDate Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search. (optional)
+ * @param string|null $endDate Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 10)
+ * @param int|null $offset Index of the first document in the page. (optional, default to 0)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAccountActivity_0'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetAccountActivity|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function corporateUserRevokeEmailDeleteWithHttpInfo($email)
+ public function getAccountActivity_0WithHttpInfo(
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $limit = 10,
+ ?int $offset = 0,
+ string $contentType = self::contentTypes['getAccountActivity_0'][0]
+ ): array
{
- $returnType = '';
- $request = $this->corporateUserRevokeEmailDeleteRequest($email);
+ $request = $this->getAccountActivity_0Request($startDate, $endDate, $limit, $offset, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -3157,35 +7047,134 @@ public function corporateUserRevokeEmailDeleteWithHttpInfo($email)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetAccountActivity', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetAccountActivity' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetAccountActivity', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- return [null, $statusCode, $response->getHeaders()];
+ $returnType = '\Brevo\Client\Models\GetAccountActivity';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\GetAccountActivity',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -3196,18 +7185,28 @@ public function corporateUserRevokeEmailDeleteWithHttpInfo($email)
}
/**
- * Operation corporateUserRevokeEmailDeleteAsync
+ * Operation getAccountActivity_0Async
*
- * Revoke an admin user
+ * Get user activity logs
*
- * @param string $email Email of the invited user (required)
+ * @param string|null $startDate Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search. (optional)
+ * @param string|null $endDate Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 10)
+ * @param int|null $offset Index of the first document in the page. (optional, default to 0)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAccountActivity_0'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function corporateUserRevokeEmailDeleteAsync($email)
+ public function getAccountActivity_0Async(
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $limit = 10,
+ ?int $offset = 0,
+ string $contentType = self::contentTypes['getAccountActivity_0'][0]
+ ): PromiseInterface
{
- return $this->corporateUserRevokeEmailDeleteAsyncWithHttpInfo($email)
+ return $this->getAccountActivity_0AsyncWithHttpInfo($startDate, $endDate, $limit, $offset, $contentType)
->then(
function ($response) {
return $response[0];
@@ -3216,25 +7215,49 @@ function ($response) {
}
/**
- * Operation corporateUserRevokeEmailDeleteAsyncWithHttpInfo
+ * Operation getAccountActivity_0AsyncWithHttpInfo
*
- * Revoke an admin user
+ * Get user activity logs
*
- * @param string $email Email of the invited user (required)
+ * @param string|null $startDate Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search. (optional)
+ * @param string|null $endDate Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 10)
+ * @param int|null $offset Index of the first document in the page. (optional, default to 0)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAccountActivity_0'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function corporateUserRevokeEmailDeleteAsyncWithHttpInfo($email)
+ public function getAccountActivity_0AsyncWithHttpInfo(
+ $startDate = null,
+ $endDate = null,
+ $limit = 10,
+ $offset = 0,
+ string $contentType = self::contentTypes['getAccountActivity_0'][0]
+ ): PromiseInterface
{
- $returnType = '';
- $request = $this->corporateUserRevokeEmailDeleteRequest($email);
+ $returnType = '\Brevo\Client\Models\GetAccountActivity';
+ $request = $this->getAccountActivity_0Request($startDate, $endDate, $limit, $offset, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- return [null, $response->getStatusCode(), $response->getHeaders()];
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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();
@@ -3247,93 +7270,119 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
}
/**
- * Create request for operation 'corporateUserRevokeEmailDelete'
+ * Create request for operation 'getAccountActivity_0'
*
- * @param string $email Email of the invited user (required)
+ * @param string|null $startDate Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search. (optional)
+ * @param string|null $endDate Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 10)
+ * @param int|null $offset Index of the first document in the page. (optional, default to 0)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAccountActivity_0'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function corporateUserRevokeEmailDeleteRequest($email)
+ public function getAccountActivity_0Request(
+ $startDate = null,
+ $endDate = null,
+ $limit = 10,
+ $offset = 0,
+ string $contentType = self::contentTypes['getAccountActivity_0'][0]
+ ): Request
{
- // verify the required parameter 'email' is set
- if ($email === null || (is_array($email) && count($email) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $email when calling corporateUserRevokeEmailDelete'
- );
+
+
+
+ if ($limit !== null && $limit > 100) {
+ throw new InvalidArgumentException('invalid value for "$limit" when calling MasterAccountApi.getAccountActivity_0, must be smaller than or equal to 100.');
+ }
+ if ($limit !== null && $limit < 1) {
+ throw new InvalidArgumentException('invalid value for "$limit" when calling MasterAccountApi.getAccountActivity_0, must be bigger than or equal to 1.');
}
+
- $resourcePath = '/corporate/user/revoke/{email}';
+
+ $resourcePath = '/organization/activities';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $startDate,
+ 'startDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $endDate,
+ 'endDate', // 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(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
- // path params
- if ($email !== null) {
- $resourcePath = str_replace(
- '{' . 'email' . '}',
- ObjectSerializer::toPathValue($email),
- $resourcePath
- );
- }
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -3359,53 +7408,51 @@ protected function corporateUserRevokeEmailDeleteRequest($email)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
- 'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ 'GET',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
}
/**
- * Operation getAccountActivity
+ * Operation getCorporateInvitedUsersList
*
- * Get user activity logs
+ * Get the list of all admin users
*
- * @param string $startDate Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search. (optional)
- * @param string $endDate Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. (optional)
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document in the page. (optional, default to 0)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCorporateInvitedUsersList'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetAccountActivity
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetCorporateInvitedUsersList
*/
- public function getAccountActivity($startDate = null, $endDate = null, $limit = '10', $offset = '0')
+ public function getCorporateInvitedUsersList(
+ string $contentType = self::contentTypes['getCorporateInvitedUsersList'][0]
+ ): \Brevo\Client\Models\GetCorporateInvitedUsersList
{
- list($response) = $this->getAccountActivityWithHttpInfo($startDate, $endDate, $limit, $offset);
+ list($response) = $this->getCorporateInvitedUsersListWithHttpInfo($contentType);
return $response;
}
/**
- * Operation getAccountActivityWithHttpInfo
+ * Operation getCorporateInvitedUsersListWithHttpInfo
*
- * Get user activity logs
+ * Get the list of all admin users
*
- * @param string $startDate Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search. (optional)
- * @param string $endDate Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. (optional)
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document in the page. (optional, default to 0)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCorporateInvitedUsersList'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetAccountActivity, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetCorporateInvitedUsersList, HTTP status code, HTTP response headers (array of strings)
*/
- public function getAccountActivityWithHttpInfo($startDate = null, $endDate = null, $limit = '10', $offset = '0')
+ public function getCorporateInvitedUsersListWithHttpInfo(
+ string $contentType = self::contentTypes['getCorporateInvitedUsersList'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetAccountActivity';
- $request = $this->getAccountActivityRequest($startDate, $endDate, $limit, $offset);
+ $request = $this->getCorporateInvitedUsersListRequest($contentType);
try {
$options = $this->createHttpClientOption();
@@ -3414,34 +7461,84 @@ public function getAccountActivityWithHttpInfo($startDate = null, $endDate = nul
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetCorporateInvitedUsersList', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetCorporateInvitedUsersList' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetCorporateInvitedUsersList', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetCorporateInvitedUsersList';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -3456,15 +7553,7 @@ public function getAccountActivityWithHttpInfo($startDate = null, $endDate = nul
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetAccountActivity',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\GetCorporateInvitedUsersList',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -3475,21 +7564,20 @@ public function getAccountActivityWithHttpInfo($startDate = null, $endDate = nul
}
/**
- * Operation getAccountActivityAsync
+ * Operation getCorporateInvitedUsersListAsync
*
- * Get user activity logs
+ * Get the list of all admin users
*
- * @param string $startDate Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search. (optional)
- * @param string $endDate Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. (optional)
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document in the page. (optional, default to 0)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCorporateInvitedUsersList'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getAccountActivityAsync($startDate = null, $endDate = null, $limit = '10', $offset = '0')
+ public function getCorporateInvitedUsersListAsync(
+ string $contentType = self::contentTypes['getCorporateInvitedUsersList'][0]
+ ): PromiseInterface
{
- return $this->getAccountActivityAsyncWithHttpInfo($startDate, $endDate, $limit, $offset)
+ return $this->getCorporateInvitedUsersListAsyncWithHttpInfo($contentType)
->then(
function ($response) {
return $response[0];
@@ -3498,32 +7586,31 @@ function ($response) {
}
/**
- * Operation getAccountActivityAsyncWithHttpInfo
+ * Operation getCorporateInvitedUsersListAsyncWithHttpInfo
*
- * Get user activity logs
+ * Get the list of all admin users
*
- * @param string $startDate Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search. (optional)
- * @param string $endDate Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. (optional)
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document in the page. (optional, default to 0)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCorporateInvitedUsersList'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getAccountActivityAsyncWithHttpInfo($startDate = null, $endDate = null, $limit = '10', $offset = '0')
+ public function getCorporateInvitedUsersListAsyncWithHttpInfo(
+ string $contentType = self::contentTypes['getCorporateInvitedUsersList'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetAccountActivity';
- $request = $this->getAccountActivityRequest($startDate, $endDate, $limit, $offset);
+ $returnType = '\Brevo\Client\Models\GetCorporateInvitedUsersList';
+ $request = $this->getCorporateInvitedUsersListRequest($contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -3546,105 +7633,65 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
}
/**
- * Create request for operation 'getAccountActivity'
+ * Create request for operation 'getCorporateInvitedUsersList'
*
- * @param string $startDate Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search. (optional)
- * @param string $endDate Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. (optional)
- * @param int $limit Number of documents per page (optional, default to 10)
- * @param int $offset Index of the first document in the page. (optional, default to 0)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCorporateInvitedUsersList'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getAccountActivityRequest($startDate = null, $endDate = null, $limit = '10', $offset = '0')
+ public function getCorporateInvitedUsersListRequest(
+ string $contentType = self::contentTypes['getCorporateInvitedUsersList'][0]
+ ): Request
{
- if ($limit !== null && $limit > 100) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling MasterAccountApi.getAccountActivity, must be smaller than or equal to 100.');
- }
- if ($limit !== null && $limit < 1) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling MasterAccountApi.getAccountActivity, must be bigger than or equal to 1.');
- }
- $resourcePath = '/organization/activities';
+ $resourcePath = '/corporate/invited/users';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
- // query params
- if ($startDate !== null) {
- $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate);
- }
- // query params
- if ($endDate !== null) {
- $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate);
- }
- // query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
- // query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -3670,45 +7717,55 @@ protected function getAccountActivityRequest($startDate = null, $endDate = null,
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
}
/**
- * Operation getCorporateInvitedUsersList
+ * Operation getCorporateUserPermission
*
- * Get the list of all admin users
+ * Check admin user permissions
*
+ * @param string $email Email of the invited user. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCorporateUserPermission'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetCorporateInvitedUsersList
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetCorporateUserPermission|\Brevo\Client\Models\ErrorModel
*/
- public function getCorporateInvitedUsersList()
+ public function getCorporateUserPermission(
+ string $email,
+ string $contentType = self::contentTypes['getCorporateUserPermission'][0]
+ ): \Brevo\Client\Models\GetCorporateUserPermission
{
- list($response) = $this->getCorporateInvitedUsersListWithHttpInfo();
+ list($response) = $this->getCorporateUserPermissionWithHttpInfo($email, $contentType);
return $response;
}
/**
- * Operation getCorporateInvitedUsersListWithHttpInfo
+ * Operation getCorporateUserPermissionWithHttpInfo
*
- * Get the list of all admin users
+ * Check admin user permissions
*
+ * @param string $email Email of the invited user. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCorporateUserPermission'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetCorporateInvitedUsersList, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetCorporateUserPermission|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getCorporateInvitedUsersListWithHttpInfo()
+ public function getCorporateUserPermissionWithHttpInfo(
+ string $email,
+ string $contentType = self::contentTypes['getCorporateUserPermission'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetCorporateInvitedUsersList';
- $request = $this->getCorporateInvitedUsersListRequest();
+ $request = $this->getCorporateUserPermissionRequest($email, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -3717,34 +7774,111 @@ public function getCorporateInvitedUsersListWithHttpInfo()
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetCorporateUserPermission', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetCorporateUserPermission' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetCorporateUserPermission', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetCorporateUserPermission';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -3759,7 +7893,7 @@ public function getCorporateInvitedUsersListWithHttpInfo()
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetCorporateInvitedUsersList',
+ '\Brevo\Client\Models\GetCorporateUserPermission',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -3767,7 +7901,7 @@ public function getCorporateInvitedUsersListWithHttpInfo()
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -3778,17 +7912,22 @@ public function getCorporateInvitedUsersListWithHttpInfo()
}
/**
- * Operation getCorporateInvitedUsersListAsync
+ * Operation getCorporateUserPermissionAsync
*
- * Get the list of all admin users
+ * Check admin user permissions
*
+ * @param string $email Email of the invited user. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCorporateUserPermission'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getCorporateInvitedUsersListAsync()
+ public function getCorporateUserPermissionAsync(
+ string $email,
+ string $contentType = self::contentTypes['getCorporateUserPermission'][0]
+ ): PromiseInterface
{
- return $this->getCorporateInvitedUsersListAsyncWithHttpInfo()
+ return $this->getCorporateUserPermissionAsyncWithHttpInfo($email, $contentType)
->then(
function ($response) {
return $response[0];
@@ -3797,28 +7936,33 @@ function ($response) {
}
/**
- * Operation getCorporateInvitedUsersListAsyncWithHttpInfo
+ * Operation getCorporateUserPermissionAsyncWithHttpInfo
*
- * Get the list of all admin users
+ * Check admin user permissions
*
+ * @param string $email Email of the invited user. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCorporateUserPermission'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getCorporateInvitedUsersListAsyncWithHttpInfo()
+ public function getCorporateUserPermissionAsyncWithHttpInfo(
+ $email,
+ string $contentType = self::contentTypes['getCorporateUserPermission'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetCorporateInvitedUsersList';
- $request = $this->getCorporateInvitedUsersListRequest();
+ $returnType = '\Brevo\Client\Models\GetCorporateUserPermission';
+ $request = $this->getCorporateUserPermissionRequest($email, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -3841,23 +7985,36 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
}
/**
- * Create request for operation 'getCorporateInvitedUsersList'
+ * Create request for operation 'getCorporateUserPermission'
*
+ * @param string $email Email of the invited user. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCorporateUserPermission'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getCorporateInvitedUsersListRequest()
+ public function getCorporateUserPermissionRequest(
+ $email,
+ string $contentType = self::contentTypes['getCorporateUserPermission'][0]
+ ): Request
{
- $resourcePath = '/corporate/invited/users';
+ // verify the required parameter 'email' is set
+ if ($email === null || (is_array($email) && count($email) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $email when calling getCorporateUserPermission'
+ );
+ }
+
+
+ $resourcePath = '/corporate/user/{email}/permissions';
$formParams = [];
$queryParams = [];
$headerParams = [];
@@ -3866,53 +8023,44 @@ protected function getCorporateInvitedUsersListRequest()
- // body params
- $_tempBody = null;
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
+ // path params
+ if ($email !== null) {
+ $resourcePath = str_replace(
+ '{' . 'email' . '}',
+ ObjectSerializer::toPathValue($email),
+ $resourcePath
);
}
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -3938,10 +8086,11 @@ protected function getCorporateInvitedUsersListRequest()
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -3952,14 +8101,17 @@ protected function getCorporateInvitedUsersListRequest()
*
* Get the list of groups
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSubAccountGroups'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\InlineResponse200[]
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetSubAccountGroups200ResponseInner[]
*/
- public function getSubAccountGroups()
+ public function getSubAccountGroups(
+ string $contentType = self::contentTypes['getSubAccountGroups'][0]
+ ): array
{
- list($response) = $this->getSubAccountGroupsWithHttpInfo();
+ list($response) = $this->getSubAccountGroupsWithHttpInfo($contentType);
return $response;
}
@@ -3968,15 +8120,17 @@ public function getSubAccountGroups()
*
* Get the list of groups
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSubAccountGroups'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\InlineResponse200[], HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetSubAccountGroups200ResponseInner[], HTTP status code, HTTP response headers (array of strings)
*/
- public function getSubAccountGroupsWithHttpInfo()
+ public function getSubAccountGroupsWithHttpInfo(
+ string $contentType = self::contentTypes['getSubAccountGroups'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\InlineResponse200[]';
- $request = $this->getSubAccountGroupsRequest();
+ $request = $this->getSubAccountGroupsRequest($contentType);
try {
$options = $this->createHttpClientOption();
@@ -3985,34 +8139,84 @@ public function getSubAccountGroupsWithHttpInfo()
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetSubAccountGroups200ResponseInner[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetSubAccountGroups200ResponseInner[]' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetSubAccountGroups200ResponseInner[]', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetSubAccountGroups200ResponseInner[]';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -4027,15 +8231,7 @@ public function getSubAccountGroupsWithHttpInfo()
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\InlineResponse200[]',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\GetSubAccountGroups200ResponseInner[]',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -4050,13 +8246,16 @@ public function getSubAccountGroupsWithHttpInfo()
*
* Get the list of groups
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSubAccountGroups'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getSubAccountGroupsAsync()
+ public function getSubAccountGroupsAsync(
+ string $contentType = self::contentTypes['getSubAccountGroups'][0]
+ ): PromiseInterface
{
- return $this->getSubAccountGroupsAsyncWithHttpInfo()
+ return $this->getSubAccountGroupsAsyncWithHttpInfo($contentType)
->then(
function ($response) {
return $response[0];
@@ -4069,24 +8268,27 @@ function ($response) {
*
* Get the list of groups
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSubAccountGroups'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getSubAccountGroupsAsyncWithHttpInfo()
+ public function getSubAccountGroupsAsyncWithHttpInfo(
+ string $contentType = self::contentTypes['getSubAccountGroups'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\InlineResponse200[]';
- $request = $this->getSubAccountGroupsRequest();
+ $returnType = '\Brevo\Client\Models\GetSubAccountGroups200ResponseInner[]';
+ $request = $this->getSubAccountGroupsRequest($contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -4109,7 +8311,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -4118,13 +8320,17 @@ function ($exception) {
/**
* Create request for operation 'getSubAccountGroups'
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSubAccountGroups'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getSubAccountGroupsRequest()
+ public function getSubAccountGroupsRequest(
+ string $contentType = self::contentTypes['getSubAccountGroups'][0]
+ ): Request
{
+
$resourcePath = '/corporate/groups';
$formParams = [];
$queryParams = [];
@@ -4134,53 +8340,36 @@ protected function getSubAccountGroupsRequest()
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -4206,10 +8395,11 @@ protected function getSubAccountGroupsRequest()
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -4220,15 +8410,19 @@ protected function getSubAccountGroupsRequest()
*
* Send invitation to an admin user
*
- * @param \Brevo\Client\Model\InviteAdminUser $sendInvitation Payload to send an invitation (required)
+ * @param \Brevo\Client\Models\InviteAdminUser $inviteAdminUser Payload to send an invitation (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['inviteAdminUser'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\InviteAdminUser
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CorporateGroupPost201Response|\Brevo\Client\Models\ErrorModel
*/
- public function inviteAdminUser($sendInvitation)
+ public function inviteAdminUser(
+ \Brevo\Client\Models\InviteAdminUser $inviteAdminUser,
+ string $contentType = self::contentTypes['inviteAdminUser'][0]
+ ): \Brevo\Client\Models\CorporateGroupPost201Response
{
- list($response) = $this->inviteAdminUserWithHttpInfo($sendInvitation);
+ list($response) = $this->inviteAdminUserWithHttpInfo($inviteAdminUser, $contentType);
return $response;
}
@@ -4237,16 +8431,19 @@ public function inviteAdminUser($sendInvitation)
*
* Send invitation to an admin user
*
- * @param \Brevo\Client\Model\InviteAdminUser $sendInvitation Payload to send an invitation (required)
+ * @param \Brevo\Client\Models\InviteAdminUser $inviteAdminUser Payload to send an invitation (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['inviteAdminUser'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\InviteAdminUser, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CorporateGroupPost201Response|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function inviteAdminUserWithHttpInfo($sendInvitation)
+ public function inviteAdminUserWithHttpInfo(
+ \Brevo\Client\Models\InviteAdminUser $inviteAdminUser,
+ string $contentType = self::contentTypes['inviteAdminUser'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\InviteAdminUser';
- $request = $this->inviteAdminUserRequest($sendInvitation);
+ $request = $this->inviteAdminUserRequest($inviteAdminUser, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -4255,34 +8452,111 @@ public function inviteAdminUserWithHttpInfo($sendInvitation)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 201:
+ if (in_array('\Brevo\Client\Models\CorporateGroupPost201Response', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CorporateGroupPost201Response' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CorporateGroupPost201Response', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CorporateGroupPost201Response';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -4294,10 +8568,10 @@ public function inviteAdminUserWithHttpInfo($sendInvitation)
} catch (ApiException $e) {
switch ($e->getCode()) {
- case 200:
+ case 201:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\InviteAdminUser',
+ '\Brevo\Client\Models\CorporateGroupPost201Response',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -4305,7 +8579,7 @@ public function inviteAdminUserWithHttpInfo($sendInvitation)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -4320,14 +8594,18 @@ public function inviteAdminUserWithHttpInfo($sendInvitation)
*
* Send invitation to an admin user
*
- * @param \Brevo\Client\Model\InviteAdminUser $sendInvitation Payload to send an invitation (required)
+ * @param \Brevo\Client\Models\InviteAdminUser $inviteAdminUser Payload to send an invitation (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['inviteAdminUser'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function inviteAdminUserAsync($sendInvitation)
+ public function inviteAdminUserAsync(
+ \Brevo\Client\Models\InviteAdminUser $inviteAdminUser,
+ string $contentType = self::contentTypes['inviteAdminUser'][0]
+ ): PromiseInterface
{
- return $this->inviteAdminUserAsyncWithHttpInfo($sendInvitation)
+ return $this->inviteAdminUserAsyncWithHttpInfo($inviteAdminUser, $contentType)
->then(
function ($response) {
return $response[0];
@@ -4340,25 +8618,29 @@ function ($response) {
*
* Send invitation to an admin user
*
- * @param \Brevo\Client\Model\InviteAdminUser $sendInvitation Payload to send an invitation (required)
+ * @param \Brevo\Client\Models\InviteAdminUser $inviteAdminUser Payload to send an invitation (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['inviteAdminUser'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function inviteAdminUserAsyncWithHttpInfo($sendInvitation)
+ public function inviteAdminUserAsyncWithHttpInfo(
+ $inviteAdminUser,
+ string $contentType = self::contentTypes['inviteAdminUser'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\InviteAdminUser';
- $request = $this->inviteAdminUserRequest($sendInvitation);
+ $returnType = '\Brevo\Client\Models\CorporateGroupPost201Response';
+ $request = $this->inviteAdminUserRequest($inviteAdminUser, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -4381,7 +8663,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -4390,20 +8672,26 @@ function ($exception) {
/**
* Create request for operation 'inviteAdminUser'
*
- * @param \Brevo\Client\Model\InviteAdminUser $sendInvitation Payload to send an invitation (required)
+ * @param \Brevo\Client\Models\InviteAdminUser $inviteAdminUser Payload to send an invitation (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['inviteAdminUser'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function inviteAdminUserRequest($sendInvitation)
+ public function inviteAdminUserRequest(
+ $inviteAdminUser,
+ string $contentType = self::contentTypes['inviteAdminUser'][0]
+ ): Request
{
- // verify the required parameter 'sendInvitation' is set
- if ($sendInvitation === null || (is_array($sendInvitation) && count($sendInvitation) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $sendInvitation when calling inviteAdminUser'
+
+ // verify the required parameter 'inviteAdminUser' is set
+ if ($inviteAdminUser === null || (is_array($inviteAdminUser) && count($inviteAdminUser) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $inviteAdminUser when calling inviteAdminUser'
);
}
+
$resourcePath = '/corporate/user/invitation/send';
$formParams = [];
$queryParams = [];
@@ -4413,56 +8701,43 @@ protected function inviteAdminUserRequest($sendInvitation)
- // body params
- $_tempBody = null;
- if (isset($sendInvitation)) {
- $_tempBody = $sendInvitation;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($inviteAdminUser)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($inviteAdminUser));
+ } else {
+ $httpBody = $inviteAdminUser;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -4488,10 +8763,11 @@ protected function inviteAdminUserRequest($sendInvitation)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -4503,7 +8779,7 @@ protected function inviteAdminUserRequest($sendInvitation)
* @throws \RuntimeException on file opening failure
* @return array of http client options
*/
- protected function createHttpClientOption()
+ protected function createHttpClientOption(): array
{
$options = [];
if ($this->config->getDebug()) {
diff --git a/lib/Api/NotesApi.php b/lib/Api/NotesApi.php
index 16e235d..6960c93 100644
--- a/lib/Api/NotesApi.php
+++ b/lib/Api/NotesApi.php
@@ -1,39 +1,41 @@
[
+ 'application/json',
+ ],
+ 'crmNotesIdDelete' => [
+ 'application/json',
+ ],
+ 'crmNotesIdGet' => [
+ 'application/json',
+ ],
+ 'crmNotesIdPatch' => [
+ 'application/json',
+ ],
+ 'crmNotesPost' => [
+ 'application/json',
+ ],
+ ];
+
+ /**
+ * @param ClientInterface|null $client
+ * @param Configuration|null $config
+ * @param HeaderSelector|null $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
+ HeaderSelector $selector = null,
+ int $hostIndex = 0
) {
$this->client = $client ?: new Client();
- $this->config = $config ?: new Configuration();
+ $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(int $hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex(): int
+ {
+ return $this->hostIndex;
}
/**
* @return Configuration
*/
- public function getConfig()
+ public function getConfig(): Configuration
{
return $this->config;
}
@@ -92,21 +140,31 @@ public function getConfig()
*
* Get all notes
*
- * @param string $entity Filter by note entity type (optional)
- * @param string $entityIds Filter by note entity IDs (optional)
- * @param int $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
- * @param int $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
- * @param int $offset Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\NoteList
+ * @param string|null $entity Filter by note entity type (optional)
+ * @param string|null $entityIds Filter by note entity IDs (optional)
+ * @param int|null $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
+ * @param int|null $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
+ * @param int|null $offset Index of the first document of the page (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param string|null $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmNotesGet'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\Note[]|\Brevo\Client\Models\ErrorModel
*/
- public function crmNotesGet($entity = null, $entityIds = null, $dateFrom = null, $dateTo = null, $offset = null, $limit = '50', $sort = null)
+ public function crmNotesGet(
+ ?string $entity = null,
+ ?string $entityIds = null,
+ ?int $dateFrom = null,
+ ?int $dateTo = null,
+ ?int $offset = null,
+ ?int $limit = 50,
+ ?string $sort = null,
+ string $contentType = self::contentTypes['crmNotesGet'][0]
+ ): array
{
- list($response) = $this->crmNotesGetWithHttpInfo($entity, $entityIds, $dateFrom, $dateTo, $offset, $limit, $sort);
+ list($response) = $this->crmNotesGetWithHttpInfo($entity, $entityIds, $dateFrom, $dateTo, $offset, $limit, $sort, $contentType);
return $response;
}
@@ -115,22 +173,31 @@ public function crmNotesGet($entity = null, $entityIds = null, $dateFrom = null,
*
* Get all notes
*
- * @param string $entity Filter by note entity type (optional)
- * @param string $entityIds Filter by note entity IDs (optional)
- * @param int $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
- * @param int $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
- * @param int $offset Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\NoteList, HTTP status code, HTTP response headers (array of strings)
+ * @param string|null $entity Filter by note entity type (optional)
+ * @param string|null $entityIds Filter by note entity IDs (optional)
+ * @param int|null $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
+ * @param int|null $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
+ * @param int|null $offset Index of the first document of the page (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param string|null $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmNotesGet'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\Note[]|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function crmNotesGetWithHttpInfo($entity = null, $entityIds = null, $dateFrom = null, $dateTo = null, $offset = null, $limit = '50', $sort = null)
+ public function crmNotesGetWithHttpInfo(
+ ?string $entity = null,
+ ?string $entityIds = null,
+ ?int $dateFrom = null,
+ ?int $dateTo = null,
+ ?int $offset = null,
+ ?int $limit = 50,
+ ?string $sort = null,
+ string $contentType = self::contentTypes['crmNotesGet'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\NoteList';
- $request = $this->crmNotesGetRequest($entity, $entityIds, $dateFrom, $dateTo, $offset, $limit, $sort);
+ $request = $this->crmNotesGetRequest($entity, $entityIds, $dateFrom, $dateTo, $offset, $limit, $sort, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -139,34 +206,111 @@ public function crmNotesGetWithHttpInfo($entity = null, $entityIds = null, $date
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\Note[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\Note[]' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\Note[]', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\Note[]';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -181,7 +325,7 @@ public function crmNotesGetWithHttpInfo($entity = null, $entityIds = null, $date
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\NoteList',
+ '\Brevo\Client\Models\Note[]',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -189,7 +333,7 @@ public function crmNotesGetWithHttpInfo($entity = null, $entityIds = null, $date
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -204,20 +348,30 @@ public function crmNotesGetWithHttpInfo($entity = null, $entityIds = null, $date
*
* Get all notes
*
- * @param string $entity Filter by note entity type (optional)
- * @param string $entityIds Filter by note entity IDs (optional)
- * @param int $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
- * @param int $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
- * @param int $offset Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @param string|null $entity Filter by note entity type (optional)
+ * @param string|null $entityIds Filter by note entity IDs (optional)
+ * @param int|null $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
+ * @param int|null $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
+ * @param int|null $offset Index of the first document of the page (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param string|null $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmNotesGet'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmNotesGetAsync($entity = null, $entityIds = null, $dateFrom = null, $dateTo = null, $offset = null, $limit = '50', $sort = null)
+ public function crmNotesGetAsync(
+ ?string $entity = null,
+ ?string $entityIds = null,
+ ?int $dateFrom = null,
+ ?int $dateTo = null,
+ ?int $offset = null,
+ ?int $limit = 50,
+ ?string $sort = null,
+ string $contentType = self::contentTypes['crmNotesGet'][0]
+ ): PromiseInterface
{
- return $this->crmNotesGetAsyncWithHttpInfo($entity, $entityIds, $dateFrom, $dateTo, $offset, $limit, $sort)
+ return $this->crmNotesGetAsyncWithHttpInfo($entity, $entityIds, $dateFrom, $dateTo, $offset, $limit, $sort, $contentType)
->then(
function ($response) {
return $response[0];
@@ -230,31 +384,41 @@ function ($response) {
*
* Get all notes
*
- * @param string $entity Filter by note entity type (optional)
- * @param string $entityIds Filter by note entity IDs (optional)
- * @param int $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
- * @param int $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
- * @param int $offset Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @param string|null $entity Filter by note entity type (optional)
+ * @param string|null $entityIds Filter by note entity IDs (optional)
+ * @param int|null $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
+ * @param int|null $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
+ * @param int|null $offset Index of the first document of the page (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param string|null $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmNotesGet'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmNotesGetAsyncWithHttpInfo($entity = null, $entityIds = null, $dateFrom = null, $dateTo = null, $offset = null, $limit = '50', $sort = null)
+ public function crmNotesGetAsyncWithHttpInfo(
+ $entity = null,
+ $entityIds = null,
+ $dateFrom = null,
+ $dateTo = null,
+ $offset = null,
+ $limit = 50,
+ $sort = null,
+ string $contentType = self::contentTypes['crmNotesGet'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\NoteList';
- $request = $this->crmNotesGetRequest($entity, $entityIds, $dateFrom, $dateTo, $offset, $limit, $sort);
+ $returnType = '\Brevo\Client\Models\Note[]';
+ $request = $this->crmNotesGetRequest($entity, $entityIds, $dateFrom, $dateTo, $offset, $limit, $sort, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -277,7 +441,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -286,20 +450,38 @@ function ($exception) {
/**
* Create request for operation 'crmNotesGet'
*
- * @param string $entity Filter by note entity type (optional)
- * @param string $entityIds Filter by note entity IDs (optional)
- * @param int $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
- * @param int $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
- * @param int $offset Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
+ * @param string|null $entity Filter by note entity type (optional)
+ * @param string|null $entityIds Filter by note entity IDs (optional)
+ * @param int|null $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
+ * @param int|null $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
+ * @param int|null $offset Index of the first document of the page (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param string|null $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmNotesGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function crmNotesGetRequest($entity = null, $entityIds = null, $dateFrom = null, $dateTo = null, $offset = null, $limit = '50', $sort = null)
+ public function crmNotesGetRequest(
+ $entity = null,
+ $entityIds = null,
+ $dateFrom = null,
+ $dateTo = null,
+ $offset = null,
+ $limit = 50,
+ $sort = null,
+ string $contentType = self::contentTypes['crmNotesGet'][0]
+ ): Request
{
+
+
+
+
+
+
+
+
$resourcePath = '/crm/notes';
$formParams = [];
$queryParams = [];
@@ -308,82 +490,100 @@ protected function crmNotesGetRequest($entity = null, $entityIds = null, $dateFr
$multipart = false;
// query params
- if ($entity !== null) {
- $queryParams['entity'] = ObjectSerializer::toQueryValue($entity);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $entity,
+ 'entity', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($entityIds !== null) {
- $queryParams['entityIds'] = ObjectSerializer::toQueryValue($entityIds);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $entityIds,
+ 'entityIds', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($dateFrom !== null) {
- $queryParams['dateFrom'] = ObjectSerializer::toQueryValue($dateFrom);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $dateFrom,
+ 'dateFrom', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($dateTo !== null) {
- $queryParams['dateTo'] = ObjectSerializer::toQueryValue($dateTo);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $dateTo,
+ 'dateTo', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -409,10 +609,11 @@ protected function crmNotesGetRequest($entity = null, $entityIds = null, $dateFr
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -424,14 +625,18 @@ protected function crmNotesGetRequest($entity = null, $entityIds = null, $dateFr
* Delete a note
*
* @param string $id Note ID to delete (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmNotesIdDelete'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function crmNotesIdDelete($id)
+ public function crmNotesIdDelete(
+ string $id,
+ string $contentType = self::contentTypes['crmNotesIdDelete'][0]
+ ): void
{
- $this->crmNotesIdDeleteWithHttpInfo($id);
+ $this->crmNotesIdDeleteWithHttpInfo($id, $contentType);
}
/**
@@ -440,15 +645,18 @@ public function crmNotesIdDelete($id)
* Delete a note
*
* @param string $id Note ID to delete (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmNotesIdDelete'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function crmNotesIdDeleteWithHttpInfo($id)
+ public function crmNotesIdDeleteWithHttpInfo(
+ string $id,
+ string $contentType = self::contentTypes['crmNotesIdDelete'][0]
+ ): array
{
- $returnType = '';
- $request = $this->crmNotesIdDeleteRequest($id);
+ $request = $this->crmNotesIdDeleteRequest($id, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -457,26 +665,21 @@ public function crmNotesIdDeleteWithHttpInfo($id)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -485,7 +688,7 @@ public function crmNotesIdDeleteWithHttpInfo($id)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -493,7 +696,7 @@ public function crmNotesIdDeleteWithHttpInfo($id)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -509,13 +712,17 @@ public function crmNotesIdDeleteWithHttpInfo($id)
* Delete a note
*
* @param string $id Note ID to delete (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmNotesIdDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmNotesIdDeleteAsync($id)
+ public function crmNotesIdDeleteAsync(
+ string $id,
+ string $contentType = self::contentTypes['crmNotesIdDelete'][0]
+ ): PromiseInterface
{
- return $this->crmNotesIdDeleteAsyncWithHttpInfo($id)
+ return $this->crmNotesIdDeleteAsyncWithHttpInfo($id, $contentType)
->then(
function ($response) {
return $response[0];
@@ -529,14 +736,19 @@ function ($response) {
* Delete a note
*
* @param string $id Note ID to delete (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmNotesIdDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmNotesIdDeleteAsyncWithHttpInfo($id)
+ public function crmNotesIdDeleteAsyncWithHttpInfo(
+ $id,
+ string $contentType = self::contentTypes['crmNotesIdDelete'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->crmNotesIdDeleteRequest($id);
+ $request = $this->crmNotesIdDeleteRequest($id, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -555,7 +767,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -565,19 +777,25 @@ function ($exception) {
* Create request for operation 'crmNotesIdDelete'
*
* @param string $id Note ID to delete (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmNotesIdDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function crmNotesIdDeleteRequest($id)
+ public function crmNotesIdDeleteRequest(
+ $id,
+ string $contentType = self::contentTypes['crmNotesIdDelete'][0]
+ ): Request
{
+
// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $id when calling crmNotesIdDelete'
);
}
+
$resourcePath = '/crm/notes/{id}';
$formParams = [];
$queryParams = [];
@@ -586,6 +804,7 @@ protected function crmNotesIdDeleteRequest($id)
$multipart = false;
+
// path params
if ($id !== null) {
$resourcePath = str_replace(
@@ -595,53 +814,35 @@ protected function crmNotesIdDeleteRequest($id)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -667,10 +868,11 @@ protected function crmNotesIdDeleteRequest($id)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -682,14 +884,18 @@ protected function crmNotesIdDeleteRequest($id)
* Get a note
*
* @param string $id Note ID to get (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmNotesIdGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\Note
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\Note|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function crmNotesIdGet($id)
+ public function crmNotesIdGet(
+ string $id,
+ string $contentType = self::contentTypes['crmNotesIdGet'][0]
+ ): \Brevo\Client\Models\Note
{
- list($response) = $this->crmNotesIdGetWithHttpInfo($id);
+ list($response) = $this->crmNotesIdGetWithHttpInfo($id, $contentType);
return $response;
}
@@ -699,15 +905,18 @@ public function crmNotesIdGet($id)
* Get a note
*
* @param string $id Note ID to get (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmNotesIdGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\Note, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\Note|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function crmNotesIdGetWithHttpInfo($id)
+ public function crmNotesIdGetWithHttpInfo(
+ string $id,
+ string $contentType = self::contentTypes['crmNotesIdGet'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\Note';
- $request = $this->crmNotesIdGetRequest($id);
+ $request = $this->crmNotesIdGetRequest($id, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -716,34 +925,138 @@ public function crmNotesIdGetWithHttpInfo($id)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\Note', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\Note' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\Note', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\Note';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -758,7 +1071,7 @@ public function crmNotesIdGetWithHttpInfo($id)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\Note',
+ '\Brevo\Client\Models\Note',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -766,7 +1079,7 @@ public function crmNotesIdGetWithHttpInfo($id)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -774,7 +1087,7 @@ public function crmNotesIdGetWithHttpInfo($id)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -790,13 +1103,17 @@ public function crmNotesIdGetWithHttpInfo($id)
* Get a note
*
* @param string $id Note ID to get (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmNotesIdGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmNotesIdGetAsync($id)
+ public function crmNotesIdGetAsync(
+ string $id,
+ string $contentType = self::contentTypes['crmNotesIdGet'][0]
+ ): PromiseInterface
{
- return $this->crmNotesIdGetAsyncWithHttpInfo($id)
+ return $this->crmNotesIdGetAsyncWithHttpInfo($id, $contentType)
->then(
function ($response) {
return $response[0];
@@ -810,24 +1127,28 @@ function ($response) {
* Get a note
*
* @param string $id Note ID to get (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmNotesIdGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmNotesIdGetAsyncWithHttpInfo($id)
+ public function crmNotesIdGetAsyncWithHttpInfo(
+ $id,
+ string $contentType = self::contentTypes['crmNotesIdGet'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\Note';
- $request = $this->crmNotesIdGetRequest($id);
+ $returnType = '\Brevo\Client\Models\Note';
+ $request = $this->crmNotesIdGetRequest($id, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -850,7 +1171,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -860,19 +1181,25 @@ function ($exception) {
* Create request for operation 'crmNotesIdGet'
*
* @param string $id Note ID to get (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmNotesIdGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function crmNotesIdGetRequest($id)
+ public function crmNotesIdGetRequest(
+ $id,
+ string $contentType = self::contentTypes['crmNotesIdGet'][0]
+ ): Request
{
+
// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $id when calling crmNotesIdGet'
);
}
+
$resourcePath = '/crm/notes/{id}';
$formParams = [];
$queryParams = [];
@@ -881,6 +1208,7 @@ protected function crmNotesIdGetRequest($id)
$multipart = false;
+
// path params
if ($id !== null) {
$resourcePath = str_replace(
@@ -890,53 +1218,35 @@ protected function crmNotesIdGetRequest($id)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -962,10 +1272,11 @@ protected function crmNotesIdGetRequest($id)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -977,15 +1288,20 @@ protected function crmNotesIdGetRequest($id)
* Update a note
*
* @param string $id Note ID to update (required)
- * @param \Brevo\Client\Model\NoteData $body Note data to update a note (required)
+ * @param \Brevo\Client\Models\NoteData $noteData Note data to update a note. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmNotesIdPatch'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function crmNotesIdPatch($id, $body)
+ public function crmNotesIdPatch(
+ string $id,
+ \Brevo\Client\Models\NoteData $noteData,
+ string $contentType = self::contentTypes['crmNotesIdPatch'][0]
+ ): void
{
- $this->crmNotesIdPatchWithHttpInfo($id, $body);
+ $this->crmNotesIdPatchWithHttpInfo($id, $noteData, $contentType);
}
/**
@@ -994,16 +1310,20 @@ public function crmNotesIdPatch($id, $body)
* Update a note
*
* @param string $id Note ID to update (required)
- * @param \Brevo\Client\Model\NoteData $body Note data to update a note (required)
+ * @param \Brevo\Client\Models\NoteData $noteData Note data to update a note. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmNotesIdPatch'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function crmNotesIdPatchWithHttpInfo($id, $body)
+ public function crmNotesIdPatchWithHttpInfo(
+ string $id,
+ \Brevo\Client\Models\NoteData $noteData,
+ string $contentType = self::contentTypes['crmNotesIdPatch'][0]
+ ): array
{
- $returnType = '';
- $request = $this->crmNotesIdPatchRequest($id, $body);
+ $request = $this->crmNotesIdPatchRequest($id, $noteData, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1012,26 +1332,21 @@ public function crmNotesIdPatchWithHttpInfo($id, $body)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -1040,7 +1355,7 @@ public function crmNotesIdPatchWithHttpInfo($id, $body)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1048,7 +1363,7 @@ public function crmNotesIdPatchWithHttpInfo($id, $body)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1056,7 +1371,7 @@ public function crmNotesIdPatchWithHttpInfo($id, $body)
case 415:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1072,14 +1387,19 @@ public function crmNotesIdPatchWithHttpInfo($id, $body)
* Update a note
*
* @param string $id Note ID to update (required)
- * @param \Brevo\Client\Model\NoteData $body Note data to update a note (required)
+ * @param \Brevo\Client\Models\NoteData $noteData Note data to update a note. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmNotesIdPatch'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmNotesIdPatchAsync($id, $body)
+ public function crmNotesIdPatchAsync(
+ string $id,
+ \Brevo\Client\Models\NoteData $noteData,
+ string $contentType = self::contentTypes['crmNotesIdPatch'][0]
+ ): PromiseInterface
{
- return $this->crmNotesIdPatchAsyncWithHttpInfo($id, $body)
+ return $this->crmNotesIdPatchAsyncWithHttpInfo($id, $noteData, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1093,15 +1413,21 @@ function ($response) {
* Update a note
*
* @param string $id Note ID to update (required)
- * @param \Brevo\Client\Model\NoteData $body Note data to update a note (required)
+ * @param \Brevo\Client\Models\NoteData $noteData Note data to update a note. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmNotesIdPatch'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmNotesIdPatchAsyncWithHttpInfo($id, $body)
+ public function crmNotesIdPatchAsyncWithHttpInfo(
+ $id,
+ $noteData,
+ string $contentType = self::contentTypes['crmNotesIdPatch'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->crmNotesIdPatchRequest($id, $body);
+ $request = $this->crmNotesIdPatchRequest($id, $noteData, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -1120,7 +1446,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1130,26 +1456,34 @@ function ($exception) {
* Create request for operation 'crmNotesIdPatch'
*
* @param string $id Note ID to update (required)
- * @param \Brevo\Client\Model\NoteData $body Note data to update a note (required)
+ * @param \Brevo\Client\Models\NoteData $noteData Note data to update a note. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmNotesIdPatch'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function crmNotesIdPatchRequest($id, $body)
+ public function crmNotesIdPatchRequest(
+ $id,
+ $noteData,
+ string $contentType = self::contentTypes['crmNotesIdPatch'][0]
+ ): Request
{
+
// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $id when calling crmNotesIdPatch'
);
}
- // verify the required parameter 'body' is set
- if ($body === null || (is_array($body) && count($body) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $body when calling crmNotesIdPatch'
+
+ // verify the required parameter 'noteData' is set
+ if ($noteData === null || (is_array($noteData) && count($noteData) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $noteData when calling crmNotesIdPatch'
);
}
+
$resourcePath = '/crm/notes/{id}';
$formParams = [];
$queryParams = [];
@@ -1158,6 +1492,7 @@ protected function crmNotesIdPatchRequest($id, $body)
$multipart = false;
+
// path params
if ($id !== null) {
$resourcePath = str_replace(
@@ -1167,56 +1502,42 @@ protected function crmNotesIdPatchRequest($id, $body)
);
}
- // body params
- $_tempBody = null;
- if (isset($body)) {
- $_tempBody = $body;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($noteData)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($noteData));
+ } else {
+ $httpBody = $noteData;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1242,10 +1563,11 @@ protected function crmNotesIdPatchRequest($id, $body)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'PATCH',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1256,15 +1578,19 @@ protected function crmNotesIdPatchRequest($id, $body)
*
* Create a note
*
- * @param \Brevo\Client\Model\NoteData $body Note data to create a note. (required)
+ * @param \Brevo\Client\Models\NoteData $noteData Note data to create a note. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmNotesPost'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\NoteId
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\NoteId|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function crmNotesPost($body)
+ public function crmNotesPost(
+ \Brevo\Client\Models\NoteData $noteData,
+ string $contentType = self::contentTypes['crmNotesPost'][0]
+ ): \Brevo\Client\Models\NoteId
{
- list($response) = $this->crmNotesPostWithHttpInfo($body);
+ list($response) = $this->crmNotesPostWithHttpInfo($noteData, $contentType);
return $response;
}
@@ -1273,16 +1599,19 @@ public function crmNotesPost($body)
*
* Create a note
*
- * @param \Brevo\Client\Model\NoteData $body Note data to create a note. (required)
+ * @param \Brevo\Client\Models\NoteData $noteData Note data to create a note. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmNotesPost'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\NoteId, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\NoteId|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function crmNotesPostWithHttpInfo($body)
+ public function crmNotesPostWithHttpInfo(
+ \Brevo\Client\Models\NoteData $noteData,
+ string $contentType = self::contentTypes['crmNotesPost'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\NoteId';
- $request = $this->crmNotesPostRequest($body);
+ $request = $this->crmNotesPostRequest($noteData, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1291,34 +1620,138 @@ public function crmNotesPostWithHttpInfo($body)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\NoteId', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\NoteId' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\NoteId', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 415:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\NoteId';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1333,7 +1766,7 @@ public function crmNotesPostWithHttpInfo($body)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\NoteId',
+ '\Brevo\Client\Models\NoteId',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1341,7 +1774,7 @@ public function crmNotesPostWithHttpInfo($body)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1349,7 +1782,7 @@ public function crmNotesPostWithHttpInfo($body)
case 415:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1364,14 +1797,18 @@ public function crmNotesPostWithHttpInfo($body)
*
* Create a note
*
- * @param \Brevo\Client\Model\NoteData $body Note data to create a note. (required)
+ * @param \Brevo\Client\Models\NoteData $noteData Note data to create a note. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmNotesPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmNotesPostAsync($body)
+ public function crmNotesPostAsync(
+ \Brevo\Client\Models\NoteData $noteData,
+ string $contentType = self::contentTypes['crmNotesPost'][0]
+ ): PromiseInterface
{
- return $this->crmNotesPostAsyncWithHttpInfo($body)
+ return $this->crmNotesPostAsyncWithHttpInfo($noteData, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1384,25 +1821,29 @@ function ($response) {
*
* Create a note
*
- * @param \Brevo\Client\Model\NoteData $body Note data to create a note. (required)
+ * @param \Brevo\Client\Models\NoteData $noteData Note data to create a note. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmNotesPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmNotesPostAsyncWithHttpInfo($body)
+ public function crmNotesPostAsyncWithHttpInfo(
+ $noteData,
+ string $contentType = self::contentTypes['crmNotesPost'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\NoteId';
- $request = $this->crmNotesPostRequest($body);
+ $returnType = '\Brevo\Client\Models\NoteId';
+ $request = $this->crmNotesPostRequest($noteData, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1425,7 +1866,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1434,20 +1875,26 @@ function ($exception) {
/**
* Create request for operation 'crmNotesPost'
*
- * @param \Brevo\Client\Model\NoteData $body Note data to create a note. (required)
+ * @param \Brevo\Client\Models\NoteData $noteData Note data to create a note. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmNotesPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function crmNotesPostRequest($body)
+ public function crmNotesPostRequest(
+ $noteData,
+ string $contentType = self::contentTypes['crmNotesPost'][0]
+ ): Request
{
- // verify the required parameter 'body' is set
- if ($body === null || (is_array($body) && count($body) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $body when calling crmNotesPost'
+
+ // verify the required parameter 'noteData' is set
+ if ($noteData === null || (is_array($noteData) && count($noteData) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $noteData when calling crmNotesPost'
);
}
+
$resourcePath = '/crm/notes';
$formParams = [];
$queryParams = [];
@@ -1457,56 +1904,43 @@ protected function crmNotesPostRequest($body)
- // body params
- $_tempBody = null;
- if (isset($body)) {
- $_tempBody = $body;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($noteData)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($noteData));
+ } else {
+ $httpBody = $noteData;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1532,10 +1966,11 @@ protected function crmNotesPostRequest($body)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1547,7 +1982,7 @@ protected function crmNotesPostRequest($body)
* @throws \RuntimeException on file opening failure
* @return array of http client options
*/
- protected function createHttpClientOption()
+ protected function createHttpClientOption(): array
{
$options = [];
if ($this->config->getDebug()) {
diff --git a/lib/Api/PaymentsApi.php b/lib/Api/PaymentsApi.php
new file mode 100644
index 0000000..ac79434
--- /dev/null
+++ b/lib/Api/PaymentsApi.php
@@ -0,0 +1,1329 @@
+ [
+ 'application/json',
+ ],
+ 'deletePaymentRequest' => [
+ 'application/json',
+ ],
+ 'getPaymentRequest' => [
+ 'application/json',
+ ],
+ ];
+
+ /**
+ * @param ClientInterface|null $client
+ * @param Configuration|null $config
+ * @param HeaderSelector|null $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(int $hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex(): int
+ {
+ return $this->hostIndex;
+ }
+
+ /**
+ * @return Configuration
+ */
+ public function getConfig(): Configuration
+ {
+ return $this->config;
+ }
+
+ /**
+ * Operation createPaymentRequest
+ *
+ * Create a payment request
+ *
+ * @param \Brevo\Client\Models\CreatePaymentRequest $createPaymentRequest Create a payment request (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPaymentRequest'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CreatePaymentResponse|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
+ */
+ public function createPaymentRequest(
+ \Brevo\Client\Models\CreatePaymentRequest $createPaymentRequest,
+ string $contentType = self::contentTypes['createPaymentRequest'][0]
+ ): \Brevo\Client\Models\CreatePaymentResponse
+ {
+ list($response) = $this->createPaymentRequestWithHttpInfo($createPaymentRequest, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation createPaymentRequestWithHttpInfo
+ *
+ * Create a payment request
+ *
+ * @param \Brevo\Client\Models\CreatePaymentRequest $createPaymentRequest Create a payment request (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPaymentRequest'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CreatePaymentResponse|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function createPaymentRequestWithHttpInfo(
+ \Brevo\Client\Models\CreatePaymentRequest $createPaymentRequest,
+ string $contentType = self::contentTypes['createPaymentRequest'][0]
+ ): array
+ {
+ $request = $this->createPaymentRequestRequest($createPaymentRequest, $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 201:
+ if (in_array('\Brevo\Client\Models\CreatePaymentResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CreatePaymentResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CreatePaymentResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $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 = '\Brevo\Client\Models\CreatePaymentResponse';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 201:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\CreatePaymentResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation createPaymentRequestAsync
+ *
+ * Create a payment request
+ *
+ * @param \Brevo\Client\Models\CreatePaymentRequest $createPaymentRequest Create a payment request (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPaymentRequest'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function createPaymentRequestAsync(
+ \Brevo\Client\Models\CreatePaymentRequest $createPaymentRequest,
+ string $contentType = self::contentTypes['createPaymentRequest'][0]
+ ): PromiseInterface
+ {
+ return $this->createPaymentRequestAsyncWithHttpInfo($createPaymentRequest, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation createPaymentRequestAsyncWithHttpInfo
+ *
+ * Create a payment request
+ *
+ * @param \Brevo\Client\Models\CreatePaymentRequest $createPaymentRequest Create a payment request (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPaymentRequest'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function createPaymentRequestAsyncWithHttpInfo(
+ $createPaymentRequest,
+ string $contentType = self::contentTypes['createPaymentRequest'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\CreatePaymentResponse';
+ $request = $this->createPaymentRequestRequest($createPaymentRequest, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'createPaymentRequest'
+ *
+ * @param \Brevo\Client\Models\CreatePaymentRequest $createPaymentRequest Create a payment request (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPaymentRequest'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function createPaymentRequestRequest(
+ $createPaymentRequest,
+ string $contentType = self::contentTypes['createPaymentRequest'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'createPaymentRequest' is set
+ if ($createPaymentRequest === null || (is_array($createPaymentRequest) && count($createPaymentRequest) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $createPaymentRequest when calling createPaymentRequest'
+ );
+ }
+
+
+ $resourcePath = '/payments/requests';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($createPaymentRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createPaymentRequest));
+ } else {
+ $httpBody = $createPaymentRequest;
+ }
+ } 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 deletePaymentRequest
+ *
+ * Delete a payment request.
+ *
+ * @param string $id ID of the payment request. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePaymentRequest'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return void
+ */
+ public function deletePaymentRequest(
+ string $id,
+ string $contentType = self::contentTypes['deletePaymentRequest'][0]
+ ): void
+ {
+ $this->deletePaymentRequestWithHttpInfo($id, $contentType);
+ }
+
+ /**
+ * Operation deletePaymentRequestWithHttpInfo
+ *
+ * Delete a payment request.
+ *
+ * @param string $id ID of the payment request. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePaymentRequest'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function deletePaymentRequestWithHttpInfo(
+ string $id,
+ string $contentType = self::contentTypes['deletePaymentRequest'][0]
+ ): array
+ {
+ $request = $this->deletePaymentRequestRequest($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();
+
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation deletePaymentRequestAsync
+ *
+ * Delete a payment request.
+ *
+ * @param string $id ID of the payment request. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePaymentRequest'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function deletePaymentRequestAsync(
+ string $id,
+ string $contentType = self::contentTypes['deletePaymentRequest'][0]
+ ): PromiseInterface
+ {
+ return $this->deletePaymentRequestAsyncWithHttpInfo($id, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation deletePaymentRequestAsyncWithHttpInfo
+ *
+ * Delete a payment request.
+ *
+ * @param string $id ID of the payment request. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePaymentRequest'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function deletePaymentRequestAsyncWithHttpInfo(
+ $id,
+ string $contentType = self::contentTypes['deletePaymentRequest'][0]
+ ): PromiseInterface
+ {
+ $returnType = '';
+ $request = $this->deletePaymentRequestRequest($id, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $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 'deletePaymentRequest'
+ *
+ * @param string $id ID of the payment request. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePaymentRequest'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function deletePaymentRequestRequest(
+ $id,
+ string $contentType = self::contentTypes['deletePaymentRequest'][0]
+ ): Request
+ {
+
+ // 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 deletePaymentRequest'
+ );
+ }
+
+
+ $resourcePath = '/payments/requests/{id}';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'id' . '}',
+ ObjectSerializer::toPathValue($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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 getPaymentRequest
+ *
+ * Get payment request details
+ *
+ * @param string $id Id of the payment Request (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPaymentRequest'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetPaymentRequest|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
+ */
+ public function getPaymentRequest(
+ string $id,
+ string $contentType = self::contentTypes['getPaymentRequest'][0]
+ ): \Brevo\Client\Models\GetPaymentRequest
+ {
+ list($response) = $this->getPaymentRequestWithHttpInfo($id, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation getPaymentRequestWithHttpInfo
+ *
+ * Get payment request details
+ *
+ * @param string $id Id of the payment Request (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPaymentRequest'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetPaymentRequest|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function getPaymentRequestWithHttpInfo(
+ string $id,
+ string $contentType = self::contentTypes['getPaymentRequest'][0]
+ ): array
+ {
+ $request = $this->getPaymentRequestRequest($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 (in_array('\Brevo\Client\Models\GetPaymentRequest', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetPaymentRequest' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetPaymentRequest', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $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 = '\Brevo\Client\Models\GetPaymentRequest';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\GetPaymentRequest',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation getPaymentRequestAsync
+ *
+ * Get payment request details
+ *
+ * @param string $id Id of the payment Request (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPaymentRequest'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getPaymentRequestAsync(
+ string $id,
+ string $contentType = self::contentTypes['getPaymentRequest'][0]
+ ): PromiseInterface
+ {
+ return $this->getPaymentRequestAsyncWithHttpInfo($id, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation getPaymentRequestAsyncWithHttpInfo
+ *
+ * Get payment request details
+ *
+ * @param string $id Id of the payment Request (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPaymentRequest'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getPaymentRequestAsyncWithHttpInfo(
+ $id,
+ string $contentType = self::contentTypes['getPaymentRequest'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\GetPaymentRequest';
+ $request = $this->getPaymentRequestRequest($id, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'getPaymentRequest'
+ *
+ * @param string $id Id of the payment Request (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPaymentRequest'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function getPaymentRequestRequest(
+ $id,
+ string $contentType = self::contentTypes['getPaymentRequest'][0]
+ ): Request
+ {
+
+ // 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 getPaymentRequest'
+ );
+ }
+
+
+ $resourcePath = '/payments/requests/{id}';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'id' . '}',
+ ObjectSerializer::toPathValue($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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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
+ );
+ }
+
+ /**
+ * Create http client option
+ *
+ * @throws \RuntimeException on file opening failure
+ * @return array of http client options
+ */
+ protected function createHttpClientOption(): array
+ {
+ $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/ProcessApi.php b/lib/Api/ProcessApi.php
index 7e38628..6be2a2b 100644
--- a/lib/Api/ProcessApi.php
+++ b/lib/Api/ProcessApi.php
@@ -1,39 +1,41 @@
[
+ 'application/json',
+ ],
+ 'getProcesses' => [
+ 'application/json',
+ ],
+ ];
+
+ /**
+ * @param ClientInterface|null $client
+ * @param Configuration|null $config
+ * @param HeaderSelector|null $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
+ HeaderSelector $selector = null,
+ int $hostIndex = 0
) {
$this->client = $client ?: new Client();
- $this->config = $config ?: new Configuration();
+ $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(int $hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex(): int
+ {
+ return $this->hostIndex;
}
/**
* @return Configuration
*/
- public function getConfig()
+ public function getConfig(): Configuration
{
return $this->config;
}
@@ -93,14 +132,18 @@ public function getConfig()
* Return the informations for a process
*
* @param int $processId Id of the process (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProcess'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetProcess
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetProcess|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function getProcess($processId)
+ public function getProcess(
+ int $processId,
+ string $contentType = self::contentTypes['getProcess'][0]
+ ): \Brevo\Client\Models\GetProcess
{
- list($response) = $this->getProcessWithHttpInfo($processId);
+ list($response) = $this->getProcessWithHttpInfo($processId, $contentType);
return $response;
}
@@ -110,15 +153,18 @@ public function getProcess($processId)
* Return the informations for a process
*
* @param int $processId Id of the process (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProcess'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetProcess, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetProcess|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getProcessWithHttpInfo($processId)
+ public function getProcessWithHttpInfo(
+ int $processId,
+ string $contentType = self::contentTypes['getProcess'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetProcess';
- $request = $this->getProcessRequest($processId);
+ $request = $this->getProcessRequest($processId, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -127,34 +173,138 @@ public function getProcessWithHttpInfo($processId)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetProcess', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetProcess' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetProcess', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetProcess';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -169,23 +319,23 @@ public function getProcessWithHttpInfo($processId)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetProcess',
+ '\Brevo\Client\Models\GetProcess',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 404:
+ case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 400:
+ case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -201,13 +351,17 @@ public function getProcessWithHttpInfo($processId)
* Return the informations for a process
*
* @param int $processId Id of the process (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProcess'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getProcessAsync($processId)
+ public function getProcessAsync(
+ int $processId,
+ string $contentType = self::contentTypes['getProcess'][0]
+ ): PromiseInterface
{
- return $this->getProcessAsyncWithHttpInfo($processId)
+ return $this->getProcessAsyncWithHttpInfo($processId, $contentType)
->then(
function ($response) {
return $response[0];
@@ -221,24 +375,28 @@ function ($response) {
* Return the informations for a process
*
* @param int $processId Id of the process (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProcess'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getProcessAsyncWithHttpInfo($processId)
+ public function getProcessAsyncWithHttpInfo(
+ $processId,
+ string $contentType = self::contentTypes['getProcess'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetProcess';
- $request = $this->getProcessRequest($processId);
+ $returnType = '\Brevo\Client\Models\GetProcess';
+ $request = $this->getProcessRequest($processId, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -261,7 +419,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -271,19 +429,25 @@ function ($exception) {
* Create request for operation 'getProcess'
*
* @param int $processId Id of the process (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProcess'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getProcessRequest($processId)
+ public function getProcessRequest(
+ $processId,
+ string $contentType = self::contentTypes['getProcess'][0]
+ ): Request
{
+
// verify the required parameter 'processId' is set
if ($processId === null || (is_array($processId) && count($processId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $processId when calling getProcess'
);
}
+
$resourcePath = '/processes/{processId}';
$formParams = [];
$queryParams = [];
@@ -292,6 +456,7 @@ protected function getProcessRequest($processId)
$multipart = false;
+
// path params
if ($processId !== null) {
$resourcePath = str_replace(
@@ -301,53 +466,35 @@ protected function getProcessRequest($processId)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -373,10 +520,11 @@ protected function getProcessRequest($processId)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -387,17 +535,23 @@ protected function getProcessRequest($processId)
*
* Return all the processes for your account
*
- * @param int $limit Number limitation for the result returned (optional, default to 10)
- * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number limitation for the result returned (optional, default to 10)
+ * @param int|null $offset Beginning point in the list to retrieve from. (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProcesses'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetProcesses
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetProcesses|\Brevo\Client\Models\ErrorModel
*/
- public function getProcesses($limit = '10', $offset = '0', $sort = 'desc')
+ public function getProcesses(
+ ?int $limit = 10,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getProcesses'][0]
+ ): \Brevo\Client\Models\GetProcesses
{
- list($response) = $this->getProcessesWithHttpInfo($limit, $offset, $sort);
+ list($response) = $this->getProcessesWithHttpInfo($limit, $offset, $sort, $contentType);
return $response;
}
@@ -406,18 +560,23 @@ public function getProcesses($limit = '10', $offset = '0', $sort = 'desc')
*
* Return all the processes for your account
*
- * @param int $limit Number limitation for the result returned (optional, default to 10)
- * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number limitation for the result returned (optional, default to 10)
+ * @param int|null $offset Beginning point in the list to retrieve from. (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProcesses'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetProcesses, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetProcesses|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getProcessesWithHttpInfo($limit = '10', $offset = '0', $sort = 'desc')
+ public function getProcessesWithHttpInfo(
+ ?int $limit = 10,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getProcesses'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetProcesses';
- $request = $this->getProcessesRequest($limit, $offset, $sort);
+ $request = $this->getProcessesRequest($limit, $offset, $sort, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -426,34 +585,111 @@ public function getProcessesWithHttpInfo($limit = '10', $offset = '0', $sort = '
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetProcesses', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetProcesses' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetProcesses', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetProcesses';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -468,7 +704,7 @@ public function getProcessesWithHttpInfo($limit = '10', $offset = '0', $sort = '
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetProcesses',
+ '\Brevo\Client\Models\GetProcesses',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -476,7 +712,7 @@ public function getProcessesWithHttpInfo($limit = '10', $offset = '0', $sort = '
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -491,16 +727,22 @@ public function getProcessesWithHttpInfo($limit = '10', $offset = '0', $sort = '
*
* Return all the processes for your account
*
- * @param int $limit Number limitation for the result returned (optional, default to 10)
- * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number limitation for the result returned (optional, default to 10)
+ * @param int|null $offset Beginning point in the list to retrieve from. (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProcesses'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getProcessesAsync($limit = '10', $offset = '0', $sort = 'desc')
+ public function getProcessesAsync(
+ ?int $limit = 10,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getProcesses'][0]
+ ): PromiseInterface
{
- return $this->getProcessesAsyncWithHttpInfo($limit, $offset, $sort)
+ return $this->getProcessesAsyncWithHttpInfo($limit, $offset, $sort, $contentType)
->then(
function ($response) {
return $response[0];
@@ -513,27 +755,33 @@ function ($response) {
*
* Return all the processes for your account
*
- * @param int $limit Number limitation for the result returned (optional, default to 10)
- * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number limitation for the result returned (optional, default to 10)
+ * @param int|null $offset Beginning point in the list to retrieve from. (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProcesses'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getProcessesAsyncWithHttpInfo($limit = '10', $offset = '0', $sort = 'desc')
+ public function getProcessesAsyncWithHttpInfo(
+ $limit = 10,
+ $offset = 0,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getProcesses'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetProcesses';
- $request = $this->getProcessesRequest($limit, $offset, $sort);
+ $returnType = '\Brevo\Client\Models\GetProcesses';
+ $request = $this->getProcessesRequest($limit, $offset, $sort, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -556,7 +804,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -565,21 +813,30 @@ function ($exception) {
/**
* Create request for operation 'getProcesses'
*
- * @param int $limit Number limitation for the result returned (optional, default to 10)
- * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number limitation for the result returned (optional, default to 10)
+ * @param int|null $offset Beginning point in the list to retrieve from. (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProcesses'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getProcessesRequest($limit = '10', $offset = '0', $sort = 'desc')
+ public function getProcessesRequest(
+ $limit = 10,
+ $offset = 0,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getProcesses'][0]
+ ): Request
{
+
if ($limit !== null && $limit > 50) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling ProcessApi.getProcesses, must be smaller than or equal to 50.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling ProcessApi.getProcesses, must be smaller than or equal to 50.');
}
if ($limit !== null && $limit < 0) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling ProcessApi.getProcesses, must be bigger than or equal to 0.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling ProcessApi.getProcesses, must be bigger than or equal to 0.');
}
+
+
$resourcePath = '/processes';
@@ -590,66 +847,64 @@ protected function getProcessesRequest($limit = '10', $offset = '0', $sort = 'de
$multipart = false;
// query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -675,10 +930,11 @@ protected function getProcessesRequest($limit = '10', $offset = '0', $sort = 'de
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -690,7 +946,7 @@ protected function getProcessesRequest($limit = '10', $offset = '0', $sort = 'de
* @throws \RuntimeException on file opening failure
* @return array of http client options
*/
- protected function createHttpClientOption()
+ protected function createHttpClientOption(): array
{
$options = [];
if ($this->config->getDebug()) {
diff --git a/lib/Api/ProgramApi.php b/lib/Api/ProgramApi.php
new file mode 100644
index 0000000..d6c1884
--- /dev/null
+++ b/lib/Api/ProgramApi.php
@@ -0,0 +1,5684 @@
+ [
+ 'application/json',
+ ],
+ 'deleteContactMembers' => [
+ 'application/json',
+ ],
+ 'deleteLoyaltyProgram' => [
+ 'application/json',
+ ],
+ 'deleteSubscriptionMember' => [
+ 'application/json',
+ ],
+ 'getLPList' => [
+ 'application/json',
+ ],
+ 'getLoyaltyProgramInfo' => [
+ 'application/json',
+ ],
+ 'getParameterSubscriptionInfo' => [
+ 'application/json',
+ ],
+ 'getSubscriptionMember' => [
+ 'application/json',
+ ],
+ 'partiallyUpdateLoyaltyProgram' => [
+ 'application/json',
+ ],
+ 'publishLoyaltyProgram' => [
+ 'application/json',
+ ],
+ 'subscribeMemberToASubscription' => [
+ 'application/json',
+ ],
+ 'subscribeToLoyaltyProgram' => [
+ 'application/json',
+ ],
+ 'updateLoyaltyProgram' => [
+ 'application/json',
+ ],
+ ];
+
+ /**
+ * @param ClientInterface|null $client
+ * @param Configuration|null $config
+ * @param HeaderSelector|null $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(int $hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex(): int
+ {
+ return $this->hostIndex;
+ }
+
+ /**
+ * @return Configuration
+ */
+ public function getConfig(): Configuration
+ {
+ return $this->config;
+ }
+
+ /**
+ * Operation createNewLP
+ *
+ * Create loyalty program
+ *
+ * @param \Brevo\Client\Models\CreateLoyaltyProgramPayload|null $createLoyaltyProgramPayload Loyalty Program information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNewLP'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\LoyaltyProgram|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload
+ */
+ public function createNewLP(
+ ?\Brevo\Client\Models\CreateLoyaltyProgramPayload $createLoyaltyProgramPayload = null,
+ string $contentType = self::contentTypes['createNewLP'][0]
+ ): \Brevo\Client\Models\LoyaltyProgram
+ {
+ list($response) = $this->createNewLPWithHttpInfo($createLoyaltyProgramPayload, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation createNewLPWithHttpInfo
+ *
+ * Create loyalty program
+ *
+ * @param \Brevo\Client\Models\CreateLoyaltyProgramPayload|null $createLoyaltyProgramPayload Loyalty Program information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNewLP'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\LoyaltyProgram|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function createNewLPWithHttpInfo(
+ ?\Brevo\Client\Models\CreateLoyaltyProgramPayload $createLoyaltyProgramPayload = null,
+ string $contentType = self::contentTypes['createNewLP'][0]
+ ): array
+ {
+ $request = $this->createNewLPRequest($createLoyaltyProgramPayload, $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 201:
+ if (in_array('\Brevo\Client\Models\LoyaltyProgram', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\LoyaltyProgram' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\LoyaltyProgram', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $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 = '\Brevo\Client\Models\LoyaltyProgram';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 201:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\LoyaltyProgram',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation createNewLPAsync
+ *
+ * Create loyalty program
+ *
+ * @param \Brevo\Client\Models\CreateLoyaltyProgramPayload|null $createLoyaltyProgramPayload Loyalty Program information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNewLP'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function createNewLPAsync(
+ ?\Brevo\Client\Models\CreateLoyaltyProgramPayload $createLoyaltyProgramPayload = null,
+ string $contentType = self::contentTypes['createNewLP'][0]
+ ): PromiseInterface
+ {
+ return $this->createNewLPAsyncWithHttpInfo($createLoyaltyProgramPayload, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation createNewLPAsyncWithHttpInfo
+ *
+ * Create loyalty program
+ *
+ * @param \Brevo\Client\Models\CreateLoyaltyProgramPayload|null $createLoyaltyProgramPayload Loyalty Program information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNewLP'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function createNewLPAsyncWithHttpInfo(
+ $createLoyaltyProgramPayload = null,
+ string $contentType = self::contentTypes['createNewLP'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\LoyaltyProgram';
+ $request = $this->createNewLPRequest($createLoyaltyProgramPayload, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'createNewLP'
+ *
+ * @param \Brevo\Client\Models\CreateLoyaltyProgramPayload|null $createLoyaltyProgramPayload Loyalty Program information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNewLP'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function createNewLPRequest(
+ $createLoyaltyProgramPayload = null,
+ string $contentType = self::contentTypes['createNewLP'][0]
+ ): Request
+ {
+
+
+
+ $resourcePath = '/loyalty/config/programs';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($createLoyaltyProgramPayload)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createLoyaltyProgramPayload));
+ } else {
+ $httpBody = $createLoyaltyProgramPayload;
+ }
+ } 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 deleteContactMembers
+ *
+ * Delete subscription member
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param int $contactId Contact Id (required)
+ * @param int $memberContactIds Member Contact Ids, comma-seperated (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteContactMembers'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return void
+ */
+ public function deleteContactMembers(
+ string $loyaltyProgramId,
+ int $contactId,
+ int $memberContactIds,
+ string $contentType = self::contentTypes['deleteContactMembers'][0]
+ ): void
+ {
+ $this->deleteContactMembersWithHttpInfo($loyaltyProgramId, $contactId, $memberContactIds, $contentType);
+ }
+
+ /**
+ * Operation deleteContactMembersWithHttpInfo
+ *
+ * Delete subscription member
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param int $contactId Contact Id (required)
+ * @param int $memberContactIds Member Contact Ids, comma-seperated (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteContactMembers'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function deleteContactMembersWithHttpInfo(
+ string $loyaltyProgramId,
+ int $contactId,
+ int $memberContactIds,
+ string $contentType = self::contentTypes['deleteContactMembers'][0]
+ ): array
+ {
+ $request = $this->deleteContactMembersRequest($loyaltyProgramId, $contactId, $memberContactIds, $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();
+
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ContactIdInvalidResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ContactIdInvalidResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ContactIdInvalidResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation deleteContactMembersAsync
+ *
+ * Delete subscription member
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param int $contactId Contact Id (required)
+ * @param int $memberContactIds Member Contact Ids, comma-seperated (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteContactMembers'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function deleteContactMembersAsync(
+ string $loyaltyProgramId,
+ int $contactId,
+ int $memberContactIds,
+ string $contentType = self::contentTypes['deleteContactMembers'][0]
+ ): PromiseInterface
+ {
+ return $this->deleteContactMembersAsyncWithHttpInfo($loyaltyProgramId, $contactId, $memberContactIds, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation deleteContactMembersAsyncWithHttpInfo
+ *
+ * Delete subscription member
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param int $contactId Contact Id (required)
+ * @param int $memberContactIds Member Contact Ids, comma-seperated (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteContactMembers'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function deleteContactMembersAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $contactId,
+ $memberContactIds,
+ string $contentType = self::contentTypes['deleteContactMembers'][0]
+ ): PromiseInterface
+ {
+ $returnType = '';
+ $request = $this->deleteContactMembersRequest($loyaltyProgramId, $contactId, $memberContactIds, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $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 'deleteContactMembers'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param int $contactId Contact Id (required)
+ * @param int $memberContactIds Member Contact Ids, comma-seperated (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteContactMembers'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function deleteContactMembersRequest(
+ $loyaltyProgramId,
+ $contactId,
+ $memberContactIds,
+ string $contentType = self::contentTypes['deleteContactMembers'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling deleteContactMembers'
+ );
+ }
+
+ // verify the required parameter 'contactId' is set
+ if ($contactId === null || (is_array($contactId) && count($contactId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $contactId when calling deleteContactMembers'
+ );
+ }
+
+ // verify the required parameter 'memberContactIds' is set
+ if ($memberContactIds === null || (is_array($memberContactIds) && count($memberContactIds) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $memberContactIds when calling deleteContactMembers'
+ );
+ }
+
+
+ $resourcePath = '/loyalty/config/programs/{loyaltyProgramId}/subscriptions-members';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $contactId,
+ 'contactId', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ true // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $memberContactIds,
+ 'memberContactIds', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ true // required
+ ) ?? []);
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 deleteLoyaltyProgram
+ *
+ * Delete Loyalty Program
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteLoyaltyProgram'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return void
+ */
+ public function deleteLoyaltyProgram(
+ string $loyaltyProgramId,
+ string $contentType = self::contentTypes['deleteLoyaltyProgram'][0]
+ ): void
+ {
+ $this->deleteLoyaltyProgramWithHttpInfo($loyaltyProgramId, $contentType);
+ }
+
+ /**
+ * Operation deleteLoyaltyProgramWithHttpInfo
+ *
+ * Delete Loyalty Program
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteLoyaltyProgram'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function deleteLoyaltyProgramWithHttpInfo(
+ string $loyaltyProgramId,
+ string $contentType = self::contentTypes['deleteLoyaltyProgram'][0]
+ ): array
+ {
+ $request = $this->deleteLoyaltyProgramRequest($loyaltyProgramId, $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();
+
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation deleteLoyaltyProgramAsync
+ *
+ * Delete Loyalty Program
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteLoyaltyProgram'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function deleteLoyaltyProgramAsync(
+ string $loyaltyProgramId,
+ string $contentType = self::contentTypes['deleteLoyaltyProgram'][0]
+ ): PromiseInterface
+ {
+ return $this->deleteLoyaltyProgramAsyncWithHttpInfo($loyaltyProgramId, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation deleteLoyaltyProgramAsyncWithHttpInfo
+ *
+ * Delete Loyalty Program
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteLoyaltyProgram'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function deleteLoyaltyProgramAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ string $contentType = self::contentTypes['deleteLoyaltyProgram'][0]
+ ): PromiseInterface
+ {
+ $returnType = '';
+ $request = $this->deleteLoyaltyProgramRequest($loyaltyProgramId, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $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 'deleteLoyaltyProgram'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteLoyaltyProgram'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function deleteLoyaltyProgramRequest(
+ $loyaltyProgramId,
+ string $contentType = self::contentTypes['deleteLoyaltyProgram'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling deleteLoyaltyProgram'
+ );
+ }
+
+
+ $resourcePath = '/loyalty/config/programs/{loyaltyProgramId}';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 deleteSubscriptionMember
+ *
+ * Delete subscription
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contactId Contact Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSubscriptionMember'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return void
+ */
+ public function deleteSubscriptionMember(
+ string $loyaltyProgramId,
+ string $contactId,
+ string $contentType = self::contentTypes['deleteSubscriptionMember'][0]
+ ): void
+ {
+ $this->deleteSubscriptionMemberWithHttpInfo($loyaltyProgramId, $contactId, $contentType);
+ }
+
+ /**
+ * Operation deleteSubscriptionMemberWithHttpInfo
+ *
+ * Delete subscription
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contactId Contact Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSubscriptionMember'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function deleteSubscriptionMemberWithHttpInfo(
+ string $loyaltyProgramId,
+ string $contactId,
+ string $contentType = self::contentTypes['deleteSubscriptionMember'][0]
+ ): array
+ {
+ $request = $this->deleteSubscriptionMemberRequest($loyaltyProgramId, $contactId, $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();
+
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ContactIdInvalidResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ContactIdInvalidResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ContactIdInvalidResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation deleteSubscriptionMemberAsync
+ *
+ * Delete subscription
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contactId Contact Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSubscriptionMember'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function deleteSubscriptionMemberAsync(
+ string $loyaltyProgramId,
+ string $contactId,
+ string $contentType = self::contentTypes['deleteSubscriptionMember'][0]
+ ): PromiseInterface
+ {
+ return $this->deleteSubscriptionMemberAsyncWithHttpInfo($loyaltyProgramId, $contactId, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation deleteSubscriptionMemberAsyncWithHttpInfo
+ *
+ * Delete subscription
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contactId Contact Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSubscriptionMember'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function deleteSubscriptionMemberAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $contactId,
+ string $contentType = self::contentTypes['deleteSubscriptionMember'][0]
+ ): PromiseInterface
+ {
+ $returnType = '';
+ $request = $this->deleteSubscriptionMemberRequest($loyaltyProgramId, $contactId, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $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 'deleteSubscriptionMember'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contactId Contact Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSubscriptionMember'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function deleteSubscriptionMemberRequest(
+ $loyaltyProgramId,
+ $contactId,
+ string $contentType = self::contentTypes['deleteSubscriptionMember'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling deleteSubscriptionMember'
+ );
+ }
+
+ // verify the required parameter 'contactId' is set
+ if ($contactId === null || (is_array($contactId) && count($contactId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $contactId when calling deleteSubscriptionMember'
+ );
+ }
+
+
+ $resourcePath = '/loyalty/config/programs/{loyaltyProgramId}/contact/{contactId}';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($contactId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'contactId' . '}',
+ ObjectSerializer::toPathValue($contactId),
+ $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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 getLPList
+ *
+ * Get loyalty program list
+ *
+ * @param int|null $limit Number of documents per page (optional, default to 200)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sortField Sort documents by field (optional, default to 'updatedAt')
+ * @param string|null $sort Sort the documents in the ascending or descending order (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLPList'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\LoyaltyProgramPage|\Brevo\Client\Models\BadRequestPayload
+ */
+ public function getLPList(
+ ?int $limit = 200,
+ ?int $offset = 0,
+ ?string $sortField = 'updatedAt',
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getLPList'][0]
+ ): \Brevo\Client\Models\LoyaltyProgramPage
+ {
+ list($response) = $this->getLPListWithHttpInfo($limit, $offset, $sortField, $sort, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation getLPListWithHttpInfo
+ *
+ * Get loyalty program list
+ *
+ * @param int|null $limit Number of documents per page (optional, default to 200)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sortField Sort documents by field (optional, default to 'updatedAt')
+ * @param string|null $sort Sort the documents in the ascending or descending order (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLPList'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\LoyaltyProgramPage|\Brevo\Client\Models\BadRequestPayload, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function getLPListWithHttpInfo(
+ ?int $limit = 200,
+ ?int $offset = 0,
+ ?string $sortField = 'updatedAt',
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getLPList'][0]
+ ): array
+ {
+ $request = $this->getLPListRequest($limit, $offset, $sortField, $sort, $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 (in_array('\Brevo\Client\Models\LoyaltyProgramPage', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\LoyaltyProgramPage' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\LoyaltyProgramPage', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $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 = '\Brevo\Client\Models\LoyaltyProgramPage';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\LoyaltyProgramPage',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation getLPListAsync
+ *
+ * Get loyalty program list
+ *
+ * @param int|null $limit Number of documents per page (optional, default to 200)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sortField Sort documents by field (optional, default to 'updatedAt')
+ * @param string|null $sort Sort the documents in the ascending or descending order (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLPList'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getLPListAsync(
+ ?int $limit = 200,
+ ?int $offset = 0,
+ ?string $sortField = 'updatedAt',
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getLPList'][0]
+ ): PromiseInterface
+ {
+ return $this->getLPListAsyncWithHttpInfo($limit, $offset, $sortField, $sort, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation getLPListAsyncWithHttpInfo
+ *
+ * Get loyalty program list
+ *
+ * @param int|null $limit Number of documents per page (optional, default to 200)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sortField Sort documents by field (optional, default to 'updatedAt')
+ * @param string|null $sort Sort the documents in the ascending or descending order (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLPList'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getLPListAsyncWithHttpInfo(
+ $limit = 200,
+ $offset = 0,
+ $sortField = 'updatedAt',
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getLPList'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\LoyaltyProgramPage';
+ $request = $this->getLPListRequest($limit, $offset, $sortField, $sort, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'getLPList'
+ *
+ * @param int|null $limit Number of documents per page (optional, default to 200)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sortField Sort documents by field (optional, default to 'updatedAt')
+ * @param string|null $sort Sort the documents in the ascending or descending order (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLPList'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function getLPListRequest(
+ $limit = 200,
+ $offset = 0,
+ $sortField = 'updatedAt',
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getLPList'][0]
+ ): Request
+ {
+
+
+
+
+
+
+ $resourcePath = '/loyalty/config/programs';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // 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(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sortField,
+ 'sortField', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 getLoyaltyProgramInfo
+ *
+ * Get loyalty program Info
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLoyaltyProgramInfo'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\LoyaltyProgram|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload
+ */
+ public function getLoyaltyProgramInfo(
+ string $loyaltyProgramId,
+ string $contentType = self::contentTypes['getLoyaltyProgramInfo'][0]
+ ): \Brevo\Client\Models\LoyaltyProgram
+ {
+ list($response) = $this->getLoyaltyProgramInfoWithHttpInfo($loyaltyProgramId, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation getLoyaltyProgramInfoWithHttpInfo
+ *
+ * Get loyalty program Info
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLoyaltyProgramInfo'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\LoyaltyProgram|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function getLoyaltyProgramInfoWithHttpInfo(
+ string $loyaltyProgramId,
+ string $contentType = self::contentTypes['getLoyaltyProgramInfo'][0]
+ ): array
+ {
+ $request = $this->getLoyaltyProgramInfoRequest($loyaltyProgramId, $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 (in_array('\Brevo\Client\Models\LoyaltyProgram', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\LoyaltyProgram' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\LoyaltyProgram', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $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 = '\Brevo\Client\Models\LoyaltyProgram';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\LoyaltyProgram',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation getLoyaltyProgramInfoAsync
+ *
+ * Get loyalty program Info
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLoyaltyProgramInfo'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getLoyaltyProgramInfoAsync(
+ string $loyaltyProgramId,
+ string $contentType = self::contentTypes['getLoyaltyProgramInfo'][0]
+ ): PromiseInterface
+ {
+ return $this->getLoyaltyProgramInfoAsyncWithHttpInfo($loyaltyProgramId, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation getLoyaltyProgramInfoAsyncWithHttpInfo
+ *
+ * Get loyalty program Info
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLoyaltyProgramInfo'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getLoyaltyProgramInfoAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ string $contentType = self::contentTypes['getLoyaltyProgramInfo'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\LoyaltyProgram';
+ $request = $this->getLoyaltyProgramInfoRequest($loyaltyProgramId, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'getLoyaltyProgramInfo'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLoyaltyProgramInfo'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function getLoyaltyProgramInfoRequest(
+ $loyaltyProgramId,
+ string $contentType = self::contentTypes['getLoyaltyProgramInfo'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling getLoyaltyProgramInfo'
+ );
+ }
+
+
+ $resourcePath = '/loyalty/config/programs/{loyaltyProgramId}';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 getParameterSubscriptionInfo
+ *
+ * Get Subscription Data
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param int $contactId One of contact id or loyalty subscription id is required (required)
+ * @param string|null $loyaltySubscriptionId Loyalty Subscription Id (optional)
+ * @param string[]|null $params Add query params (balance, tier, reward, or member) (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getParameterSubscriptionInfo'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetSubscriptionInfoResponse|\Brevo\Client\Models\ContactIdInvalidResponse|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ContactIdInvalidResponse
+ */
+ public function getParameterSubscriptionInfo(
+ string $loyaltyProgramId,
+ int $contactId,
+ ?string $loyaltySubscriptionId = null,
+ ?array $params = null,
+ string $contentType = self::contentTypes['getParameterSubscriptionInfo'][0]
+ ): \Brevo\Client\Models\GetSubscriptionInfoResponse
+ {
+ list($response) = $this->getParameterSubscriptionInfoWithHttpInfo($loyaltyProgramId, $contactId, $loyaltySubscriptionId, $params, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation getParameterSubscriptionInfoWithHttpInfo
+ *
+ * Get Subscription Data
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param int $contactId One of contact id or loyalty subscription id is required (required)
+ * @param string|null $loyaltySubscriptionId Loyalty Subscription Id (optional)
+ * @param string[]|null $params Add query params (balance, tier, reward, or member) (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getParameterSubscriptionInfo'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetSubscriptionInfoResponse|\Brevo\Client\Models\ContactIdInvalidResponse|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ContactIdInvalidResponse, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function getParameterSubscriptionInfoWithHttpInfo(
+ string $loyaltyProgramId,
+ int $contactId,
+ ?string $loyaltySubscriptionId = null,
+ ?array $params = null,
+ string $contentType = self::contentTypes['getParameterSubscriptionInfo'][0]
+ ): array
+ {
+ $request = $this->getParameterSubscriptionInfoRequest($loyaltyProgramId, $contactId, $loyaltySubscriptionId, $params, $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 (in_array('\Brevo\Client\Models\GetSubscriptionInfoResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetSubscriptionInfoResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetSubscriptionInfoResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ContactIdInvalidResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ContactIdInvalidResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ContactIdInvalidResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if (in_array('\Brevo\Client\Models\ContactIdInvalidResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ContactIdInvalidResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ContactIdInvalidResponse', []),
+ $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 = '\Brevo\Client\Models\GetSubscriptionInfoResponse';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\GetSubscriptionInfoResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ContactIdInvalidResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ContactIdInvalidResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation getParameterSubscriptionInfoAsync
+ *
+ * Get Subscription Data
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param int $contactId One of contact id or loyalty subscription id is required (required)
+ * @param string|null $loyaltySubscriptionId Loyalty Subscription Id (optional)
+ * @param string[]|null $params Add query params (balance, tier, reward, or member) (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getParameterSubscriptionInfo'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getParameterSubscriptionInfoAsync(
+ string $loyaltyProgramId,
+ int $contactId,
+ ?string $loyaltySubscriptionId = null,
+ ?array $params = null,
+ string $contentType = self::contentTypes['getParameterSubscriptionInfo'][0]
+ ): PromiseInterface
+ {
+ return $this->getParameterSubscriptionInfoAsyncWithHttpInfo($loyaltyProgramId, $contactId, $loyaltySubscriptionId, $params, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation getParameterSubscriptionInfoAsyncWithHttpInfo
+ *
+ * Get Subscription Data
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param int $contactId One of contact id or loyalty subscription id is required (required)
+ * @param string|null $loyaltySubscriptionId Loyalty Subscription Id (optional)
+ * @param string[]|null $params Add query params (balance, tier, reward, or member) (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getParameterSubscriptionInfo'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getParameterSubscriptionInfoAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $contactId,
+ $loyaltySubscriptionId = null,
+ $params = null,
+ string $contentType = self::contentTypes['getParameterSubscriptionInfo'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\GetSubscriptionInfoResponse';
+ $request = $this->getParameterSubscriptionInfoRequest($loyaltyProgramId, $contactId, $loyaltySubscriptionId, $params, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'getParameterSubscriptionInfo'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param int $contactId One of contact id or loyalty subscription id is required (required)
+ * @param string|null $loyaltySubscriptionId Loyalty Subscription Id (optional)
+ * @param string[]|null $params Add query params (balance, tier, reward, or member) (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getParameterSubscriptionInfo'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function getParameterSubscriptionInfoRequest(
+ $loyaltyProgramId,
+ $contactId,
+ $loyaltySubscriptionId = null,
+ $params = null,
+ string $contentType = self::contentTypes['getParameterSubscriptionInfo'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling getParameterSubscriptionInfo'
+ );
+ }
+
+ // verify the required parameter 'contactId' is set
+ if ($contactId === null || (is_array($contactId) && count($contactId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $contactId when calling getParameterSubscriptionInfo'
+ );
+ }
+
+
+
+
+ $resourcePath = '/loyalty/config/programs/{loyaltyProgramId}/account-info';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $contactId,
+ 'contactId', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ true // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $loyaltySubscriptionId,
+ 'loyaltySubscriptionId', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $params,
+ 'params', // param base name
+ 'array', // openApiType
+ 'form', // style
+ false, // explode
+ false // required
+ ) ?? []);
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 getSubscriptionMember
+ *
+ * Get subscription info
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contactId Contact Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSubscriptionMember'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetSubscriptionMemberResponse|\Brevo\Client\Models\ContactIdInvalidResponse|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ContactIdInvalidResponse
+ */
+ public function getSubscriptionMember(
+ string $loyaltyProgramId,
+ string $contactId,
+ string $contentType = self::contentTypes['getSubscriptionMember'][0]
+ ): \Brevo\Client\Models\GetSubscriptionMemberResponse
+ {
+ list($response) = $this->getSubscriptionMemberWithHttpInfo($loyaltyProgramId, $contactId, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation getSubscriptionMemberWithHttpInfo
+ *
+ * Get subscription info
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contactId Contact Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSubscriptionMember'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetSubscriptionMemberResponse|\Brevo\Client\Models\ContactIdInvalidResponse|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ContactIdInvalidResponse, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function getSubscriptionMemberWithHttpInfo(
+ string $loyaltyProgramId,
+ string $contactId,
+ string $contentType = self::contentTypes['getSubscriptionMember'][0]
+ ): array
+ {
+ $request = $this->getSubscriptionMemberRequest($loyaltyProgramId, $contactId, $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 (in_array('\Brevo\Client\Models\GetSubscriptionMemberResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetSubscriptionMemberResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetSubscriptionMemberResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ContactIdInvalidResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ContactIdInvalidResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ContactIdInvalidResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if (in_array('\Brevo\Client\Models\ContactIdInvalidResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ContactIdInvalidResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ContactIdInvalidResponse', []),
+ $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 = '\Brevo\Client\Models\GetSubscriptionMemberResponse';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\GetSubscriptionMemberResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ContactIdInvalidResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ContactIdInvalidResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation getSubscriptionMemberAsync
+ *
+ * Get subscription info
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contactId Contact Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSubscriptionMember'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getSubscriptionMemberAsync(
+ string $loyaltyProgramId,
+ string $contactId,
+ string $contentType = self::contentTypes['getSubscriptionMember'][0]
+ ): PromiseInterface
+ {
+ return $this->getSubscriptionMemberAsyncWithHttpInfo($loyaltyProgramId, $contactId, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation getSubscriptionMemberAsyncWithHttpInfo
+ *
+ * Get subscription info
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contactId Contact Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSubscriptionMember'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getSubscriptionMemberAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $contactId,
+ string $contentType = self::contentTypes['getSubscriptionMember'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\GetSubscriptionMemberResponse';
+ $request = $this->getSubscriptionMemberRequest($loyaltyProgramId, $contactId, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'getSubscriptionMember'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contactId Contact Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSubscriptionMember'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function getSubscriptionMemberRequest(
+ $loyaltyProgramId,
+ $contactId,
+ string $contentType = self::contentTypes['getSubscriptionMember'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling getSubscriptionMember'
+ );
+ }
+
+ // verify the required parameter 'contactId' is set
+ if ($contactId === null || (is_array($contactId) && count($contactId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $contactId when calling getSubscriptionMember'
+ );
+ }
+
+
+ $resourcePath = '/loyalty/config/programs/{loyaltyProgramId}/contact/{contactId}';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($contactId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'contactId' . '}',
+ ObjectSerializer::toPathValue($contactId),
+ $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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 partiallyUpdateLoyaltyProgram
+ *
+ * Partially update loyalty program
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\PatchLoyaltyProgramPayload|null $patchLoyaltyProgramPayload Loyalty Program information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['partiallyUpdateLoyaltyProgram'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\LoyaltyProgram|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload
+ */
+ public function partiallyUpdateLoyaltyProgram(
+ string $loyaltyProgramId,
+ ?\Brevo\Client\Models\PatchLoyaltyProgramPayload $patchLoyaltyProgramPayload = null,
+ string $contentType = self::contentTypes['partiallyUpdateLoyaltyProgram'][0]
+ ): \Brevo\Client\Models\LoyaltyProgram
+ {
+ list($response) = $this->partiallyUpdateLoyaltyProgramWithHttpInfo($loyaltyProgramId, $patchLoyaltyProgramPayload, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation partiallyUpdateLoyaltyProgramWithHttpInfo
+ *
+ * Partially update loyalty program
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\PatchLoyaltyProgramPayload|null $patchLoyaltyProgramPayload Loyalty Program information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['partiallyUpdateLoyaltyProgram'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\LoyaltyProgram|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function partiallyUpdateLoyaltyProgramWithHttpInfo(
+ string $loyaltyProgramId,
+ ?\Brevo\Client\Models\PatchLoyaltyProgramPayload $patchLoyaltyProgramPayload = null,
+ string $contentType = self::contentTypes['partiallyUpdateLoyaltyProgram'][0]
+ ): array
+ {
+ $request = $this->partiallyUpdateLoyaltyProgramRequest($loyaltyProgramId, $patchLoyaltyProgramPayload, $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 (in_array('\Brevo\Client\Models\LoyaltyProgram', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\LoyaltyProgram' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\LoyaltyProgram', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $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 = '\Brevo\Client\Models\LoyaltyProgram';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\LoyaltyProgram',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation partiallyUpdateLoyaltyProgramAsync
+ *
+ * Partially update loyalty program
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\PatchLoyaltyProgramPayload|null $patchLoyaltyProgramPayload Loyalty Program information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['partiallyUpdateLoyaltyProgram'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function partiallyUpdateLoyaltyProgramAsync(
+ string $loyaltyProgramId,
+ ?\Brevo\Client\Models\PatchLoyaltyProgramPayload $patchLoyaltyProgramPayload = null,
+ string $contentType = self::contentTypes['partiallyUpdateLoyaltyProgram'][0]
+ ): PromiseInterface
+ {
+ return $this->partiallyUpdateLoyaltyProgramAsyncWithHttpInfo($loyaltyProgramId, $patchLoyaltyProgramPayload, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation partiallyUpdateLoyaltyProgramAsyncWithHttpInfo
+ *
+ * Partially update loyalty program
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\PatchLoyaltyProgramPayload|null $patchLoyaltyProgramPayload Loyalty Program information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['partiallyUpdateLoyaltyProgram'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function partiallyUpdateLoyaltyProgramAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $patchLoyaltyProgramPayload = null,
+ string $contentType = self::contentTypes['partiallyUpdateLoyaltyProgram'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\LoyaltyProgram';
+ $request = $this->partiallyUpdateLoyaltyProgramRequest($loyaltyProgramId, $patchLoyaltyProgramPayload, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'partiallyUpdateLoyaltyProgram'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\PatchLoyaltyProgramPayload|null $patchLoyaltyProgramPayload Loyalty Program information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['partiallyUpdateLoyaltyProgram'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function partiallyUpdateLoyaltyProgramRequest(
+ $loyaltyProgramId,
+ $patchLoyaltyProgramPayload = null,
+ string $contentType = self::contentTypes['partiallyUpdateLoyaltyProgram'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling partiallyUpdateLoyaltyProgram'
+ );
+ }
+
+
+
+ $resourcePath = '/loyalty/config/programs/{loyaltyProgramId}';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($patchLoyaltyProgramPayload)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($patchLoyaltyProgramPayload));
+ } else {
+ $httpBody = $patchLoyaltyProgramPayload;
+ }
+ } 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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(
+ 'PATCH',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation publishLoyaltyProgram
+ *
+ * Publish loyalty program
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['publishLoyaltyProgram'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return void
+ */
+ public function publishLoyaltyProgram(
+ string $loyaltyProgramId,
+ string $contentType = self::contentTypes['publishLoyaltyProgram'][0]
+ ): void
+ {
+ $this->publishLoyaltyProgramWithHttpInfo($loyaltyProgramId, $contentType);
+ }
+
+ /**
+ * Operation publishLoyaltyProgramWithHttpInfo
+ *
+ * Publish loyalty program
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['publishLoyaltyProgram'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function publishLoyaltyProgramWithHttpInfo(
+ string $loyaltyProgramId,
+ string $contentType = self::contentTypes['publishLoyaltyProgram'][0]
+ ): array
+ {
+ $request = $this->publishLoyaltyProgramRequest($loyaltyProgramId, $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();
+
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation publishLoyaltyProgramAsync
+ *
+ * Publish loyalty program
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['publishLoyaltyProgram'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function publishLoyaltyProgramAsync(
+ string $loyaltyProgramId,
+ string $contentType = self::contentTypes['publishLoyaltyProgram'][0]
+ ): PromiseInterface
+ {
+ return $this->publishLoyaltyProgramAsyncWithHttpInfo($loyaltyProgramId, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation publishLoyaltyProgramAsyncWithHttpInfo
+ *
+ * Publish loyalty program
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['publishLoyaltyProgram'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function publishLoyaltyProgramAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ string $contentType = self::contentTypes['publishLoyaltyProgram'][0]
+ ): PromiseInterface
+ {
+ $returnType = '';
+ $request = $this->publishLoyaltyProgramRequest($loyaltyProgramId, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $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 'publishLoyaltyProgram'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['publishLoyaltyProgram'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function publishLoyaltyProgramRequest(
+ $loyaltyProgramId,
+ string $contentType = self::contentTypes['publishLoyaltyProgram'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling publishLoyaltyProgram'
+ );
+ }
+
+
+ $resourcePath = '/loyalty/config/programs/{loyaltyProgramId}/publish';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 subscribeMemberToASubscription
+ *
+ * Create subscription member
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\CreateSubscriptionMemberPayload|null $createSubscriptionMemberPayload Subscription Member information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['subscribeMemberToASubscription'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CreateSubscriptionMemberResponse|\Brevo\Client\Models\ContactIdInvalidResponse|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ContactIdInvalidResponse|\Brevo\Client\Models\ContactIdInvalidResponse|\Brevo\Client\Models\ContactIdInvalidResponse
+ */
+ public function subscribeMemberToASubscription(
+ string $loyaltyProgramId,
+ ?\Brevo\Client\Models\CreateSubscriptionMemberPayload $createSubscriptionMemberPayload = null,
+ string $contentType = self::contentTypes['subscribeMemberToASubscription'][0]
+ ): \Brevo\Client\Models\CreateSubscriptionMemberResponse
+ {
+ list($response) = $this->subscribeMemberToASubscriptionWithHttpInfo($loyaltyProgramId, $createSubscriptionMemberPayload, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation subscribeMemberToASubscriptionWithHttpInfo
+ *
+ * Create subscription member
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\CreateSubscriptionMemberPayload|null $createSubscriptionMemberPayload Subscription Member information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['subscribeMemberToASubscription'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CreateSubscriptionMemberResponse|\Brevo\Client\Models\ContactIdInvalidResponse|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ContactIdInvalidResponse|\Brevo\Client\Models\ContactIdInvalidResponse|\Brevo\Client\Models\ContactIdInvalidResponse, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function subscribeMemberToASubscriptionWithHttpInfo(
+ string $loyaltyProgramId,
+ ?\Brevo\Client\Models\CreateSubscriptionMemberPayload $createSubscriptionMemberPayload = null,
+ string $contentType = self::contentTypes['subscribeMemberToASubscription'][0]
+ ): array
+ {
+ $request = $this->subscribeMemberToASubscriptionRequest($loyaltyProgramId, $createSubscriptionMemberPayload, $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 (in_array('\Brevo\Client\Models\CreateSubscriptionMemberResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CreateSubscriptionMemberResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CreateSubscriptionMemberResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ContactIdInvalidResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ContactIdInvalidResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ContactIdInvalidResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ContactIdInvalidResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ContactIdInvalidResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ContactIdInvalidResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if (in_array('\Brevo\Client\Models\ContactIdInvalidResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ContactIdInvalidResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ContactIdInvalidResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if (in_array('\Brevo\Client\Models\ContactIdInvalidResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ContactIdInvalidResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ContactIdInvalidResponse', []),
+ $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 = '\Brevo\Client\Models\CreateSubscriptionMemberResponse';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\CreateSubscriptionMemberResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ContactIdInvalidResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ContactIdInvalidResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ContactIdInvalidResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ContactIdInvalidResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation subscribeMemberToASubscriptionAsync
+ *
+ * Create subscription member
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\CreateSubscriptionMemberPayload|null $createSubscriptionMemberPayload Subscription Member information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['subscribeMemberToASubscription'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function subscribeMemberToASubscriptionAsync(
+ string $loyaltyProgramId,
+ ?\Brevo\Client\Models\CreateSubscriptionMemberPayload $createSubscriptionMemberPayload = null,
+ string $contentType = self::contentTypes['subscribeMemberToASubscription'][0]
+ ): PromiseInterface
+ {
+ return $this->subscribeMemberToASubscriptionAsyncWithHttpInfo($loyaltyProgramId, $createSubscriptionMemberPayload, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation subscribeMemberToASubscriptionAsyncWithHttpInfo
+ *
+ * Create subscription member
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\CreateSubscriptionMemberPayload|null $createSubscriptionMemberPayload Subscription Member information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['subscribeMemberToASubscription'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function subscribeMemberToASubscriptionAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $createSubscriptionMemberPayload = null,
+ string $contentType = self::contentTypes['subscribeMemberToASubscription'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\CreateSubscriptionMemberResponse';
+ $request = $this->subscribeMemberToASubscriptionRequest($loyaltyProgramId, $createSubscriptionMemberPayload, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'subscribeMemberToASubscription'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\CreateSubscriptionMemberPayload|null $createSubscriptionMemberPayload Subscription Member information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['subscribeMemberToASubscription'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function subscribeMemberToASubscriptionRequest(
+ $loyaltyProgramId,
+ $createSubscriptionMemberPayload = null,
+ string $contentType = self::contentTypes['subscribeMemberToASubscription'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling subscribeMemberToASubscription'
+ );
+ }
+
+
+
+ $resourcePath = '/loyalty/config/programs/{loyaltyProgramId}/subscriptions-members';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($createSubscriptionMemberPayload)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createSubscriptionMemberPayload));
+ } else {
+ $httpBody = $createSubscriptionMemberPayload;
+ }
+ } 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 subscribeToLoyaltyProgram
+ *
+ * Create subscription
+ *
+ * @param string $loyaltyProgramId Loyalty Program ID (required)
+ * @param \Brevo\Client\Models\CreateSubscriptionPayload $createSubscriptionPayload Subscription information (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['subscribeToLoyaltyProgram'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CreateSubscriptionResponse|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ContactIdInvalidResponse|\Brevo\Client\Models\ContactIdInvalidResponse
+ */
+ public function subscribeToLoyaltyProgram(
+ string $loyaltyProgramId,
+ \Brevo\Client\Models\CreateSubscriptionPayload $createSubscriptionPayload,
+ string $contentType = self::contentTypes['subscribeToLoyaltyProgram'][0]
+ ): \Brevo\Client\Models\CreateSubscriptionResponse
+ {
+ list($response) = $this->subscribeToLoyaltyProgramWithHttpInfo($loyaltyProgramId, $createSubscriptionPayload, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation subscribeToLoyaltyProgramWithHttpInfo
+ *
+ * Create subscription
+ *
+ * @param string $loyaltyProgramId Loyalty Program ID (required)
+ * @param \Brevo\Client\Models\CreateSubscriptionPayload $createSubscriptionPayload Subscription information (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['subscribeToLoyaltyProgram'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CreateSubscriptionResponse|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ContactIdInvalidResponse|\Brevo\Client\Models\ContactIdInvalidResponse, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function subscribeToLoyaltyProgramWithHttpInfo(
+ string $loyaltyProgramId,
+ \Brevo\Client\Models\CreateSubscriptionPayload $createSubscriptionPayload,
+ string $contentType = self::contentTypes['subscribeToLoyaltyProgram'][0]
+ ): array
+ {
+ $request = $this->subscribeToLoyaltyProgramRequest($loyaltyProgramId, $createSubscriptionPayload, $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 201:
+ if (in_array('\Brevo\Client\Models\CreateSubscriptionResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CreateSubscriptionResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CreateSubscriptionResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ContactIdInvalidResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ContactIdInvalidResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ContactIdInvalidResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if (in_array('\Brevo\Client\Models\ContactIdInvalidResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ContactIdInvalidResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ContactIdInvalidResponse', []),
+ $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 = '\Brevo\Client\Models\CreateSubscriptionResponse';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 201:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\CreateSubscriptionResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ContactIdInvalidResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ContactIdInvalidResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation subscribeToLoyaltyProgramAsync
+ *
+ * Create subscription
+ *
+ * @param string $loyaltyProgramId Loyalty Program ID (required)
+ * @param \Brevo\Client\Models\CreateSubscriptionPayload $createSubscriptionPayload Subscription information (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['subscribeToLoyaltyProgram'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function subscribeToLoyaltyProgramAsync(
+ string $loyaltyProgramId,
+ \Brevo\Client\Models\CreateSubscriptionPayload $createSubscriptionPayload,
+ string $contentType = self::contentTypes['subscribeToLoyaltyProgram'][0]
+ ): PromiseInterface
+ {
+ return $this->subscribeToLoyaltyProgramAsyncWithHttpInfo($loyaltyProgramId, $createSubscriptionPayload, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation subscribeToLoyaltyProgramAsyncWithHttpInfo
+ *
+ * Create subscription
+ *
+ * @param string $loyaltyProgramId Loyalty Program ID (required)
+ * @param \Brevo\Client\Models\CreateSubscriptionPayload $createSubscriptionPayload Subscription information (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['subscribeToLoyaltyProgram'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function subscribeToLoyaltyProgramAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $createSubscriptionPayload,
+ string $contentType = self::contentTypes['subscribeToLoyaltyProgram'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\CreateSubscriptionResponse';
+ $request = $this->subscribeToLoyaltyProgramRequest($loyaltyProgramId, $createSubscriptionPayload, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'subscribeToLoyaltyProgram'
+ *
+ * @param string $loyaltyProgramId Loyalty Program ID (required)
+ * @param \Brevo\Client\Models\CreateSubscriptionPayload $createSubscriptionPayload Subscription information (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['subscribeToLoyaltyProgram'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function subscribeToLoyaltyProgramRequest(
+ $loyaltyProgramId,
+ $createSubscriptionPayload,
+ string $contentType = self::contentTypes['subscribeToLoyaltyProgram'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling subscribeToLoyaltyProgram'
+ );
+ }
+
+ // verify the required parameter 'createSubscriptionPayload' is set
+ if ($createSubscriptionPayload === null || (is_array($createSubscriptionPayload) && count($createSubscriptionPayload) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $createSubscriptionPayload when calling subscribeToLoyaltyProgram'
+ );
+ }
+
+
+ $resourcePath = '/loyalty/config/programs/{loyaltyProgramId}/subscriptions';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($createSubscriptionPayload)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createSubscriptionPayload));
+ } else {
+ $httpBody = $createSubscriptionPayload;
+ }
+ } 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 updateLoyaltyProgram
+ *
+ * Update loyalty program
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\UpdateLoyaltyProgramPayload|null $updateLoyaltyProgramPayload Loyalty Program information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLoyaltyProgram'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\LoyaltyProgram|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload
+ */
+ public function updateLoyaltyProgram(
+ string $loyaltyProgramId,
+ ?\Brevo\Client\Models\UpdateLoyaltyProgramPayload $updateLoyaltyProgramPayload = null,
+ string $contentType = self::contentTypes['updateLoyaltyProgram'][0]
+ ): \Brevo\Client\Models\LoyaltyProgram
+ {
+ list($response) = $this->updateLoyaltyProgramWithHttpInfo($loyaltyProgramId, $updateLoyaltyProgramPayload, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation updateLoyaltyProgramWithHttpInfo
+ *
+ * Update loyalty program
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\UpdateLoyaltyProgramPayload|null $updateLoyaltyProgramPayload Loyalty Program information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLoyaltyProgram'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\LoyaltyProgram|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function updateLoyaltyProgramWithHttpInfo(
+ string $loyaltyProgramId,
+ ?\Brevo\Client\Models\UpdateLoyaltyProgramPayload $updateLoyaltyProgramPayload = null,
+ string $contentType = self::contentTypes['updateLoyaltyProgram'][0]
+ ): array
+ {
+ $request = $this->updateLoyaltyProgramRequest($loyaltyProgramId, $updateLoyaltyProgramPayload, $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 (in_array('\Brevo\Client\Models\LoyaltyProgram', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\LoyaltyProgram' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\LoyaltyProgram', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $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 = '\Brevo\Client\Models\LoyaltyProgram';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\LoyaltyProgram',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation updateLoyaltyProgramAsync
+ *
+ * Update loyalty program
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\UpdateLoyaltyProgramPayload|null $updateLoyaltyProgramPayload Loyalty Program information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLoyaltyProgram'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function updateLoyaltyProgramAsync(
+ string $loyaltyProgramId,
+ ?\Brevo\Client\Models\UpdateLoyaltyProgramPayload $updateLoyaltyProgramPayload = null,
+ string $contentType = self::contentTypes['updateLoyaltyProgram'][0]
+ ): PromiseInterface
+ {
+ return $this->updateLoyaltyProgramAsyncWithHttpInfo($loyaltyProgramId, $updateLoyaltyProgramPayload, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation updateLoyaltyProgramAsyncWithHttpInfo
+ *
+ * Update loyalty program
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\UpdateLoyaltyProgramPayload|null $updateLoyaltyProgramPayload Loyalty Program information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLoyaltyProgram'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function updateLoyaltyProgramAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $updateLoyaltyProgramPayload = null,
+ string $contentType = self::contentTypes['updateLoyaltyProgram'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\LoyaltyProgram';
+ $request = $this->updateLoyaltyProgramRequest($loyaltyProgramId, $updateLoyaltyProgramPayload, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'updateLoyaltyProgram'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\UpdateLoyaltyProgramPayload|null $updateLoyaltyProgramPayload Loyalty Program information (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLoyaltyProgram'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function updateLoyaltyProgramRequest(
+ $loyaltyProgramId,
+ $updateLoyaltyProgramPayload = null,
+ string $contentType = self::contentTypes['updateLoyaltyProgram'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling updateLoyaltyProgram'
+ );
+ }
+
+
+
+ $resourcePath = '/loyalty/config/programs/{loyaltyProgramId}';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($updateLoyaltyProgramPayload)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($updateLoyaltyProgramPayload));
+ } else {
+ $httpBody = $updateLoyaltyProgramPayload;
+ }
+ } 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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(): array
+ {
+ $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/ResellerApi.php b/lib/Api/ResellerApi.php
deleted file mode 100644
index 410a8c5..0000000
--- a/lib/Api/ResellerApi.php
+++ /dev/null
@@ -1,4765 +0,0 @@
-client = $client ?: new Client();
- $this->config = $config ?: new Configuration();
- $this->headerSelector = $selector ?: new HeaderSelector();
- }
-
- /**
- * @return Configuration
- */
- public function getConfig()
- {
- return $this->config;
- }
-
- /**
- * Operation addCredits
- *
- * Add Email and/or SMS credits to a specific child account
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\AddCredits $addCredits Values to post to add credit to a specific child account (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\RemainingCreditModel
- */
- public function addCredits($childIdentifier, $addCredits)
- {
- list($response) = $this->addCreditsWithHttpInfo($childIdentifier, $addCredits);
- return $response;
- }
-
- /**
- * Operation addCreditsWithHttpInfo
- *
- * Add Email and/or SMS credits to a specific child account
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\AddCredits $addCredits Values to post to add credit to a specific child account (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\RemainingCreditModel, HTTP status code, HTTP response headers (array of strings)
- */
- public function addCreditsWithHttpInfo($childIdentifier, $addCredits)
- {
- $returnType = '\Brevo\Client\Model\RemainingCreditModel';
- $request = $this->addCreditsRequest($childIdentifier, $addCredits);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
-
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 200:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\RemainingCreditModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 403:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation addCreditsAsync
- *
- * Add Email and/or SMS credits to a specific child account
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\AddCredits $addCredits Values to post to add credit to a specific child account (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function addCreditsAsync($childIdentifier, $addCredits)
- {
- return $this->addCreditsAsyncWithHttpInfo($childIdentifier, $addCredits)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation addCreditsAsyncWithHttpInfo
- *
- * Add Email and/or SMS credits to a specific child account
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\AddCredits $addCredits Values to post to add credit to a specific child account (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function addCreditsAsyncWithHttpInfo($childIdentifier, $addCredits)
- {
- $returnType = '\Brevo\Client\Model\RemainingCreditModel';
- $request = $this->addCreditsRequest($childIdentifier, $addCredits);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- 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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'addCredits'
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\AddCredits $addCredits Values to post to add credit to a specific child account (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function addCreditsRequest($childIdentifier, $addCredits)
- {
- // verify the required parameter 'childIdentifier' is set
- if ($childIdentifier === null || (is_array($childIdentifier) && count($childIdentifier) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $childIdentifier when calling addCredits'
- );
- }
- // verify the required parameter 'addCredits' is set
- if ($addCredits === null || (is_array($addCredits) && count($addCredits) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $addCredits when calling addCredits'
- );
- }
-
- $resourcePath = '/reseller/children/{childIdentifier}/credits/add';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
- // path params
- if ($childIdentifier !== null) {
- $resourcePath = str_replace(
- '{' . 'childIdentifier' . '}',
- ObjectSerializer::toPathValue($childIdentifier),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
- if (isset($addCredits)) {
- $_tempBody = $addCredits;
- }
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation associateIpToChild
- *
- * Associate a dedicated IP to the child
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\ManageIp $ip IP to associate (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return void
- */
- public function associateIpToChild($childIdentifier, $ip)
- {
- $this->associateIpToChildWithHttpInfo($childIdentifier, $ip);
- }
-
- /**
- * Operation associateIpToChildWithHttpInfo
- *
- * Associate a dedicated IP to the child
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\ManageIp $ip IP to associate (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of null, HTTP status code, HTTP response headers (array of strings)
- */
- public function associateIpToChildWithHttpInfo($childIdentifier, $ip)
- {
- $returnType = '';
- $request = $this->associateIpToChildRequest($childIdentifier, $ip);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- return [null, $statusCode, $response->getHeaders()];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation associateIpToChildAsync
- *
- * Associate a dedicated IP to the child
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\ManageIp $ip IP to associate (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function associateIpToChildAsync($childIdentifier, $ip)
- {
- return $this->associateIpToChildAsyncWithHttpInfo($childIdentifier, $ip)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation associateIpToChildAsyncWithHttpInfo
- *
- * Associate a dedicated IP to the child
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\ManageIp $ip IP to associate (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function associateIpToChildAsyncWithHttpInfo($childIdentifier, $ip)
- {
- $returnType = '';
- $request = $this->associateIpToChildRequest($childIdentifier, $ip);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- return [null, $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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'associateIpToChild'
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\ManageIp $ip IP to associate (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function associateIpToChildRequest($childIdentifier, $ip)
- {
- // verify the required parameter 'childIdentifier' is set
- if ($childIdentifier === null || (is_array($childIdentifier) && count($childIdentifier) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $childIdentifier when calling associateIpToChild'
- );
- }
- // verify the required parameter 'ip' is set
- if ($ip === null || (is_array($ip) && count($ip) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $ip when calling associateIpToChild'
- );
- }
-
- $resourcePath = '/reseller/children/{childIdentifier}/ips/associate';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
- // path params
- if ($childIdentifier !== null) {
- $resourcePath = str_replace(
- '{' . 'childIdentifier' . '}',
- ObjectSerializer::toPathValue($childIdentifier),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
- if (isset($ip)) {
- $_tempBody = $ip;
- }
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation createChildDomain
- *
- * Create a domain for a child account
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\AddChildDomain $addChildDomain Sender domain to add for a specific child account. This will not be displayed to the parent account. (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return void
- */
- public function createChildDomain($childIdentifier, $addChildDomain)
- {
- $this->createChildDomainWithHttpInfo($childIdentifier, $addChildDomain);
- }
-
- /**
- * Operation createChildDomainWithHttpInfo
- *
- * Create a domain for a child account
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\AddChildDomain $addChildDomain Sender domain to add for a specific child account. This will not be displayed to the parent account. (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of null, HTTP status code, HTTP response headers (array of strings)
- */
- public function createChildDomainWithHttpInfo($childIdentifier, $addChildDomain)
- {
- $returnType = '';
- $request = $this->createChildDomainRequest($childIdentifier, $addChildDomain);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- return [null, $statusCode, $response->getHeaders()];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 403:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation createChildDomainAsync
- *
- * Create a domain for a child account
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\AddChildDomain $addChildDomain Sender domain to add for a specific child account. This will not be displayed to the parent account. (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function createChildDomainAsync($childIdentifier, $addChildDomain)
- {
- return $this->createChildDomainAsyncWithHttpInfo($childIdentifier, $addChildDomain)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation createChildDomainAsyncWithHttpInfo
- *
- * Create a domain for a child account
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\AddChildDomain $addChildDomain Sender domain to add for a specific child account. This will not be displayed to the parent account. (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function createChildDomainAsyncWithHttpInfo($childIdentifier, $addChildDomain)
- {
- $returnType = '';
- $request = $this->createChildDomainRequest($childIdentifier, $addChildDomain);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- return [null, $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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'createChildDomain'
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\AddChildDomain $addChildDomain Sender domain to add for a specific child account. This will not be displayed to the parent account. (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function createChildDomainRequest($childIdentifier, $addChildDomain)
- {
- // verify the required parameter 'childIdentifier' is set
- if ($childIdentifier === null || (is_array($childIdentifier) && count($childIdentifier) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $childIdentifier when calling createChildDomain'
- );
- }
- // verify the required parameter 'addChildDomain' is set
- if ($addChildDomain === null || (is_array($addChildDomain) && count($addChildDomain) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $addChildDomain when calling createChildDomain'
- );
- }
-
- $resourcePath = '/reseller/children/{childIdentifier}/domains';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
- // path params
- if ($childIdentifier !== null) {
- $resourcePath = str_replace(
- '{' . 'childIdentifier' . '}',
- ObjectSerializer::toPathValue($childIdentifier),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
- if (isset($addChildDomain)) {
- $_tempBody = $addChildDomain;
- }
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation createResellerChild
- *
- * Creates a reseller child
- *
- * @param \Brevo\Client\Model\CreateChild $resellerChild reseller child to add (optional)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\CreateReseller
- */
- public function createResellerChild($resellerChild = null)
- {
- list($response) = $this->createResellerChildWithHttpInfo($resellerChild);
- return $response;
- }
-
- /**
- * Operation createResellerChildWithHttpInfo
- *
- * Creates a reseller child
- *
- * @param \Brevo\Client\Model\CreateChild $resellerChild reseller child to add (optional)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\CreateReseller, HTTP status code, HTTP response headers (array of strings)
- */
- public function createResellerChildWithHttpInfo($resellerChild = null)
- {
- $returnType = '\Brevo\Client\Model\CreateReseller';
- $request = $this->createResellerChildRequest($resellerChild);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
-
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 201:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\CreateReseller',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 403:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation createResellerChildAsync
- *
- * Creates a reseller child
- *
- * @param \Brevo\Client\Model\CreateChild $resellerChild reseller child to add (optional)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function createResellerChildAsync($resellerChild = null)
- {
- return $this->createResellerChildAsyncWithHttpInfo($resellerChild)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation createResellerChildAsyncWithHttpInfo
- *
- * Creates a reseller child
- *
- * @param \Brevo\Client\Model\CreateChild $resellerChild reseller child to add (optional)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function createResellerChildAsyncWithHttpInfo($resellerChild = null)
- {
- $returnType = '\Brevo\Client\Model\CreateReseller';
- $request = $this->createResellerChildRequest($resellerChild);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- 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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'createResellerChild'
- *
- * @param \Brevo\Client\Model\CreateChild $resellerChild reseller child to add (optional)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function createResellerChildRequest($resellerChild = null)
- {
-
- $resourcePath = '/reseller/children';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
-
- // body params
- $_tempBody = null;
- if (isset($resellerChild)) {
- $_tempBody = $resellerChild;
- }
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation deleteChildDomain
- *
- * Delete the sender domain of the reseller child based on the childIdentifier and domainName passed
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param string $domainName Pass the existing domain that needs to be deleted (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return void
- */
- public function deleteChildDomain($childIdentifier, $domainName)
- {
- $this->deleteChildDomainWithHttpInfo($childIdentifier, $domainName);
- }
-
- /**
- * Operation deleteChildDomainWithHttpInfo
- *
- * Delete the sender domain of the reseller child based on the childIdentifier and domainName passed
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param string $domainName Pass the existing domain that needs to be deleted (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of null, HTTP status code, HTTP response headers (array of strings)
- */
- public function deleteChildDomainWithHttpInfo($childIdentifier, $domainName)
- {
- $returnType = '';
- $request = $this->deleteChildDomainRequest($childIdentifier, $domainName);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- return [null, $statusCode, $response->getHeaders()];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 403:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation deleteChildDomainAsync
- *
- * Delete the sender domain of the reseller child based on the childIdentifier and domainName passed
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param string $domainName Pass the existing domain that needs to be deleted (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function deleteChildDomainAsync($childIdentifier, $domainName)
- {
- return $this->deleteChildDomainAsyncWithHttpInfo($childIdentifier, $domainName)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation deleteChildDomainAsyncWithHttpInfo
- *
- * Delete the sender domain of the reseller child based on the childIdentifier and domainName passed
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param string $domainName Pass the existing domain that needs to be deleted (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function deleteChildDomainAsyncWithHttpInfo($childIdentifier, $domainName)
- {
- $returnType = '';
- $request = $this->deleteChildDomainRequest($childIdentifier, $domainName);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- return [null, $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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'deleteChildDomain'
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param string $domainName Pass the existing domain that needs to be deleted (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function deleteChildDomainRequest($childIdentifier, $domainName)
- {
- // verify the required parameter 'childIdentifier' is set
- if ($childIdentifier === null || (is_array($childIdentifier) && count($childIdentifier) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $childIdentifier when calling deleteChildDomain'
- );
- }
- // verify the required parameter 'domainName' is set
- if ($domainName === null || (is_array($domainName) && count($domainName) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $domainName when calling deleteChildDomain'
- );
- }
-
- $resourcePath = '/reseller/children/{childIdentifier}/domains/{domainName}';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
- // path params
- if ($childIdentifier !== null) {
- $resourcePath = str_replace(
- '{' . 'childIdentifier' . '}',
- ObjectSerializer::toPathValue($childIdentifier),
- $resourcePath
- );
- }
- // path params
- if ($domainName !== null) {
- $resourcePath = str_replace(
- '{' . 'domainName' . '}',
- ObjectSerializer::toPathValue($domainName),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation deleteResellerChild
- *
- * Delete a single reseller child based on the child identifier supplied
- *
- * @param string $childIdentifier Either auth key or child id of reseller's child (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return void
- */
- public function deleteResellerChild($childIdentifier)
- {
- $this->deleteResellerChildWithHttpInfo($childIdentifier);
- }
-
- /**
- * Operation deleteResellerChildWithHttpInfo
- *
- * Delete a single reseller child based on the child identifier supplied
- *
- * @param string $childIdentifier Either auth key or child id of reseller's child (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of null, HTTP status code, HTTP response headers (array of strings)
- */
- public function deleteResellerChildWithHttpInfo($childIdentifier)
- {
- $returnType = '';
- $request = $this->deleteResellerChildRequest($childIdentifier);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- return [null, $statusCode, $response->getHeaders()];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 403:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation deleteResellerChildAsync
- *
- * Delete a single reseller child based on the child identifier supplied
- *
- * @param string $childIdentifier Either auth key or child id of reseller's child (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function deleteResellerChildAsync($childIdentifier)
- {
- return $this->deleteResellerChildAsyncWithHttpInfo($childIdentifier)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation deleteResellerChildAsyncWithHttpInfo
- *
- * Delete a single reseller child based on the child identifier supplied
- *
- * @param string $childIdentifier Either auth key or child id of reseller's child (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function deleteResellerChildAsyncWithHttpInfo($childIdentifier)
- {
- $returnType = '';
- $request = $this->deleteResellerChildRequest($childIdentifier);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- return [null, $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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'deleteResellerChild'
- *
- * @param string $childIdentifier Either auth key or child id of reseller's child (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function deleteResellerChildRequest($childIdentifier)
- {
- // verify the required parameter 'childIdentifier' is set
- if ($childIdentifier === null || (is_array($childIdentifier) && count($childIdentifier) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $childIdentifier when calling deleteResellerChild'
- );
- }
-
- $resourcePath = '/reseller/children/{childIdentifier}';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
- // path params
- if ($childIdentifier !== null) {
- $resourcePath = str_replace(
- '{' . 'childIdentifier' . '}',
- ObjectSerializer::toPathValue($childIdentifier),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation dissociateIpFromChild
- *
- * Dissociate a dedicated IP to the child
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\ManageIp $ip IP to dissociate (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return void
- */
- public function dissociateIpFromChild($childIdentifier, $ip)
- {
- $this->dissociateIpFromChildWithHttpInfo($childIdentifier, $ip);
- }
-
- /**
- * Operation dissociateIpFromChildWithHttpInfo
- *
- * Dissociate a dedicated IP to the child
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\ManageIp $ip IP to dissociate (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of null, HTTP status code, HTTP response headers (array of strings)
- */
- public function dissociateIpFromChildWithHttpInfo($childIdentifier, $ip)
- {
- $returnType = '';
- $request = $this->dissociateIpFromChildRequest($childIdentifier, $ip);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- return [null, $statusCode, $response->getHeaders()];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation dissociateIpFromChildAsync
- *
- * Dissociate a dedicated IP to the child
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\ManageIp $ip IP to dissociate (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function dissociateIpFromChildAsync($childIdentifier, $ip)
- {
- return $this->dissociateIpFromChildAsyncWithHttpInfo($childIdentifier, $ip)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation dissociateIpFromChildAsyncWithHttpInfo
- *
- * Dissociate a dedicated IP to the child
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\ManageIp $ip IP to dissociate (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function dissociateIpFromChildAsyncWithHttpInfo($childIdentifier, $ip)
- {
- $returnType = '';
- $request = $this->dissociateIpFromChildRequest($childIdentifier, $ip);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- return [null, $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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'dissociateIpFromChild'
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\ManageIp $ip IP to dissociate (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function dissociateIpFromChildRequest($childIdentifier, $ip)
- {
- // verify the required parameter 'childIdentifier' is set
- if ($childIdentifier === null || (is_array($childIdentifier) && count($childIdentifier) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $childIdentifier when calling dissociateIpFromChild'
- );
- }
- // verify the required parameter 'ip' is set
- if ($ip === null || (is_array($ip) && count($ip) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $ip when calling dissociateIpFromChild'
- );
- }
-
- $resourcePath = '/reseller/children/{childIdentifier}/ips/dissociate';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
- // path params
- if ($childIdentifier !== null) {
- $resourcePath = str_replace(
- '{' . 'childIdentifier' . '}',
- ObjectSerializer::toPathValue($childIdentifier),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
- if (isset($ip)) {
- $_tempBody = $ip;
- }
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation getChildAccountCreationStatus
- *
- * Get the status of a reseller's child account creation, whether it is successfully created (exists) or not based on the identifier supplied
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetChildAccountCreationStatus
- */
- public function getChildAccountCreationStatus($childIdentifier)
- {
- list($response) = $this->getChildAccountCreationStatusWithHttpInfo($childIdentifier);
- return $response;
- }
-
- /**
- * Operation getChildAccountCreationStatusWithHttpInfo
- *
- * Get the status of a reseller's child account creation, whether it is successfully created (exists) or not based on the identifier supplied
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetChildAccountCreationStatus, HTTP status code, HTTP response headers (array of strings)
- */
- public function getChildAccountCreationStatusWithHttpInfo($childIdentifier)
- {
- $returnType = '\Brevo\Client\Model\GetChildAccountCreationStatus';
- $request = $this->getChildAccountCreationStatusRequest($childIdentifier);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
-
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 200:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\GetChildAccountCreationStatus',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 403:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation getChildAccountCreationStatusAsync
- *
- * Get the status of a reseller's child account creation, whether it is successfully created (exists) or not based on the identifier supplied
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getChildAccountCreationStatusAsync($childIdentifier)
- {
- return $this->getChildAccountCreationStatusAsyncWithHttpInfo($childIdentifier)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation getChildAccountCreationStatusAsyncWithHttpInfo
- *
- * Get the status of a reseller's child account creation, whether it is successfully created (exists) or not based on the identifier supplied
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getChildAccountCreationStatusAsyncWithHttpInfo($childIdentifier)
- {
- $returnType = '\Brevo\Client\Model\GetChildAccountCreationStatus';
- $request = $this->getChildAccountCreationStatusRequest($childIdentifier);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- 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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'getChildAccountCreationStatus'
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function getChildAccountCreationStatusRequest($childIdentifier)
- {
- // verify the required parameter 'childIdentifier' is set
- if ($childIdentifier === null || (is_array($childIdentifier) && count($childIdentifier) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $childIdentifier when calling getChildAccountCreationStatus'
- );
- }
-
- $resourcePath = '/reseller/children/{childIdentifier}/accountCreationStatus';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
- // path params
- if ($childIdentifier !== null) {
- $resourcePath = str_replace(
- '{' . 'childIdentifier' . '}',
- ObjectSerializer::toPathValue($childIdentifier),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation getChildDomains
- *
- * Get all sender domains for a specific child account
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetChildDomains
- */
- public function getChildDomains($childIdentifier)
- {
- list($response) = $this->getChildDomainsWithHttpInfo($childIdentifier);
- return $response;
- }
-
- /**
- * Operation getChildDomainsWithHttpInfo
- *
- * Get all sender domains for a specific child account
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetChildDomains, HTTP status code, HTTP response headers (array of strings)
- */
- public function getChildDomainsWithHttpInfo($childIdentifier)
- {
- $returnType = '\Brevo\Client\Model\GetChildDomains';
- $request = $this->getChildDomainsRequest($childIdentifier);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
-
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 200:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\GetChildDomains',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 403:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation getChildDomainsAsync
- *
- * Get all sender domains for a specific child account
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getChildDomainsAsync($childIdentifier)
- {
- return $this->getChildDomainsAsyncWithHttpInfo($childIdentifier)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation getChildDomainsAsyncWithHttpInfo
- *
- * Get all sender domains for a specific child account
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getChildDomainsAsyncWithHttpInfo($childIdentifier)
- {
- $returnType = '\Brevo\Client\Model\GetChildDomains';
- $request = $this->getChildDomainsRequest($childIdentifier);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- 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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'getChildDomains'
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function getChildDomainsRequest($childIdentifier)
- {
- // verify the required parameter 'childIdentifier' is set
- if ($childIdentifier === null || (is_array($childIdentifier) && count($childIdentifier) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $childIdentifier when calling getChildDomains'
- );
- }
-
- $resourcePath = '/reseller/children/{childIdentifier}/domains';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
- // path params
- if ($childIdentifier !== null) {
- $resourcePath = str_replace(
- '{' . 'childIdentifier' . '}',
- ObjectSerializer::toPathValue($childIdentifier),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation getChildInfo
- *
- * Get a child account's details
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetChildInfo
- */
- public function getChildInfo($childIdentifier)
- {
- list($response) = $this->getChildInfoWithHttpInfo($childIdentifier);
- return $response;
- }
-
- /**
- * Operation getChildInfoWithHttpInfo
- *
- * Get a child account's details
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetChildInfo, HTTP status code, HTTP response headers (array of strings)
- */
- public function getChildInfoWithHttpInfo($childIdentifier)
- {
- $returnType = '\Brevo\Client\Model\GetChildInfo';
- $request = $this->getChildInfoRequest($childIdentifier);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
-
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 200:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\GetChildInfo',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 403:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation getChildInfoAsync
- *
- * Get a child account's details
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getChildInfoAsync($childIdentifier)
- {
- return $this->getChildInfoAsyncWithHttpInfo($childIdentifier)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation getChildInfoAsyncWithHttpInfo
- *
- * Get a child account's details
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getChildInfoAsyncWithHttpInfo($childIdentifier)
- {
- $returnType = '\Brevo\Client\Model\GetChildInfo';
- $request = $this->getChildInfoRequest($childIdentifier);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- 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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'getChildInfo'
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function getChildInfoRequest($childIdentifier)
- {
- // verify the required parameter 'childIdentifier' is set
- if ($childIdentifier === null || (is_array($childIdentifier) && count($childIdentifier) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $childIdentifier when calling getChildInfo'
- );
- }
-
- $resourcePath = '/reseller/children/{childIdentifier}';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
- // path params
- if ($childIdentifier !== null) {
- $resourcePath = str_replace(
- '{' . 'childIdentifier' . '}',
- ObjectSerializer::toPathValue($childIdentifier),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation getResellerChilds
- *
- * Get the list of all children accounts
- *
- * @param int $limit Number of documents for child accounts information per page (optional, default to 10)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetChildrenList
- */
- public function getResellerChilds($limit = '10', $offset = '0')
- {
- list($response) = $this->getResellerChildsWithHttpInfo($limit, $offset);
- return $response;
- }
-
- /**
- * Operation getResellerChildsWithHttpInfo
- *
- * Get the list of all children accounts
- *
- * @param int $limit Number of documents for child accounts information per page (optional, default to 10)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetChildrenList, HTTP status code, HTTP response headers (array of strings)
- */
- public function getResellerChildsWithHttpInfo($limit = '10', $offset = '0')
- {
- $returnType = '\Brevo\Client\Model\GetChildrenList';
- $request = $this->getResellerChildsRequest($limit, $offset);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
-
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 200:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\GetChildrenList',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 403:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation getResellerChildsAsync
- *
- * Get the list of all children accounts
- *
- * @param int $limit Number of documents for child accounts information per page (optional, default to 10)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getResellerChildsAsync($limit = '10', $offset = '0')
- {
- return $this->getResellerChildsAsyncWithHttpInfo($limit, $offset)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation getResellerChildsAsyncWithHttpInfo
- *
- * Get the list of all children accounts
- *
- * @param int $limit Number of documents for child accounts information per page (optional, default to 10)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getResellerChildsAsyncWithHttpInfo($limit = '10', $offset = '0')
- {
- $returnType = '\Brevo\Client\Model\GetChildrenList';
- $request = $this->getResellerChildsRequest($limit, $offset);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- 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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'getResellerChilds'
- *
- * @param int $limit Number of documents for child accounts information per page (optional, default to 10)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function getResellerChildsRequest($limit = '10', $offset = '0')
- {
- if ($limit !== null && $limit > 20) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling ResellerApi.getResellerChilds, must be smaller than or equal to 20.');
- }
- if ($limit !== null && $limit < 0) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling ResellerApi.getResellerChilds, must be bigger than or equal to 0.');
- }
-
-
- $resourcePath = '/reseller/children';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
- // query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
- // query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
-
-
- // body params
- $_tempBody = null;
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation getSsoToken
- *
- * Get session token to access Brevo (SSO)
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetSsoToken
- */
- public function getSsoToken($childIdentifier)
- {
- list($response) = $this->getSsoTokenWithHttpInfo($childIdentifier);
- return $response;
- }
-
- /**
- * Operation getSsoTokenWithHttpInfo
- *
- * Get session token to access Brevo (SSO)
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetSsoToken, HTTP status code, HTTP response headers (array of strings)
- */
- public function getSsoTokenWithHttpInfo($childIdentifier)
- {
- $returnType = '\Brevo\Client\Model\GetSsoToken';
- $request = $this->getSsoTokenRequest($childIdentifier);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
-
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 200:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\GetSsoToken',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 403:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation getSsoTokenAsync
- *
- * Get session token to access Brevo (SSO)
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getSsoTokenAsync($childIdentifier)
- {
- return $this->getSsoTokenAsyncWithHttpInfo($childIdentifier)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation getSsoTokenAsyncWithHttpInfo
- *
- * Get session token to access Brevo (SSO)
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getSsoTokenAsyncWithHttpInfo($childIdentifier)
- {
- $returnType = '\Brevo\Client\Model\GetSsoToken';
- $request = $this->getSsoTokenRequest($childIdentifier);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- 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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'getSsoToken'
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function getSsoTokenRequest($childIdentifier)
- {
- // verify the required parameter 'childIdentifier' is set
- if ($childIdentifier === null || (is_array($childIdentifier) && count($childIdentifier) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $childIdentifier when calling getSsoToken'
- );
- }
-
- $resourcePath = '/reseller/children/{childIdentifier}/auth';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
- // path params
- if ($childIdentifier !== null) {
- $resourcePath = str_replace(
- '{' . 'childIdentifier' . '}',
- ObjectSerializer::toPathValue($childIdentifier),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation removeCredits
- *
- * Remove Email and/or SMS credits from a specific child account
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\RemoveCredits $removeCredits Values to post to remove email or SMS credits from a specific child account (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\RemainingCreditModel
- */
- public function removeCredits($childIdentifier, $removeCredits)
- {
- list($response) = $this->removeCreditsWithHttpInfo($childIdentifier, $removeCredits);
- return $response;
- }
-
- /**
- * Operation removeCreditsWithHttpInfo
- *
- * Remove Email and/or SMS credits from a specific child account
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\RemoveCredits $removeCredits Values to post to remove email or SMS credits from a specific child account (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\RemainingCreditModel, HTTP status code, HTTP response headers (array of strings)
- */
- public function removeCreditsWithHttpInfo($childIdentifier, $removeCredits)
- {
- $returnType = '\Brevo\Client\Model\RemainingCreditModel';
- $request = $this->removeCreditsRequest($childIdentifier, $removeCredits);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
-
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 200:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\RemainingCreditModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 403:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation removeCreditsAsync
- *
- * Remove Email and/or SMS credits from a specific child account
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\RemoveCredits $removeCredits Values to post to remove email or SMS credits from a specific child account (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function removeCreditsAsync($childIdentifier, $removeCredits)
- {
- return $this->removeCreditsAsyncWithHttpInfo($childIdentifier, $removeCredits)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation removeCreditsAsyncWithHttpInfo
- *
- * Remove Email and/or SMS credits from a specific child account
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\RemoveCredits $removeCredits Values to post to remove email or SMS credits from a specific child account (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function removeCreditsAsyncWithHttpInfo($childIdentifier, $removeCredits)
- {
- $returnType = '\Brevo\Client\Model\RemainingCreditModel';
- $request = $this->removeCreditsRequest($childIdentifier, $removeCredits);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- 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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'removeCredits'
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\RemoveCredits $removeCredits Values to post to remove email or SMS credits from a specific child account (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function removeCreditsRequest($childIdentifier, $removeCredits)
- {
- // verify the required parameter 'childIdentifier' is set
- if ($childIdentifier === null || (is_array($childIdentifier) && count($childIdentifier) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $childIdentifier when calling removeCredits'
- );
- }
- // verify the required parameter 'removeCredits' is set
- if ($removeCredits === null || (is_array($removeCredits) && count($removeCredits) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $removeCredits when calling removeCredits'
- );
- }
-
- $resourcePath = '/reseller/children/{childIdentifier}/credits/remove';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
- // path params
- if ($childIdentifier !== null) {
- $resourcePath = str_replace(
- '{' . 'childIdentifier' . '}',
- ObjectSerializer::toPathValue($childIdentifier),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
- if (isset($removeCredits)) {
- $_tempBody = $removeCredits;
- }
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation updateChildAccountStatus
- *
- * Update info of reseller's child account status based on the childIdentifier supplied
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\UpdateChildAccountStatus $updateChildAccountStatus values to update in child account status (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return void
- */
- public function updateChildAccountStatus($childIdentifier, $updateChildAccountStatus)
- {
- $this->updateChildAccountStatusWithHttpInfo($childIdentifier, $updateChildAccountStatus);
- }
-
- /**
- * Operation updateChildAccountStatusWithHttpInfo
- *
- * Update info of reseller's child account status based on the childIdentifier supplied
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\UpdateChildAccountStatus $updateChildAccountStatus values to update in child account status (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of null, HTTP status code, HTTP response headers (array of strings)
- */
- public function updateChildAccountStatusWithHttpInfo($childIdentifier, $updateChildAccountStatus)
- {
- $returnType = '';
- $request = $this->updateChildAccountStatusRequest($childIdentifier, $updateChildAccountStatus);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- return [null, $statusCode, $response->getHeaders()];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 403:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation updateChildAccountStatusAsync
- *
- * Update info of reseller's child account status based on the childIdentifier supplied
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\UpdateChildAccountStatus $updateChildAccountStatus values to update in child account status (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function updateChildAccountStatusAsync($childIdentifier, $updateChildAccountStatus)
- {
- return $this->updateChildAccountStatusAsyncWithHttpInfo($childIdentifier, $updateChildAccountStatus)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation updateChildAccountStatusAsyncWithHttpInfo
- *
- * Update info of reseller's child account status based on the childIdentifier supplied
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\UpdateChildAccountStatus $updateChildAccountStatus values to update in child account status (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function updateChildAccountStatusAsyncWithHttpInfo($childIdentifier, $updateChildAccountStatus)
- {
- $returnType = '';
- $request = $this->updateChildAccountStatusRequest($childIdentifier, $updateChildAccountStatus);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- return [null, $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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'updateChildAccountStatus'
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\UpdateChildAccountStatus $updateChildAccountStatus values to update in child account status (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function updateChildAccountStatusRequest($childIdentifier, $updateChildAccountStatus)
- {
- // verify the required parameter 'childIdentifier' is set
- if ($childIdentifier === null || (is_array($childIdentifier) && count($childIdentifier) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $childIdentifier when calling updateChildAccountStatus'
- );
- }
- // verify the required parameter 'updateChildAccountStatus' is set
- if ($updateChildAccountStatus === null || (is_array($updateChildAccountStatus) && count($updateChildAccountStatus) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $updateChildAccountStatus when calling updateChildAccountStatus'
- );
- }
-
- $resourcePath = '/reseller/children/{childIdentifier}/accountStatus';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
- // path params
- if ($childIdentifier !== null) {
- $resourcePath = str_replace(
- '{' . 'childIdentifier' . '}',
- ObjectSerializer::toPathValue($childIdentifier),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
- if (isset($updateChildAccountStatus)) {
- $_tempBody = $updateChildAccountStatus;
- }
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'PUT',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation updateChildDomain
- *
- * Update the sender domain of reseller's child based on the childIdentifier and domainName passed
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param string $domainName Pass the existing domain that needs to be updated (required)
- * @param \Brevo\Client\Model\UpdateChildDomain $updateChildDomain value to update for sender domain (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return void
- */
- public function updateChildDomain($childIdentifier, $domainName, $updateChildDomain)
- {
- $this->updateChildDomainWithHttpInfo($childIdentifier, $domainName, $updateChildDomain);
- }
-
- /**
- * Operation updateChildDomainWithHttpInfo
- *
- * Update the sender domain of reseller's child based on the childIdentifier and domainName passed
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param string $domainName Pass the existing domain that needs to be updated (required)
- * @param \Brevo\Client\Model\UpdateChildDomain $updateChildDomain value to update for sender domain (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of null, HTTP status code, HTTP response headers (array of strings)
- */
- public function updateChildDomainWithHttpInfo($childIdentifier, $domainName, $updateChildDomain)
- {
- $returnType = '';
- $request = $this->updateChildDomainRequest($childIdentifier, $domainName, $updateChildDomain);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- return [null, $statusCode, $response->getHeaders()];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 403:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation updateChildDomainAsync
- *
- * Update the sender domain of reseller's child based on the childIdentifier and domainName passed
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param string $domainName Pass the existing domain that needs to be updated (required)
- * @param \Brevo\Client\Model\UpdateChildDomain $updateChildDomain value to update for sender domain (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function updateChildDomainAsync($childIdentifier, $domainName, $updateChildDomain)
- {
- return $this->updateChildDomainAsyncWithHttpInfo($childIdentifier, $domainName, $updateChildDomain)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation updateChildDomainAsyncWithHttpInfo
- *
- * Update the sender domain of reseller's child based on the childIdentifier and domainName passed
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param string $domainName Pass the existing domain that needs to be updated (required)
- * @param \Brevo\Client\Model\UpdateChildDomain $updateChildDomain value to update for sender domain (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function updateChildDomainAsyncWithHttpInfo($childIdentifier, $domainName, $updateChildDomain)
- {
- $returnType = '';
- $request = $this->updateChildDomainRequest($childIdentifier, $domainName, $updateChildDomain);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- return [null, $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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'updateChildDomain'
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param string $domainName Pass the existing domain that needs to be updated (required)
- * @param \Brevo\Client\Model\UpdateChildDomain $updateChildDomain value to update for sender domain (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function updateChildDomainRequest($childIdentifier, $domainName, $updateChildDomain)
- {
- // verify the required parameter 'childIdentifier' is set
- if ($childIdentifier === null || (is_array($childIdentifier) && count($childIdentifier) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $childIdentifier when calling updateChildDomain'
- );
- }
- // verify the required parameter 'domainName' is set
- if ($domainName === null || (is_array($domainName) && count($domainName) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $domainName when calling updateChildDomain'
- );
- }
- // verify the required parameter 'updateChildDomain' is set
- if ($updateChildDomain === null || (is_array($updateChildDomain) && count($updateChildDomain) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $updateChildDomain when calling updateChildDomain'
- );
- }
-
- $resourcePath = '/reseller/children/{childIdentifier}/domains/{domainName}';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
- // path params
- if ($childIdentifier !== null) {
- $resourcePath = str_replace(
- '{' . 'childIdentifier' . '}',
- ObjectSerializer::toPathValue($childIdentifier),
- $resourcePath
- );
- }
- // path params
- if ($domainName !== null) {
- $resourcePath = str_replace(
- '{' . 'domainName' . '}',
- ObjectSerializer::toPathValue($domainName),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
- if (isset($updateChildDomain)) {
- $_tempBody = $updateChildDomain;
- }
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'PUT',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation updateResellerChild
- *
- * Update info of reseller's child based on the child identifier supplied
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\UpdateChild $resellerChild values to update in child profile (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return void
- */
- public function updateResellerChild($childIdentifier, $resellerChild)
- {
- $this->updateResellerChildWithHttpInfo($childIdentifier, $resellerChild);
- }
-
- /**
- * Operation updateResellerChildWithHttpInfo
- *
- * Update info of reseller's child based on the child identifier supplied
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\UpdateChild $resellerChild values to update in child profile (required)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of null, HTTP status code, HTTP response headers (array of strings)
- */
- public function updateResellerChildWithHttpInfo($childIdentifier, $resellerChild)
- {
- $returnType = '';
- $request = $this->updateResellerChildRequest($childIdentifier, $resellerChild);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
-
- return [null, $statusCode, $response->getHeaders()];
-
- } catch (ApiException $e) {
- switch ($e->getCode()) {
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 403:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation updateResellerChildAsync
- *
- * Update info of reseller's child based on the child identifier supplied
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\UpdateChild $resellerChild values to update in child profile (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function updateResellerChildAsync($childIdentifier, $resellerChild)
- {
- return $this->updateResellerChildAsyncWithHttpInfo($childIdentifier, $resellerChild)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation updateResellerChildAsyncWithHttpInfo
- *
- * Update info of reseller's child based on the child identifier supplied
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\UpdateChild $resellerChild values to update in child profile (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function updateResellerChildAsyncWithHttpInfo($childIdentifier, $resellerChild)
- {
- $returnType = '';
- $request = $this->updateResellerChildRequest($childIdentifier, $resellerChild);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- return [null, $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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'updateResellerChild'
- *
- * @param string $childIdentifier Either auth key or id of reseller's child (required)
- * @param \Brevo\Client\Model\UpdateChild $resellerChild values to update in child profile (required)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function updateResellerChildRequest($childIdentifier, $resellerChild)
- {
- // verify the required parameter 'childIdentifier' is set
- if ($childIdentifier === null || (is_array($childIdentifier) && count($childIdentifier) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $childIdentifier when calling updateResellerChild'
- );
- }
- // verify the required parameter 'resellerChild' is set
- if ($resellerChild === null || (is_array($resellerChild) && count($resellerChild) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $resellerChild when calling updateResellerChild'
- );
- }
-
- $resourcePath = '/reseller/children/{childIdentifier}';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
-
- // path params
- if ($childIdentifier !== null) {
- $resourcePath = str_replace(
- '{' . 'childIdentifier' . '}',
- ObjectSerializer::toPathValue($childIdentifier),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
- if (isset($resellerChild)) {
- $_tempBody = $resellerChild;
- }
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
-
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
- ];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'PUT',
- $this->config->getHost() . $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/RewardsApi.php b/lib/Api/RewardsApi.php
new file mode 100644
index 0000000..71a9426
--- /dev/null
+++ b/lib/Api/RewardsApi.php
@@ -0,0 +1,2699 @@
+ [
+ 'application/json',
+ ],
+ 'getOffersList' => [
+ 'application/json',
+ ],
+ 'redeemReward' => [
+ 'application/json',
+ ],
+ 'revokeReward' => [
+ 'application/json',
+ ],
+ 'validateReward' => [
+ 'application/json',
+ ],
+ ];
+
+ /**
+ * @param ClientInterface|null $client
+ * @param Configuration|null $config
+ * @param HeaderSelector|null $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(int $hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex(): int
+ {
+ return $this->hostIndex;
+ }
+
+ /**
+ * @return Configuration
+ */
+ public function getConfig(): Configuration
+ {
+ return $this->config;
+ }
+
+ /**
+ * Operation attributeReward
+ *
+ * Attribute reward to a contact
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\AttributeRewardPayload $attributeRewardPayload Attribute reward information (One of contactId and loyaltySubscriptionId must be provided.) (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['attributeReward'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\RewardAttributionResponse|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\AttributedRewardFailedConditionErrorResponse|\Brevo\Client\Models\ContactIdInvalidResponse|\Brevo\Client\Models\ContactIdInvalidResponse
+ */
+ public function attributeReward(
+ string $loyaltyProgramId,
+ \Brevo\Client\Models\AttributeRewardPayload $attributeRewardPayload,
+ string $contentType = self::contentTypes['attributeReward'][0]
+ ): \Brevo\Client\Models\RewardAttributionResponse
+ {
+ list($response) = $this->attributeRewardWithHttpInfo($loyaltyProgramId, $attributeRewardPayload, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation attributeRewardWithHttpInfo
+ *
+ * Attribute reward to a contact
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\AttributeRewardPayload $attributeRewardPayload Attribute reward information (One of contactId and loyaltySubscriptionId must be provided.) (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['attributeReward'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\RewardAttributionResponse|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\AttributedRewardFailedConditionErrorResponse|\Brevo\Client\Models\ContactIdInvalidResponse|\Brevo\Client\Models\ContactIdInvalidResponse, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function attributeRewardWithHttpInfo(
+ string $loyaltyProgramId,
+ \Brevo\Client\Models\AttributeRewardPayload $attributeRewardPayload,
+ string $contentType = self::contentTypes['attributeReward'][0]
+ ): array
+ {
+ $request = $this->attributeRewardRequest($loyaltyProgramId, $attributeRewardPayload, $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 (in_array('\Brevo\Client\Models\RewardAttributionResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\RewardAttributionResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\RewardAttributionResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 412:
+ if (in_array('\Brevo\Client\Models\AttributedRewardFailedConditionErrorResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\AttributedRewardFailedConditionErrorResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\AttributedRewardFailedConditionErrorResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if (in_array('\Brevo\Client\Models\ContactIdInvalidResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ContactIdInvalidResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ContactIdInvalidResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 424:
+ if (in_array('\Brevo\Client\Models\ContactIdInvalidResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ContactIdInvalidResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ContactIdInvalidResponse', []),
+ $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 = '\Brevo\Client\Models\RewardAttributionResponse';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\RewardAttributionResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 412:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\AttributedRewardFailedConditionErrorResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ContactIdInvalidResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 424:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ContactIdInvalidResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation attributeRewardAsync
+ *
+ * Attribute reward to a contact
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\AttributeRewardPayload $attributeRewardPayload Attribute reward information (One of contactId and loyaltySubscriptionId must be provided.) (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['attributeReward'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function attributeRewardAsync(
+ string $loyaltyProgramId,
+ \Brevo\Client\Models\AttributeRewardPayload $attributeRewardPayload,
+ string $contentType = self::contentTypes['attributeReward'][0]
+ ): PromiseInterface
+ {
+ return $this->attributeRewardAsyncWithHttpInfo($loyaltyProgramId, $attributeRewardPayload, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation attributeRewardAsyncWithHttpInfo
+ *
+ * Attribute reward to a contact
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\AttributeRewardPayload $attributeRewardPayload Attribute reward information (One of contactId and loyaltySubscriptionId must be provided.) (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['attributeReward'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function attributeRewardAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $attributeRewardPayload,
+ string $contentType = self::contentTypes['attributeReward'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\RewardAttributionResponse';
+ $request = $this->attributeRewardRequest($loyaltyProgramId, $attributeRewardPayload, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'attributeReward'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\AttributeRewardPayload $attributeRewardPayload Attribute reward information (One of contactId and loyaltySubscriptionId must be provided.) (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['attributeReward'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function attributeRewardRequest(
+ $loyaltyProgramId,
+ $attributeRewardPayload,
+ string $contentType = self::contentTypes['attributeReward'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling attributeReward'
+ );
+ }
+
+ // verify the required parameter 'attributeRewardPayload' is set
+ if ($attributeRewardPayload === null || (is_array($attributeRewardPayload) && count($attributeRewardPayload) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $attributeRewardPayload when calling attributeReward'
+ );
+ }
+
+
+ $resourcePath = '/loyalty/offer/programs/{loyaltyProgramId}/rewards/attribute';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($attributeRewardPayload)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($attributeRewardPayload));
+ } else {
+ $httpBody = $attributeRewardPayload;
+ }
+ } 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 getOffersList
+ *
+ * Get Reward list
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param int|null $limit Number of documents per page (optional, default to 100)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $rewardState State of the reward (optional, default to 'all')
+ * @param string|null $rewardVersion Select 'active' to retrieve list of all rewards which are live for clients. Select draft to retrieve list of all non deleted rewards. (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOffersList'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\OffersListResponse|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ContactIdInvalidResponse
+ */
+ public function getOffersList(
+ string $loyaltyProgramId,
+ ?int $limit = 100,
+ ?int $offset = 0,
+ ?string $rewardState = 'all',
+ ?string $rewardVersion = 'draft',
+ string $contentType = self::contentTypes['getOffersList'][0]
+ ): \Brevo\Client\Models\OffersListResponse
+ {
+ list($response) = $this->getOffersListWithHttpInfo($loyaltyProgramId, $limit, $offset, $rewardState, $rewardVersion, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation getOffersListWithHttpInfo
+ *
+ * Get Reward list
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param int|null $limit Number of documents per page (optional, default to 100)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $rewardState State of the reward (optional, default to 'all')
+ * @param string|null $rewardVersion Select 'active' to retrieve list of all rewards which are live for clients. Select draft to retrieve list of all non deleted rewards. (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOffersList'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\OffersListResponse|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ContactIdInvalidResponse, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function getOffersListWithHttpInfo(
+ string $loyaltyProgramId,
+ ?int $limit = 100,
+ ?int $offset = 0,
+ ?string $rewardState = 'all',
+ ?string $rewardVersion = 'draft',
+ string $contentType = self::contentTypes['getOffersList'][0]
+ ): array
+ {
+ $request = $this->getOffersListRequest($loyaltyProgramId, $limit, $offset, $rewardState, $rewardVersion, $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 (in_array('\Brevo\Client\Models\OffersListResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\OffersListResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\OffersListResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if (in_array('\Brevo\Client\Models\ContactIdInvalidResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ContactIdInvalidResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ContactIdInvalidResponse', []),
+ $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 = '\Brevo\Client\Models\OffersListResponse';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\OffersListResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ContactIdInvalidResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation getOffersListAsync
+ *
+ * Get Reward list
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param int|null $limit Number of documents per page (optional, default to 100)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $rewardState State of the reward (optional, default to 'all')
+ * @param string|null $rewardVersion Select 'active' to retrieve list of all rewards which are live for clients. Select draft to retrieve list of all non deleted rewards. (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOffersList'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getOffersListAsync(
+ string $loyaltyProgramId,
+ ?int $limit = 100,
+ ?int $offset = 0,
+ ?string $rewardState = 'all',
+ ?string $rewardVersion = 'draft',
+ string $contentType = self::contentTypes['getOffersList'][0]
+ ): PromiseInterface
+ {
+ return $this->getOffersListAsyncWithHttpInfo($loyaltyProgramId, $limit, $offset, $rewardState, $rewardVersion, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation getOffersListAsyncWithHttpInfo
+ *
+ * Get Reward list
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param int|null $limit Number of documents per page (optional, default to 100)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $rewardState State of the reward (optional, default to 'all')
+ * @param string|null $rewardVersion Select 'active' to retrieve list of all rewards which are live for clients. Select draft to retrieve list of all non deleted rewards. (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOffersList'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getOffersListAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $limit = 100,
+ $offset = 0,
+ $rewardState = 'all',
+ $rewardVersion = 'draft',
+ string $contentType = self::contentTypes['getOffersList'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\OffersListResponse';
+ $request = $this->getOffersListRequest($loyaltyProgramId, $limit, $offset, $rewardState, $rewardVersion, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'getOffersList'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param int|null $limit Number of documents per page (optional, default to 100)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $rewardState State of the reward (optional, default to 'all')
+ * @param string|null $rewardVersion Select 'active' to retrieve list of all rewards which are live for clients. Select draft to retrieve list of all non deleted rewards. (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOffersList'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function getOffersListRequest(
+ $loyaltyProgramId,
+ $limit = 100,
+ $offset = 0,
+ $rewardState = 'all',
+ $rewardVersion = 'draft',
+ string $contentType = self::contentTypes['getOffersList'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling getOffersList'
+ );
+ }
+
+
+
+
+
+
+ $resourcePath = '/loyalty/offer/programs/{loyaltyProgramId}/offers';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // 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(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $rewardState,
+ 'rewardState', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $rewardVersion,
+ 'rewardVersion', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 redeemReward
+ *
+ * Redeem reward
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\RedeemRewardPayload $redeemRewardPayload Redeemed reward information (Either contactId or loyaltySubscriptionId must be present.) (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['redeemReward'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\RewardRedeemResponse|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\SubscriptionNotFoundErrorResponse|\Brevo\Client\Models\RedeemedRewardFailedConditionErrorResponse|\Brevo\Client\Models\ContactIdInvalidResponse
+ */
+ public function redeemReward(
+ string $loyaltyProgramId,
+ \Brevo\Client\Models\RedeemRewardPayload $redeemRewardPayload,
+ string $contentType = self::contentTypes['redeemReward'][0]
+ ): \Brevo\Client\Models\RewardRedeemResponse
+ {
+ list($response) = $this->redeemRewardWithHttpInfo($loyaltyProgramId, $redeemRewardPayload, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation redeemRewardWithHttpInfo
+ *
+ * Redeem reward
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\RedeemRewardPayload $redeemRewardPayload Redeemed reward information (Either contactId or loyaltySubscriptionId must be present.) (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['redeemReward'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\RewardRedeemResponse|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\SubscriptionNotFoundErrorResponse|\Brevo\Client\Models\RedeemedRewardFailedConditionErrorResponse|\Brevo\Client\Models\ContactIdInvalidResponse, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function redeemRewardWithHttpInfo(
+ string $loyaltyProgramId,
+ \Brevo\Client\Models\RedeemRewardPayload $redeemRewardPayload,
+ string $contentType = self::contentTypes['redeemReward'][0]
+ ): array
+ {
+ $request = $this->redeemRewardRequest($loyaltyProgramId, $redeemRewardPayload, $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 (in_array('\Brevo\Client\Models\RewardRedeemResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\RewardRedeemResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\RewardRedeemResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\SubscriptionNotFoundErrorResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\SubscriptionNotFoundErrorResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\SubscriptionNotFoundErrorResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 412:
+ if (in_array('\Brevo\Client\Models\RedeemedRewardFailedConditionErrorResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\RedeemedRewardFailedConditionErrorResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\RedeemedRewardFailedConditionErrorResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if (in_array('\Brevo\Client\Models\ContactIdInvalidResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ContactIdInvalidResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ContactIdInvalidResponse', []),
+ $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 = '\Brevo\Client\Models\RewardRedeemResponse';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\RewardRedeemResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\SubscriptionNotFoundErrorResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 412:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\RedeemedRewardFailedConditionErrorResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ContactIdInvalidResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation redeemRewardAsync
+ *
+ * Redeem reward
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\RedeemRewardPayload $redeemRewardPayload Redeemed reward information (Either contactId or loyaltySubscriptionId must be present.) (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['redeemReward'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function redeemRewardAsync(
+ string $loyaltyProgramId,
+ \Brevo\Client\Models\RedeemRewardPayload $redeemRewardPayload,
+ string $contentType = self::contentTypes['redeemReward'][0]
+ ): PromiseInterface
+ {
+ return $this->redeemRewardAsyncWithHttpInfo($loyaltyProgramId, $redeemRewardPayload, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation redeemRewardAsyncWithHttpInfo
+ *
+ * Redeem reward
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\RedeemRewardPayload $redeemRewardPayload Redeemed reward information (Either contactId or loyaltySubscriptionId must be present.) (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['redeemReward'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function redeemRewardAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $redeemRewardPayload,
+ string $contentType = self::contentTypes['redeemReward'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\RewardRedeemResponse';
+ $request = $this->redeemRewardRequest($loyaltyProgramId, $redeemRewardPayload, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'redeemReward'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\RedeemRewardPayload $redeemRewardPayload Redeemed reward information (Either contactId or loyaltySubscriptionId must be present.) (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['redeemReward'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function redeemRewardRequest(
+ $loyaltyProgramId,
+ $redeemRewardPayload,
+ string $contentType = self::contentTypes['redeemReward'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling redeemReward'
+ );
+ }
+
+ // verify the required parameter 'redeemRewardPayload' is set
+ if ($redeemRewardPayload === null || (is_array($redeemRewardPayload) && count($redeemRewardPayload) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $redeemRewardPayload when calling redeemReward'
+ );
+ }
+
+
+ $resourcePath = '/loyalty/offer/programs/{loyaltyProgramId}/rewards/redeem';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($redeemRewardPayload)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($redeemRewardPayload));
+ } else {
+ $httpBody = $redeemRewardPayload;
+ }
+ } 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 revokeReward
+ *
+ * Revoke reward
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $attributedRewardId Attributed Reward Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['revokeReward'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return void
+ */
+ public function revokeReward(
+ string $loyaltyProgramId,
+ string $attributedRewardId,
+ string $contentType = self::contentTypes['revokeReward'][0]
+ ): void
+ {
+ $this->revokeRewardWithHttpInfo($loyaltyProgramId, $attributedRewardId, $contentType);
+ }
+
+ /**
+ * Operation revokeRewardWithHttpInfo
+ *
+ * Revoke reward
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $attributedRewardId Attributed Reward Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['revokeReward'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function revokeRewardWithHttpInfo(
+ string $loyaltyProgramId,
+ string $attributedRewardId,
+ string $contentType = self::contentTypes['revokeReward'][0]
+ ): array
+ {
+ $request = $this->revokeRewardRequest($loyaltyProgramId, $attributedRewardId, $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();
+
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation revokeRewardAsync
+ *
+ * Revoke reward
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $attributedRewardId Attributed Reward Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['revokeReward'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function revokeRewardAsync(
+ string $loyaltyProgramId,
+ string $attributedRewardId,
+ string $contentType = self::contentTypes['revokeReward'][0]
+ ): PromiseInterface
+ {
+ return $this->revokeRewardAsyncWithHttpInfo($loyaltyProgramId, $attributedRewardId, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation revokeRewardAsyncWithHttpInfo
+ *
+ * Revoke reward
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $attributedRewardId Attributed Reward Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['revokeReward'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function revokeRewardAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $attributedRewardId,
+ string $contentType = self::contentTypes['revokeReward'][0]
+ ): PromiseInterface
+ {
+ $returnType = '';
+ $request = $this->revokeRewardRequest($loyaltyProgramId, $attributedRewardId, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $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 'revokeReward'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $attributedRewardId Attributed Reward Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['revokeReward'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function revokeRewardRequest(
+ $loyaltyProgramId,
+ $attributedRewardId,
+ string $contentType = self::contentTypes['revokeReward'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling revokeReward'
+ );
+ }
+
+ // verify the required parameter 'attributedRewardId' is set
+ if ($attributedRewardId === null || (is_array($attributedRewardId) && count($attributedRewardId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $attributedRewardId when calling revokeReward'
+ );
+ }
+
+
+ $resourcePath = '/loyalty/offer/programs/{loyaltyProgramId}/rewards/revoke';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $attributedRewardId,
+ 'attributedRewardId', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ true // required
+ ) ?? []);
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 validateReward
+ *
+ * Validates a voucher
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\ValidateRewardPayload $validateRewardPayload Validate reward information (One of contactId and loyaltySubscriptionId must be present, or one of code and attributedRewardId must be present.) (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['validateReward'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\ValidatedRewardResponse|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\SubscriptionNotFoundErrorResponse|\Brevo\Client\Models\ContactIdInvalidResponse|\Brevo\Client\Models\ContactIdInvalidResponse
+ */
+ public function validateReward(
+ string $loyaltyProgramId,
+ \Brevo\Client\Models\ValidateRewardPayload $validateRewardPayload,
+ string $contentType = self::contentTypes['validateReward'][0]
+ ): \Brevo\Client\Models\ValidatedRewardResponse
+ {
+ list($response) = $this->validateRewardWithHttpInfo($loyaltyProgramId, $validateRewardPayload, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation validateRewardWithHttpInfo
+ *
+ * Validates a voucher
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\ValidateRewardPayload $validateRewardPayload Validate reward information (One of contactId and loyaltySubscriptionId must be present, or one of code and attributedRewardId must be present.) (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['validateReward'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\ValidatedRewardResponse|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\SubscriptionNotFoundErrorResponse|\Brevo\Client\Models\ContactIdInvalidResponse|\Brevo\Client\Models\ContactIdInvalidResponse, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function validateRewardWithHttpInfo(
+ string $loyaltyProgramId,
+ \Brevo\Client\Models\ValidateRewardPayload $validateRewardPayload,
+ string $contentType = self::contentTypes['validateReward'][0]
+ ): array
+ {
+ $request = $this->validateRewardRequest($loyaltyProgramId, $validateRewardPayload, $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 (in_array('\Brevo\Client\Models\ValidatedRewardResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ValidatedRewardResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ValidatedRewardResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\SubscriptionNotFoundErrorResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\SubscriptionNotFoundErrorResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\SubscriptionNotFoundErrorResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if (in_array('\Brevo\Client\Models\ContactIdInvalidResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ContactIdInvalidResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ContactIdInvalidResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 424:
+ if (in_array('\Brevo\Client\Models\ContactIdInvalidResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ContactIdInvalidResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ContactIdInvalidResponse', []),
+ $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 = '\Brevo\Client\Models\ValidatedRewardResponse';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\ValidatedRewardResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\SubscriptionNotFoundErrorResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ContactIdInvalidResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 424:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ContactIdInvalidResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation validateRewardAsync
+ *
+ * Validates a voucher
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\ValidateRewardPayload $validateRewardPayload Validate reward information (One of contactId and loyaltySubscriptionId must be present, or one of code and attributedRewardId must be present.) (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['validateReward'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function validateRewardAsync(
+ string $loyaltyProgramId,
+ \Brevo\Client\Models\ValidateRewardPayload $validateRewardPayload,
+ string $contentType = self::contentTypes['validateReward'][0]
+ ): PromiseInterface
+ {
+ return $this->validateRewardAsyncWithHttpInfo($loyaltyProgramId, $validateRewardPayload, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation validateRewardAsyncWithHttpInfo
+ *
+ * Validates a voucher
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\ValidateRewardPayload $validateRewardPayload Validate reward information (One of contactId and loyaltySubscriptionId must be present, or one of code and attributedRewardId must be present.) (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['validateReward'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function validateRewardAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $validateRewardPayload,
+ string $contentType = self::contentTypes['validateReward'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\ValidatedRewardResponse';
+ $request = $this->validateRewardRequest($loyaltyProgramId, $validateRewardPayload, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'validateReward'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\ValidateRewardPayload $validateRewardPayload Validate reward information (One of contactId and loyaltySubscriptionId must be present, or one of code and attributedRewardId must be present.) (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['validateReward'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function validateRewardRequest(
+ $loyaltyProgramId,
+ $validateRewardPayload,
+ string $contentType = self::contentTypes['validateReward'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling validateReward'
+ );
+ }
+
+ // verify the required parameter 'validateRewardPayload' is set
+ if ($validateRewardPayload === null || (is_array($validateRewardPayload) && count($validateRewardPayload) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $validateRewardPayload when calling validateReward'
+ );
+ }
+
+
+ $resourcePath = '/loyalty/offer/programs/{loyaltyProgramId}/rewards/validate';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($validateRewardPayload)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($validateRewardPayload));
+ } else {
+ $httpBody = $validateRewardPayload;
+ }
+ } 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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
+ );
+ }
+
+ /**
+ * Create http client option
+ *
+ * @throws \RuntimeException on file opening failure
+ * @return array of http client options
+ */
+ protected function createHttpClientOption(): array
+ {
+ $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/SMSCampaignsApi.php b/lib/Api/SMSCampaignsApi.php
index f01c678..901346e 100644
--- a/lib/Api/SMSCampaignsApi.php
+++ b/lib/Api/SMSCampaignsApi.php
@@ -1,39 +1,41 @@
[
+ 'application/json',
+ ],
+ 'deleteSmsCampaign' => [
+ 'application/json',
+ ],
+ 'getSmsCampaign' => [
+ 'application/json',
+ ],
+ 'getSmsCampaigns' => [
+ 'application/json',
+ ],
+ 'requestSmsRecipientExport' => [
+ 'application/json',
+ ],
+ 'sendSmsCampaignNow' => [
+ 'application/json',
+ ],
+ 'sendSmsReport' => [
+ 'application/json',
+ ],
+ 'sendTestSms' => [
+ 'application/json',
+ ],
+ 'updateSmsCampaign' => [
+ 'application/json',
+ ],
+ 'updateSmsCampaignStatus' => [
+ 'application/json',
+ ],
+ ];
+
+ /**
+ * @param ClientInterface|null $client
+ * @param Configuration|null $config
+ * @param HeaderSelector|null $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
+ HeaderSelector $selector = null,
+ int $hostIndex = 0
) {
$this->client = $client ?: new Client();
- $this->config = $config ?: new Configuration();
+ $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(int $hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex(): int
+ {
+ return $this->hostIndex;
}
/**
* @return Configuration
*/
- public function getConfig()
+ public function getConfig(): Configuration
{
return $this->config;
}
@@ -92,15 +155,19 @@ public function getConfig()
*
* Creates an SMS campaign
*
- * @param \Brevo\Client\Model\CreateSmsCampaign $createSmsCampaign Values to create an SMS Campaign (required)
+ * @param \Brevo\Client\Models\CreateSmsCampaign $createSmsCampaign Values to create an SMS Campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSmsCampaign'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\CreateModel
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CreateModel|\Brevo\Client\Models\ErrorModel
*/
- public function createSmsCampaign($createSmsCampaign)
+ public function createSmsCampaign(
+ \Brevo\Client\Models\CreateSmsCampaign $createSmsCampaign,
+ string $contentType = self::contentTypes['createSmsCampaign'][0]
+ ): \Brevo\Client\Models\CreateModel
{
- list($response) = $this->createSmsCampaignWithHttpInfo($createSmsCampaign);
+ list($response) = $this->createSmsCampaignWithHttpInfo($createSmsCampaign, $contentType);
return $response;
}
@@ -109,16 +176,19 @@ public function createSmsCampaign($createSmsCampaign)
*
* Creates an SMS campaign
*
- * @param \Brevo\Client\Model\CreateSmsCampaign $createSmsCampaign Values to create an SMS Campaign (required)
+ * @param \Brevo\Client\Models\CreateSmsCampaign $createSmsCampaign Values to create an SMS Campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSmsCampaign'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\CreateModel, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CreateModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function createSmsCampaignWithHttpInfo($createSmsCampaign)
+ public function createSmsCampaignWithHttpInfo(
+ \Brevo\Client\Models\CreateSmsCampaign $createSmsCampaign,
+ string $contentType = self::contentTypes['createSmsCampaign'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\CreateModel';
- $request = $this->createSmsCampaignRequest($createSmsCampaign);
+ $request = $this->createSmsCampaignRequest($createSmsCampaign, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -127,34 +197,111 @@ public function createSmsCampaignWithHttpInfo($createSmsCampaign)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 201:
+ if (in_array('\Brevo\Client\Models\CreateModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CreateModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CreateModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CreateModel';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -169,7 +316,7 @@ public function createSmsCampaignWithHttpInfo($createSmsCampaign)
case 201:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\CreateModel',
+ '\Brevo\Client\Models\CreateModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -177,7 +324,7 @@ public function createSmsCampaignWithHttpInfo($createSmsCampaign)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -192,14 +339,18 @@ public function createSmsCampaignWithHttpInfo($createSmsCampaign)
*
* Creates an SMS campaign
*
- * @param \Brevo\Client\Model\CreateSmsCampaign $createSmsCampaign Values to create an SMS Campaign (required)
+ * @param \Brevo\Client\Models\CreateSmsCampaign $createSmsCampaign Values to create an SMS Campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSmsCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createSmsCampaignAsync($createSmsCampaign)
+ public function createSmsCampaignAsync(
+ \Brevo\Client\Models\CreateSmsCampaign $createSmsCampaign,
+ string $contentType = self::contentTypes['createSmsCampaign'][0]
+ ): PromiseInterface
{
- return $this->createSmsCampaignAsyncWithHttpInfo($createSmsCampaign)
+ return $this->createSmsCampaignAsyncWithHttpInfo($createSmsCampaign, $contentType)
->then(
function ($response) {
return $response[0];
@@ -212,25 +363,29 @@ function ($response) {
*
* Creates an SMS campaign
*
- * @param \Brevo\Client\Model\CreateSmsCampaign $createSmsCampaign Values to create an SMS Campaign (required)
+ * @param \Brevo\Client\Models\CreateSmsCampaign $createSmsCampaign Values to create an SMS Campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSmsCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createSmsCampaignAsyncWithHttpInfo($createSmsCampaign)
+ public function createSmsCampaignAsyncWithHttpInfo(
+ $createSmsCampaign,
+ string $contentType = self::contentTypes['createSmsCampaign'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\CreateModel';
- $request = $this->createSmsCampaignRequest($createSmsCampaign);
+ $returnType = '\Brevo\Client\Models\CreateModel';
+ $request = $this->createSmsCampaignRequest($createSmsCampaign, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -253,7 +408,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -262,20 +417,26 @@ function ($exception) {
/**
* Create request for operation 'createSmsCampaign'
*
- * @param \Brevo\Client\Model\CreateSmsCampaign $createSmsCampaign Values to create an SMS Campaign (required)
+ * @param \Brevo\Client\Models\CreateSmsCampaign $createSmsCampaign Values to create an SMS Campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSmsCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function createSmsCampaignRequest($createSmsCampaign)
+ public function createSmsCampaignRequest(
+ $createSmsCampaign,
+ string $contentType = self::contentTypes['createSmsCampaign'][0]
+ ): Request
{
+
// verify the required parameter 'createSmsCampaign' is set
if ($createSmsCampaign === null || (is_array($createSmsCampaign) && count($createSmsCampaign) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $createSmsCampaign when calling createSmsCampaign'
);
}
+
$resourcePath = '/smsCampaigns';
$formParams = [];
$queryParams = [];
@@ -285,56 +446,43 @@ protected function createSmsCampaignRequest($createSmsCampaign)
- // body params
- $_tempBody = null;
- if (isset($createSmsCampaign)) {
- $_tempBody = $createSmsCampaign;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($createSmsCampaign)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createSmsCampaign));
+ } else {
+ $httpBody = $createSmsCampaign;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -360,10 +508,11 @@ protected function createSmsCampaignRequest($createSmsCampaign)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -375,14 +524,18 @@ protected function createSmsCampaignRequest($createSmsCampaign)
* Delete an SMS campaign
*
* @param int $campaignId id of the SMS campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSmsCampaign'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function deleteSmsCampaign($campaignId)
+ public function deleteSmsCampaign(
+ int $campaignId,
+ string $contentType = self::contentTypes['deleteSmsCampaign'][0]
+ ): void
{
- $this->deleteSmsCampaignWithHttpInfo($campaignId);
+ $this->deleteSmsCampaignWithHttpInfo($campaignId, $contentType);
}
/**
@@ -391,15 +544,18 @@ public function deleteSmsCampaign($campaignId)
* Delete an SMS campaign
*
* @param int $campaignId id of the SMS campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSmsCampaign'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function deleteSmsCampaignWithHttpInfo($campaignId)
+ public function deleteSmsCampaignWithHttpInfo(
+ int $campaignId,
+ string $contentType = self::contentTypes['deleteSmsCampaign'][0]
+ ): array
{
- $returnType = '';
- $request = $this->deleteSmsCampaignRequest($campaignId);
+ $request = $this->deleteSmsCampaignRequest($campaignId, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -408,43 +564,38 @@ public function deleteSmsCampaignWithHttpInfo($campaignId)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
} catch (ApiException $e) {
switch ($e->getCode()) {
- case 404:
+ case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 400:
+ case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -460,13 +611,17 @@ public function deleteSmsCampaignWithHttpInfo($campaignId)
* Delete an SMS campaign
*
* @param int $campaignId id of the SMS campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSmsCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteSmsCampaignAsync($campaignId)
+ public function deleteSmsCampaignAsync(
+ int $campaignId,
+ string $contentType = self::contentTypes['deleteSmsCampaign'][0]
+ ): PromiseInterface
{
- return $this->deleteSmsCampaignAsyncWithHttpInfo($campaignId)
+ return $this->deleteSmsCampaignAsyncWithHttpInfo($campaignId, $contentType)
->then(
function ($response) {
return $response[0];
@@ -480,14 +635,19 @@ function ($response) {
* Delete an SMS campaign
*
* @param int $campaignId id of the SMS campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSmsCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteSmsCampaignAsyncWithHttpInfo($campaignId)
+ public function deleteSmsCampaignAsyncWithHttpInfo(
+ $campaignId,
+ string $contentType = self::contentTypes['deleteSmsCampaign'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->deleteSmsCampaignRequest($campaignId);
+ $request = $this->deleteSmsCampaignRequest($campaignId, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -506,7 +666,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -516,19 +676,25 @@ function ($exception) {
* Create request for operation 'deleteSmsCampaign'
*
* @param int $campaignId id of the SMS campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSmsCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function deleteSmsCampaignRequest($campaignId)
+ public function deleteSmsCampaignRequest(
+ $campaignId,
+ string $contentType = self::contentTypes['deleteSmsCampaign'][0]
+ ): Request
{
+
// verify the required parameter 'campaignId' is set
if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $campaignId when calling deleteSmsCampaign'
);
}
+
$resourcePath = '/smsCampaigns/{campaignId}';
$formParams = [];
$queryParams = [];
@@ -537,6 +703,7 @@ protected function deleteSmsCampaignRequest($campaignId)
$multipart = false;
+
// path params
if ($campaignId !== null) {
$resourcePath = str_replace(
@@ -546,53 +713,35 @@ protected function deleteSmsCampaignRequest($campaignId)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -618,10 +767,11 @@ protected function deleteSmsCampaignRequest($campaignId)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -633,14 +783,18 @@ protected function deleteSmsCampaignRequest($campaignId)
* Get an SMS campaign
*
* @param int $campaignId id of the SMS campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSmsCampaign'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetSmsCampaign
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetSmsCampaign|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function getSmsCampaign($campaignId)
+ public function getSmsCampaign(
+ int $campaignId,
+ string $contentType = self::contentTypes['getSmsCampaign'][0]
+ ): \Brevo\Client\Models\GetSmsCampaign
{
- list($response) = $this->getSmsCampaignWithHttpInfo($campaignId);
+ list($response) = $this->getSmsCampaignWithHttpInfo($campaignId, $contentType);
return $response;
}
@@ -650,15 +804,18 @@ public function getSmsCampaign($campaignId)
* Get an SMS campaign
*
* @param int $campaignId id of the SMS campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSmsCampaign'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetSmsCampaign, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetSmsCampaign|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getSmsCampaignWithHttpInfo($campaignId)
+ public function getSmsCampaignWithHttpInfo(
+ int $campaignId,
+ string $contentType = self::contentTypes['getSmsCampaign'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetSmsCampaign';
- $request = $this->getSmsCampaignRequest($campaignId);
+ $request = $this->getSmsCampaignRequest($campaignId, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -667,34 +824,138 @@ public function getSmsCampaignWithHttpInfo($campaignId)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetSmsCampaign', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetSmsCampaign' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetSmsCampaign', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetSmsCampaign';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -709,7 +970,7 @@ public function getSmsCampaignWithHttpInfo($campaignId)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetSmsCampaign',
+ '\Brevo\Client\Models\GetSmsCampaign',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -717,7 +978,7 @@ public function getSmsCampaignWithHttpInfo($campaignId)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -725,7 +986,7 @@ public function getSmsCampaignWithHttpInfo($campaignId)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -741,13 +1002,17 @@ public function getSmsCampaignWithHttpInfo($campaignId)
* Get an SMS campaign
*
* @param int $campaignId id of the SMS campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSmsCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getSmsCampaignAsync($campaignId)
+ public function getSmsCampaignAsync(
+ int $campaignId,
+ string $contentType = self::contentTypes['getSmsCampaign'][0]
+ ): PromiseInterface
{
- return $this->getSmsCampaignAsyncWithHttpInfo($campaignId)
+ return $this->getSmsCampaignAsyncWithHttpInfo($campaignId, $contentType)
->then(
function ($response) {
return $response[0];
@@ -761,24 +1026,28 @@ function ($response) {
* Get an SMS campaign
*
* @param int $campaignId id of the SMS campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSmsCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getSmsCampaignAsyncWithHttpInfo($campaignId)
+ public function getSmsCampaignAsyncWithHttpInfo(
+ $campaignId,
+ string $contentType = self::contentTypes['getSmsCampaign'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetSmsCampaign';
- $request = $this->getSmsCampaignRequest($campaignId);
+ $returnType = '\Brevo\Client\Models\GetSmsCampaign';
+ $request = $this->getSmsCampaignRequest($campaignId, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -801,7 +1070,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -811,19 +1080,25 @@ function ($exception) {
* Create request for operation 'getSmsCampaign'
*
* @param int $campaignId id of the SMS campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSmsCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getSmsCampaignRequest($campaignId)
+ public function getSmsCampaignRequest(
+ $campaignId,
+ string $contentType = self::contentTypes['getSmsCampaign'][0]
+ ): Request
{
+
// verify the required parameter 'campaignId' is set
if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $campaignId when calling getSmsCampaign'
);
}
+
$resourcePath = '/smsCampaigns/{campaignId}';
$formParams = [];
$queryParams = [];
@@ -832,6 +1107,7 @@ protected function getSmsCampaignRequest($campaignId)
$multipart = false;
+
// path params
if ($campaignId !== null) {
$resourcePath = str_replace(
@@ -841,53 +1117,35 @@ protected function getSmsCampaignRequest($campaignId)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -913,10 +1171,11 @@ protected function getSmsCampaignRequest($campaignId)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -927,20 +1186,29 @@ protected function getSmsCampaignRequest($campaignId)
*
* Returns the information for all your created SMS campaigns
*
- * @param string $status Status of campaign. (optional)
- * @param string $startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
- * @param string $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
- * @param int $limit Number limitation for the result returned (optional, default to 500)
- * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetSmsCampaigns
+ * @param string|null $status Status of campaign. (optional)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
+ * @param int|null $limit Number limitation for the result returned (optional, default to 500)
+ * @param int|null $offset Beginning point in the list to retrieve from. (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSmsCampaigns'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetSmsCampaigns|\Brevo\Client\Models\ErrorModel
*/
- public function getSmsCampaigns($status = null, $startDate = null, $endDate = null, $limit = '500', $offset = '0', $sort = 'desc')
+ public function getSmsCampaigns(
+ ?string $status = null,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $limit = 500,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getSmsCampaigns'][0]
+ ): \Brevo\Client\Models\GetSmsCampaigns
{
- list($response) = $this->getSmsCampaignsWithHttpInfo($status, $startDate, $endDate, $limit, $offset, $sort);
+ list($response) = $this->getSmsCampaignsWithHttpInfo($status, $startDate, $endDate, $limit, $offset, $sort, $contentType);
return $response;
}
@@ -949,21 +1217,29 @@ public function getSmsCampaigns($status = null, $startDate = null, $endDate = nu
*
* Returns the information for all your created SMS campaigns
*
- * @param string $status Status of campaign. (optional)
- * @param string $startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
- * @param string $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
- * @param int $limit Number limitation for the result returned (optional, default to 500)
- * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetSmsCampaigns, HTTP status code, HTTP response headers (array of strings)
+ * @param string|null $status Status of campaign. (optional)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
+ * @param int|null $limit Number limitation for the result returned (optional, default to 500)
+ * @param int|null $offset Beginning point in the list to retrieve from. (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSmsCampaigns'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetSmsCampaigns|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getSmsCampaignsWithHttpInfo($status = null, $startDate = null, $endDate = null, $limit = '500', $offset = '0', $sort = 'desc')
+ public function getSmsCampaignsWithHttpInfo(
+ ?string $status = null,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $limit = 500,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getSmsCampaigns'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetSmsCampaigns';
- $request = $this->getSmsCampaignsRequest($status, $startDate, $endDate, $limit, $offset, $sort);
+ $request = $this->getSmsCampaignsRequest($status, $startDate, $endDate, $limit, $offset, $sort, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -972,34 +1248,111 @@ public function getSmsCampaignsWithHttpInfo($status = null, $startDate = null, $
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetSmsCampaigns', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetSmsCampaigns' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetSmsCampaigns', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetSmsCampaigns';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1014,7 +1367,7 @@ public function getSmsCampaignsWithHttpInfo($status = null, $startDate = null, $
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetSmsCampaigns',
+ '\Brevo\Client\Models\GetSmsCampaigns',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1022,7 +1375,7 @@ public function getSmsCampaignsWithHttpInfo($status = null, $startDate = null, $
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1037,19 +1390,28 @@ public function getSmsCampaignsWithHttpInfo($status = null, $startDate = null, $
*
* Returns the information for all your created SMS campaigns
*
- * @param string $status Status of campaign. (optional)
- * @param string $startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
- * @param string $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
- * @param int $limit Number limitation for the result returned (optional, default to 500)
- * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param string|null $status Status of campaign. (optional)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
+ * @param int|null $limit Number limitation for the result returned (optional, default to 500)
+ * @param int|null $offset Beginning point in the list to retrieve from. (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSmsCampaigns'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getSmsCampaignsAsync($status = null, $startDate = null, $endDate = null, $limit = '500', $offset = '0', $sort = 'desc')
+ public function getSmsCampaignsAsync(
+ ?string $status = null,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $limit = 500,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getSmsCampaigns'][0]
+ ): PromiseInterface
{
- return $this->getSmsCampaignsAsyncWithHttpInfo($status, $startDate, $endDate, $limit, $offset, $sort)
+ return $this->getSmsCampaignsAsyncWithHttpInfo($status, $startDate, $endDate, $limit, $offset, $sort, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1062,30 +1424,39 @@ function ($response) {
*
* Returns the information for all your created SMS campaigns
*
- * @param string $status Status of campaign. (optional)
- * @param string $startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
- * @param string $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
- * @param int $limit Number limitation for the result returned (optional, default to 500)
- * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @param string|null $status Status of campaign. (optional)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
+ * @param int|null $limit Number limitation for the result returned (optional, default to 500)
+ * @param int|null $offset Beginning point in the list to retrieve from. (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSmsCampaigns'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getSmsCampaignsAsyncWithHttpInfo($status = null, $startDate = null, $endDate = null, $limit = '500', $offset = '0', $sort = 'desc')
+ public function getSmsCampaignsAsyncWithHttpInfo(
+ $status = null,
+ $startDate = null,
+ $endDate = null,
+ $limit = 500,
+ $offset = 0,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getSmsCampaigns'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetSmsCampaigns';
- $request = $this->getSmsCampaignsRequest($status, $startDate, $endDate, $limit, $offset, $sort);
+ $returnType = '\Brevo\Client\Models\GetSmsCampaigns';
+ $request = $this->getSmsCampaignsRequest($status, $startDate, $endDate, $limit, $offset, $sort, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1108,7 +1479,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1117,24 +1488,39 @@ function ($exception) {
/**
* Create request for operation 'getSmsCampaigns'
*
- * @param string $status Status of campaign. (optional)
- * @param string $startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
- * @param string $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
- * @param int $limit Number limitation for the result returned (optional, default to 500)
- * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param string|null $status Status of campaign. (optional)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
+ * @param int|null $limit Number limitation for the result returned (optional, default to 500)
+ * @param int|null $offset Beginning point in the list to retrieve from. (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSmsCampaigns'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getSmsCampaignsRequest($status = null, $startDate = null, $endDate = null, $limit = '500', $offset = '0', $sort = 'desc')
+ public function getSmsCampaignsRequest(
+ $status = null,
+ $startDate = null,
+ $endDate = null,
+ $limit = 500,
+ $offset = 0,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getSmsCampaigns'][0]
+ ): Request
{
+
+
+
+
if ($limit !== null && $limit > 1000) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling SMSCampaignsApi.getSmsCampaigns, must be smaller than or equal to 1000.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling SMSCampaignsApi.getSmsCampaigns, must be smaller than or equal to 1000.');
}
if ($limit !== null && $limit < 0) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling SMSCampaignsApi.getSmsCampaigns, must be bigger than or equal to 0.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling SMSCampaignsApi.getSmsCampaigns, must be bigger than or equal to 0.');
}
+
+
$resourcePath = '/smsCampaigns';
@@ -1145,78 +1531,91 @@ protected function getSmsCampaignsRequest($status = null, $startDate = null, $en
$multipart = false;
// query params
- if ($status !== null) {
- $queryParams['status'] = ObjectSerializer::toQueryValue($status);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $status,
+ 'status', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($startDate !== null) {
- $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $startDate,
+ 'startDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($endDate !== null) {
- $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $endDate,
+ 'endDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1242,10 +1641,11 @@ protected function getSmsCampaignsRequest($status = null, $startDate = null, $en
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1254,37 +1654,46 @@ protected function getSmsCampaignsRequest($status = null, $startDate = null, $en
/**
* Operation requestSmsRecipientExport
*
- * Export an SMS campaign's recipients
+ * Export an SMS campaign's recipients
*
* @param int $campaignId id of the campaign (required)
- * @param \Brevo\Client\Model\RequestSmsRecipientExport $recipientExport Values to send for a recipient export request (optional)
+ * @param \Brevo\Client\Models\RequestSmsRecipientExport|null $recipientExport Values to send for a recipient export request (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requestSmsRecipientExport'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\CreatedProcessId
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CreatedProcessId|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function requestSmsRecipientExport($campaignId, $recipientExport = null)
+ public function requestSmsRecipientExport(
+ int $campaignId,
+ ?\Brevo\Client\Models\RequestSmsRecipientExport $recipientExport = null,
+ string $contentType = self::contentTypes['requestSmsRecipientExport'][0]
+ ): \Brevo\Client\Models\CreatedProcessId
{
- list($response) = $this->requestSmsRecipientExportWithHttpInfo($campaignId, $recipientExport);
+ list($response) = $this->requestSmsRecipientExportWithHttpInfo($campaignId, $recipientExport, $contentType);
return $response;
}
/**
* Operation requestSmsRecipientExportWithHttpInfo
*
- * Export an SMS campaign's recipients
+ * Export an SMS campaign's recipients
*
* @param int $campaignId id of the campaign (required)
- * @param \Brevo\Client\Model\RequestSmsRecipientExport $recipientExport Values to send for a recipient export request (optional)
+ * @param \Brevo\Client\Models\RequestSmsRecipientExport|null $recipientExport Values to send for a recipient export request (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requestSmsRecipientExport'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\CreatedProcessId, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CreatedProcessId|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function requestSmsRecipientExportWithHttpInfo($campaignId, $recipientExport = null)
+ public function requestSmsRecipientExportWithHttpInfo(
+ int $campaignId,
+ ?\Brevo\Client\Models\RequestSmsRecipientExport $recipientExport = null,
+ string $contentType = self::contentTypes['requestSmsRecipientExport'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\CreatedProcessId';
- $request = $this->requestSmsRecipientExportRequest($campaignId, $recipientExport);
+ $request = $this->requestSmsRecipientExportRequest($campaignId, $recipientExport, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1293,34 +1702,138 @@ public function requestSmsRecipientExportWithHttpInfo($campaignId, $recipientExp
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 202:
+ if (in_array('\Brevo\Client\Models\CreatedProcessId', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CreatedProcessId' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CreatedProcessId', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CreatedProcessId';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1335,7 +1848,7 @@ public function requestSmsRecipientExportWithHttpInfo($campaignId, $recipientExp
case 202:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\CreatedProcessId',
+ '\Brevo\Client\Models\CreatedProcessId',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1343,7 +1856,7 @@ public function requestSmsRecipientExportWithHttpInfo($campaignId, $recipientExp
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1351,7 +1864,7 @@ public function requestSmsRecipientExportWithHttpInfo($campaignId, $recipientExp
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1364,17 +1877,22 @@ public function requestSmsRecipientExportWithHttpInfo($campaignId, $recipientExp
/**
* Operation requestSmsRecipientExportAsync
*
- * Export an SMS campaign's recipients
+ * Export an SMS campaign's recipients
*
* @param int $campaignId id of the campaign (required)
- * @param \Brevo\Client\Model\RequestSmsRecipientExport $recipientExport Values to send for a recipient export request (optional)
+ * @param \Brevo\Client\Models\RequestSmsRecipientExport|null $recipientExport Values to send for a recipient export request (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requestSmsRecipientExport'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function requestSmsRecipientExportAsync($campaignId, $recipientExport = null)
+ public function requestSmsRecipientExportAsync(
+ int $campaignId,
+ ?\Brevo\Client\Models\RequestSmsRecipientExport $recipientExport = null,
+ string $contentType = self::contentTypes['requestSmsRecipientExport'][0]
+ ): PromiseInterface
{
- return $this->requestSmsRecipientExportAsyncWithHttpInfo($campaignId, $recipientExport)
+ return $this->requestSmsRecipientExportAsyncWithHttpInfo($campaignId, $recipientExport, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1385,28 +1903,33 @@ function ($response) {
/**
* Operation requestSmsRecipientExportAsyncWithHttpInfo
*
- * Export an SMS campaign's recipients
+ * Export an SMS campaign's recipients
*
* @param int $campaignId id of the campaign (required)
- * @param \Brevo\Client\Model\RequestSmsRecipientExport $recipientExport Values to send for a recipient export request (optional)
+ * @param \Brevo\Client\Models\RequestSmsRecipientExport|null $recipientExport Values to send for a recipient export request (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requestSmsRecipientExport'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function requestSmsRecipientExportAsyncWithHttpInfo($campaignId, $recipientExport = null)
+ public function requestSmsRecipientExportAsyncWithHttpInfo(
+ $campaignId,
+ $recipientExport = null,
+ string $contentType = self::contentTypes['requestSmsRecipientExport'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\CreatedProcessId';
- $request = $this->requestSmsRecipientExportRequest($campaignId, $recipientExport);
+ $returnType = '\Brevo\Client\Models\CreatedProcessId';
+ $request = $this->requestSmsRecipientExportRequest($campaignId, $recipientExport, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1429,7 +1952,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1439,20 +1962,28 @@ function ($exception) {
* Create request for operation 'requestSmsRecipientExport'
*
* @param int $campaignId id of the campaign (required)
- * @param \Brevo\Client\Model\RequestSmsRecipientExport $recipientExport Values to send for a recipient export request (optional)
+ * @param \Brevo\Client\Models\RequestSmsRecipientExport|null $recipientExport Values to send for a recipient export request (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requestSmsRecipientExport'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function requestSmsRecipientExportRequest($campaignId, $recipientExport = null)
+ public function requestSmsRecipientExportRequest(
+ $campaignId,
+ $recipientExport = null,
+ string $contentType = self::contentTypes['requestSmsRecipientExport'][0]
+ ): Request
{
+
// verify the required parameter 'campaignId' is set
if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $campaignId when calling requestSmsRecipientExport'
);
}
+
+
$resourcePath = '/smsCampaigns/{campaignId}/exportRecipients';
$formParams = [];
$queryParams = [];
@@ -1461,6 +1992,7 @@ protected function requestSmsRecipientExportRequest($campaignId, $recipientExpor
$multipart = false;
+
// path params
if ($campaignId !== null) {
$resourcePath = str_replace(
@@ -1470,56 +2002,42 @@ protected function requestSmsRecipientExportRequest($campaignId, $recipientExpor
);
}
- // body params
- $_tempBody = null;
- if (isset($recipientExport)) {
- $_tempBody = $recipientExport;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($recipientExport)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($recipientExport));
+ } else {
+ $httpBody = $recipientExport;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1545,10 +2063,11 @@ protected function requestSmsRecipientExportRequest($campaignId, $recipientExpor
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1560,14 +2079,18 @@ protected function requestSmsRecipientExportRequest($campaignId, $recipientExpor
* Send your SMS campaign immediately
*
* @param int $campaignId id of the campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendSmsCampaignNow'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function sendSmsCampaignNow($campaignId)
+ public function sendSmsCampaignNow(
+ int $campaignId,
+ string $contentType = self::contentTypes['sendSmsCampaignNow'][0]
+ ): void
{
- $this->sendSmsCampaignNowWithHttpInfo($campaignId);
+ $this->sendSmsCampaignNowWithHttpInfo($campaignId, $contentType);
}
/**
@@ -1576,15 +2099,18 @@ public function sendSmsCampaignNow($campaignId)
* Send your SMS campaign immediately
*
* @param int $campaignId id of the campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendSmsCampaignNow'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function sendSmsCampaignNowWithHttpInfo($campaignId)
+ public function sendSmsCampaignNowWithHttpInfo(
+ int $campaignId,
+ string $contentType = self::contentTypes['sendSmsCampaignNow'][0]
+ ): array
{
- $returnType = '';
- $request = $this->sendSmsCampaignNowRequest($campaignId);
+ $request = $this->sendSmsCampaignNowRequest($campaignId, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1593,26 +2119,21 @@ public function sendSmsCampaignNowWithHttpInfo($campaignId)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -1621,7 +2142,7 @@ public function sendSmsCampaignNowWithHttpInfo($campaignId)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1629,7 +2150,7 @@ public function sendSmsCampaignNowWithHttpInfo($campaignId)
case 402:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1637,7 +2158,7 @@ public function sendSmsCampaignNowWithHttpInfo($campaignId)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1653,13 +2174,17 @@ public function sendSmsCampaignNowWithHttpInfo($campaignId)
* Send your SMS campaign immediately
*
* @param int $campaignId id of the campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendSmsCampaignNow'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function sendSmsCampaignNowAsync($campaignId)
+ public function sendSmsCampaignNowAsync(
+ int $campaignId,
+ string $contentType = self::contentTypes['sendSmsCampaignNow'][0]
+ ): PromiseInterface
{
- return $this->sendSmsCampaignNowAsyncWithHttpInfo($campaignId)
+ return $this->sendSmsCampaignNowAsyncWithHttpInfo($campaignId, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1673,14 +2198,19 @@ function ($response) {
* Send your SMS campaign immediately
*
* @param int $campaignId id of the campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendSmsCampaignNow'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function sendSmsCampaignNowAsyncWithHttpInfo($campaignId)
+ public function sendSmsCampaignNowAsyncWithHttpInfo(
+ $campaignId,
+ string $contentType = self::contentTypes['sendSmsCampaignNow'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->sendSmsCampaignNowRequest($campaignId);
+ $request = $this->sendSmsCampaignNowRequest($campaignId, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -1699,7 +2229,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1709,19 +2239,25 @@ function ($exception) {
* Create request for operation 'sendSmsCampaignNow'
*
* @param int $campaignId id of the campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendSmsCampaignNow'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function sendSmsCampaignNowRequest($campaignId)
+ public function sendSmsCampaignNowRequest(
+ $campaignId,
+ string $contentType = self::contentTypes['sendSmsCampaignNow'][0]
+ ): Request
{
+
// verify the required parameter 'campaignId' is set
if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $campaignId when calling sendSmsCampaignNow'
);
}
+
$resourcePath = '/smsCampaigns/{campaignId}/sendNow';
$formParams = [];
$queryParams = [];
@@ -1730,6 +2266,7 @@ protected function sendSmsCampaignNowRequest($campaignId)
$multipart = false;
+
// path params
if ($campaignId !== null) {
$resourcePath = str_replace(
@@ -1739,53 +2276,35 @@ protected function sendSmsCampaignNowRequest($campaignId)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1811,10 +2330,11 @@ protected function sendSmsCampaignNowRequest($campaignId)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1823,36 +2343,45 @@ protected function sendSmsCampaignNowRequest($campaignId)
/**
* Operation sendSmsReport
*
- * Send an SMS campaign's report
+ * Send an SMS campaign's report
*
* @param int $campaignId id of the campaign (required)
- * @param \Brevo\Client\Model\SendReport $sendReport Values for send a report (required)
+ * @param \Brevo\Client\Models\SendReport $sendReport Values for send a report (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendSmsReport'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function sendSmsReport($campaignId, $sendReport)
+ public function sendSmsReport(
+ int $campaignId,
+ \Brevo\Client\Models\SendReport $sendReport,
+ string $contentType = self::contentTypes['sendSmsReport'][0]
+ ): void
{
- $this->sendSmsReportWithHttpInfo($campaignId, $sendReport);
+ $this->sendSmsReportWithHttpInfo($campaignId, $sendReport, $contentType);
}
/**
* Operation sendSmsReportWithHttpInfo
*
- * Send an SMS campaign's report
+ * Send an SMS campaign's report
*
* @param int $campaignId id of the campaign (required)
- * @param \Brevo\Client\Model\SendReport $sendReport Values for send a report (required)
+ * @param \Brevo\Client\Models\SendReport $sendReport Values for send a report (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendSmsReport'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function sendSmsReportWithHttpInfo($campaignId, $sendReport)
+ public function sendSmsReportWithHttpInfo(
+ int $campaignId,
+ \Brevo\Client\Models\SendReport $sendReport,
+ string $contentType = self::contentTypes['sendSmsReport'][0]
+ ): array
{
- $returnType = '';
- $request = $this->sendSmsReportRequest($campaignId, $sendReport);
+ $request = $this->sendSmsReportRequest($campaignId, $sendReport, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1861,26 +2390,21 @@ public function sendSmsReportWithHttpInfo($campaignId, $sendReport)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -1889,7 +2413,7 @@ public function sendSmsReportWithHttpInfo($campaignId, $sendReport)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1897,7 +2421,7 @@ public function sendSmsReportWithHttpInfo($campaignId, $sendReport)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1910,17 +2434,22 @@ public function sendSmsReportWithHttpInfo($campaignId, $sendReport)
/**
* Operation sendSmsReportAsync
*
- * Send an SMS campaign's report
+ * Send an SMS campaign's report
*
* @param int $campaignId id of the campaign (required)
- * @param \Brevo\Client\Model\SendReport $sendReport Values for send a report (required)
+ * @param \Brevo\Client\Models\SendReport $sendReport Values for send a report (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendSmsReport'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function sendSmsReportAsync($campaignId, $sendReport)
+ public function sendSmsReportAsync(
+ int $campaignId,
+ \Brevo\Client\Models\SendReport $sendReport,
+ string $contentType = self::contentTypes['sendSmsReport'][0]
+ ): PromiseInterface
{
- return $this->sendSmsReportAsyncWithHttpInfo($campaignId, $sendReport)
+ return $this->sendSmsReportAsyncWithHttpInfo($campaignId, $sendReport, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1931,18 +2460,24 @@ function ($response) {
/**
* Operation sendSmsReportAsyncWithHttpInfo
*
- * Send an SMS campaign's report
+ * Send an SMS campaign's report
*
* @param int $campaignId id of the campaign (required)
- * @param \Brevo\Client\Model\SendReport $sendReport Values for send a report (required)
+ * @param \Brevo\Client\Models\SendReport $sendReport Values for send a report (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendSmsReport'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function sendSmsReportAsyncWithHttpInfo($campaignId, $sendReport)
+ public function sendSmsReportAsyncWithHttpInfo(
+ $campaignId,
+ $sendReport,
+ string $contentType = self::contentTypes['sendSmsReport'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->sendSmsReportRequest($campaignId, $sendReport);
+ $request = $this->sendSmsReportRequest($campaignId, $sendReport, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -1961,7 +2496,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1971,26 +2506,34 @@ function ($exception) {
* Create request for operation 'sendSmsReport'
*
* @param int $campaignId id of the campaign (required)
- * @param \Brevo\Client\Model\SendReport $sendReport Values for send a report (required)
+ * @param \Brevo\Client\Models\SendReport $sendReport Values for send a report (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendSmsReport'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function sendSmsReportRequest($campaignId, $sendReport)
+ public function sendSmsReportRequest(
+ $campaignId,
+ $sendReport,
+ string $contentType = self::contentTypes['sendSmsReport'][0]
+ ): Request
{
+
// verify the required parameter 'campaignId' is set
if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $campaignId when calling sendSmsReport'
);
}
+
// verify the required parameter 'sendReport' is set
if ($sendReport === null || (is_array($sendReport) && count($sendReport) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $sendReport when calling sendSmsReport'
);
}
+
$resourcePath = '/smsCampaigns/{campaignId}/sendReport';
$formParams = [];
$queryParams = [];
@@ -1999,6 +2542,7 @@ protected function sendSmsReportRequest($campaignId, $sendReport)
$multipart = false;
+
// path params
if ($campaignId !== null) {
$resourcePath = str_replace(
@@ -2008,56 +2552,42 @@ protected function sendSmsReportRequest($campaignId, $sendReport)
);
}
- // body params
- $_tempBody = null;
- if (isset($sendReport)) {
- $_tempBody = $sendReport;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($sendReport)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($sendReport));
+ } else {
+ $httpBody = $sendReport;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -2083,10 +2613,11 @@ protected function sendSmsReportRequest($campaignId, $sendReport)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -2098,15 +2629,20 @@ protected function sendSmsReportRequest($campaignId, $sendReport)
* Send a test SMS campaign
*
* @param int $campaignId Id of the SMS campaign (required)
- * @param \Brevo\Client\Model\SendTestSms $phoneNumber Mobile number of the recipient with the country code. This number must belong to one of your contacts in Brevo account and must not be blacklisted (required)
+ * @param \Brevo\Client\Models\SendTestSms $sendTestSms Mobile number of the recipient with the country code. This number **must belong to one of your contacts in Brevo account and must not be blacklisted** (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTestSms'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function sendTestSms($campaignId, $phoneNumber)
+ public function sendTestSms(
+ int $campaignId,
+ \Brevo\Client\Models\SendTestSms $sendTestSms,
+ string $contentType = self::contentTypes['sendTestSms'][0]
+ ): void
{
- $this->sendTestSmsWithHttpInfo($campaignId, $phoneNumber);
+ $this->sendTestSmsWithHttpInfo($campaignId, $sendTestSms, $contentType);
}
/**
@@ -2115,16 +2651,20 @@ public function sendTestSms($campaignId, $phoneNumber)
* Send a test SMS campaign
*
* @param int $campaignId Id of the SMS campaign (required)
- * @param \Brevo\Client\Model\SendTestSms $phoneNumber Mobile number of the recipient with the country code. This number must belong to one of your contacts in Brevo account and must not be blacklisted (required)
+ * @param \Brevo\Client\Models\SendTestSms $sendTestSms Mobile number of the recipient with the country code. This number **must belong to one of your contacts in Brevo account and must not be blacklisted** (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTestSms'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function sendTestSmsWithHttpInfo($campaignId, $phoneNumber)
+ public function sendTestSmsWithHttpInfo(
+ int $campaignId,
+ \Brevo\Client\Models\SendTestSms $sendTestSms,
+ string $contentType = self::contentTypes['sendTestSms'][0]
+ ): array
{
- $returnType = '';
- $request = $this->sendTestSmsRequest($campaignId, $phoneNumber);
+ $request = $this->sendTestSmsRequest($campaignId, $sendTestSms, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -2133,26 +2673,21 @@ public function sendTestSmsWithHttpInfo($campaignId, $phoneNumber)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -2161,7 +2696,7 @@ public function sendTestSmsWithHttpInfo($campaignId, $phoneNumber)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\PostSendSmsTestFailed',
+ '\Brevo\Client\Models\PostSendSmsTestFailed',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2169,7 +2704,7 @@ public function sendTestSmsWithHttpInfo($campaignId, $phoneNumber)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2185,14 +2720,19 @@ public function sendTestSmsWithHttpInfo($campaignId, $phoneNumber)
* Send a test SMS campaign
*
* @param int $campaignId Id of the SMS campaign (required)
- * @param \Brevo\Client\Model\SendTestSms $phoneNumber Mobile number of the recipient with the country code. This number must belong to one of your contacts in Brevo account and must not be blacklisted (required)
+ * @param \Brevo\Client\Models\SendTestSms $sendTestSms Mobile number of the recipient with the country code. This number **must belong to one of your contacts in Brevo account and must not be blacklisted** (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTestSms'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function sendTestSmsAsync($campaignId, $phoneNumber)
+ public function sendTestSmsAsync(
+ int $campaignId,
+ \Brevo\Client\Models\SendTestSms $sendTestSms,
+ string $contentType = self::contentTypes['sendTestSms'][0]
+ ): PromiseInterface
{
- return $this->sendTestSmsAsyncWithHttpInfo($campaignId, $phoneNumber)
+ return $this->sendTestSmsAsyncWithHttpInfo($campaignId, $sendTestSms, $contentType)
->then(
function ($response) {
return $response[0];
@@ -2206,15 +2746,21 @@ function ($response) {
* Send a test SMS campaign
*
* @param int $campaignId Id of the SMS campaign (required)
- * @param \Brevo\Client\Model\SendTestSms $phoneNumber Mobile number of the recipient with the country code. This number must belong to one of your contacts in Brevo account and must not be blacklisted (required)
+ * @param \Brevo\Client\Models\SendTestSms $sendTestSms Mobile number of the recipient with the country code. This number **must belong to one of your contacts in Brevo account and must not be blacklisted** (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTestSms'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function sendTestSmsAsyncWithHttpInfo($campaignId, $phoneNumber)
+ public function sendTestSmsAsyncWithHttpInfo(
+ $campaignId,
+ $sendTestSms,
+ string $contentType = self::contentTypes['sendTestSms'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->sendTestSmsRequest($campaignId, $phoneNumber);
+ $request = $this->sendTestSmsRequest($campaignId, $sendTestSms, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -2233,7 +2779,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -2243,26 +2789,34 @@ function ($exception) {
* Create request for operation 'sendTestSms'
*
* @param int $campaignId Id of the SMS campaign (required)
- * @param \Brevo\Client\Model\SendTestSms $phoneNumber Mobile number of the recipient with the country code. This number must belong to one of your contacts in Brevo account and must not be blacklisted (required)
+ * @param \Brevo\Client\Models\SendTestSms $sendTestSms Mobile number of the recipient with the country code. This number **must belong to one of your contacts in Brevo account and must not be blacklisted** (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTestSms'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function sendTestSmsRequest($campaignId, $phoneNumber)
+ public function sendTestSmsRequest(
+ $campaignId,
+ $sendTestSms,
+ string $contentType = self::contentTypes['sendTestSms'][0]
+ ): Request
{
+
// verify the required parameter 'campaignId' is set
if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $campaignId when calling sendTestSms'
);
}
- // verify the required parameter 'phoneNumber' is set
- if ($phoneNumber === null || (is_array($phoneNumber) && count($phoneNumber) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $phoneNumber when calling sendTestSms'
+
+ // verify the required parameter 'sendTestSms' is set
+ if ($sendTestSms === null || (is_array($sendTestSms) && count($sendTestSms) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $sendTestSms when calling sendTestSms'
);
}
+
$resourcePath = '/smsCampaigns/{campaignId}/sendTest';
$formParams = [];
$queryParams = [];
@@ -2271,6 +2825,7 @@ protected function sendTestSmsRequest($campaignId, $phoneNumber)
$multipart = false;
+
// path params
if ($campaignId !== null) {
$resourcePath = str_replace(
@@ -2280,56 +2835,42 @@ protected function sendTestSmsRequest($campaignId, $phoneNumber)
);
}
- // body params
- $_tempBody = null;
- if (isset($phoneNumber)) {
- $_tempBody = $phoneNumber;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($sendTestSms)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($sendTestSms));
+ } else {
+ $httpBody = $sendTestSms;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -2355,10 +2896,11 @@ protected function sendTestSmsRequest($campaignId, $phoneNumber)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -2370,15 +2912,20 @@ protected function sendTestSmsRequest($campaignId, $phoneNumber)
* Update an SMS campaign
*
* @param int $campaignId id of the SMS campaign (required)
- * @param \Brevo\Client\Model\UpdateSmsCampaign $updateSmsCampaign Values to update an SMS Campaign (required)
+ * @param \Brevo\Client\Models\UpdateSmsCampaign $updateSmsCampaign Values to update an SMS Campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSmsCampaign'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function updateSmsCampaign($campaignId, $updateSmsCampaign)
+ public function updateSmsCampaign(
+ int $campaignId,
+ \Brevo\Client\Models\UpdateSmsCampaign $updateSmsCampaign,
+ string $contentType = self::contentTypes['updateSmsCampaign'][0]
+ ): void
{
- $this->updateSmsCampaignWithHttpInfo($campaignId, $updateSmsCampaign);
+ $this->updateSmsCampaignWithHttpInfo($campaignId, $updateSmsCampaign, $contentType);
}
/**
@@ -2387,16 +2934,20 @@ public function updateSmsCampaign($campaignId, $updateSmsCampaign)
* Update an SMS campaign
*
* @param int $campaignId id of the SMS campaign (required)
- * @param \Brevo\Client\Model\UpdateSmsCampaign $updateSmsCampaign Values to update an SMS Campaign (required)
+ * @param \Brevo\Client\Models\UpdateSmsCampaign $updateSmsCampaign Values to update an SMS Campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSmsCampaign'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function updateSmsCampaignWithHttpInfo($campaignId, $updateSmsCampaign)
+ public function updateSmsCampaignWithHttpInfo(
+ int $campaignId,
+ \Brevo\Client\Models\UpdateSmsCampaign $updateSmsCampaign,
+ string $contentType = self::contentTypes['updateSmsCampaign'][0]
+ ): array
{
- $returnType = '';
- $request = $this->updateSmsCampaignRequest($campaignId, $updateSmsCampaign);
+ $request = $this->updateSmsCampaignRequest($campaignId, $updateSmsCampaign, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -2405,26 +2956,21 @@ public function updateSmsCampaignWithHttpInfo($campaignId, $updateSmsCampaign)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -2433,7 +2979,7 @@ public function updateSmsCampaignWithHttpInfo($campaignId, $updateSmsCampaign)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2441,7 +2987,7 @@ public function updateSmsCampaignWithHttpInfo($campaignId, $updateSmsCampaign)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2457,14 +3003,19 @@ public function updateSmsCampaignWithHttpInfo($campaignId, $updateSmsCampaign)
* Update an SMS campaign
*
* @param int $campaignId id of the SMS campaign (required)
- * @param \Brevo\Client\Model\UpdateSmsCampaign $updateSmsCampaign Values to update an SMS Campaign (required)
+ * @param \Brevo\Client\Models\UpdateSmsCampaign $updateSmsCampaign Values to update an SMS Campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSmsCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function updateSmsCampaignAsync($campaignId, $updateSmsCampaign)
+ public function updateSmsCampaignAsync(
+ int $campaignId,
+ \Brevo\Client\Models\UpdateSmsCampaign $updateSmsCampaign,
+ string $contentType = self::contentTypes['updateSmsCampaign'][0]
+ ): PromiseInterface
{
- return $this->updateSmsCampaignAsyncWithHttpInfo($campaignId, $updateSmsCampaign)
+ return $this->updateSmsCampaignAsyncWithHttpInfo($campaignId, $updateSmsCampaign, $contentType)
->then(
function ($response) {
return $response[0];
@@ -2478,15 +3029,21 @@ function ($response) {
* Update an SMS campaign
*
* @param int $campaignId id of the SMS campaign (required)
- * @param \Brevo\Client\Model\UpdateSmsCampaign $updateSmsCampaign Values to update an SMS Campaign (required)
+ * @param \Brevo\Client\Models\UpdateSmsCampaign $updateSmsCampaign Values to update an SMS Campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSmsCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function updateSmsCampaignAsyncWithHttpInfo($campaignId, $updateSmsCampaign)
+ public function updateSmsCampaignAsyncWithHttpInfo(
+ $campaignId,
+ $updateSmsCampaign,
+ string $contentType = self::contentTypes['updateSmsCampaign'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->updateSmsCampaignRequest($campaignId, $updateSmsCampaign);
+ $request = $this->updateSmsCampaignRequest($campaignId, $updateSmsCampaign, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -2505,7 +3062,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -2515,26 +3072,34 @@ function ($exception) {
* Create request for operation 'updateSmsCampaign'
*
* @param int $campaignId id of the SMS campaign (required)
- * @param \Brevo\Client\Model\UpdateSmsCampaign $updateSmsCampaign Values to update an SMS Campaign (required)
+ * @param \Brevo\Client\Models\UpdateSmsCampaign $updateSmsCampaign Values to update an SMS Campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSmsCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function updateSmsCampaignRequest($campaignId, $updateSmsCampaign)
+ public function updateSmsCampaignRequest(
+ $campaignId,
+ $updateSmsCampaign,
+ string $contentType = self::contentTypes['updateSmsCampaign'][0]
+ ): Request
{
+
// verify the required parameter 'campaignId' is set
if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $campaignId when calling updateSmsCampaign'
);
}
+
// verify the required parameter 'updateSmsCampaign' is set
if ($updateSmsCampaign === null || (is_array($updateSmsCampaign) && count($updateSmsCampaign) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $updateSmsCampaign when calling updateSmsCampaign'
);
}
+
$resourcePath = '/smsCampaigns/{campaignId}';
$formParams = [];
$queryParams = [];
@@ -2543,6 +3108,7 @@ protected function updateSmsCampaignRequest($campaignId, $updateSmsCampaign)
$multipart = false;
+
// path params
if ($campaignId !== null) {
$resourcePath = str_replace(
@@ -2552,56 +3118,42 @@ protected function updateSmsCampaignRequest($campaignId, $updateSmsCampaign)
);
}
- // body params
- $_tempBody = null;
- if (isset($updateSmsCampaign)) {
- $_tempBody = $updateSmsCampaign;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($updateSmsCampaign)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($updateSmsCampaign));
+ } else {
+ $httpBody = $updateSmsCampaign;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -2627,10 +3179,11 @@ protected function updateSmsCampaignRequest($campaignId, $updateSmsCampaign)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'PUT',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -2639,36 +3192,45 @@ protected function updateSmsCampaignRequest($campaignId, $updateSmsCampaign)
/**
* Operation updateSmsCampaignStatus
*
- * Update a campaign's status
+ * Update a campaign's status
*
* @param int $campaignId id of the campaign (required)
- * @param \Brevo\Client\Model\UpdateCampaignStatus $status Status of the campaign. (required)
+ * @param \Brevo\Client\Models\UpdateCampaignStatus $status Status of the campaign. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSmsCampaignStatus'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function updateSmsCampaignStatus($campaignId, $status)
+ public function updateSmsCampaignStatus(
+ int $campaignId,
+ \Brevo\Client\Models\UpdateCampaignStatus $status,
+ string $contentType = self::contentTypes['updateSmsCampaignStatus'][0]
+ ): void
{
- $this->updateSmsCampaignStatusWithHttpInfo($campaignId, $status);
+ $this->updateSmsCampaignStatusWithHttpInfo($campaignId, $status, $contentType);
}
/**
* Operation updateSmsCampaignStatusWithHttpInfo
*
- * Update a campaign's status
+ * Update a campaign's status
*
* @param int $campaignId id of the campaign (required)
- * @param \Brevo\Client\Model\UpdateCampaignStatus $status Status of the campaign. (required)
+ * @param \Brevo\Client\Models\UpdateCampaignStatus $status Status of the campaign. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSmsCampaignStatus'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function updateSmsCampaignStatusWithHttpInfo($campaignId, $status)
+ public function updateSmsCampaignStatusWithHttpInfo(
+ int $campaignId,
+ \Brevo\Client\Models\UpdateCampaignStatus $status,
+ string $contentType = self::contentTypes['updateSmsCampaignStatus'][0]
+ ): array
{
- $returnType = '';
- $request = $this->updateSmsCampaignStatusRequest($campaignId, $status);
+ $request = $this->updateSmsCampaignStatusRequest($campaignId, $status, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -2677,26 +3239,21 @@ public function updateSmsCampaignStatusWithHttpInfo($campaignId, $status)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -2705,7 +3262,7 @@ public function updateSmsCampaignStatusWithHttpInfo($campaignId, $status)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2713,7 +3270,7 @@ public function updateSmsCampaignStatusWithHttpInfo($campaignId, $status)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2726,17 +3283,22 @@ public function updateSmsCampaignStatusWithHttpInfo($campaignId, $status)
/**
* Operation updateSmsCampaignStatusAsync
*
- * Update a campaign's status
+ * Update a campaign's status
*
* @param int $campaignId id of the campaign (required)
- * @param \Brevo\Client\Model\UpdateCampaignStatus $status Status of the campaign. (required)
+ * @param \Brevo\Client\Models\UpdateCampaignStatus $status Status of the campaign. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSmsCampaignStatus'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function updateSmsCampaignStatusAsync($campaignId, $status)
+ public function updateSmsCampaignStatusAsync(
+ int $campaignId,
+ \Brevo\Client\Models\UpdateCampaignStatus $status,
+ string $contentType = self::contentTypes['updateSmsCampaignStatus'][0]
+ ): PromiseInterface
{
- return $this->updateSmsCampaignStatusAsyncWithHttpInfo($campaignId, $status)
+ return $this->updateSmsCampaignStatusAsyncWithHttpInfo($campaignId, $status, $contentType)
->then(
function ($response) {
return $response[0];
@@ -2747,18 +3309,24 @@ function ($response) {
/**
* Operation updateSmsCampaignStatusAsyncWithHttpInfo
*
- * Update a campaign's status
+ * Update a campaign's status
*
* @param int $campaignId id of the campaign (required)
- * @param \Brevo\Client\Model\UpdateCampaignStatus $status Status of the campaign. (required)
+ * @param \Brevo\Client\Models\UpdateCampaignStatus $status Status of the campaign. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSmsCampaignStatus'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function updateSmsCampaignStatusAsyncWithHttpInfo($campaignId, $status)
+ public function updateSmsCampaignStatusAsyncWithHttpInfo(
+ $campaignId,
+ $status,
+ string $contentType = self::contentTypes['updateSmsCampaignStatus'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->updateSmsCampaignStatusRequest($campaignId, $status);
+ $request = $this->updateSmsCampaignStatusRequest($campaignId, $status, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -2777,7 +3345,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -2787,26 +3355,34 @@ function ($exception) {
* Create request for operation 'updateSmsCampaignStatus'
*
* @param int $campaignId id of the campaign (required)
- * @param \Brevo\Client\Model\UpdateCampaignStatus $status Status of the campaign. (required)
+ * @param \Brevo\Client\Models\UpdateCampaignStatus $status Status of the campaign. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSmsCampaignStatus'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function updateSmsCampaignStatusRequest($campaignId, $status)
+ public function updateSmsCampaignStatusRequest(
+ $campaignId,
+ $status,
+ string $contentType = self::contentTypes['updateSmsCampaignStatus'][0]
+ ): Request
{
+
// verify the required parameter 'campaignId' is set
if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $campaignId when calling updateSmsCampaignStatus'
);
}
+
// verify the required parameter 'status' is set
if ($status === null || (is_array($status) && count($status) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $status when calling updateSmsCampaignStatus'
);
}
+
$resourcePath = '/smsCampaigns/{campaignId}/status';
$formParams = [];
$queryParams = [];
@@ -2815,6 +3391,7 @@ protected function updateSmsCampaignStatusRequest($campaignId, $status)
$multipart = false;
+
// path params
if ($campaignId !== null) {
$resourcePath = str_replace(
@@ -2824,56 +3401,42 @@ protected function updateSmsCampaignStatusRequest($campaignId, $status)
);
}
- // body params
- $_tempBody = null;
- if (isset($status)) {
- $_tempBody = $status;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($status)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($status));
+ } else {
+ $httpBody = $status;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -2899,10 +3462,11 @@ protected function updateSmsCampaignStatusRequest($campaignId, $status)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'PUT',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -2914,7 +3478,7 @@ protected function updateSmsCampaignStatusRequest($campaignId, $status)
* @throws \RuntimeException on file opening failure
* @return array of http client options
*/
- protected function createHttpClientOption()
+ protected function createHttpClientOption(): array
{
$options = [];
if ($this->config->getDebug()) {
diff --git a/lib/Api/SendersApi.php b/lib/Api/SendersApi.php
index 8da7a97..13ce863 100644
--- a/lib/Api/SendersApi.php
+++ b/lib/Api/SendersApi.php
@@ -1,39 +1,41 @@
[
+ 'application/json',
+ ],
+ 'deleteSender' => [
+ 'application/json',
+ ],
+ 'getIps' => [
+ 'application/json',
+ ],
+ 'getIpsFromSender' => [
+ 'application/json',
+ ],
+ 'getSenders' => [
+ 'application/json',
+ ],
+ 'updateSender' => [
+ 'application/json',
+ ],
+ 'validateSenderByOTP' => [
+ 'application/json',
+ ],
+ ];
+
+ /**
+ * @param ClientInterface|null $client
+ * @param Configuration|null $config
+ * @param HeaderSelector|null $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
+ HeaderSelector $selector = null,
+ int $hostIndex = 0
) {
$this->client = $client ?: new Client();
- $this->config = $config ?: new Configuration();
+ $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(int $hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex(): int
+ {
+ return $this->hostIndex;
}
/**
* @return Configuration
*/
- public function getConfig()
+ public function getConfig(): Configuration
{
return $this->config;
}
@@ -92,15 +146,19 @@ public function getConfig()
*
* Create a new sender
*
- * @param \Brevo\Client\Model\CreateSender $sender sender's name (optional)
+ * @param \Brevo\Client\Models\CreateSender|null $sender sender's name (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSender'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\CreateSenderModel
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CreateSenderModel|\Brevo\Client\Models\ErrorModel
*/
- public function createSender($sender = null)
+ public function createSender(
+ ?\Brevo\Client\Models\CreateSender $sender = null,
+ string $contentType = self::contentTypes['createSender'][0]
+ ): \Brevo\Client\Models\CreateSenderModel
{
- list($response) = $this->createSenderWithHttpInfo($sender);
+ list($response) = $this->createSenderWithHttpInfo($sender, $contentType);
return $response;
}
@@ -109,16 +167,19 @@ public function createSender($sender = null)
*
* Create a new sender
*
- * @param \Brevo\Client\Model\CreateSender $sender sender's name (optional)
+ * @param \Brevo\Client\Models\CreateSender|null $sender sender's name (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSender'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\CreateSenderModel, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CreateSenderModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function createSenderWithHttpInfo($sender = null)
+ public function createSenderWithHttpInfo(
+ ?\Brevo\Client\Models\CreateSender $sender = null,
+ string $contentType = self::contentTypes['createSender'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\CreateSenderModel';
- $request = $this->createSenderRequest($sender);
+ $request = $this->createSenderRequest($sender, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -127,34 +188,111 @@ public function createSenderWithHttpInfo($sender = null)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 201:
+ if (in_array('\Brevo\Client\Models\CreateSenderModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CreateSenderModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CreateSenderModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CreateSenderModel';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -169,7 +307,7 @@ public function createSenderWithHttpInfo($sender = null)
case 201:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\CreateSenderModel',
+ '\Brevo\Client\Models\CreateSenderModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -177,7 +315,7 @@ public function createSenderWithHttpInfo($sender = null)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -192,14 +330,18 @@ public function createSenderWithHttpInfo($sender = null)
*
* Create a new sender
*
- * @param \Brevo\Client\Model\CreateSender $sender sender's name (optional)
+ * @param \Brevo\Client\Models\CreateSender|null $sender sender's name (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSender'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createSenderAsync($sender = null)
+ public function createSenderAsync(
+ ?\Brevo\Client\Models\CreateSender $sender = null,
+ string $contentType = self::contentTypes['createSender'][0]
+ ): PromiseInterface
{
- return $this->createSenderAsyncWithHttpInfo($sender)
+ return $this->createSenderAsyncWithHttpInfo($sender, $contentType)
->then(
function ($response) {
return $response[0];
@@ -212,25 +354,29 @@ function ($response) {
*
* Create a new sender
*
- * @param \Brevo\Client\Model\CreateSender $sender sender's name (optional)
+ * @param \Brevo\Client\Models\CreateSender|null $sender sender's name (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSender'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createSenderAsyncWithHttpInfo($sender = null)
+ public function createSenderAsyncWithHttpInfo(
+ $sender = null,
+ string $contentType = self::contentTypes['createSender'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\CreateSenderModel';
- $request = $this->createSenderRequest($sender);
+ $returnType = '\Brevo\Client\Models\CreateSenderModel';
+ $request = $this->createSenderRequest($sender, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -253,7 +399,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -262,14 +408,20 @@ function ($exception) {
/**
* Create request for operation 'createSender'
*
- * @param \Brevo\Client\Model\CreateSender $sender sender's name (optional)
+ * @param \Brevo\Client\Models\CreateSender|null $sender sender's name (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSender'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function createSenderRequest($sender = null)
+ public function createSenderRequest(
+ $sender = null,
+ string $contentType = self::contentTypes['createSender'][0]
+ ): Request
{
+
+
$resourcePath = '/senders';
$formParams = [];
$queryParams = [];
@@ -279,56 +431,43 @@ protected function createSenderRequest($sender = null)
- // body params
- $_tempBody = null;
- if (isset($sender)) {
- $_tempBody = $sender;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($sender)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($sender));
+ } else {
+ $httpBody = $sender;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -354,10 +493,11 @@ protected function createSenderRequest($sender = null)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -369,14 +509,18 @@ protected function createSenderRequest($sender = null)
* Delete a sender
*
* @param int $senderId Id of the sender (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSender'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function deleteSender($senderId)
+ public function deleteSender(
+ int $senderId,
+ string $contentType = self::contentTypes['deleteSender'][0]
+ ): void
{
- $this->deleteSenderWithHttpInfo($senderId);
+ $this->deleteSenderWithHttpInfo($senderId, $contentType);
}
/**
@@ -385,15 +529,18 @@ public function deleteSender($senderId)
* Delete a sender
*
* @param int $senderId Id of the sender (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSender'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function deleteSenderWithHttpInfo($senderId)
+ public function deleteSenderWithHttpInfo(
+ int $senderId,
+ string $contentType = self::contentTypes['deleteSender'][0]
+ ): array
{
- $returnType = '';
- $request = $this->deleteSenderRequest($senderId);
+ $request = $this->deleteSenderRequest($senderId, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -402,43 +549,38 @@ public function deleteSenderWithHttpInfo($senderId)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
} catch (ApiException $e) {
switch ($e->getCode()) {
- case 404:
+ case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 400:
+ case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -454,13 +596,17 @@ public function deleteSenderWithHttpInfo($senderId)
* Delete a sender
*
* @param int $senderId Id of the sender (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSender'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteSenderAsync($senderId)
+ public function deleteSenderAsync(
+ int $senderId,
+ string $contentType = self::contentTypes['deleteSender'][0]
+ ): PromiseInterface
{
- return $this->deleteSenderAsyncWithHttpInfo($senderId)
+ return $this->deleteSenderAsyncWithHttpInfo($senderId, $contentType)
->then(
function ($response) {
return $response[0];
@@ -474,14 +620,19 @@ function ($response) {
* Delete a sender
*
* @param int $senderId Id of the sender (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSender'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteSenderAsyncWithHttpInfo($senderId)
+ public function deleteSenderAsyncWithHttpInfo(
+ $senderId,
+ string $contentType = self::contentTypes['deleteSender'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->deleteSenderRequest($senderId);
+ $request = $this->deleteSenderRequest($senderId, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -500,7 +651,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -510,19 +661,25 @@ function ($exception) {
* Create request for operation 'deleteSender'
*
* @param int $senderId Id of the sender (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSender'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function deleteSenderRequest($senderId)
+ public function deleteSenderRequest(
+ $senderId,
+ string $contentType = self::contentTypes['deleteSender'][0]
+ ): Request
{
+
// verify the required parameter 'senderId' is set
if ($senderId === null || (is_array($senderId) && count($senderId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $senderId when calling deleteSender'
);
}
+
$resourcePath = '/senders/{senderId}';
$formParams = [];
$queryParams = [];
@@ -531,6 +688,7 @@ protected function deleteSenderRequest($senderId)
$multipart = false;
+
// path params
if ($senderId !== null) {
$resourcePath = str_replace(
@@ -540,53 +698,35 @@ protected function deleteSenderRequest($senderId)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -612,10 +752,11 @@ protected function deleteSenderRequest($senderId)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -626,14 +767,17 @@ protected function deleteSenderRequest($senderId)
*
* Get all the dedicated IPs for your account
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getIps'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetIps
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetIps
*/
- public function getIps()
+ public function getIps(
+ string $contentType = self::contentTypes['getIps'][0]
+ ): \Brevo\Client\Models\GetIps
{
- list($response) = $this->getIpsWithHttpInfo();
+ list($response) = $this->getIpsWithHttpInfo($contentType);
return $response;
}
@@ -642,15 +786,17 @@ public function getIps()
*
* Get all the dedicated IPs for your account
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getIps'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetIps, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetIps, HTTP status code, HTTP response headers (array of strings)
*/
- public function getIpsWithHttpInfo()
+ public function getIpsWithHttpInfo(
+ string $contentType = self::contentTypes['getIps'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetIps';
- $request = $this->getIpsRequest();
+ $request = $this->getIpsRequest($contentType);
try {
$options = $this->createHttpClientOption();
@@ -659,34 +805,84 @@ public function getIpsWithHttpInfo()
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetIps', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetIps' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetIps', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetIps';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -701,7 +897,7 @@ public function getIpsWithHttpInfo()
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetIps',
+ '\Brevo\Client\Models\GetIps',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -716,13 +912,16 @@ public function getIpsWithHttpInfo()
*
* Get all the dedicated IPs for your account
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getIps'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getIpsAsync()
+ public function getIpsAsync(
+ string $contentType = self::contentTypes['getIps'][0]
+ ): PromiseInterface
{
- return $this->getIpsAsyncWithHttpInfo()
+ return $this->getIpsAsyncWithHttpInfo($contentType)
->then(
function ($response) {
return $response[0];
@@ -735,24 +934,27 @@ function ($response) {
*
* Get all the dedicated IPs for your account
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getIps'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getIpsAsyncWithHttpInfo()
+ public function getIpsAsyncWithHttpInfo(
+ string $contentType = self::contentTypes['getIps'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetIps';
- $request = $this->getIpsRequest();
+ $returnType = '\Brevo\Client\Models\GetIps';
+ $request = $this->getIpsRequest($contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -775,7 +977,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -784,13 +986,17 @@ function ($exception) {
/**
* Create request for operation 'getIps'
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getIps'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getIpsRequest()
+ public function getIpsRequest(
+ string $contentType = self::contentTypes['getIps'][0]
+ ): Request
{
+
$resourcePath = '/senders/ips';
$formParams = [];
$queryParams = [];
@@ -800,53 +1006,36 @@ protected function getIpsRequest()
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -872,10 +1061,11 @@ protected function getIpsRequest()
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -887,14 +1077,18 @@ protected function getIpsRequest()
* Get all the dedicated IPs for a sender
*
* @param int $senderId Id of the sender (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getIpsFromSender'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetIpsFromSender
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetIpsFromSender|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function getIpsFromSender($senderId)
+ public function getIpsFromSender(
+ int $senderId,
+ string $contentType = self::contentTypes['getIpsFromSender'][0]
+ ): \Brevo\Client\Models\GetIpsFromSender
{
- list($response) = $this->getIpsFromSenderWithHttpInfo($senderId);
+ list($response) = $this->getIpsFromSenderWithHttpInfo($senderId, $contentType);
return $response;
}
@@ -904,15 +1098,18 @@ public function getIpsFromSender($senderId)
* Get all the dedicated IPs for a sender
*
* @param int $senderId Id of the sender (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getIpsFromSender'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetIpsFromSender, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetIpsFromSender|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getIpsFromSenderWithHttpInfo($senderId)
+ public function getIpsFromSenderWithHttpInfo(
+ int $senderId,
+ string $contentType = self::contentTypes['getIpsFromSender'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetIpsFromSender';
- $request = $this->getIpsFromSenderRequest($senderId);
+ $request = $this->getIpsFromSenderRequest($senderId, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -921,34 +1118,138 @@ public function getIpsFromSenderWithHttpInfo($senderId)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetIpsFromSender', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetIpsFromSender' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetIpsFromSender', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetIpsFromSender';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -963,23 +1264,23 @@ public function getIpsFromSenderWithHttpInfo($senderId)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetIpsFromSender',
+ '\Brevo\Client\Models\GetIpsFromSender',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 404:
+ case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 400:
+ case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -995,13 +1296,17 @@ public function getIpsFromSenderWithHttpInfo($senderId)
* Get all the dedicated IPs for a sender
*
* @param int $senderId Id of the sender (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getIpsFromSender'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getIpsFromSenderAsync($senderId)
+ public function getIpsFromSenderAsync(
+ int $senderId,
+ string $contentType = self::contentTypes['getIpsFromSender'][0]
+ ): PromiseInterface
{
- return $this->getIpsFromSenderAsyncWithHttpInfo($senderId)
+ return $this->getIpsFromSenderAsyncWithHttpInfo($senderId, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1015,24 +1320,28 @@ function ($response) {
* Get all the dedicated IPs for a sender
*
* @param int $senderId Id of the sender (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getIpsFromSender'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getIpsFromSenderAsyncWithHttpInfo($senderId)
+ public function getIpsFromSenderAsyncWithHttpInfo(
+ $senderId,
+ string $contentType = self::contentTypes['getIpsFromSender'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetIpsFromSender';
- $request = $this->getIpsFromSenderRequest($senderId);
+ $returnType = '\Brevo\Client\Models\GetIpsFromSender';
+ $request = $this->getIpsFromSenderRequest($senderId, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1055,7 +1364,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1065,19 +1374,25 @@ function ($exception) {
* Create request for operation 'getIpsFromSender'
*
* @param int $senderId Id of the sender (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getIpsFromSender'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getIpsFromSenderRequest($senderId)
+ public function getIpsFromSenderRequest(
+ $senderId,
+ string $contentType = self::contentTypes['getIpsFromSender'][0]
+ ): Request
{
+
// verify the required parameter 'senderId' is set
if ($senderId === null || (is_array($senderId) && count($senderId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $senderId when calling getIpsFromSender'
);
}
+
$resourcePath = '/senders/{senderId}/ips';
$formParams = [];
$queryParams = [];
@@ -1086,6 +1401,7 @@ protected function getIpsFromSenderRequest($senderId)
$multipart = false;
+
// path params
if ($senderId !== null) {
$resourcePath = str_replace(
@@ -1095,53 +1411,35 @@ protected function getIpsFromSenderRequest($senderId)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1167,10 +1465,11 @@ protected function getIpsFromSenderRequest($senderId)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1181,16 +1480,21 @@ protected function getIpsFromSenderRequest($senderId)
*
* Get the list of all your senders
*
- * @param string $ip Filter your senders for a specific ip (available for dedicated IP usage only) (optional)
- * @param string $domain Filter your senders for a specific domain (optional)
+ * @param string|null $ip Filter your senders for a specific ip. **Available for dedicated IP usage only** (optional)
+ * @param string|null $domain Filter your senders for a specific domain (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSenders'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetSendersList
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetSendersList|\Brevo\Client\Models\ErrorModel
*/
- public function getSenders($ip = null, $domain = null)
+ public function getSenders(
+ ?string $ip = null,
+ ?string $domain = null,
+ string $contentType = self::contentTypes['getSenders'][0]
+ ): \Brevo\Client\Models\GetSendersList
{
- list($response) = $this->getSendersWithHttpInfo($ip, $domain);
+ list($response) = $this->getSendersWithHttpInfo($ip, $domain, $contentType);
return $response;
}
@@ -1199,17 +1503,21 @@ public function getSenders($ip = null, $domain = null)
*
* Get the list of all your senders
*
- * @param string $ip Filter your senders for a specific ip (available for dedicated IP usage only) (optional)
- * @param string $domain Filter your senders for a specific domain (optional)
+ * @param string|null $ip Filter your senders for a specific ip. **Available for dedicated IP usage only** (optional)
+ * @param string|null $domain Filter your senders for a specific domain (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSenders'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetSendersList, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetSendersList|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getSendersWithHttpInfo($ip = null, $domain = null)
+ public function getSendersWithHttpInfo(
+ ?string $ip = null,
+ ?string $domain = null,
+ string $contentType = self::contentTypes['getSenders'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetSendersList';
- $request = $this->getSendersRequest($ip, $domain);
+ $request = $this->getSendersRequest($ip, $domain, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1218,34 +1526,111 @@ public function getSendersWithHttpInfo($ip = null, $domain = null)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetSendersList', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetSendersList' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetSendersList', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetSendersList';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1260,7 +1645,7 @@ public function getSendersWithHttpInfo($ip = null, $domain = null)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetSendersList',
+ '\Brevo\Client\Models\GetSendersList',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1268,7 +1653,7 @@ public function getSendersWithHttpInfo($ip = null, $domain = null)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1283,15 +1668,20 @@ public function getSendersWithHttpInfo($ip = null, $domain = null)
*
* Get the list of all your senders
*
- * @param string $ip Filter your senders for a specific ip (available for dedicated IP usage only) (optional)
- * @param string $domain Filter your senders for a specific domain (optional)
+ * @param string|null $ip Filter your senders for a specific ip. **Available for dedicated IP usage only** (optional)
+ * @param string|null $domain Filter your senders for a specific domain (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSenders'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getSendersAsync($ip = null, $domain = null)
+ public function getSendersAsync(
+ ?string $ip = null,
+ ?string $domain = null,
+ string $contentType = self::contentTypes['getSenders'][0]
+ ): PromiseInterface
{
- return $this->getSendersAsyncWithHttpInfo($ip, $domain)
+ return $this->getSendersAsyncWithHttpInfo($ip, $domain, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1304,26 +1694,31 @@ function ($response) {
*
* Get the list of all your senders
*
- * @param string $ip Filter your senders for a specific ip (available for dedicated IP usage only) (optional)
- * @param string $domain Filter your senders for a specific domain (optional)
+ * @param string|null $ip Filter your senders for a specific ip. **Available for dedicated IP usage only** (optional)
+ * @param string|null $domain Filter your senders for a specific domain (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSenders'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getSendersAsyncWithHttpInfo($ip = null, $domain = null)
+ public function getSendersAsyncWithHttpInfo(
+ $ip = null,
+ $domain = null,
+ string $contentType = self::contentTypes['getSenders'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetSendersList';
- $request = $this->getSendersRequest($ip, $domain);
+ $returnType = '\Brevo\Client\Models\GetSendersList';
+ $request = $this->getSendersRequest($ip, $domain, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1346,7 +1741,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1355,15 +1750,23 @@ function ($exception) {
/**
* Create request for operation 'getSenders'
*
- * @param string $ip Filter your senders for a specific ip (available for dedicated IP usage only) (optional)
- * @param string $domain Filter your senders for a specific domain (optional)
+ * @param string|null $ip Filter your senders for a specific ip. **Available for dedicated IP usage only** (optional)
+ * @param string|null $domain Filter your senders for a specific domain (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSenders'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getSendersRequest($ip = null, $domain = null)
+ public function getSendersRequest(
+ $ip = null,
+ $domain = null,
+ string $contentType = self::contentTypes['getSenders'][0]
+ ): Request
{
+
+
+
$resourcePath = '/senders';
$formParams = [];
$queryParams = [];
@@ -1372,62 +1775,55 @@ protected function getSendersRequest($ip = null, $domain = null)
$multipart = false;
// query params
- if ($ip !== null) {
- $queryParams['ip'] = ObjectSerializer::toQueryValue($ip);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $ip,
+ 'ip', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($domain !== null) {
- $queryParams['domain'] = ObjectSerializer::toQueryValue($domain);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $domain,
+ 'domain', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1453,10 +1849,11 @@ protected function getSendersRequest($ip = null, $domain = null)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1468,15 +1865,20 @@ protected function getSendersRequest($ip = null, $domain = null)
* Update a sender
*
* @param int $senderId Id of the sender (required)
- * @param \Brevo\Client\Model\UpdateSender $sender sender's name (optional)
+ * @param \Brevo\Client\Models\UpdateSender|null $sender sender's name (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSender'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function updateSender($senderId, $sender = null)
+ public function updateSender(
+ int $senderId,
+ ?\Brevo\Client\Models\UpdateSender $sender = null,
+ string $contentType = self::contentTypes['updateSender'][0]
+ ): void
{
- $this->updateSenderWithHttpInfo($senderId, $sender);
+ $this->updateSenderWithHttpInfo($senderId, $sender, $contentType);
}
/**
@@ -1485,16 +1887,20 @@ public function updateSender($senderId, $sender = null)
* Update a sender
*
* @param int $senderId Id of the sender (required)
- * @param \Brevo\Client\Model\UpdateSender $sender sender's name (optional)
+ * @param \Brevo\Client\Models\UpdateSender|null $sender sender's name (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSender'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function updateSenderWithHttpInfo($senderId, $sender = null)
+ public function updateSenderWithHttpInfo(
+ int $senderId,
+ ?\Brevo\Client\Models\UpdateSender $sender = null,
+ string $contentType = self::contentTypes['updateSender'][0]
+ ): array
{
- $returnType = '';
- $request = $this->updateSenderRequest($senderId, $sender);
+ $request = $this->updateSenderRequest($senderId, $sender, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1503,26 +1909,21 @@ public function updateSenderWithHttpInfo($senderId, $sender = null)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -1531,7 +1932,7 @@ public function updateSenderWithHttpInfo($senderId, $sender = null)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1539,7 +1940,7 @@ public function updateSenderWithHttpInfo($senderId, $sender = null)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1555,14 +1956,19 @@ public function updateSenderWithHttpInfo($senderId, $sender = null)
* Update a sender
*
* @param int $senderId Id of the sender (required)
- * @param \Brevo\Client\Model\UpdateSender $sender sender's name (optional)
+ * @param \Brevo\Client\Models\UpdateSender|null $sender sender's name (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSender'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function updateSenderAsync($senderId, $sender = null)
+ public function updateSenderAsync(
+ int $senderId,
+ ?\Brevo\Client\Models\UpdateSender $sender = null,
+ string $contentType = self::contentTypes['updateSender'][0]
+ ): PromiseInterface
{
- return $this->updateSenderAsyncWithHttpInfo($senderId, $sender)
+ return $this->updateSenderAsyncWithHttpInfo($senderId, $sender, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1576,15 +1982,21 @@ function ($response) {
* Update a sender
*
* @param int $senderId Id of the sender (required)
- * @param \Brevo\Client\Model\UpdateSender $sender sender's name (optional)
+ * @param \Brevo\Client\Models\UpdateSender|null $sender sender's name (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSender'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function updateSenderAsyncWithHttpInfo($senderId, $sender = null)
+ public function updateSenderAsyncWithHttpInfo(
+ $senderId,
+ $sender = null,
+ string $contentType = self::contentTypes['updateSender'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->updateSenderRequest($senderId, $sender);
+ $request = $this->updateSenderRequest($senderId, $sender, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -1603,7 +2015,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1613,20 +2025,28 @@ function ($exception) {
* Create request for operation 'updateSender'
*
* @param int $senderId Id of the sender (required)
- * @param \Brevo\Client\Model\UpdateSender $sender sender's name (optional)
+ * @param \Brevo\Client\Models\UpdateSender|null $sender sender's name (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSender'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function updateSenderRequest($senderId, $sender = null)
+ public function updateSenderRequest(
+ $senderId,
+ $sender = null,
+ string $contentType = self::contentTypes['updateSender'][0]
+ ): Request
{
+
// verify the required parameter 'senderId' is set
if ($senderId === null || (is_array($senderId) && count($senderId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $senderId when calling updateSender'
);
}
+
+
$resourcePath = '/senders/{senderId}';
$formParams = [];
$queryParams = [];
@@ -1635,6 +2055,7 @@ protected function updateSenderRequest($senderId, $sender = null)
$multipart = false;
+
// path params
if ($senderId !== null) {
$resourcePath = str_replace(
@@ -1644,56 +2065,42 @@ protected function updateSenderRequest($senderId, $sender = null)
);
}
- // body params
- $_tempBody = null;
- if (isset($sender)) {
- $_tempBody = $sender;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($sender)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($sender));
+ } else {
+ $httpBody = $sender;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1719,10 +2126,11 @@ protected function updateSenderRequest($senderId, $sender = null)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'PUT',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1731,36 +2139,45 @@ protected function updateSenderRequest($senderId, $sender = null)
/**
* Operation validateSenderByOTP
*
- * Update a sender
+ * Validate Sender using OTP
*
* @param int $senderId Id of the sender (required)
- * @param \Brevo\Client\Model\Otp $otp otp (optional)
+ * @param \Brevo\Client\Models\Otp|null $sender otp (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['validateSenderByOTP'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function validateSenderByOTP($senderId, $otp = null)
+ public function validateSenderByOTP(
+ int $senderId,
+ ?\Brevo\Client\Models\Otp $sender = null,
+ string $contentType = self::contentTypes['validateSenderByOTP'][0]
+ ): void
{
- $this->validateSenderByOTPWithHttpInfo($senderId, $otp);
+ $this->validateSenderByOTPWithHttpInfo($senderId, $sender, $contentType);
}
/**
* Operation validateSenderByOTPWithHttpInfo
*
- * Update a sender
+ * Validate Sender using OTP
*
* @param int $senderId Id of the sender (required)
- * @param \Brevo\Client\Model\Otp $otp otp (optional)
+ * @param \Brevo\Client\Models\Otp|null $sender otp (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['validateSenderByOTP'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function validateSenderByOTPWithHttpInfo($senderId, $otp = null)
+ public function validateSenderByOTPWithHttpInfo(
+ int $senderId,
+ ?\Brevo\Client\Models\Otp $sender = null,
+ string $contentType = self::contentTypes['validateSenderByOTP'][0]
+ ): array
{
- $returnType = '';
- $request = $this->validateSenderByOTPRequest($senderId, $otp);
+ $request = $this->validateSenderByOTPRequest($senderId, $sender, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1769,26 +2186,21 @@ public function validateSenderByOTPWithHttpInfo($senderId, $otp = null)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -1797,7 +2209,7 @@ public function validateSenderByOTPWithHttpInfo($senderId, $otp = null)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1805,7 +2217,7 @@ public function validateSenderByOTPWithHttpInfo($senderId, $otp = null)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1818,17 +2230,22 @@ public function validateSenderByOTPWithHttpInfo($senderId, $otp = null)
/**
* Operation validateSenderByOTPAsync
*
- * Update a sender
+ * Validate Sender using OTP
*
* @param int $senderId Id of the sender (required)
- * @param \Brevo\Client\Model\Otp $otp otp (optional)
+ * @param \Brevo\Client\Models\Otp|null $sender otp (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['validateSenderByOTP'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function validateSenderByOTPAsync($senderId, $otp = null)
+ public function validateSenderByOTPAsync(
+ int $senderId,
+ ?\Brevo\Client\Models\Otp $sender = null,
+ string $contentType = self::contentTypes['validateSenderByOTP'][0]
+ ): PromiseInterface
{
- return $this->validateSenderByOTPAsyncWithHttpInfo($senderId, $otp)
+ return $this->validateSenderByOTPAsyncWithHttpInfo($senderId, $sender, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1839,18 +2256,24 @@ function ($response) {
/**
* Operation validateSenderByOTPAsyncWithHttpInfo
*
- * Update a sender
+ * Validate Sender using OTP
*
* @param int $senderId Id of the sender (required)
- * @param \Brevo\Client\Model\Otp $otp otp (optional)
+ * @param \Brevo\Client\Models\Otp|null $sender otp (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['validateSenderByOTP'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function validateSenderByOTPAsyncWithHttpInfo($senderId, $otp = null)
+ public function validateSenderByOTPAsyncWithHttpInfo(
+ $senderId,
+ $sender = null,
+ string $contentType = self::contentTypes['validateSenderByOTP'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->validateSenderByOTPRequest($senderId, $otp);
+ $request = $this->validateSenderByOTPRequest($senderId, $sender, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -1869,7 +2292,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1879,20 +2302,28 @@ function ($exception) {
* Create request for operation 'validateSenderByOTP'
*
* @param int $senderId Id of the sender (required)
- * @param \Brevo\Client\Model\Otp $otp otp (optional)
+ * @param \Brevo\Client\Models\Otp|null $sender otp (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['validateSenderByOTP'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function validateSenderByOTPRequest($senderId, $otp = null)
+ public function validateSenderByOTPRequest(
+ $senderId,
+ $sender = null,
+ string $contentType = self::contentTypes['validateSenderByOTP'][0]
+ ): Request
{
+
// verify the required parameter 'senderId' is set
if ($senderId === null || (is_array($senderId) && count($senderId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $senderId when calling validateSenderByOTP'
);
}
+
+
$resourcePath = '/senders/{senderId}/validate';
$formParams = [];
$queryParams = [];
@@ -1901,6 +2332,7 @@ protected function validateSenderByOTPRequest($senderId, $otp = null)
$multipart = false;
+
// path params
if ($senderId !== null) {
$resourcePath = str_replace(
@@ -1910,56 +2342,42 @@ protected function validateSenderByOTPRequest($senderId, $otp = null)
);
}
- // body params
- $_tempBody = null;
- if (isset($otp)) {
- $_tempBody = $otp;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($sender)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($sender));
+ } else {
+ $httpBody = $sender;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1985,10 +2403,11 @@ protected function validateSenderByOTPRequest($senderId, $otp = null)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'PUT',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -2000,7 +2419,7 @@ protected function validateSenderByOTPRequest($senderId, $otp = null)
* @throws \RuntimeException on file opening failure
* @return array of http client options
*/
- protected function createHttpClientOption()
+ protected function createHttpClientOption(): array
{
$options = [];
if ($this->config->getDebug()) {
diff --git a/lib/Api/TasksApi.php b/lib/Api/TasksApi.php
index 259ce0f..fbb4562 100644
--- a/lib/Api/TasksApi.php
+++ b/lib/Api/TasksApi.php
@@ -1,39 +1,41 @@
[
+ 'application/json',
+ ],
+ 'crmTasksIdDelete' => [
+ 'application/json',
+ ],
+ 'crmTasksIdGet' => [
+ 'application/json',
+ ],
+ 'crmTasksIdPatch' => [
+ 'application/json',
+ ],
+ 'crmTasksPost' => [
+ 'application/json',
+ ],
+ 'crmTasktypesGet' => [
+ 'application/json',
+ ],
+ ];
+
+ /**
+ * @param ClientInterface|null $client
+ * @param Configuration|null $config
+ * @param HeaderSelector|null $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
+ HeaderSelector $selector = null,
+ int $hostIndex = 0
) {
$this->client = $client ?: new Client();
- $this->config = $config ?: new Configuration();
+ $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(int $hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex(): int
+ {
+ return $this->hostIndex;
}
/**
* @return Configuration
*/
- public function getConfig()
+ public function getConfig(): Configuration
{
return $this->config;
}
@@ -92,27 +143,43 @@ public function getConfig()
*
* Get all tasks
*
- * @param string $filterType Filter by task type (ID) (optional)
- * @param string $filterStatus Filter by task status (optional)
- * @param string $filterDate Filter by date (optional)
- * @param string $filterAssignTo Filter by assignTo id (optional)
- * @param string $filterContacts Filter by contact ids (optional)
- * @param string $filterDeals Filter by deals ids (optional)
- * @param string $filterCompanies Filter by companies ids (optional)
- * @param int $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
- * @param int $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
- * @param int $offset Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- * @param string $sortBy The field used to sort field names. (optional)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\TaskList
+ * @param string|null $filterType Filter by task type (ID) (optional)
+ * @param string|null $filterStatus Filter by task status (optional)
+ * @param string|null $filterDate Filter by date (optional)
+ * @param string|null $filterAssignTo Filter by the \"assignTo\" ID. You can utilize account emails for the \"assignTo\" attribute. (optional)
+ * @param string|null $filterContacts Filter by contact ids (optional)
+ * @param string|null $filterDeals Filter by deals ids (optional)
+ * @param string|null $filterCompanies Filter by companies ids (optional)
+ * @param int|null $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
+ * @param int|null $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
+ * @param int|null $offset Index of the first document of the page (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param string|null $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
+ * @param string|null $sortBy The field used to sort field names. (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmTasksGet'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\TaskList|\Brevo\Client\Models\ErrorModel
*/
- public function crmTasksGet($filterType = null, $filterStatus = null, $filterDate = null, $filterAssignTo = null, $filterContacts = null, $filterDeals = null, $filterCompanies = null, $dateFrom = null, $dateTo = null, $offset = null, $limit = '50', $sort = null, $sortBy = null)
+ public function crmTasksGet(
+ ?string $filterType = null,
+ ?string $filterStatus = null,
+ ?string $filterDate = null,
+ ?string $filterAssignTo = null,
+ ?string $filterContacts = null,
+ ?string $filterDeals = null,
+ ?string $filterCompanies = null,
+ ?int $dateFrom = null,
+ ?int $dateTo = null,
+ ?int $offset = null,
+ ?int $limit = 50,
+ ?string $sort = null,
+ ?string $sortBy = null,
+ string $contentType = self::contentTypes['crmTasksGet'][0]
+ ): \Brevo\Client\Models\TaskList
{
- list($response) = $this->crmTasksGetWithHttpInfo($filterType, $filterStatus, $filterDate, $filterAssignTo, $filterContacts, $filterDeals, $filterCompanies, $dateFrom, $dateTo, $offset, $limit, $sort, $sortBy);
+ list($response) = $this->crmTasksGetWithHttpInfo($filterType, $filterStatus, $filterDate, $filterAssignTo, $filterContacts, $filterDeals, $filterCompanies, $dateFrom, $dateTo, $offset, $limit, $sort, $sortBy, $contentType);
return $response;
}
@@ -121,28 +188,43 @@ public function crmTasksGet($filterType = null, $filterStatus = null, $filterDat
*
* Get all tasks
*
- * @param string $filterType Filter by task type (ID) (optional)
- * @param string $filterStatus Filter by task status (optional)
- * @param string $filterDate Filter by date (optional)
- * @param string $filterAssignTo Filter by assignTo id (optional)
- * @param string $filterContacts Filter by contact ids (optional)
- * @param string $filterDeals Filter by deals ids (optional)
- * @param string $filterCompanies Filter by companies ids (optional)
- * @param int $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
- * @param int $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
- * @param int $offset Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- * @param string $sortBy The field used to sort field names. (optional)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\TaskList, HTTP status code, HTTP response headers (array of strings)
+ * @param string|null $filterType Filter by task type (ID) (optional)
+ * @param string|null $filterStatus Filter by task status (optional)
+ * @param string|null $filterDate Filter by date (optional)
+ * @param string|null $filterAssignTo Filter by the \"assignTo\" ID. You can utilize account emails for the \"assignTo\" attribute. (optional)
+ * @param string|null $filterContacts Filter by contact ids (optional)
+ * @param string|null $filterDeals Filter by deals ids (optional)
+ * @param string|null $filterCompanies Filter by companies ids (optional)
+ * @param int|null $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
+ * @param int|null $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
+ * @param int|null $offset Index of the first document of the page (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param string|null $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
+ * @param string|null $sortBy The field used to sort field names. (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmTasksGet'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\TaskList|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function crmTasksGetWithHttpInfo($filterType = null, $filterStatus = null, $filterDate = null, $filterAssignTo = null, $filterContacts = null, $filterDeals = null, $filterCompanies = null, $dateFrom = null, $dateTo = null, $offset = null, $limit = '50', $sort = null, $sortBy = null)
+ public function crmTasksGetWithHttpInfo(
+ ?string $filterType = null,
+ ?string $filterStatus = null,
+ ?string $filterDate = null,
+ ?string $filterAssignTo = null,
+ ?string $filterContacts = null,
+ ?string $filterDeals = null,
+ ?string $filterCompanies = null,
+ ?int $dateFrom = null,
+ ?int $dateTo = null,
+ ?int $offset = null,
+ ?int $limit = 50,
+ ?string $sort = null,
+ ?string $sortBy = null,
+ string $contentType = self::contentTypes['crmTasksGet'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\TaskList';
- $request = $this->crmTasksGetRequest($filterType, $filterStatus, $filterDate, $filterAssignTo, $filterContacts, $filterDeals, $filterCompanies, $dateFrom, $dateTo, $offset, $limit, $sort, $sortBy);
+ $request = $this->crmTasksGetRequest($filterType, $filterStatus, $filterDate, $filterAssignTo, $filterContacts, $filterDeals, $filterCompanies, $dateFrom, $dateTo, $offset, $limit, $sort, $sortBy, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -151,34 +233,111 @@ public function crmTasksGetWithHttpInfo($filterType = null, $filterStatus = null
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\TaskList', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\TaskList' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\TaskList', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\TaskList';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -193,7 +352,7 @@ public function crmTasksGetWithHttpInfo($filterType = null, $filterStatus = null
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\TaskList',
+ '\Brevo\Client\Models\TaskList',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -201,7 +360,7 @@ public function crmTasksGetWithHttpInfo($filterType = null, $filterStatus = null
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -216,26 +375,42 @@ public function crmTasksGetWithHttpInfo($filterType = null, $filterStatus = null
*
* Get all tasks
*
- * @param string $filterType Filter by task type (ID) (optional)
- * @param string $filterStatus Filter by task status (optional)
- * @param string $filterDate Filter by date (optional)
- * @param string $filterAssignTo Filter by assignTo id (optional)
- * @param string $filterContacts Filter by contact ids (optional)
- * @param string $filterDeals Filter by deals ids (optional)
- * @param string $filterCompanies Filter by companies ids (optional)
- * @param int $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
- * @param int $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
- * @param int $offset Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- * @param string $sortBy The field used to sort field names. (optional)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @param string|null $filterType Filter by task type (ID) (optional)
+ * @param string|null $filterStatus Filter by task status (optional)
+ * @param string|null $filterDate Filter by date (optional)
+ * @param string|null $filterAssignTo Filter by the \"assignTo\" ID. You can utilize account emails for the \"assignTo\" attribute. (optional)
+ * @param string|null $filterContacts Filter by contact ids (optional)
+ * @param string|null $filterDeals Filter by deals ids (optional)
+ * @param string|null $filterCompanies Filter by companies ids (optional)
+ * @param int|null $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
+ * @param int|null $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
+ * @param int|null $offset Index of the first document of the page (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param string|null $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
+ * @param string|null $sortBy The field used to sort field names. (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmTasksGet'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmTasksGetAsync($filterType = null, $filterStatus = null, $filterDate = null, $filterAssignTo = null, $filterContacts = null, $filterDeals = null, $filterCompanies = null, $dateFrom = null, $dateTo = null, $offset = null, $limit = '50', $sort = null, $sortBy = null)
+ public function crmTasksGetAsync(
+ ?string $filterType = null,
+ ?string $filterStatus = null,
+ ?string $filterDate = null,
+ ?string $filterAssignTo = null,
+ ?string $filterContacts = null,
+ ?string $filterDeals = null,
+ ?string $filterCompanies = null,
+ ?int $dateFrom = null,
+ ?int $dateTo = null,
+ ?int $offset = null,
+ ?int $limit = 50,
+ ?string $sort = null,
+ ?string $sortBy = null,
+ string $contentType = self::contentTypes['crmTasksGet'][0]
+ ): PromiseInterface
{
- return $this->crmTasksGetAsyncWithHttpInfo($filterType, $filterStatus, $filterDate, $filterAssignTo, $filterContacts, $filterDeals, $filterCompanies, $dateFrom, $dateTo, $offset, $limit, $sort, $sortBy)
+ return $this->crmTasksGetAsyncWithHttpInfo($filterType, $filterStatus, $filterDate, $filterAssignTo, $filterContacts, $filterDeals, $filterCompanies, $dateFrom, $dateTo, $offset, $limit, $sort, $sortBy, $contentType)
->then(
function ($response) {
return $response[0];
@@ -248,37 +423,53 @@ function ($response) {
*
* Get all tasks
*
- * @param string $filterType Filter by task type (ID) (optional)
- * @param string $filterStatus Filter by task status (optional)
- * @param string $filterDate Filter by date (optional)
- * @param string $filterAssignTo Filter by assignTo id (optional)
- * @param string $filterContacts Filter by contact ids (optional)
- * @param string $filterDeals Filter by deals ids (optional)
- * @param string $filterCompanies Filter by companies ids (optional)
- * @param int $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
- * @param int $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
- * @param int $offset Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- * @param string $sortBy The field used to sort field names. (optional)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @param string|null $filterType Filter by task type (ID) (optional)
+ * @param string|null $filterStatus Filter by task status (optional)
+ * @param string|null $filterDate Filter by date (optional)
+ * @param string|null $filterAssignTo Filter by the \"assignTo\" ID. You can utilize account emails for the \"assignTo\" attribute. (optional)
+ * @param string|null $filterContacts Filter by contact ids (optional)
+ * @param string|null $filterDeals Filter by deals ids (optional)
+ * @param string|null $filterCompanies Filter by companies ids (optional)
+ * @param int|null $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
+ * @param int|null $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
+ * @param int|null $offset Index of the first document of the page (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param string|null $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
+ * @param string|null $sortBy The field used to sort field names. (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmTasksGet'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmTasksGetAsyncWithHttpInfo($filterType = null, $filterStatus = null, $filterDate = null, $filterAssignTo = null, $filterContacts = null, $filterDeals = null, $filterCompanies = null, $dateFrom = null, $dateTo = null, $offset = null, $limit = '50', $sort = null, $sortBy = null)
+ public function crmTasksGetAsyncWithHttpInfo(
+ $filterType = null,
+ $filterStatus = null,
+ $filterDate = null,
+ $filterAssignTo = null,
+ $filterContacts = null,
+ $filterDeals = null,
+ $filterCompanies = null,
+ $dateFrom = null,
+ $dateTo = null,
+ $offset = null,
+ $limit = 50,
+ $sort = null,
+ $sortBy = null,
+ string $contentType = self::contentTypes['crmTasksGet'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\TaskList';
- $request = $this->crmTasksGetRequest($filterType, $filterStatus, $filterDate, $filterAssignTo, $filterContacts, $filterDeals, $filterCompanies, $dateFrom, $dateTo, $offset, $limit, $sort, $sortBy);
+ $returnType = '\Brevo\Client\Models\TaskList';
+ $request = $this->crmTasksGetRequest($filterType, $filterStatus, $filterDate, $filterAssignTo, $filterContacts, $filterDeals, $filterCompanies, $dateFrom, $dateTo, $offset, $limit, $sort, $sortBy, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -301,7 +492,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -310,26 +501,56 @@ function ($exception) {
/**
* Create request for operation 'crmTasksGet'
*
- * @param string $filterType Filter by task type (ID) (optional)
- * @param string $filterStatus Filter by task status (optional)
- * @param string $filterDate Filter by date (optional)
- * @param string $filterAssignTo Filter by assignTo id (optional)
- * @param string $filterContacts Filter by contact ids (optional)
- * @param string $filterDeals Filter by deals ids (optional)
- * @param string $filterCompanies Filter by companies ids (optional)
- * @param int $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
- * @param int $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
- * @param int $offset Index of the first document of the page (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
- * @param string $sortBy The field used to sort field names. (optional)
- *
- * @throws \InvalidArgumentException
+ * @param string|null $filterType Filter by task type (ID) (optional)
+ * @param string|null $filterStatus Filter by task status (optional)
+ * @param string|null $filterDate Filter by date (optional)
+ * @param string|null $filterAssignTo Filter by the \"assignTo\" ID. You can utilize account emails for the \"assignTo\" attribute. (optional)
+ * @param string|null $filterContacts Filter by contact ids (optional)
+ * @param string|null $filterDeals Filter by deals ids (optional)
+ * @param string|null $filterCompanies Filter by companies ids (optional)
+ * @param int|null $dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional)
+ * @param int|null $dateTo dateTo to date range filter type (timestamp in milliseconds) (optional)
+ * @param int|null $offset Index of the first document of the page (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param string|null $sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
+ * @param string|null $sortBy The field used to sort field names. (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmTasksGet'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function crmTasksGetRequest($filterType = null, $filterStatus = null, $filterDate = null, $filterAssignTo = null, $filterContacts = null, $filterDeals = null, $filterCompanies = null, $dateFrom = null, $dateTo = null, $offset = null, $limit = '50', $sort = null, $sortBy = null)
+ public function crmTasksGetRequest(
+ $filterType = null,
+ $filterStatus = null,
+ $filterDate = null,
+ $filterAssignTo = null,
+ $filterContacts = null,
+ $filterDeals = null,
+ $filterCompanies = null,
+ $dateFrom = null,
+ $dateTo = null,
+ $offset = null,
+ $limit = 50,
+ $sort = null,
+ $sortBy = null,
+ string $contentType = self::contentTypes['crmTasksGet'][0]
+ ): Request
{
+
+
+
+
+
+
+
+
+
+
+
+
+
+
$resourcePath = '/crm/tasks';
$formParams = [];
$queryParams = [];
@@ -338,106 +559,154 @@ protected function crmTasksGetRequest($filterType = null, $filterStatus = null,
$multipart = false;
// query params
- if ($filterType !== null) {
- $queryParams['filter[type]'] = ObjectSerializer::toQueryValue($filterType);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $filterType,
+ 'filter[type]', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($filterStatus !== null) {
- $queryParams['filter[status]'] = ObjectSerializer::toQueryValue($filterStatus);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $filterStatus,
+ 'filter[status]', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($filterDate !== null) {
- $queryParams['filter[date]'] = ObjectSerializer::toQueryValue($filterDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $filterDate,
+ 'filter[date]', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($filterAssignTo !== null) {
- $queryParams['filter[assignTo]'] = ObjectSerializer::toQueryValue($filterAssignTo);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $filterAssignTo,
+ 'filter[assignTo]', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($filterContacts !== null) {
- $queryParams['filter[contacts]'] = ObjectSerializer::toQueryValue($filterContacts);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $filterContacts,
+ 'filter[contacts]', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($filterDeals !== null) {
- $queryParams['filter[deals]'] = ObjectSerializer::toQueryValue($filterDeals);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $filterDeals,
+ 'filter[deals]', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($filterCompanies !== null) {
- $queryParams['filter[companies]'] = ObjectSerializer::toQueryValue($filterCompanies);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $filterCompanies,
+ 'filter[companies]', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($dateFrom !== null) {
- $queryParams['dateFrom'] = ObjectSerializer::toQueryValue($dateFrom);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $dateFrom,
+ 'dateFrom', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($dateTo !== null) {
- $queryParams['dateTo'] = ObjectSerializer::toQueryValue($dateTo);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $dateTo,
+ 'dateTo', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($sortBy !== null) {
- $queryParams['sortBy'] = ObjectSerializer::toQueryValue($sortBy);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sortBy,
+ 'sortBy', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -463,10 +732,11 @@ protected function crmTasksGetRequest($filterType = null, $filterStatus = null,
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -478,14 +748,18 @@ protected function crmTasksGetRequest($filterType = null, $filterStatus = null,
* Delete a task
*
* @param string $id id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmTasksIdDelete'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function crmTasksIdDelete($id)
+ public function crmTasksIdDelete(
+ string $id,
+ string $contentType = self::contentTypes['crmTasksIdDelete'][0]
+ ): void
{
- $this->crmTasksIdDeleteWithHttpInfo($id);
+ $this->crmTasksIdDeleteWithHttpInfo($id, $contentType);
}
/**
@@ -494,15 +768,18 @@ public function crmTasksIdDelete($id)
* Delete a task
*
* @param string $id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmTasksIdDelete'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function crmTasksIdDeleteWithHttpInfo($id)
+ public function crmTasksIdDeleteWithHttpInfo(
+ string $id,
+ string $contentType = self::contentTypes['crmTasksIdDelete'][0]
+ ): array
{
- $returnType = '';
- $request = $this->crmTasksIdDeleteRequest($id);
+ $request = $this->crmTasksIdDeleteRequest($id, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -511,26 +788,21 @@ public function crmTasksIdDeleteWithHttpInfo($id)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -539,7 +811,7 @@ public function crmTasksIdDeleteWithHttpInfo($id)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -547,7 +819,7 @@ public function crmTasksIdDeleteWithHttpInfo($id)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -563,13 +835,17 @@ public function crmTasksIdDeleteWithHttpInfo($id)
* Delete a task
*
* @param string $id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmTasksIdDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmTasksIdDeleteAsync($id)
+ public function crmTasksIdDeleteAsync(
+ string $id,
+ string $contentType = self::contentTypes['crmTasksIdDelete'][0]
+ ): PromiseInterface
{
- return $this->crmTasksIdDeleteAsyncWithHttpInfo($id)
+ return $this->crmTasksIdDeleteAsyncWithHttpInfo($id, $contentType)
->then(
function ($response) {
return $response[0];
@@ -583,14 +859,19 @@ function ($response) {
* Delete a task
*
* @param string $id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmTasksIdDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmTasksIdDeleteAsyncWithHttpInfo($id)
+ public function crmTasksIdDeleteAsyncWithHttpInfo(
+ $id,
+ string $contentType = self::contentTypes['crmTasksIdDelete'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->crmTasksIdDeleteRequest($id);
+ $request = $this->crmTasksIdDeleteRequest($id, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -609,7 +890,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -619,19 +900,25 @@ function ($exception) {
* Create request for operation 'crmTasksIdDelete'
*
* @param string $id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmTasksIdDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function crmTasksIdDeleteRequest($id)
+ public function crmTasksIdDeleteRequest(
+ $id,
+ string $contentType = self::contentTypes['crmTasksIdDelete'][0]
+ ): Request
{
+
// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $id when calling crmTasksIdDelete'
);
}
+
$resourcePath = '/crm/tasks/{id}';
$formParams = [];
$queryParams = [];
@@ -640,6 +927,7 @@ protected function crmTasksIdDeleteRequest($id)
$multipart = false;
+
// path params
if ($id !== null) {
$resourcePath = str_replace(
@@ -649,53 +937,35 @@ protected function crmTasksIdDeleteRequest($id)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -721,10 +991,11 @@ protected function crmTasksIdDeleteRequest($id)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -736,14 +1007,18 @@ protected function crmTasksIdDeleteRequest($id)
* Get a task
*
* @param string $id id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmTasksIdGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\Task
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\Task|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function crmTasksIdGet($id)
+ public function crmTasksIdGet(
+ string $id,
+ string $contentType = self::contentTypes['crmTasksIdGet'][0]
+ ): \Brevo\Client\Models\Task
{
- list($response) = $this->crmTasksIdGetWithHttpInfo($id);
+ list($response) = $this->crmTasksIdGetWithHttpInfo($id, $contentType);
return $response;
}
@@ -753,15 +1028,18 @@ public function crmTasksIdGet($id)
* Get a task
*
* @param string $id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmTasksIdGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\Task, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\Task|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function crmTasksIdGetWithHttpInfo($id)
+ public function crmTasksIdGetWithHttpInfo(
+ string $id,
+ string $contentType = self::contentTypes['crmTasksIdGet'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\Task';
- $request = $this->crmTasksIdGetRequest($id);
+ $request = $this->crmTasksIdGetRequest($id, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -770,34 +1048,138 @@ public function crmTasksIdGetWithHttpInfo($id)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\Task', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\Task' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\Task', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\Task';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -812,7 +1194,7 @@ public function crmTasksIdGetWithHttpInfo($id)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\Task',
+ '\Brevo\Client\Models\Task',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -820,7 +1202,7 @@ public function crmTasksIdGetWithHttpInfo($id)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -828,7 +1210,7 @@ public function crmTasksIdGetWithHttpInfo($id)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -844,13 +1226,17 @@ public function crmTasksIdGetWithHttpInfo($id)
* Get a task
*
* @param string $id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmTasksIdGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmTasksIdGetAsync($id)
+ public function crmTasksIdGetAsync(
+ string $id,
+ string $contentType = self::contentTypes['crmTasksIdGet'][0]
+ ): PromiseInterface
{
- return $this->crmTasksIdGetAsyncWithHttpInfo($id)
+ return $this->crmTasksIdGetAsyncWithHttpInfo($id, $contentType)
->then(
function ($response) {
return $response[0];
@@ -864,24 +1250,28 @@ function ($response) {
* Get a task
*
* @param string $id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmTasksIdGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmTasksIdGetAsyncWithHttpInfo($id)
+ public function crmTasksIdGetAsyncWithHttpInfo(
+ $id,
+ string $contentType = self::contentTypes['crmTasksIdGet'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\Task';
- $request = $this->crmTasksIdGetRequest($id);
+ $returnType = '\Brevo\Client\Models\Task';
+ $request = $this->crmTasksIdGetRequest($id, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -904,7 +1294,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -914,19 +1304,25 @@ function ($exception) {
* Create request for operation 'crmTasksIdGet'
*
* @param string $id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmTasksIdGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function crmTasksIdGetRequest($id)
+ public function crmTasksIdGetRequest(
+ $id,
+ string $contentType = self::contentTypes['crmTasksIdGet'][0]
+ ): Request
{
+
// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $id when calling crmTasksIdGet'
);
}
+
$resourcePath = '/crm/tasks/{id}';
$formParams = [];
$queryParams = [];
@@ -935,6 +1331,7 @@ protected function crmTasksIdGetRequest($id)
$multipart = false;
+
// path params
if ($id !== null) {
$resourcePath = str_replace(
@@ -944,53 +1341,35 @@ protected function crmTasksIdGetRequest($id)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1016,10 +1395,11 @@ protected function crmTasksIdGetRequest($id)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1031,15 +1411,20 @@ protected function crmTasksIdGetRequest($id)
* Update a task
*
* @param string $id id (required)
- * @param \Brevo\Client\Model\Body9 $body Updated task details. (required)
+ * @param \Brevo\Client\Models\CrmTasksIdPatchRequest $crmTasksIdPatchRequest Updated task details. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmTasksIdPatch'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function crmTasksIdPatch($id, $body)
+ public function crmTasksIdPatch(
+ string $id,
+ \Brevo\Client\Models\CrmTasksIdPatchRequest $crmTasksIdPatchRequest,
+ string $contentType = self::contentTypes['crmTasksIdPatch'][0]
+ ): void
{
- $this->crmTasksIdPatchWithHttpInfo($id, $body);
+ $this->crmTasksIdPatchWithHttpInfo($id, $crmTasksIdPatchRequest, $contentType);
}
/**
@@ -1048,16 +1433,20 @@ public function crmTasksIdPatch($id, $body)
* Update a task
*
* @param string $id (required)
- * @param \Brevo\Client\Model\Body9 $body Updated task details. (required)
+ * @param \Brevo\Client\Models\CrmTasksIdPatchRequest $crmTasksIdPatchRequest Updated task details. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmTasksIdPatch'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function crmTasksIdPatchWithHttpInfo($id, $body)
+ public function crmTasksIdPatchWithHttpInfo(
+ string $id,
+ \Brevo\Client\Models\CrmTasksIdPatchRequest $crmTasksIdPatchRequest,
+ string $contentType = self::contentTypes['crmTasksIdPatch'][0]
+ ): array
{
- $returnType = '';
- $request = $this->crmTasksIdPatchRequest($id, $body);
+ $request = $this->crmTasksIdPatchRequest($id, $crmTasksIdPatchRequest, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1066,26 +1455,21 @@ public function crmTasksIdPatchWithHttpInfo($id, $body)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -1094,7 +1478,7 @@ public function crmTasksIdPatchWithHttpInfo($id, $body)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1102,7 +1486,7 @@ public function crmTasksIdPatchWithHttpInfo($id, $body)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1118,14 +1502,19 @@ public function crmTasksIdPatchWithHttpInfo($id, $body)
* Update a task
*
* @param string $id (required)
- * @param \Brevo\Client\Model\Body9 $body Updated task details. (required)
+ * @param \Brevo\Client\Models\CrmTasksIdPatchRequest $crmTasksIdPatchRequest Updated task details. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmTasksIdPatch'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmTasksIdPatchAsync($id, $body)
+ public function crmTasksIdPatchAsync(
+ string $id,
+ \Brevo\Client\Models\CrmTasksIdPatchRequest $crmTasksIdPatchRequest,
+ string $contentType = self::contentTypes['crmTasksIdPatch'][0]
+ ): PromiseInterface
{
- return $this->crmTasksIdPatchAsyncWithHttpInfo($id, $body)
+ return $this->crmTasksIdPatchAsyncWithHttpInfo($id, $crmTasksIdPatchRequest, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1139,15 +1528,21 @@ function ($response) {
* Update a task
*
* @param string $id (required)
- * @param \Brevo\Client\Model\Body9 $body Updated task details. (required)
+ * @param \Brevo\Client\Models\CrmTasksIdPatchRequest $crmTasksIdPatchRequest Updated task details. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmTasksIdPatch'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmTasksIdPatchAsyncWithHttpInfo($id, $body)
+ public function crmTasksIdPatchAsyncWithHttpInfo(
+ $id,
+ $crmTasksIdPatchRequest,
+ string $contentType = self::contentTypes['crmTasksIdPatch'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->crmTasksIdPatchRequest($id, $body);
+ $request = $this->crmTasksIdPatchRequest($id, $crmTasksIdPatchRequest, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -1166,7 +1561,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1176,26 +1571,34 @@ function ($exception) {
* Create request for operation 'crmTasksIdPatch'
*
* @param string $id (required)
- * @param \Brevo\Client\Model\Body9 $body Updated task details. (required)
+ * @param \Brevo\Client\Models\CrmTasksIdPatchRequest $crmTasksIdPatchRequest Updated task details. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmTasksIdPatch'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function crmTasksIdPatchRequest($id, $body)
+ public function crmTasksIdPatchRequest(
+ $id,
+ $crmTasksIdPatchRequest,
+ string $contentType = self::contentTypes['crmTasksIdPatch'][0]
+ ): Request
{
+
// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $id when calling crmTasksIdPatch'
);
}
- // verify the required parameter 'body' is set
- if ($body === null || (is_array($body) && count($body) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $body when calling crmTasksIdPatch'
+
+ // verify the required parameter 'crmTasksIdPatchRequest' is set
+ if ($crmTasksIdPatchRequest === null || (is_array($crmTasksIdPatchRequest) && count($crmTasksIdPatchRequest) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $crmTasksIdPatchRequest when calling crmTasksIdPatch'
);
}
+
$resourcePath = '/crm/tasks/{id}';
$formParams = [];
$queryParams = [];
@@ -1204,6 +1607,7 @@ protected function crmTasksIdPatchRequest($id, $body)
$multipart = false;
+
// path params
if ($id !== null) {
$resourcePath = str_replace(
@@ -1213,56 +1617,42 @@ protected function crmTasksIdPatchRequest($id, $body)
);
}
- // body params
- $_tempBody = null;
- if (isset($body)) {
- $_tempBody = $body;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($crmTasksIdPatchRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($crmTasksIdPatchRequest));
+ } else {
+ $httpBody = $crmTasksIdPatchRequest;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1288,10 +1678,11 @@ protected function crmTasksIdPatchRequest($id, $body)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'PATCH',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1302,15 +1693,19 @@ protected function crmTasksIdPatchRequest($id, $body)
*
* Create a task
*
- * @param \Brevo\Client\Model\Body8 $body Task name. (required)
+ * @param \Brevo\Client\Models\CrmTasksPostRequest $crmTasksPostRequest Task name. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmTasksPost'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\InlineResponse2012
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CrmTasksPost201Response
*/
- public function crmTasksPost($body)
+ public function crmTasksPost(
+ \Brevo\Client\Models\CrmTasksPostRequest $crmTasksPostRequest,
+ string $contentType = self::contentTypes['crmTasksPost'][0]
+ ): \Brevo\Client\Models\CrmTasksPost201Response
{
- list($response) = $this->crmTasksPostWithHttpInfo($body);
+ list($response) = $this->crmTasksPostWithHttpInfo($crmTasksPostRequest, $contentType);
return $response;
}
@@ -1319,16 +1714,19 @@ public function crmTasksPost($body)
*
* Create a task
*
- * @param \Brevo\Client\Model\Body8 $body Task name. (required)
+ * @param \Brevo\Client\Models\CrmTasksPostRequest $crmTasksPostRequest Task name. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmTasksPost'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\InlineResponse2012, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CrmTasksPost201Response, HTTP status code, HTTP response headers (array of strings)
*/
- public function crmTasksPostWithHttpInfo($body)
+ public function crmTasksPostWithHttpInfo(
+ \Brevo\Client\Models\CrmTasksPostRequest $crmTasksPostRequest,
+ string $contentType = self::contentTypes['crmTasksPost'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\InlineResponse2012';
- $request = $this->crmTasksPostRequest($body);
+ $request = $this->crmTasksPostRequest($crmTasksPostRequest, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1337,34 +1735,84 @@ public function crmTasksPostWithHttpInfo($body)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 201:
+ if (in_array('\Brevo\Client\Models\CrmTasksPost201Response', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CrmTasksPost201Response' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CrmTasksPost201Response', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CrmTasksPost201Response';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1379,7 +1827,7 @@ public function crmTasksPostWithHttpInfo($body)
case 201:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\InlineResponse2012',
+ '\Brevo\Client\Models\CrmTasksPost201Response',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1394,14 +1842,18 @@ public function crmTasksPostWithHttpInfo($body)
*
* Create a task
*
- * @param \Brevo\Client\Model\Body8 $body Task name. (required)
+ * @param \Brevo\Client\Models\CrmTasksPostRequest $crmTasksPostRequest Task name. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmTasksPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmTasksPostAsync($body)
+ public function crmTasksPostAsync(
+ \Brevo\Client\Models\CrmTasksPostRequest $crmTasksPostRequest,
+ string $contentType = self::contentTypes['crmTasksPost'][0]
+ ): PromiseInterface
{
- return $this->crmTasksPostAsyncWithHttpInfo($body)
+ return $this->crmTasksPostAsyncWithHttpInfo($crmTasksPostRequest, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1414,25 +1866,29 @@ function ($response) {
*
* Create a task
*
- * @param \Brevo\Client\Model\Body8 $body Task name. (required)
+ * @param \Brevo\Client\Models\CrmTasksPostRequest $crmTasksPostRequest Task name. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmTasksPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmTasksPostAsyncWithHttpInfo($body)
+ public function crmTasksPostAsyncWithHttpInfo(
+ $crmTasksPostRequest,
+ string $contentType = self::contentTypes['crmTasksPost'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\InlineResponse2012';
- $request = $this->crmTasksPostRequest($body);
+ $returnType = '\Brevo\Client\Models\CrmTasksPost201Response';
+ $request = $this->crmTasksPostRequest($crmTasksPostRequest, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1455,7 +1911,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1464,20 +1920,26 @@ function ($exception) {
/**
* Create request for operation 'crmTasksPost'
*
- * @param \Brevo\Client\Model\Body8 $body Task name. (required)
+ * @param \Brevo\Client\Models\CrmTasksPostRequest $crmTasksPostRequest Task name. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmTasksPost'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function crmTasksPostRequest($body)
+ public function crmTasksPostRequest(
+ $crmTasksPostRequest,
+ string $contentType = self::contentTypes['crmTasksPost'][0]
+ ): Request
{
- // verify the required parameter 'body' is set
- if ($body === null || (is_array($body) && count($body) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $body when calling crmTasksPost'
+
+ // verify the required parameter 'crmTasksPostRequest' is set
+ if ($crmTasksPostRequest === null || (is_array($crmTasksPostRequest) && count($crmTasksPostRequest) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $crmTasksPostRequest when calling crmTasksPost'
);
}
+
$resourcePath = '/crm/tasks';
$formParams = [];
$queryParams = [];
@@ -1487,56 +1949,43 @@ protected function crmTasksPostRequest($body)
- // body params
- $_tempBody = null;
- if (isset($body)) {
- $_tempBody = $body;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($crmTasksPostRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($crmTasksPostRequest));
+ } else {
+ $httpBody = $crmTasksPostRequest;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1562,10 +2011,11 @@ protected function crmTasksPostRequest($body)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1576,14 +2026,17 @@ protected function crmTasksPostRequest($body)
*
* Get all task types
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmTasktypesGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\TaskTypes
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\TaskTypes
*/
- public function crmTasktypesGet()
+ public function crmTasktypesGet(
+ string $contentType = self::contentTypes['crmTasktypesGet'][0]
+ ): \Brevo\Client\Models\TaskTypes
{
- list($response) = $this->crmTasktypesGetWithHttpInfo();
+ list($response) = $this->crmTasktypesGetWithHttpInfo($contentType);
return $response;
}
@@ -1592,15 +2045,17 @@ public function crmTasktypesGet()
*
* Get all task types
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmTasktypesGet'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\TaskTypes, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\TaskTypes, HTTP status code, HTTP response headers (array of strings)
*/
- public function crmTasktypesGetWithHttpInfo()
+ public function crmTasktypesGetWithHttpInfo(
+ string $contentType = self::contentTypes['crmTasktypesGet'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\TaskTypes';
- $request = $this->crmTasktypesGetRequest();
+ $request = $this->crmTasktypesGetRequest($contentType);
try {
$options = $this->createHttpClientOption();
@@ -1609,34 +2064,84 @@ public function crmTasktypesGetWithHttpInfo()
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\TaskTypes', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\TaskTypes' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\TaskTypes', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\TaskTypes';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1651,7 +2156,7 @@ public function crmTasktypesGetWithHttpInfo()
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\TaskTypes',
+ '\Brevo\Client\Models\TaskTypes',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1666,13 +2171,16 @@ public function crmTasktypesGetWithHttpInfo()
*
* Get all task types
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmTasktypesGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmTasktypesGetAsync()
+ public function crmTasktypesGetAsync(
+ string $contentType = self::contentTypes['crmTasktypesGet'][0]
+ ): PromiseInterface
{
- return $this->crmTasktypesGetAsyncWithHttpInfo()
+ return $this->crmTasktypesGetAsyncWithHttpInfo($contentType)
->then(
function ($response) {
return $response[0];
@@ -1685,24 +2193,27 @@ function ($response) {
*
* Get all task types
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmTasktypesGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function crmTasktypesGetAsyncWithHttpInfo()
+ public function crmTasktypesGetAsyncWithHttpInfo(
+ string $contentType = self::contentTypes['crmTasktypesGet'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\TaskTypes';
- $request = $this->crmTasktypesGetRequest();
+ $returnType = '\Brevo\Client\Models\TaskTypes';
+ $request = $this->crmTasktypesGetRequest($contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1725,7 +2236,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1734,13 +2245,17 @@ function ($exception) {
/**
* Create request for operation 'crmTasktypesGet'
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['crmTasktypesGet'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function crmTasktypesGetRequest()
+ public function crmTasktypesGetRequest(
+ string $contentType = self::contentTypes['crmTasktypesGet'][0]
+ ): Request
{
+
$resourcePath = '/crm/tasktypes';
$formParams = [];
$queryParams = [];
@@ -1750,53 +2265,36 @@ protected function crmTasktypesGetRequest()
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1822,10 +2320,11 @@ protected function crmTasktypesGetRequest()
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1837,7 +2336,7 @@ protected function crmTasktypesGetRequest()
* @throws \RuntimeException on file opening failure
* @return array of http client options
*/
- protected function createHttpClientOption()
+ protected function createHttpClientOption(): array
{
$options = [];
if ($this->config->getDebug()) {
diff --git a/lib/Api/TierApi.php b/lib/Api/TierApi.php
new file mode 100644
index 0000000..66a154e
--- /dev/null
+++ b/lib/Api/TierApi.php
@@ -0,0 +1,4549 @@
+ [
+ 'application/json',
+ ],
+ 'createTierGroup' => [
+ 'application/json',
+ ],
+ 'deleteTierGroup' => [
+ 'application/json',
+ ],
+ 'getListOfTierGroups' => [
+ 'application/json',
+ ],
+ 'getLoyaltyProgramTier' => [
+ 'application/json',
+ ],
+ 'getTierGroup' => [
+ 'application/json',
+ ],
+ 'loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPost' => [
+ 'application/json',
+ ],
+ 'loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDelete' => [
+ 'application/json',
+ ],
+ 'loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPut' => [
+ 'application/json',
+ ],
+ 'updateTierGroup' => [
+ 'application/json',
+ ],
+ ];
+
+ /**
+ * @param ClientInterface|null $client
+ * @param Configuration|null $config
+ * @param HeaderSelector|null $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(int $hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex(): int
+ {
+ return $this->hostIndex;
+ }
+
+ /**
+ * @return Configuration
+ */
+ public function getConfig(): Configuration
+ {
+ return $this->config;
+ }
+
+ /**
+ * Operation createTierForTierGroup
+ *
+ * Create new tier
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $tierGroupId Tier group Id (required)
+ * @param \Brevo\Client\Models\TierRequest $tierRequest tierRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTierForTierGroup'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\Tier|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ValidationError
+ */
+ public function createTierForTierGroup(
+ string $loyaltyProgramId,
+ string $tierGroupId,
+ \Brevo\Client\Models\TierRequest $tierRequest,
+ string $contentType = self::contentTypes['createTierForTierGroup'][0]
+ ): \Brevo\Client\Models\Tier
+ {
+ list($response) = $this->createTierForTierGroupWithHttpInfo($loyaltyProgramId, $tierGroupId, $tierRequest, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation createTierForTierGroupWithHttpInfo
+ *
+ * Create new tier
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $tierGroupId Tier group Id (required)
+ * @param \Brevo\Client\Models\TierRequest $tierRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTierForTierGroup'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\Tier|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ValidationError, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function createTierForTierGroupWithHttpInfo(
+ string $loyaltyProgramId,
+ string $tierGroupId,
+ \Brevo\Client\Models\TierRequest $tierRequest,
+ string $contentType = self::contentTypes['createTierForTierGroup'][0]
+ ): array
+ {
+ $request = $this->createTierForTierGroupRequest($loyaltyProgramId, $tierGroupId, $tierRequest, $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 201:
+ if (in_array('\Brevo\Client\Models\Tier', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\Tier' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\Tier', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if (in_array('\Brevo\Client\Models\ValidationError', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ValidationError' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ValidationError', []),
+ $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 = '\Brevo\Client\Models\Tier';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 201:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\Tier',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation createTierForTierGroupAsync
+ *
+ * Create new tier
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $tierGroupId Tier group Id (required)
+ * @param \Brevo\Client\Models\TierRequest $tierRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTierForTierGroup'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function createTierForTierGroupAsync(
+ string $loyaltyProgramId,
+ string $tierGroupId,
+ \Brevo\Client\Models\TierRequest $tierRequest,
+ string $contentType = self::contentTypes['createTierForTierGroup'][0]
+ ): PromiseInterface
+ {
+ return $this->createTierForTierGroupAsyncWithHttpInfo($loyaltyProgramId, $tierGroupId, $tierRequest, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation createTierForTierGroupAsyncWithHttpInfo
+ *
+ * Create new tier
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $tierGroupId Tier group Id (required)
+ * @param \Brevo\Client\Models\TierRequest $tierRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTierForTierGroup'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function createTierForTierGroupAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $tierGroupId,
+ $tierRequest,
+ string $contentType = self::contentTypes['createTierForTierGroup'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\Tier';
+ $request = $this->createTierForTierGroupRequest($loyaltyProgramId, $tierGroupId, $tierRequest, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'createTierForTierGroup'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $tierGroupId Tier group Id (required)
+ * @param \Brevo\Client\Models\TierRequest $tierRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTierForTierGroup'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function createTierForTierGroupRequest(
+ $loyaltyProgramId,
+ $tierGroupId,
+ $tierRequest,
+ string $contentType = self::contentTypes['createTierForTierGroup'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling createTierForTierGroup'
+ );
+ }
+
+ // verify the required parameter 'tierGroupId' is set
+ if ($tierGroupId === null || (is_array($tierGroupId) && count($tierGroupId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $tierGroupId when calling createTierForTierGroup'
+ );
+ }
+
+ // verify the required parameter 'tierRequest' is set
+ if ($tierRequest === null || (is_array($tierRequest) && count($tierRequest) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $tierRequest when calling createTierForTierGroup'
+ );
+ }
+
+
+ $resourcePath = '/loyalty/tier/programs/{loyaltyProgramId}/tier-groups/{tierGroupId}/tiers';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($tierGroupId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'tierGroupId' . '}',
+ ObjectSerializer::toPathValue($tierGroupId),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($tierRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($tierRequest));
+ } else {
+ $httpBody = $tierRequest;
+ }
+ } 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 createTierGroup
+ *
+ * Create tier group
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\CreateTierGroupRequest $createTierGroupRequest Subscription Member information (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTierGroup'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\TierGroup|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ErrorResponse|\Brevo\Client\Models\ValidationError
+ */
+ public function createTierGroup(
+ string $loyaltyProgramId,
+ \Brevo\Client\Models\CreateTierGroupRequest $createTierGroupRequest,
+ string $contentType = self::contentTypes['createTierGroup'][0]
+ ): \Brevo\Client\Models\TierGroup
+ {
+ list($response) = $this->createTierGroupWithHttpInfo($loyaltyProgramId, $createTierGroupRequest, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation createTierGroupWithHttpInfo
+ *
+ * Create tier group
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\CreateTierGroupRequest $createTierGroupRequest Subscription Member information (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTierGroup'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\TierGroup|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ErrorResponse|\Brevo\Client\Models\ValidationError, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function createTierGroupWithHttpInfo(
+ string $loyaltyProgramId,
+ \Brevo\Client\Models\CreateTierGroupRequest $createTierGroupRequest,
+ string $contentType = self::contentTypes['createTierGroup'][0]
+ ): array
+ {
+ $request = $this->createTierGroupRequest($loyaltyProgramId, $createTierGroupRequest, $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 201:
+ if (in_array('\Brevo\Client\Models\TierGroup', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\TierGroup' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\TierGroup', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if (in_array('\Brevo\Client\Models\ErrorResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if (in_array('\Brevo\Client\Models\ValidationError', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ValidationError' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ValidationError', []),
+ $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 = '\Brevo\Client\Models\TierGroup';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 201:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\TierGroup',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation createTierGroupAsync
+ *
+ * Create tier group
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\CreateTierGroupRequest $createTierGroupRequest Subscription Member information (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTierGroup'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function createTierGroupAsync(
+ string $loyaltyProgramId,
+ \Brevo\Client\Models\CreateTierGroupRequest $createTierGroupRequest,
+ string $contentType = self::contentTypes['createTierGroup'][0]
+ ): PromiseInterface
+ {
+ return $this->createTierGroupAsyncWithHttpInfo($loyaltyProgramId, $createTierGroupRequest, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation createTierGroupAsyncWithHttpInfo
+ *
+ * Create tier group
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\CreateTierGroupRequest $createTierGroupRequest Subscription Member information (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTierGroup'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function createTierGroupAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $createTierGroupRequest,
+ string $contentType = self::contentTypes['createTierGroup'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\TierGroup';
+ $request = $this->createTierGroupRequest($loyaltyProgramId, $createTierGroupRequest, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'createTierGroup'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param \Brevo\Client\Models\CreateTierGroupRequest $createTierGroupRequest Subscription Member information (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTierGroup'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function createTierGroupRequest(
+ $loyaltyProgramId,
+ $createTierGroupRequest,
+ string $contentType = self::contentTypes['createTierGroup'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling createTierGroup'
+ );
+ }
+
+ // verify the required parameter 'createTierGroupRequest' is set
+ if ($createTierGroupRequest === null || (is_array($createTierGroupRequest) && count($createTierGroupRequest) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $createTierGroupRequest when calling createTierGroup'
+ );
+ }
+
+
+ $resourcePath = '/loyalty/tier/programs/{loyaltyProgramId}/tier-groups';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($createTierGroupRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createTierGroupRequest));
+ } else {
+ $httpBody = $createTierGroupRequest;
+ }
+ } 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 deleteTierGroup
+ *
+ * Delete tier group
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $tierGroupId Tier group Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTierGroup'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return void
+ */
+ public function deleteTierGroup(
+ string $loyaltyProgramId,
+ string $tierGroupId,
+ string $contentType = self::contentTypes['deleteTierGroup'][0]
+ ): void
+ {
+ $this->deleteTierGroupWithHttpInfo($loyaltyProgramId, $tierGroupId, $contentType);
+ }
+
+ /**
+ * Operation deleteTierGroupWithHttpInfo
+ *
+ * Delete tier group
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $tierGroupId Tier group Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTierGroup'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function deleteTierGroupWithHttpInfo(
+ string $loyaltyProgramId,
+ string $tierGroupId,
+ string $contentType = self::contentTypes['deleteTierGroup'][0]
+ ): array
+ {
+ $request = $this->deleteTierGroupRequest($loyaltyProgramId, $tierGroupId, $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();
+
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\UnauthorizedResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation deleteTierGroupAsync
+ *
+ * Delete tier group
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $tierGroupId Tier group Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTierGroup'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function deleteTierGroupAsync(
+ string $loyaltyProgramId,
+ string $tierGroupId,
+ string $contentType = self::contentTypes['deleteTierGroup'][0]
+ ): PromiseInterface
+ {
+ return $this->deleteTierGroupAsyncWithHttpInfo($loyaltyProgramId, $tierGroupId, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation deleteTierGroupAsyncWithHttpInfo
+ *
+ * Delete tier group
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $tierGroupId Tier group Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTierGroup'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function deleteTierGroupAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $tierGroupId,
+ string $contentType = self::contentTypes['deleteTierGroup'][0]
+ ): PromiseInterface
+ {
+ $returnType = '';
+ $request = $this->deleteTierGroupRequest($loyaltyProgramId, $tierGroupId, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $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 'deleteTierGroup'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $tierGroupId Tier group Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTierGroup'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function deleteTierGroupRequest(
+ $loyaltyProgramId,
+ $tierGroupId,
+ string $contentType = self::contentTypes['deleteTierGroup'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling deleteTierGroup'
+ );
+ }
+
+ // verify the required parameter 'tierGroupId' is set
+ if ($tierGroupId === null || (is_array($tierGroupId) && count($tierGroupId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $tierGroupId when calling deleteTierGroup'
+ );
+ }
+
+
+ $resourcePath = '/loyalty/tier/programs/{loyaltyProgramId}/tier-groups/{tierGroupId}';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($tierGroupId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'tierGroupId' . '}',
+ ObjectSerializer::toPathValue($tierGroupId),
+ $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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 getListOfTierGroups
+ *
+ * Get tier group page
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string|null $version Select 'active' to retrieve list of all tier groups which are live for clients. Select draft to retrieve list of all non deleted tier groups. (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getListOfTierGroups'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\TierGroupPage|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\UnauthorizedResponse|\Brevo\Client\Models\ValidationError
+ */
+ public function getListOfTierGroups(
+ string $loyaltyProgramId,
+ ?string $version = 'draft',
+ string $contentType = self::contentTypes['getListOfTierGroups'][0]
+ ): \Brevo\Client\Models\TierGroupPage
+ {
+ list($response) = $this->getListOfTierGroupsWithHttpInfo($loyaltyProgramId, $version, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation getListOfTierGroupsWithHttpInfo
+ *
+ * Get tier group page
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string|null $version Select 'active' to retrieve list of all tier groups which are live for clients. Select draft to retrieve list of all non deleted tier groups. (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getListOfTierGroups'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\TierGroupPage|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\UnauthorizedResponse|\Brevo\Client\Models\ValidationError, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function getListOfTierGroupsWithHttpInfo(
+ string $loyaltyProgramId,
+ ?string $version = 'draft',
+ string $contentType = self::contentTypes['getListOfTierGroups'][0]
+ ): array
+ {
+ $request = $this->getListOfTierGroupsRequest($loyaltyProgramId, $version, $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 (in_array('\Brevo\Client\Models\TierGroupPage', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\TierGroupPage' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\TierGroupPage', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if (in_array('\Brevo\Client\Models\UnauthorizedResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\UnauthorizedResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\UnauthorizedResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if (in_array('\Brevo\Client\Models\ValidationError', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ValidationError' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ValidationError', []),
+ $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 = '\Brevo\Client\Models\TierGroupPage';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\TierGroupPage',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\UnauthorizedResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation getListOfTierGroupsAsync
+ *
+ * Get tier group page
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string|null $version Select 'active' to retrieve list of all tier groups which are live for clients. Select draft to retrieve list of all non deleted tier groups. (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getListOfTierGroups'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getListOfTierGroupsAsync(
+ string $loyaltyProgramId,
+ ?string $version = 'draft',
+ string $contentType = self::contentTypes['getListOfTierGroups'][0]
+ ): PromiseInterface
+ {
+ return $this->getListOfTierGroupsAsyncWithHttpInfo($loyaltyProgramId, $version, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation getListOfTierGroupsAsyncWithHttpInfo
+ *
+ * Get tier group page
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string|null $version Select 'active' to retrieve list of all tier groups which are live for clients. Select draft to retrieve list of all non deleted tier groups. (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getListOfTierGroups'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getListOfTierGroupsAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $version = 'draft',
+ string $contentType = self::contentTypes['getListOfTierGroups'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\TierGroupPage';
+ $request = $this->getListOfTierGroupsRequest($loyaltyProgramId, $version, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'getListOfTierGroups'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string|null $version Select 'active' to retrieve list of all tier groups which are live for clients. Select draft to retrieve list of all non deleted tier groups. (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getListOfTierGroups'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function getListOfTierGroupsRequest(
+ $loyaltyProgramId,
+ $version = 'draft',
+ string $contentType = self::contentTypes['getListOfTierGroups'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling getListOfTierGroups'
+ );
+ }
+
+
+
+ $resourcePath = '/loyalty/tier/programs/{loyaltyProgramId}/tier-groups';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $version,
+ 'version', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 getLoyaltyProgramTier
+ *
+ * Get tier page
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string|null $version Select 'active' to retrieve list of all tiers which are live for clients. Select draft to retrieve list of all non deleted tiers. (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLoyaltyProgramTier'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\LoyaltyTierPage|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ValidationError
+ */
+ public function getLoyaltyProgramTier(
+ string $loyaltyProgramId,
+ ?string $version = 'draft',
+ string $contentType = self::contentTypes['getLoyaltyProgramTier'][0]
+ ): \Brevo\Client\Models\LoyaltyTierPage
+ {
+ list($response) = $this->getLoyaltyProgramTierWithHttpInfo($loyaltyProgramId, $version, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation getLoyaltyProgramTierWithHttpInfo
+ *
+ * Get tier page
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string|null $version Select 'active' to retrieve list of all tiers which are live for clients. Select draft to retrieve list of all non deleted tiers. (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLoyaltyProgramTier'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\LoyaltyTierPage|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ValidationError, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function getLoyaltyProgramTierWithHttpInfo(
+ string $loyaltyProgramId,
+ ?string $version = 'draft',
+ string $contentType = self::contentTypes['getLoyaltyProgramTier'][0]
+ ): array
+ {
+ $request = $this->getLoyaltyProgramTierRequest($loyaltyProgramId, $version, $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 (in_array('\Brevo\Client\Models\LoyaltyTierPage', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\LoyaltyTierPage' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\LoyaltyTierPage', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if (in_array('\Brevo\Client\Models\ValidationError', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ValidationError' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ValidationError', []),
+ $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 = '\Brevo\Client\Models\LoyaltyTierPage';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\LoyaltyTierPage',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation getLoyaltyProgramTierAsync
+ *
+ * Get tier page
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string|null $version Select 'active' to retrieve list of all tiers which are live for clients. Select draft to retrieve list of all non deleted tiers. (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLoyaltyProgramTier'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getLoyaltyProgramTierAsync(
+ string $loyaltyProgramId,
+ ?string $version = 'draft',
+ string $contentType = self::contentTypes['getLoyaltyProgramTier'][0]
+ ): PromiseInterface
+ {
+ return $this->getLoyaltyProgramTierAsyncWithHttpInfo($loyaltyProgramId, $version, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation getLoyaltyProgramTierAsyncWithHttpInfo
+ *
+ * Get tier page
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string|null $version Select 'active' to retrieve list of all tiers which are live for clients. Select draft to retrieve list of all non deleted tiers. (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLoyaltyProgramTier'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getLoyaltyProgramTierAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $version = 'draft',
+ string $contentType = self::contentTypes['getLoyaltyProgramTier'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\LoyaltyTierPage';
+ $request = $this->getLoyaltyProgramTierRequest($loyaltyProgramId, $version, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'getLoyaltyProgramTier'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string|null $version Select 'active' to retrieve list of all tiers which are live for clients. Select draft to retrieve list of all non deleted tiers. (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLoyaltyProgramTier'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function getLoyaltyProgramTierRequest(
+ $loyaltyProgramId,
+ $version = 'draft',
+ string $contentType = self::contentTypes['getLoyaltyProgramTier'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling getLoyaltyProgramTier'
+ );
+ }
+
+
+
+ $resourcePath = '/loyalty/tier/programs/{loyaltyProgramId}/tiers';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $version,
+ 'version', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 getTierGroup
+ *
+ * Get tier group by Id
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $tierGroupId Tier group Id (required)
+ * @param string|null $version Select active to retrieve active version of tier group. Select draft to retrieve latest changes in tier group. (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTierGroup'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\TierGroup|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\UnauthorizedResponse|\Brevo\Client\Models\ValidationError
+ */
+ public function getTierGroup(
+ string $loyaltyProgramId,
+ string $tierGroupId,
+ ?string $version = 'draft',
+ string $contentType = self::contentTypes['getTierGroup'][0]
+ ): \Brevo\Client\Models\TierGroup
+ {
+ list($response) = $this->getTierGroupWithHttpInfo($loyaltyProgramId, $tierGroupId, $version, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation getTierGroupWithHttpInfo
+ *
+ * Get tier group by Id
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $tierGroupId Tier group Id (required)
+ * @param string|null $version Select active to retrieve active version of tier group. Select draft to retrieve latest changes in tier group. (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTierGroup'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\TierGroup|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\UnauthorizedResponse|\Brevo\Client\Models\ValidationError, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function getTierGroupWithHttpInfo(
+ string $loyaltyProgramId,
+ string $tierGroupId,
+ ?string $version = 'draft',
+ string $contentType = self::contentTypes['getTierGroup'][0]
+ ): array
+ {
+ $request = $this->getTierGroupRequest($loyaltyProgramId, $tierGroupId, $version, $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 (in_array('\Brevo\Client\Models\TierGroup', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\TierGroup' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\TierGroup', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if (in_array('\Brevo\Client\Models\UnauthorizedResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\UnauthorizedResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\UnauthorizedResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if (in_array('\Brevo\Client\Models\ValidationError', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ValidationError' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ValidationError', []),
+ $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 = '\Brevo\Client\Models\TierGroup';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\TierGroup',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\UnauthorizedResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation getTierGroupAsync
+ *
+ * Get tier group by Id
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $tierGroupId Tier group Id (required)
+ * @param string|null $version Select active to retrieve active version of tier group. Select draft to retrieve latest changes in tier group. (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTierGroup'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getTierGroupAsync(
+ string $loyaltyProgramId,
+ string $tierGroupId,
+ ?string $version = 'draft',
+ string $contentType = self::contentTypes['getTierGroup'][0]
+ ): PromiseInterface
+ {
+ return $this->getTierGroupAsyncWithHttpInfo($loyaltyProgramId, $tierGroupId, $version, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation getTierGroupAsyncWithHttpInfo
+ *
+ * Get tier group by Id
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $tierGroupId Tier group Id (required)
+ * @param string|null $version Select active to retrieve active version of tier group. Select draft to retrieve latest changes in tier group. (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTierGroup'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function getTierGroupAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $tierGroupId,
+ $version = 'draft',
+ string $contentType = self::contentTypes['getTierGroup'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\TierGroup';
+ $request = $this->getTierGroupRequest($loyaltyProgramId, $tierGroupId, $version, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'getTierGroup'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $tierGroupId Tier group Id (required)
+ * @param string|null $version Select active to retrieve active version of tier group. Select draft to retrieve latest changes in tier group. (optional, default to 'draft')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTierGroup'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function getTierGroupRequest(
+ $loyaltyProgramId,
+ $tierGroupId,
+ $version = 'draft',
+ string $contentType = self::contentTypes['getTierGroup'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling getTierGroup'
+ );
+ }
+
+ // verify the required parameter 'tierGroupId' is set
+ if ($tierGroupId === null || (is_array($tierGroupId) && count($tierGroupId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $tierGroupId when calling getTierGroup'
+ );
+ }
+
+
+
+ $resourcePath = '/loyalty/tier/programs/{loyaltyProgramId}/tier-groups/{tierGroupId}';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $version,
+ 'version', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($tierGroupId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'tierGroupId' . '}',
+ ObjectSerializer::toPathValue($tierGroupId),
+ $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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPost
+ *
+ * Add subscription to a tier
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contactId Contact Id (required)
+ * @param string $tierId Tier Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPost'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\TierForContact|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\UpdateTierGroup404Response|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ValidationError
+ */
+ public function loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPost(
+ string $loyaltyProgramId,
+ string $contactId,
+ string $tierId,
+ string $contentType = self::contentTypes['loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPost'][0]
+ ): \Brevo\Client\Models\TierForContact
+ {
+ list($response) = $this->loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPostWithHttpInfo($loyaltyProgramId, $contactId, $tierId, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPostWithHttpInfo
+ *
+ * Add subscription to a tier
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contactId Contact Id (required)
+ * @param string $tierId Tier Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPost'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\TierForContact|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\UpdateTierGroup404Response|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ValidationError, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPostWithHttpInfo(
+ string $loyaltyProgramId,
+ string $contactId,
+ string $tierId,
+ string $contentType = self::contentTypes['loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPost'][0]
+ ): array
+ {
+ $request = $this->loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPostRequest($loyaltyProgramId, $contactId, $tierId, $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 (in_array('\Brevo\Client\Models\TierForContact', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\TierForContact' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\TierForContact', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\UpdateTierGroup404Response', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\UpdateTierGroup404Response' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\UpdateTierGroup404Response', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if (in_array('\Brevo\Client\Models\ValidationError', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ValidationError' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ValidationError', []),
+ $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 = '\Brevo\Client\Models\TierForContact';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\TierForContact',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\UpdateTierGroup404Response',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPostAsync
+ *
+ * Add subscription to a tier
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contactId Contact Id (required)
+ * @param string $tierId Tier Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPost'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPostAsync(
+ string $loyaltyProgramId,
+ string $contactId,
+ string $tierId,
+ string $contentType = self::contentTypes['loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPost'][0]
+ ): PromiseInterface
+ {
+ return $this->loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPostAsyncWithHttpInfo($loyaltyProgramId, $contactId, $tierId, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPostAsyncWithHttpInfo
+ *
+ * Add subscription to a tier
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contactId Contact Id (required)
+ * @param string $tierId Tier Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPost'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPostAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $contactId,
+ $tierId,
+ string $contentType = self::contentTypes['loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPost'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\TierForContact';
+ $request = $this->loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPostRequest($loyaltyProgramId, $contactId, $tierId, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPost'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $contactId Contact Id (required)
+ * @param string $tierId Tier Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPost'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPostRequest(
+ $loyaltyProgramId,
+ $contactId,
+ $tierId,
+ string $contentType = self::contentTypes['loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPost'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPost'
+ );
+ }
+
+ // verify the required parameter 'contactId' is set
+ if ($contactId === null || (is_array($contactId) && count($contactId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $contactId when calling loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPost'
+ );
+ }
+
+ // verify the required parameter 'tierId' is set
+ if ($tierId === null || (is_array($tierId) && count($tierId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $tierId when calling loyaltyTierProgramsLoyaltyProgramIdContactsContactIdTiersTierIdPost'
+ );
+ }
+
+
+ $resourcePath = '/loyalty/tier/programs/{loyaltyProgramId}/contacts/{contactId}/tiers/{tierId}';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($contactId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'contactId' . '}',
+ ObjectSerializer::toPathValue($contactId),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($tierId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'tierId' . '}',
+ ObjectSerializer::toPathValue($tierId),
+ $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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDelete
+ *
+ * Delete tier
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $tierId Tier Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDelete'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return void
+ */
+ public function loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDelete(
+ string $loyaltyProgramId,
+ string $tierId,
+ string $contentType = self::contentTypes['loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDelete'][0]
+ ): void
+ {
+ $this->loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDeleteWithHttpInfo($loyaltyProgramId, $tierId, $contentType);
+ }
+
+ /**
+ * Operation loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDeleteWithHttpInfo
+ *
+ * Delete tier
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $tierId Tier Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDelete'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDeleteWithHttpInfo(
+ string $loyaltyProgramId,
+ string $tierId,
+ string $contentType = self::contentTypes['loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDelete'][0]
+ ): array
+ {
+ $request = $this->loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDeleteRequest($loyaltyProgramId, $tierId, $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();
+
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDeleteAsync
+ *
+ * Delete tier
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $tierId Tier Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDelete'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDeleteAsync(
+ string $loyaltyProgramId,
+ string $tierId,
+ string $contentType = self::contentTypes['loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDelete'][0]
+ ): PromiseInterface
+ {
+ return $this->loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDeleteAsyncWithHttpInfo($loyaltyProgramId, $tierId, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDeleteAsyncWithHttpInfo
+ *
+ * Delete tier
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $tierId Tier Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDelete'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDeleteAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $tierId,
+ string $contentType = self::contentTypes['loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDelete'][0]
+ ): PromiseInterface
+ {
+ $returnType = '';
+ $request = $this->loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDeleteRequest($loyaltyProgramId, $tierId, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $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 'loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDelete'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $tierId Tier Id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDelete'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDeleteRequest(
+ $loyaltyProgramId,
+ $tierId,
+ string $contentType = self::contentTypes['loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDelete'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDelete'
+ );
+ }
+
+ // verify the required parameter 'tierId' is set
+ if ($tierId === null || (is_array($tierId) && count($tierId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $tierId when calling loyaltyTierProgramsLoyaltyProgramIdTiersTierIdDelete'
+ );
+ }
+
+
+ $resourcePath = '/loyalty/tier/programs/{loyaltyProgramId}/tiers/{tierId}';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($tierId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'tierId' . '}',
+ ObjectSerializer::toPathValue($tierId),
+ $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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPut
+ *
+ * Update tier
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $tierId Tier Id (required)
+ * @param \Brevo\Client\Models\TierRequest $tierRequest tierRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPut'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\Tier|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ValidationError
+ */
+ public function loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPut(
+ string $loyaltyProgramId,
+ string $tierId,
+ \Brevo\Client\Models\TierRequest $tierRequest,
+ string $contentType = self::contentTypes['loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPut'][0]
+ ): \Brevo\Client\Models\Tier
+ {
+ list($response) = $this->loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPutWithHttpInfo($loyaltyProgramId, $tierId, $tierRequest, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPutWithHttpInfo
+ *
+ * Update tier
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $tierId Tier Id (required)
+ * @param \Brevo\Client\Models\TierRequest $tierRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPut'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\Tier|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\ValidationError, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPutWithHttpInfo(
+ string $loyaltyProgramId,
+ string $tierId,
+ \Brevo\Client\Models\TierRequest $tierRequest,
+ string $contentType = self::contentTypes['loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPut'][0]
+ ): array
+ {
+ $request = $this->loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPutRequest($loyaltyProgramId, $tierId, $tierRequest, $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 (in_array('\Brevo\Client\Models\Tier', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\Tier' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\Tier', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if (in_array('\Brevo\Client\Models\ValidationError', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ValidationError' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ValidationError', []),
+ $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 = '\Brevo\Client\Models\Tier';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\Tier',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPutAsync
+ *
+ * Update tier
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $tierId Tier Id (required)
+ * @param \Brevo\Client\Models\TierRequest $tierRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPut'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPutAsync(
+ string $loyaltyProgramId,
+ string $tierId,
+ \Brevo\Client\Models\TierRequest $tierRequest,
+ string $contentType = self::contentTypes['loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPut'][0]
+ ): PromiseInterface
+ {
+ return $this->loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPutAsyncWithHttpInfo($loyaltyProgramId, $tierId, $tierRequest, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPutAsyncWithHttpInfo
+ *
+ * Update tier
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $tierId Tier Id (required)
+ * @param \Brevo\Client\Models\TierRequest $tierRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPut'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPutAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $tierId,
+ $tierRequest,
+ string $contentType = self::contentTypes['loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPut'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\Tier';
+ $request = $this->loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPutRequest($loyaltyProgramId, $tierId, $tierRequest, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPut'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $tierId Tier Id (required)
+ * @param \Brevo\Client\Models\TierRequest $tierRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPut'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPutRequest(
+ $loyaltyProgramId,
+ $tierId,
+ $tierRequest,
+ string $contentType = self::contentTypes['loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPut'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPut'
+ );
+ }
+
+ // verify the required parameter 'tierId' is set
+ if ($tierId === null || (is_array($tierId) && count($tierId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $tierId when calling loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPut'
+ );
+ }
+
+ // verify the required parameter 'tierRequest' is set
+ if ($tierRequest === null || (is_array($tierRequest) && count($tierRequest) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $tierRequest when calling loyaltyTierProgramsLoyaltyProgramIdTiersTierIdPut'
+ );
+ }
+
+
+ $resourcePath = '/loyalty/tier/programs/{loyaltyProgramId}/tiers/{tierId}';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($tierId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'tierId' . '}',
+ ObjectSerializer::toPathValue($tierId),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($tierRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($tierRequest));
+ } else {
+ $httpBody = $tierRequest;
+ }
+ } 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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 updateTierGroup
+ *
+ * Update tier group
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $tierGroupId Tier group Id (required)
+ * @param \Brevo\Client\Models\UpdateTierGroupRequest $updateTierGroupRequest updateTierGroupRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTierGroup'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\TierGroup|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\UnauthorizedResponse|\Brevo\Client\Models\UpdateTierGroup404Response|\Brevo\Client\Models\ErrorResponse|\Brevo\Client\Models\ValidationError
+ */
+ public function updateTierGroup(
+ string $loyaltyProgramId,
+ string $tierGroupId,
+ \Brevo\Client\Models\UpdateTierGroupRequest $updateTierGroupRequest,
+ string $contentType = self::contentTypes['updateTierGroup'][0]
+ ): \Brevo\Client\Models\TierGroup
+ {
+ list($response) = $this->updateTierGroupWithHttpInfo($loyaltyProgramId, $tierGroupId, $updateTierGroupRequest, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation updateTierGroupWithHttpInfo
+ *
+ * Update tier group
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $tierGroupId Tier group Id (required)
+ * @param \Brevo\Client\Models\UpdateTierGroupRequest $updateTierGroupRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTierGroup'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\TierGroup|\Brevo\Client\Models\BadRequestPayload|\Brevo\Client\Models\UnauthorizedResponse|\Brevo\Client\Models\UpdateTierGroup404Response|\Brevo\Client\Models\ErrorResponse|\Brevo\Client\Models\ValidationError, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function updateTierGroupWithHttpInfo(
+ string $loyaltyProgramId,
+ string $tierGroupId,
+ \Brevo\Client\Models\UpdateTierGroupRequest $updateTierGroupRequest,
+ string $contentType = self::contentTypes['updateTierGroup'][0]
+ ): array
+ {
+ $request = $this->updateTierGroupRequest($loyaltyProgramId, $tierGroupId, $updateTierGroupRequest, $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 (in_array('\Brevo\Client\Models\TierGroup', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\TierGroup' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\TierGroup', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\BadRequestPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\BadRequestPayload' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\BadRequestPayload', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if (in_array('\Brevo\Client\Models\UnauthorizedResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\UnauthorizedResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\UnauthorizedResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\UpdateTierGroup404Response', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\UpdateTierGroup404Response' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\UpdateTierGroup404Response', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if (in_array('\Brevo\Client\Models\ErrorResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if (in_array('\Brevo\Client\Models\ValidationError', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ValidationError' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ValidationError', []),
+ $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 = '\Brevo\Client\Models\TierGroup';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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(),
+ '\Brevo\Client\Models\TierGroup',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\BadRequestPayload',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\UnauthorizedResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\UpdateTierGroup404Response',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorResponse',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation updateTierGroupAsync
+ *
+ * Update tier group
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $tierGroupId Tier group Id (required)
+ * @param \Brevo\Client\Models\UpdateTierGroupRequest $updateTierGroupRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTierGroup'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function updateTierGroupAsync(
+ string $loyaltyProgramId,
+ string $tierGroupId,
+ \Brevo\Client\Models\UpdateTierGroupRequest $updateTierGroupRequest,
+ string $contentType = self::contentTypes['updateTierGroup'][0]
+ ): PromiseInterface
+ {
+ return $this->updateTierGroupAsyncWithHttpInfo($loyaltyProgramId, $tierGroupId, $updateTierGroupRequest, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation updateTierGroupAsyncWithHttpInfo
+ *
+ * Update tier group
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $tierGroupId Tier group Id (required)
+ * @param \Brevo\Client\Models\UpdateTierGroupRequest $updateTierGroupRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTierGroup'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
+ */
+ public function updateTierGroupAsyncWithHttpInfo(
+ $loyaltyProgramId,
+ $tierGroupId,
+ $updateTierGroupRequest,
+ string $contentType = self::contentTypes['updateTierGroup'][0]
+ ): PromiseInterface
+ {
+ $returnType = '\Brevo\Client\Models\TierGroup';
+ $request = $this->updateTierGroupRequest($loyaltyProgramId, $tierGroupId, $updateTierGroupRequest, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $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 'updateTierGroup'
+ *
+ * @param string $loyaltyProgramId Loyalty Program Id (required)
+ * @param string $tierGroupId Tier group Id (required)
+ * @param \Brevo\Client\Models\UpdateTierGroupRequest $updateTierGroupRequest (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTierGroup'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function updateTierGroupRequest(
+ $loyaltyProgramId,
+ $tierGroupId,
+ $updateTierGroupRequest,
+ string $contentType = self::contentTypes['updateTierGroup'][0]
+ ): Request
+ {
+
+ // verify the required parameter 'loyaltyProgramId' is set
+ if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $loyaltyProgramId when calling updateTierGroup'
+ );
+ }
+
+ // verify the required parameter 'tierGroupId' is set
+ if ($tierGroupId === null || (is_array($tierGroupId) && count($tierGroupId) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $tierGroupId when calling updateTierGroup'
+ );
+ }
+
+ // verify the required parameter 'updateTierGroupRequest' is set
+ if ($updateTierGroupRequest === null || (is_array($updateTierGroupRequest) && count($updateTierGroupRequest) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $updateTierGroupRequest when calling updateTierGroup'
+ );
+ }
+
+
+ $resourcePath = '/loyalty/tier/programs/{loyaltyProgramId}/tier-groups/{tierGroupId}';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($loyaltyProgramId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'loyaltyProgramId' . '}',
+ ObjectSerializer::toPathValue($loyaltyProgramId),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($tierGroupId !== null) {
+ $resourcePath = str_replace(
+ '{' . 'tierGroupId' . '}',
+ ObjectSerializer::toPathValue($tierGroupId),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($updateTierGroupRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($updateTierGroupRequest));
+ } else {
+ $httpBody = $updateTierGroupRequest;
+ }
+ } 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);
+ }
+ }
+
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('api-key');
+ if ($apiKey !== null) {
+ $headers['api-key'] = $apiKey;
+ }
+ // this endpoint requires API key authentication
+ $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
+ if ($apiKey !== null) {
+ $headers['partner-key'] = $apiKey;
+ }
+
+ $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(): array
+ {
+ $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/TransactionalEmailsApi.php b/lib/Api/TransactionalEmailsApi.php
index ceca9c1..236463a 100644
--- a/lib/Api/TransactionalEmailsApi.php
+++ b/lib/Api/TransactionalEmailsApi.php
@@ -1,39 +1,41 @@
[
+ 'application/json',
+ ],
+ 'createSmtpTemplate' => [
+ 'application/json',
+ ],
+ 'deleteBlockedDomain' => [
+ 'application/json',
+ ],
+ 'deleteHardbounces' => [
+ 'application/json',
+ ],
+ 'deleteScheduledEmailById' => [
+ 'application/json',
+ ],
+ 'deleteSmtpTemplate' => [
+ 'application/json',
+ ],
+ 'getAggregatedSmtpReport' => [
+ 'application/json',
+ ],
+ 'getBlockedDomains' => [
+ 'application/json',
+ ],
+ 'getEmailEventReport' => [
+ 'application/json',
+ ],
+ 'getScheduledEmailById' => [
+ 'application/json',
+ ],
+ 'getSmtpReport' => [
+ 'application/json',
+ ],
+ 'getSmtpTemplate' => [
+ 'application/json',
+ ],
+ 'getSmtpTemplates' => [
+ 'application/json',
+ ],
+ 'getTransacBlockedContacts' => [
+ 'application/json',
+ ],
+ 'getTransacEmailContent' => [
+ 'application/json',
+ ],
+ 'getTransacEmailsList' => [
+ 'application/json',
+ ],
+ 'sendTestTemplate' => [
+ 'application/json',
+ ],
+ 'sendTransacEmail' => [
+ 'application/json',
+ ],
+ 'smtpBlockedContactsEmailDelete' => [
+ 'application/json',
+ ],
+ 'smtpLogIdentifierDelete' => [
+ 'application/json',
+ ],
+ 'updateSmtpTemplate' => [
+ 'application/json',
+ ],
+ ];
+
+ /**
+ * @param ClientInterface|null $client
+ * @param Configuration|null $config
+ * @param HeaderSelector|null $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
+ HeaderSelector $selector = null,
+ int $hostIndex = 0
) {
$this->client = $client ?: new Client();
- $this->config = $config ?: new Configuration();
+ $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(int $hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex(): int
+ {
+ return $this->hostIndex;
}
/**
* @return Configuration
*/
- public function getConfig()
+ public function getConfig(): Configuration
{
return $this->config;
}
@@ -92,15 +188,19 @@ public function getConfig()
*
* Add a new domain to the list of blocked domains
*
- * @param \Brevo\Client\Model\BlockDomain $blockDomain blockDomain (required)
+ * @param \Brevo\Client\Models\BlockDomain $blockDomain Name of the domain to be blocked (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['blockNewDomain'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function blockNewDomain($blockDomain)
+ public function blockNewDomain(
+ \Brevo\Client\Models\BlockDomain $blockDomain,
+ string $contentType = self::contentTypes['blockNewDomain'][0]
+ ): void
{
- $this->blockNewDomainWithHttpInfo($blockDomain);
+ $this->blockNewDomainWithHttpInfo($blockDomain, $contentType);
}
/**
@@ -108,16 +208,19 @@ public function blockNewDomain($blockDomain)
*
* Add a new domain to the list of blocked domains
*
- * @param \Brevo\Client\Model\BlockDomain $blockDomain (required)
+ * @param \Brevo\Client\Models\BlockDomain $blockDomain Name of the domain to be blocked (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['blockNewDomain'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function blockNewDomainWithHttpInfo($blockDomain)
+ public function blockNewDomainWithHttpInfo(
+ \Brevo\Client\Models\BlockDomain $blockDomain,
+ string $contentType = self::contentTypes['blockNewDomain'][0]
+ ): array
{
- $returnType = '';
- $request = $this->blockNewDomainRequest($blockDomain);
+ $request = $this->blockNewDomainRequest($blockDomain, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -126,26 +229,21 @@ public function blockNewDomainWithHttpInfo($blockDomain)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -154,7 +252,7 @@ public function blockNewDomainWithHttpInfo($blockDomain)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -169,14 +267,18 @@ public function blockNewDomainWithHttpInfo($blockDomain)
*
* Add a new domain to the list of blocked domains
*
- * @param \Brevo\Client\Model\BlockDomain $blockDomain (required)
+ * @param \Brevo\Client\Models\BlockDomain $blockDomain Name of the domain to be blocked (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['blockNewDomain'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function blockNewDomainAsync($blockDomain)
+ public function blockNewDomainAsync(
+ \Brevo\Client\Models\BlockDomain $blockDomain,
+ string $contentType = self::contentTypes['blockNewDomain'][0]
+ ): PromiseInterface
{
- return $this->blockNewDomainAsyncWithHttpInfo($blockDomain)
+ return $this->blockNewDomainAsyncWithHttpInfo($blockDomain, $contentType)
->then(
function ($response) {
return $response[0];
@@ -189,15 +291,20 @@ function ($response) {
*
* Add a new domain to the list of blocked domains
*
- * @param \Brevo\Client\Model\BlockDomain $blockDomain (required)
+ * @param \Brevo\Client\Models\BlockDomain $blockDomain Name of the domain to be blocked (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['blockNewDomain'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function blockNewDomainAsyncWithHttpInfo($blockDomain)
+ public function blockNewDomainAsyncWithHttpInfo(
+ $blockDomain,
+ string $contentType = self::contentTypes['blockNewDomain'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->blockNewDomainRequest($blockDomain);
+ $request = $this->blockNewDomainRequest($blockDomain, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -216,7 +323,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -225,20 +332,26 @@ function ($exception) {
/**
* Create request for operation 'blockNewDomain'
*
- * @param \Brevo\Client\Model\BlockDomain $blockDomain (required)
+ * @param \Brevo\Client\Models\BlockDomain $blockDomain Name of the domain to be blocked (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['blockNewDomain'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function blockNewDomainRequest($blockDomain)
+ public function blockNewDomainRequest(
+ $blockDomain,
+ string $contentType = self::contentTypes['blockNewDomain'][0]
+ ): Request
{
+
// verify the required parameter 'blockDomain' is set
if ($blockDomain === null || (is_array($blockDomain) && count($blockDomain) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $blockDomain when calling blockNewDomain'
);
}
+
$resourcePath = '/smtp/blockedDomains';
$formParams = [];
$queryParams = [];
@@ -248,56 +361,43 @@ protected function blockNewDomainRequest($blockDomain)
- // body params
- $_tempBody = null;
- if (isset($blockDomain)) {
- $_tempBody = $blockDomain;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($blockDomain)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($blockDomain));
+ } else {
+ $httpBody = $blockDomain;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -323,10 +423,11 @@ protected function blockNewDomainRequest($blockDomain)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -337,15 +438,19 @@ protected function blockNewDomainRequest($blockDomain)
*
* Create an email template
*
- * @param \Brevo\Client\Model\CreateSmtpTemplate $smtpTemplate values to update in transactional email template (required)
+ * @param \Brevo\Client\Models\CreateSmtpTemplate $createSmtpTemplate values to update in transactional email template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSmtpTemplate'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\CreateModel
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CreateModel|\Brevo\Client\Models\ErrorModel
*/
- public function createSmtpTemplate($smtpTemplate)
+ public function createSmtpTemplate(
+ \Brevo\Client\Models\CreateSmtpTemplate $createSmtpTemplate,
+ string $contentType = self::contentTypes['createSmtpTemplate'][0]
+ ): \Brevo\Client\Models\CreateModel
{
- list($response) = $this->createSmtpTemplateWithHttpInfo($smtpTemplate);
+ list($response) = $this->createSmtpTemplateWithHttpInfo($createSmtpTemplate, $contentType);
return $response;
}
@@ -354,16 +459,19 @@ public function createSmtpTemplate($smtpTemplate)
*
* Create an email template
*
- * @param \Brevo\Client\Model\CreateSmtpTemplate $smtpTemplate values to update in transactional email template (required)
+ * @param \Brevo\Client\Models\CreateSmtpTemplate $createSmtpTemplate values to update in transactional email template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSmtpTemplate'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\CreateModel, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CreateModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function createSmtpTemplateWithHttpInfo($smtpTemplate)
+ public function createSmtpTemplateWithHttpInfo(
+ \Brevo\Client\Models\CreateSmtpTemplate $createSmtpTemplate,
+ string $contentType = self::contentTypes['createSmtpTemplate'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\CreateModel';
- $request = $this->createSmtpTemplateRequest($smtpTemplate);
+ $request = $this->createSmtpTemplateRequest($createSmtpTemplate, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -372,34 +480,111 @@ public function createSmtpTemplateWithHttpInfo($smtpTemplate)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 201:
+ if (in_array('\Brevo\Client\Models\CreateModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CreateModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CreateModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CreateModel';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -414,7 +599,7 @@ public function createSmtpTemplateWithHttpInfo($smtpTemplate)
case 201:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\CreateModel',
+ '\Brevo\Client\Models\CreateModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -422,7 +607,7 @@ public function createSmtpTemplateWithHttpInfo($smtpTemplate)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -437,14 +622,18 @@ public function createSmtpTemplateWithHttpInfo($smtpTemplate)
*
* Create an email template
*
- * @param \Brevo\Client\Model\CreateSmtpTemplate $smtpTemplate values to update in transactional email template (required)
+ * @param \Brevo\Client\Models\CreateSmtpTemplate $createSmtpTemplate values to update in transactional email template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSmtpTemplate'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createSmtpTemplateAsync($smtpTemplate)
+ public function createSmtpTemplateAsync(
+ \Brevo\Client\Models\CreateSmtpTemplate $createSmtpTemplate,
+ string $contentType = self::contentTypes['createSmtpTemplate'][0]
+ ): PromiseInterface
{
- return $this->createSmtpTemplateAsyncWithHttpInfo($smtpTemplate)
+ return $this->createSmtpTemplateAsyncWithHttpInfo($createSmtpTemplate, $contentType)
->then(
function ($response) {
return $response[0];
@@ -457,25 +646,29 @@ function ($response) {
*
* Create an email template
*
- * @param \Brevo\Client\Model\CreateSmtpTemplate $smtpTemplate values to update in transactional email template (required)
+ * @param \Brevo\Client\Models\CreateSmtpTemplate $createSmtpTemplate values to update in transactional email template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSmtpTemplate'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createSmtpTemplateAsyncWithHttpInfo($smtpTemplate)
+ public function createSmtpTemplateAsyncWithHttpInfo(
+ $createSmtpTemplate,
+ string $contentType = self::contentTypes['createSmtpTemplate'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\CreateModel';
- $request = $this->createSmtpTemplateRequest($smtpTemplate);
+ $returnType = '\Brevo\Client\Models\CreateModel';
+ $request = $this->createSmtpTemplateRequest($createSmtpTemplate, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -498,7 +691,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -507,20 +700,26 @@ function ($exception) {
/**
* Create request for operation 'createSmtpTemplate'
*
- * @param \Brevo\Client\Model\CreateSmtpTemplate $smtpTemplate values to update in transactional email template (required)
+ * @param \Brevo\Client\Models\CreateSmtpTemplate $createSmtpTemplate values to update in transactional email template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSmtpTemplate'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function createSmtpTemplateRequest($smtpTemplate)
+ public function createSmtpTemplateRequest(
+ $createSmtpTemplate,
+ string $contentType = self::contentTypes['createSmtpTemplate'][0]
+ ): Request
{
- // verify the required parameter 'smtpTemplate' is set
- if ($smtpTemplate === null || (is_array($smtpTemplate) && count($smtpTemplate) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $smtpTemplate when calling createSmtpTemplate'
+
+ // verify the required parameter 'createSmtpTemplate' is set
+ if ($createSmtpTemplate === null || (is_array($createSmtpTemplate) && count($createSmtpTemplate) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $createSmtpTemplate when calling createSmtpTemplate'
);
}
+
$resourcePath = '/smtp/templates';
$formParams = [];
$queryParams = [];
@@ -530,56 +729,43 @@ protected function createSmtpTemplateRequest($smtpTemplate)
- // body params
- $_tempBody = null;
- if (isset($smtpTemplate)) {
- $_tempBody = $smtpTemplate;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($createSmtpTemplate)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createSmtpTemplate));
+ } else {
+ $httpBody = $createSmtpTemplate;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -605,10 +791,11 @@ protected function createSmtpTemplateRequest($smtpTemplate)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -620,14 +807,18 @@ protected function createSmtpTemplateRequest($smtpTemplate)
* Unblock an existing domain from the list of blocked domains
*
* @param string $domain The name of the domain to be deleted (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteBlockedDomain'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function deleteBlockedDomain($domain)
+ public function deleteBlockedDomain(
+ string $domain,
+ string $contentType = self::contentTypes['deleteBlockedDomain'][0]
+ ): void
{
- $this->deleteBlockedDomainWithHttpInfo($domain);
+ $this->deleteBlockedDomainWithHttpInfo($domain, $contentType);
}
/**
@@ -636,15 +827,18 @@ public function deleteBlockedDomain($domain)
* Unblock an existing domain from the list of blocked domains
*
* @param string $domain The name of the domain to be deleted (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteBlockedDomain'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function deleteBlockedDomainWithHttpInfo($domain)
+ public function deleteBlockedDomainWithHttpInfo(
+ string $domain,
+ string $contentType = self::contentTypes['deleteBlockedDomain'][0]
+ ): array
{
- $returnType = '';
- $request = $this->deleteBlockedDomainRequest($domain);
+ $request = $this->deleteBlockedDomainRequest($domain, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -653,35 +847,38 @@ public function deleteBlockedDomainWithHttpInfo($domain)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
} catch (ApiException $e) {
switch ($e->getCode()) {
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Brevo\Client\Models\ErrorModel',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -697,13 +894,17 @@ public function deleteBlockedDomainWithHttpInfo($domain)
* Unblock an existing domain from the list of blocked domains
*
* @param string $domain The name of the domain to be deleted (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteBlockedDomain'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteBlockedDomainAsync($domain)
+ public function deleteBlockedDomainAsync(
+ string $domain,
+ string $contentType = self::contentTypes['deleteBlockedDomain'][0]
+ ): PromiseInterface
{
- return $this->deleteBlockedDomainAsyncWithHttpInfo($domain)
+ return $this->deleteBlockedDomainAsyncWithHttpInfo($domain, $contentType)
->then(
function ($response) {
return $response[0];
@@ -717,14 +918,19 @@ function ($response) {
* Unblock an existing domain from the list of blocked domains
*
* @param string $domain The name of the domain to be deleted (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteBlockedDomain'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteBlockedDomainAsyncWithHttpInfo($domain)
+ public function deleteBlockedDomainAsyncWithHttpInfo(
+ $domain,
+ string $contentType = self::contentTypes['deleteBlockedDomain'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->deleteBlockedDomainRequest($domain);
+ $request = $this->deleteBlockedDomainRequest($domain, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -743,7 +949,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -753,19 +959,25 @@ function ($exception) {
* Create request for operation 'deleteBlockedDomain'
*
* @param string $domain The name of the domain to be deleted (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteBlockedDomain'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function deleteBlockedDomainRequest($domain)
+ public function deleteBlockedDomainRequest(
+ $domain,
+ string $contentType = self::contentTypes['deleteBlockedDomain'][0]
+ ): Request
{
+
// verify the required parameter 'domain' is set
if ($domain === null || (is_array($domain) && count($domain) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $domain when calling deleteBlockedDomain'
);
}
+
$resourcePath = '/smtp/blockedDomains/{domain}';
$formParams = [];
$queryParams = [];
@@ -774,6 +986,7 @@ protected function deleteBlockedDomainRequest($domain)
$multipart = false;
+
// path params
if ($domain !== null) {
$resourcePath = str_replace(
@@ -783,53 +996,35 @@ protected function deleteBlockedDomainRequest($domain)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -855,10 +1050,11 @@ protected function deleteBlockedDomainRequest($domain)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -869,15 +1065,19 @@ protected function deleteBlockedDomainRequest($domain)
*
* Delete hardbounces
*
- * @param \Brevo\Client\Model\DeleteHardbounces $deleteHardbounces values to delete hardbounces (optional)
+ * @param \Brevo\Client\Models\DeleteHardbounces|null $deleteHardbounces values to delete hardbounces (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHardbounces'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function deleteHardbounces($deleteHardbounces = null)
+ public function deleteHardbounces(
+ ?\Brevo\Client\Models\DeleteHardbounces $deleteHardbounces = null,
+ string $contentType = self::contentTypes['deleteHardbounces'][0]
+ ): void
{
- $this->deleteHardbouncesWithHttpInfo($deleteHardbounces);
+ $this->deleteHardbouncesWithHttpInfo($deleteHardbounces, $contentType);
}
/**
@@ -885,16 +1085,19 @@ public function deleteHardbounces($deleteHardbounces = null)
*
* Delete hardbounces
*
- * @param \Brevo\Client\Model\DeleteHardbounces $deleteHardbounces values to delete hardbounces (optional)
+ * @param \Brevo\Client\Models\DeleteHardbounces|null $deleteHardbounces values to delete hardbounces (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHardbounces'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function deleteHardbouncesWithHttpInfo($deleteHardbounces = null)
+ public function deleteHardbouncesWithHttpInfo(
+ ?\Brevo\Client\Models\DeleteHardbounces $deleteHardbounces = null,
+ string $contentType = self::contentTypes['deleteHardbounces'][0]
+ ): array
{
- $returnType = '';
- $request = $this->deleteHardbouncesRequest($deleteHardbounces);
+ $request = $this->deleteHardbouncesRequest($deleteHardbounces, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -903,26 +1106,21 @@ public function deleteHardbouncesWithHttpInfo($deleteHardbounces = null)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -931,7 +1129,7 @@ public function deleteHardbouncesWithHttpInfo($deleteHardbounces = null)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -946,14 +1144,18 @@ public function deleteHardbouncesWithHttpInfo($deleteHardbounces = null)
*
* Delete hardbounces
*
- * @param \Brevo\Client\Model\DeleteHardbounces $deleteHardbounces values to delete hardbounces (optional)
+ * @param \Brevo\Client\Models\DeleteHardbounces|null $deleteHardbounces values to delete hardbounces (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHardbounces'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteHardbouncesAsync($deleteHardbounces = null)
+ public function deleteHardbouncesAsync(
+ ?\Brevo\Client\Models\DeleteHardbounces $deleteHardbounces = null,
+ string $contentType = self::contentTypes['deleteHardbounces'][0]
+ ): PromiseInterface
{
- return $this->deleteHardbouncesAsyncWithHttpInfo($deleteHardbounces)
+ return $this->deleteHardbouncesAsyncWithHttpInfo($deleteHardbounces, $contentType)
->then(
function ($response) {
return $response[0];
@@ -966,15 +1168,20 @@ function ($response) {
*
* Delete hardbounces
*
- * @param \Brevo\Client\Model\DeleteHardbounces $deleteHardbounces values to delete hardbounces (optional)
+ * @param \Brevo\Client\Models\DeleteHardbounces|null $deleteHardbounces values to delete hardbounces (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHardbounces'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteHardbouncesAsyncWithHttpInfo($deleteHardbounces = null)
+ public function deleteHardbouncesAsyncWithHttpInfo(
+ $deleteHardbounces = null,
+ string $contentType = self::contentTypes['deleteHardbounces'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->deleteHardbouncesRequest($deleteHardbounces);
+ $request = $this->deleteHardbouncesRequest($deleteHardbounces, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -993,7 +1200,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1002,14 +1209,20 @@ function ($exception) {
/**
* Create request for operation 'deleteHardbounces'
*
- * @param \Brevo\Client\Model\DeleteHardbounces $deleteHardbounces values to delete hardbounces (optional)
+ * @param \Brevo\Client\Models\DeleteHardbounces|null $deleteHardbounces values to delete hardbounces (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHardbounces'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function deleteHardbouncesRequest($deleteHardbounces = null)
+ public function deleteHardbouncesRequest(
+ $deleteHardbounces = null,
+ string $contentType = self::contentTypes['deleteHardbounces'][0]
+ ): Request
{
+
+
$resourcePath = '/smtp/deleteHardbounces';
$formParams = [];
$queryParams = [];
@@ -1019,56 +1232,43 @@ protected function deleteHardbouncesRequest($deleteHardbounces = null)
- // body params
- $_tempBody = null;
- if (isset($deleteHardbounces)) {
- $_tempBody = $deleteHardbounces;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($deleteHardbounces)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($deleteHardbounces));
+ } else {
+ $httpBody = $deleteHardbounces;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1094,10 +1294,11 @@ protected function deleteHardbouncesRequest($deleteHardbounces = null)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1109,14 +1310,18 @@ protected function deleteHardbouncesRequest($deleteHardbounces = null)
* Delete scheduled emails by batchId or messageId
*
* @param string $identifier The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteScheduledEmailById'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function deleteScheduledEmailById($identifier)
+ public function deleteScheduledEmailById(
+ string $identifier,
+ string $contentType = self::contentTypes['deleteScheduledEmailById'][0]
+ ): void
{
- $this->deleteScheduledEmailByIdWithHttpInfo($identifier);
+ $this->deleteScheduledEmailByIdWithHttpInfo($identifier, $contentType);
}
/**
@@ -1125,15 +1330,18 @@ public function deleteScheduledEmailById($identifier)
* Delete scheduled emails by batchId or messageId
*
* @param string $identifier The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteScheduledEmailById'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function deleteScheduledEmailByIdWithHttpInfo($identifier)
+ public function deleteScheduledEmailByIdWithHttpInfo(
+ string $identifier,
+ string $contentType = self::contentTypes['deleteScheduledEmailById'][0]
+ ): array
{
- $returnType = '';
- $request = $this->deleteScheduledEmailByIdRequest($identifier);
+ $request = $this->deleteScheduledEmailByIdRequest($identifier, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1142,26 +1350,21 @@ public function deleteScheduledEmailByIdWithHttpInfo($identifier)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -1170,7 +1373,7 @@ public function deleteScheduledEmailByIdWithHttpInfo($identifier)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1178,7 +1381,7 @@ public function deleteScheduledEmailByIdWithHttpInfo($identifier)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1194,13 +1397,17 @@ public function deleteScheduledEmailByIdWithHttpInfo($identifier)
* Delete scheduled emails by batchId or messageId
*
* @param string $identifier The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteScheduledEmailById'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteScheduledEmailByIdAsync($identifier)
+ public function deleteScheduledEmailByIdAsync(
+ string $identifier,
+ string $contentType = self::contentTypes['deleteScheduledEmailById'][0]
+ ): PromiseInterface
{
- return $this->deleteScheduledEmailByIdAsyncWithHttpInfo($identifier)
+ return $this->deleteScheduledEmailByIdAsyncWithHttpInfo($identifier, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1214,14 +1421,19 @@ function ($response) {
* Delete scheduled emails by batchId or messageId
*
* @param string $identifier The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteScheduledEmailById'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteScheduledEmailByIdAsyncWithHttpInfo($identifier)
+ public function deleteScheduledEmailByIdAsyncWithHttpInfo(
+ $identifier,
+ string $contentType = self::contentTypes['deleteScheduledEmailById'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->deleteScheduledEmailByIdRequest($identifier);
+ $request = $this->deleteScheduledEmailByIdRequest($identifier, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -1240,7 +1452,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1250,19 +1462,25 @@ function ($exception) {
* Create request for operation 'deleteScheduledEmailById'
*
* @param string $identifier The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteScheduledEmailById'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function deleteScheduledEmailByIdRequest($identifier)
+ public function deleteScheduledEmailByIdRequest(
+ $identifier,
+ string $contentType = self::contentTypes['deleteScheduledEmailById'][0]
+ ): Request
{
+
// verify the required parameter 'identifier' is set
if ($identifier === null || (is_array($identifier) && count($identifier) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $identifier when calling deleteScheduledEmailById'
);
}
+
$resourcePath = '/smtp/email/{identifier}';
$formParams = [];
$queryParams = [];
@@ -1271,6 +1489,7 @@ protected function deleteScheduledEmailByIdRequest($identifier)
$multipart = false;
+
// path params
if ($identifier !== null) {
$resourcePath = str_replace(
@@ -1280,53 +1499,35 @@ protected function deleteScheduledEmailByIdRequest($identifier)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1352,10 +1553,11 @@ protected function deleteScheduledEmailByIdRequest($identifier)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1367,14 +1569,18 @@ protected function deleteScheduledEmailByIdRequest($identifier)
* Delete an inactive email template
*
* @param int $templateId id of the template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSmtpTemplate'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function deleteSmtpTemplate($templateId)
+ public function deleteSmtpTemplate(
+ int $templateId,
+ string $contentType = self::contentTypes['deleteSmtpTemplate'][0]
+ ): void
{
- $this->deleteSmtpTemplateWithHttpInfo($templateId);
+ $this->deleteSmtpTemplateWithHttpInfo($templateId, $contentType);
}
/**
@@ -1383,15 +1589,18 @@ public function deleteSmtpTemplate($templateId)
* Delete an inactive email template
*
* @param int $templateId id of the template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSmtpTemplate'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function deleteSmtpTemplateWithHttpInfo($templateId)
+ public function deleteSmtpTemplateWithHttpInfo(
+ int $templateId,
+ string $contentType = self::contentTypes['deleteSmtpTemplate'][0]
+ ): array
{
- $returnType = '';
- $request = $this->deleteSmtpTemplateRequest($templateId);
+ $request = $this->deleteSmtpTemplateRequest($templateId, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1400,43 +1609,38 @@ public function deleteSmtpTemplateWithHttpInfo($templateId)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
} catch (ApiException $e) {
switch ($e->getCode()) {
- case 404:
+ case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 400:
+ case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1452,13 +1656,17 @@ public function deleteSmtpTemplateWithHttpInfo($templateId)
* Delete an inactive email template
*
* @param int $templateId id of the template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSmtpTemplate'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteSmtpTemplateAsync($templateId)
+ public function deleteSmtpTemplateAsync(
+ int $templateId,
+ string $contentType = self::contentTypes['deleteSmtpTemplate'][0]
+ ): PromiseInterface
{
- return $this->deleteSmtpTemplateAsyncWithHttpInfo($templateId)
+ return $this->deleteSmtpTemplateAsyncWithHttpInfo($templateId, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1472,14 +1680,19 @@ function ($response) {
* Delete an inactive email template
*
* @param int $templateId id of the template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSmtpTemplate'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteSmtpTemplateAsyncWithHttpInfo($templateId)
+ public function deleteSmtpTemplateAsyncWithHttpInfo(
+ $templateId,
+ string $contentType = self::contentTypes['deleteSmtpTemplate'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->deleteSmtpTemplateRequest($templateId);
+ $request = $this->deleteSmtpTemplateRequest($templateId, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -1498,7 +1711,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1508,19 +1721,25 @@ function ($exception) {
* Create request for operation 'deleteSmtpTemplate'
*
* @param int $templateId id of the template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSmtpTemplate'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function deleteSmtpTemplateRequest($templateId)
+ public function deleteSmtpTemplateRequest(
+ $templateId,
+ string $contentType = self::contentTypes['deleteSmtpTemplate'][0]
+ ): Request
{
+
// verify the required parameter 'templateId' is set
if ($templateId === null || (is_array($templateId) && count($templateId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $templateId when calling deleteSmtpTemplate'
);
}
+
$resourcePath = '/smtp/templates/{templateId}';
$formParams = [];
$queryParams = [];
@@ -1529,6 +1748,7 @@ protected function deleteSmtpTemplateRequest($templateId)
$multipart = false;
+
// path params
if ($templateId !== null) {
$resourcePath = str_replace(
@@ -1538,53 +1758,35 @@ protected function deleteSmtpTemplateRequest($templateId)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1610,10 +1812,11 @@ protected function deleteSmtpTemplateRequest($templateId)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1624,18 +1827,25 @@ protected function deleteSmtpTemplateRequest($templateId)
*
* Get your transactional email activity aggregated over a period of time
*
- * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
- * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional)
- * @param string $tag Tag of the emails (optional)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
+ * @param int|null $days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional)
+ * @param string|null $tag Tag of the emails (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAggregatedSmtpReport'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetAggregatedReport
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetAggregatedReport|\Brevo\Client\Models\ErrorModel
*/
- public function getAggregatedSmtpReport($startDate = null, $endDate = null, $days = null, $tag = null)
+ public function getAggregatedSmtpReport(
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $days = null,
+ ?string $tag = null,
+ string $contentType = self::contentTypes['getAggregatedSmtpReport'][0]
+ ): \Brevo\Client\Models\GetAggregatedReport
{
- list($response) = $this->getAggregatedSmtpReportWithHttpInfo($startDate, $endDate, $days, $tag);
+ list($response) = $this->getAggregatedSmtpReportWithHttpInfo($startDate, $endDate, $days, $tag, $contentType);
return $response;
}
@@ -1644,19 +1854,25 @@ public function getAggregatedSmtpReport($startDate = null, $endDate = null, $day
*
* Get your transactional email activity aggregated over a period of time
*
- * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
- * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional)
- * @param string $tag Tag of the emails (optional)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
+ * @param int|null $days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional)
+ * @param string|null $tag Tag of the emails (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAggregatedSmtpReport'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetAggregatedReport, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetAggregatedReport|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getAggregatedSmtpReportWithHttpInfo($startDate = null, $endDate = null, $days = null, $tag = null)
+ public function getAggregatedSmtpReportWithHttpInfo(
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $days = null,
+ ?string $tag = null,
+ string $contentType = self::contentTypes['getAggregatedSmtpReport'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetAggregatedReport';
- $request = $this->getAggregatedSmtpReportRequest($startDate, $endDate, $days, $tag);
+ $request = $this->getAggregatedSmtpReportRequest($startDate, $endDate, $days, $tag, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1665,34 +1881,111 @@ public function getAggregatedSmtpReportWithHttpInfo($startDate = null, $endDate
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetAggregatedReport', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetAggregatedReport' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetAggregatedReport', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetAggregatedReport';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1707,7 +2000,7 @@ public function getAggregatedSmtpReportWithHttpInfo($startDate = null, $endDate
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetAggregatedReport',
+ '\Brevo\Client\Models\GetAggregatedReport',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1715,7 +2008,7 @@ public function getAggregatedSmtpReportWithHttpInfo($startDate = null, $endDate
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1730,17 +2023,24 @@ public function getAggregatedSmtpReportWithHttpInfo($startDate = null, $endDate
*
* Get your transactional email activity aggregated over a period of time
*
- * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
- * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional)
- * @param string $tag Tag of the emails (optional)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
+ * @param int|null $days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional)
+ * @param string|null $tag Tag of the emails (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAggregatedSmtpReport'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getAggregatedSmtpReportAsync($startDate = null, $endDate = null, $days = null, $tag = null)
+ public function getAggregatedSmtpReportAsync(
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $days = null,
+ ?string $tag = null,
+ string $contentType = self::contentTypes['getAggregatedSmtpReport'][0]
+ ): PromiseInterface
{
- return $this->getAggregatedSmtpReportAsyncWithHttpInfo($startDate, $endDate, $days, $tag)
+ return $this->getAggregatedSmtpReportAsyncWithHttpInfo($startDate, $endDate, $days, $tag, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1753,28 +2053,35 @@ function ($response) {
*
* Get your transactional email activity aggregated over a period of time
*
- * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
- * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional)
- * @param string $tag Tag of the emails (optional)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
+ * @param int|null $days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional)
+ * @param string|null $tag Tag of the emails (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAggregatedSmtpReport'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getAggregatedSmtpReportAsyncWithHttpInfo($startDate = null, $endDate = null, $days = null, $tag = null)
+ public function getAggregatedSmtpReportAsyncWithHttpInfo(
+ $startDate = null,
+ $endDate = null,
+ $days = null,
+ $tag = null,
+ string $contentType = self::contentTypes['getAggregatedSmtpReport'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetAggregatedReport';
- $request = $this->getAggregatedSmtpReportRequest($startDate, $endDate, $days, $tag);
+ $returnType = '\Brevo\Client\Models\GetAggregatedReport';
+ $request = $this->getAggregatedSmtpReportRequest($startDate, $endDate, $days, $tag, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1797,7 +2104,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1806,17 +2113,29 @@ function ($exception) {
/**
* Create request for operation 'getAggregatedSmtpReport'
*
- * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
- * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional)
- * @param string $tag Tag of the emails (optional)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
+ * @param int|null $days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional)
+ * @param string|null $tag Tag of the emails (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAggregatedSmtpReport'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getAggregatedSmtpReportRequest($startDate = null, $endDate = null, $days = null, $tag = null)
+ public function getAggregatedSmtpReportRequest(
+ $startDate = null,
+ $endDate = null,
+ $days = null,
+ $tag = null,
+ string $contentType = self::contentTypes['getAggregatedSmtpReport'][0]
+ ): Request
{
+
+
+
+
+
$resourcePath = '/smtp/statistics/aggregatedReport';
$formParams = [];
$queryParams = [];
@@ -1825,70 +2144,73 @@ protected function getAggregatedSmtpReportRequest($startDate = null, $endDate =
$multipart = false;
// query params
- if ($startDate !== null) {
- $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $startDate,
+ 'startDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($endDate !== null) {
- $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $endDate,
+ 'endDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($days !== null) {
- $queryParams['days'] = ObjectSerializer::toQueryValue($days);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $days,
+ 'days', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($tag !== null) {
- $queryParams['tag'] = ObjectSerializer::toQueryValue($tag);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $tag,
+ 'tag', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1914,10 +2236,11 @@ protected function getAggregatedSmtpReportRequest($startDate = null, $endDate =
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1928,14 +2251,17 @@ protected function getAggregatedSmtpReportRequest($startDate = null, $endDate =
*
* Get the list of blocked domains
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBlockedDomains'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetBlockedDomains
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetBlockedDomains
*/
- public function getBlockedDomains()
+ public function getBlockedDomains(
+ string $contentType = self::contentTypes['getBlockedDomains'][0]
+ ): \Brevo\Client\Models\GetBlockedDomains
{
- list($response) = $this->getBlockedDomainsWithHttpInfo();
+ list($response) = $this->getBlockedDomainsWithHttpInfo($contentType);
return $response;
}
@@ -1944,15 +2270,17 @@ public function getBlockedDomains()
*
* Get the list of blocked domains
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBlockedDomains'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetBlockedDomains, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetBlockedDomains, HTTP status code, HTTP response headers (array of strings)
*/
- public function getBlockedDomainsWithHttpInfo()
+ public function getBlockedDomainsWithHttpInfo(
+ string $contentType = self::contentTypes['getBlockedDomains'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetBlockedDomains';
- $request = $this->getBlockedDomainsRequest();
+ $request = $this->getBlockedDomainsRequest($contentType);
try {
$options = $this->createHttpClientOption();
@@ -1961,34 +2289,84 @@ public function getBlockedDomainsWithHttpInfo()
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetBlockedDomains', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetBlockedDomains' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetBlockedDomains', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetBlockedDomains';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -2003,7 +2381,7 @@ public function getBlockedDomainsWithHttpInfo()
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetBlockedDomains',
+ '\Brevo\Client\Models\GetBlockedDomains',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2018,13 +2396,16 @@ public function getBlockedDomainsWithHttpInfo()
*
* Get the list of blocked domains
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBlockedDomains'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getBlockedDomainsAsync()
+ public function getBlockedDomainsAsync(
+ string $contentType = self::contentTypes['getBlockedDomains'][0]
+ ): PromiseInterface
{
- return $this->getBlockedDomainsAsyncWithHttpInfo()
+ return $this->getBlockedDomainsAsyncWithHttpInfo($contentType)
->then(
function ($response) {
return $response[0];
@@ -2037,24 +2418,27 @@ function ($response) {
*
* Get the list of blocked domains
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBlockedDomains'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getBlockedDomainsAsyncWithHttpInfo()
+ public function getBlockedDomainsAsyncWithHttpInfo(
+ string $contentType = self::contentTypes['getBlockedDomains'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetBlockedDomains';
- $request = $this->getBlockedDomainsRequest();
+ $returnType = '\Brevo\Client\Models\GetBlockedDomains';
+ $request = $this->getBlockedDomainsRequest($contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -2077,7 +2461,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -2086,13 +2470,17 @@ function ($exception) {
/**
* Create request for operation 'getBlockedDomains'
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBlockedDomains'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getBlockedDomainsRequest()
+ public function getBlockedDomainsRequest(
+ string $contentType = self::contentTypes['getBlockedDomains'][0]
+ ): Request
{
+
$resourcePath = '/smtp/blockedDomains';
$formParams = [];
$queryParams = [];
@@ -2102,53 +2490,36 @@ protected function getBlockedDomainsRequest()
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -2174,10 +2545,11 @@ protected function getBlockedDomainsRequest()
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -2188,25 +2560,39 @@ protected function getBlockedDomainsRequest()
*
* Get all your transactional email activity (unaggregated events)
*
- * @param int $limit Number limitation for the result returned (optional, default to 2500)
- * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0)
- * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
- * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional)
- * @param string $email Filter the report for a specific email addresses (optional)
- * @param string $event Filter the report for a specific event type (optional)
- * @param string $tags Filter the report for tags (serialized and urlencoded array) (optional)
- * @param string $messageId Filter on a specific message id (optional)
- * @param int $templateId Filter on a specific template id (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetEmailEventReport
+ * @param int|null $limit Number limitation for the result returned (optional, default to 2500)
+ * @param int|null $offset Beginning point in the list to retrieve from. (optional, default to 0)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
+ * @param int|null $days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional)
+ * @param string|null $email Filter the report for a specific email addresses (optional)
+ * @param string|null $event Filter the report for a specific event type (optional)
+ * @param string|null $tags Filter the report for tags (serialized and urlencoded array). To pass multiple tags, a format of string separated by commas is used such as **\"one, two, three\"** (optional)
+ * @param string|null $messageId Filter on a specific message id (optional)
+ * @param int|null $templateId Filter on a specific template id (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmailEventReport'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetEmailEventReport|\Brevo\Client\Models\ErrorModel
*/
- public function getEmailEventReport($limit = '2500', $offset = '0', $startDate = null, $endDate = null, $days = null, $email = null, $event = null, $tags = null, $messageId = null, $templateId = null, $sort = 'desc')
+ public function getEmailEventReport(
+ ?int $limit = 2500,
+ ?int $offset = 0,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $days = null,
+ ?string $email = null,
+ ?string $event = null,
+ ?string $tags = null,
+ ?string $messageId = null,
+ ?int $templateId = null,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getEmailEventReport'][0]
+ ): \Brevo\Client\Models\GetEmailEventReport
{
- list($response) = $this->getEmailEventReportWithHttpInfo($limit, $offset, $startDate, $endDate, $days, $email, $event, $tags, $messageId, $templateId, $sort);
+ list($response) = $this->getEmailEventReportWithHttpInfo($limit, $offset, $startDate, $endDate, $days, $email, $event, $tags, $messageId, $templateId, $sort, $contentType);
return $response;
}
@@ -2215,26 +2601,39 @@ public function getEmailEventReport($limit = '2500', $offset = '0', $startDate =
*
* Get all your transactional email activity (unaggregated events)
*
- * @param int $limit Number limitation for the result returned (optional, default to 2500)
- * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0)
- * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
- * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional)
- * @param string $email Filter the report for a specific email addresses (optional)
- * @param string $event Filter the report for a specific event type (optional)
- * @param string $tags Filter the report for tags (serialized and urlencoded array) (optional)
- * @param string $messageId Filter on a specific message id (optional)
- * @param int $templateId Filter on a specific template id (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetEmailEventReport, HTTP status code, HTTP response headers (array of strings)
+ * @param int|null $limit Number limitation for the result returned (optional, default to 2500)
+ * @param int|null $offset Beginning point in the list to retrieve from. (optional, default to 0)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
+ * @param int|null $days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional)
+ * @param string|null $email Filter the report for a specific email addresses (optional)
+ * @param string|null $event Filter the report for a specific event type (optional)
+ * @param string|null $tags Filter the report for tags (serialized and urlencoded array). To pass multiple tags, a format of string separated by commas is used such as **\"one, two, three\"** (optional)
+ * @param string|null $messageId Filter on a specific message id (optional)
+ * @param int|null $templateId Filter on a specific template id (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmailEventReport'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetEmailEventReport|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getEmailEventReportWithHttpInfo($limit = '2500', $offset = '0', $startDate = null, $endDate = null, $days = null, $email = null, $event = null, $tags = null, $messageId = null, $templateId = null, $sort = 'desc')
+ public function getEmailEventReportWithHttpInfo(
+ ?int $limit = 2500,
+ ?int $offset = 0,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $days = null,
+ ?string $email = null,
+ ?string $event = null,
+ ?string $tags = null,
+ ?string $messageId = null,
+ ?int $templateId = null,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getEmailEventReport'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetEmailEventReport';
- $request = $this->getEmailEventReportRequest($limit, $offset, $startDate, $endDate, $days, $email, $event, $tags, $messageId, $templateId, $sort);
+ $request = $this->getEmailEventReportRequest($limit, $offset, $startDate, $endDate, $days, $email, $event, $tags, $messageId, $templateId, $sort, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -2243,34 +2642,111 @@ public function getEmailEventReportWithHttpInfo($limit = '2500', $offset = '0',
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetEmailEventReport', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetEmailEventReport' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetEmailEventReport', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetEmailEventReport';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -2285,7 +2761,7 @@ public function getEmailEventReportWithHttpInfo($limit = '2500', $offset = '0',
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetEmailEventReport',
+ '\Brevo\Client\Models\GetEmailEventReport',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2293,7 +2769,7 @@ public function getEmailEventReportWithHttpInfo($limit = '2500', $offset = '0',
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2308,24 +2784,38 @@ public function getEmailEventReportWithHttpInfo($limit = '2500', $offset = '0',
*
* Get all your transactional email activity (unaggregated events)
*
- * @param int $limit Number limitation for the result returned (optional, default to 2500)
- * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0)
- * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
- * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional)
- * @param string $email Filter the report for a specific email addresses (optional)
- * @param string $event Filter the report for a specific event type (optional)
- * @param string $tags Filter the report for tags (serialized and urlencoded array) (optional)
- * @param string $messageId Filter on a specific message id (optional)
- * @param int $templateId Filter on a specific template id (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @param int|null $limit Number limitation for the result returned (optional, default to 2500)
+ * @param int|null $offset Beginning point in the list to retrieve from. (optional, default to 0)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
+ * @param int|null $days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional)
+ * @param string|null $email Filter the report for a specific email addresses (optional)
+ * @param string|null $event Filter the report for a specific event type (optional)
+ * @param string|null $tags Filter the report for tags (serialized and urlencoded array). To pass multiple tags, a format of string separated by commas is used such as **\"one, two, three\"** (optional)
+ * @param string|null $messageId Filter on a specific message id (optional)
+ * @param int|null $templateId Filter on a specific template id (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmailEventReport'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getEmailEventReportAsync($limit = '2500', $offset = '0', $startDate = null, $endDate = null, $days = null, $email = null, $event = null, $tags = null, $messageId = null, $templateId = null, $sort = 'desc')
+ public function getEmailEventReportAsync(
+ ?int $limit = 2500,
+ ?int $offset = 0,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $days = null,
+ ?string $email = null,
+ ?string $event = null,
+ ?string $tags = null,
+ ?string $messageId = null,
+ ?int $templateId = null,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getEmailEventReport'][0]
+ ): PromiseInterface
{
- return $this->getEmailEventReportAsyncWithHttpInfo($limit, $offset, $startDate, $endDate, $days, $email, $event, $tags, $messageId, $templateId, $sort)
+ return $this->getEmailEventReportAsyncWithHttpInfo($limit, $offset, $startDate, $endDate, $days, $email, $event, $tags, $messageId, $templateId, $sort, $contentType)
->then(
function ($response) {
return $response[0];
@@ -2338,35 +2828,49 @@ function ($response) {
*
* Get all your transactional email activity (unaggregated events)
*
- * @param int $limit Number limitation for the result returned (optional, default to 2500)
- * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0)
- * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
- * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional)
- * @param string $email Filter the report for a specific email addresses (optional)
- * @param string $event Filter the report for a specific event type (optional)
- * @param string $tags Filter the report for tags (serialized and urlencoded array) (optional)
- * @param string $messageId Filter on a specific message id (optional)
- * @param int $templateId Filter on a specific template id (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @param int|null $limit Number limitation for the result returned (optional, default to 2500)
+ * @param int|null $offset Beginning point in the list to retrieve from. (optional, default to 0)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
+ * @param int|null $days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional)
+ * @param string|null $email Filter the report for a specific email addresses (optional)
+ * @param string|null $event Filter the report for a specific event type (optional)
+ * @param string|null $tags Filter the report for tags (serialized and urlencoded array). To pass multiple tags, a format of string separated by commas is used such as **\"one, two, three\"** (optional)
+ * @param string|null $messageId Filter on a specific message id (optional)
+ * @param int|null $templateId Filter on a specific template id (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmailEventReport'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getEmailEventReportAsyncWithHttpInfo($limit = '2500', $offset = '0', $startDate = null, $endDate = null, $days = null, $email = null, $event = null, $tags = null, $messageId = null, $templateId = null, $sort = 'desc')
+ public function getEmailEventReportAsyncWithHttpInfo(
+ $limit = 2500,
+ $offset = 0,
+ $startDate = null,
+ $endDate = null,
+ $days = null,
+ $email = null,
+ $event = null,
+ $tags = null,
+ $messageId = null,
+ $templateId = null,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getEmailEventReport'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetEmailEventReport';
- $request = $this->getEmailEventReportRequest($limit, $offset, $startDate, $endDate, $days, $email, $event, $tags, $messageId, $templateId, $sort);
+ $returnType = '\Brevo\Client\Models\GetEmailEventReport';
+ $request = $this->getEmailEventReportRequest($limit, $offset, $startDate, $endDate, $days, $email, $event, $tags, $messageId, $templateId, $sort, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -2389,7 +2893,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -2398,29 +2902,54 @@ function ($exception) {
/**
* Create request for operation 'getEmailEventReport'
*
- * @param int $limit Number limitation for the result returned (optional, default to 2500)
- * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0)
- * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
- * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional)
- * @param string $email Filter the report for a specific email addresses (optional)
- * @param string $event Filter the report for a specific event type (optional)
- * @param string $tags Filter the report for tags (serialized and urlencoded array) (optional)
- * @param string $messageId Filter on a specific message id (optional)
- * @param int $templateId Filter on a specific template id (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \InvalidArgumentException
+ * @param int|null $limit Number limitation for the result returned (optional, default to 2500)
+ * @param int|null $offset Beginning point in the list to retrieve from. (optional, default to 0)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
+ * @param int|null $days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional)
+ * @param string|null $email Filter the report for a specific email addresses (optional)
+ * @param string|null $event Filter the report for a specific event type (optional)
+ * @param string|null $tags Filter the report for tags (serialized and urlencoded array). To pass multiple tags, a format of string separated by commas is used such as **\"one, two, three\"** (optional)
+ * @param string|null $messageId Filter on a specific message id (optional)
+ * @param int|null $templateId Filter on a specific template id (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmailEventReport'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getEmailEventReportRequest($limit = '2500', $offset = '0', $startDate = null, $endDate = null, $days = null, $email = null, $event = null, $tags = null, $messageId = null, $templateId = null, $sort = 'desc')
+ public function getEmailEventReportRequest(
+ $limit = 2500,
+ $offset = 0,
+ $startDate = null,
+ $endDate = null,
+ $days = null,
+ $email = null,
+ $event = null,
+ $tags = null,
+ $messageId = null,
+ $templateId = null,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getEmailEventReport'][0]
+ ): Request
{
+
if ($limit !== null && $limit > 5000) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling TransactionalEmailsApi.getEmailEventReport, must be smaller than or equal to 5000.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling TransactionalEmailsApi.getEmailEventReport, must be smaller than or equal to 5000.');
}
if ($limit !== null && $limit < 0) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling TransactionalEmailsApi.getEmailEventReport, must be bigger than or equal to 0.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling TransactionalEmailsApi.getEmailEventReport, must be bigger than or equal to 0.');
}
+
+
+
+
+
+
+
+
+
+
$resourcePath = '/smtp/statistics/events';
@@ -2431,98 +2960,136 @@ protected function getEmailEventReportRequest($limit = '2500', $offset = '0', $s
$multipart = false;
// query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($startDate !== null) {
- $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $startDate,
+ 'startDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($endDate !== null) {
- $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $endDate,
+ 'endDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($days !== null) {
- $queryParams['days'] = ObjectSerializer::toQueryValue($days);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $days,
+ 'days', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($email !== null) {
- $queryParams['email'] = ObjectSerializer::toQueryValue($email);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $email,
+ 'email', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($event !== null) {
- $queryParams['event'] = ObjectSerializer::toQueryValue($event);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $event,
+ 'event', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($tags !== null) {
- $queryParams['tags'] = ObjectSerializer::toQueryValue($tags);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $tags,
+ 'tags', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($messageId !== null) {
- $queryParams['messageId'] = ObjectSerializer::toQueryValue($messageId);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $messageId,
+ 'messageId', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($templateId !== null) {
- $queryParams['templateId'] = ObjectSerializer::toQueryValue($templateId);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $templateId,
+ 'templateId', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -2548,59 +3115,79 @@ protected function getEmailEventReportRequest($limit = '2500', $offset = '0', $s
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
}
/**
- * Operation getScheduledEmailByBatchId
+ * Operation getScheduledEmailById
*
- * Fetch scheduled emails by batchId
+ * Fetch scheduled emails by batchId or messageId
*
- * @param string $batchId The batchId of scheduled emails batch (Should be a valid UUIDv4) (required)
- * @param \DateTime $startDate Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional)
- * @param \DateTime $endDate Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param string $status Filter the records by `status` of the scheduled email batch or message. (optional)
- * @param int $limit Number of documents returned per page (optional, default to 100)
- * @param int $offset Index of the first document on the page (optional, default to 0)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetScheduledEmailByBatchId
+ * @param string $identifier The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. (required)
+ * @param \DateTime|null $startDate Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional)
+ * @param \DateTime|null $endDate Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed. Not valid when identifier is `messageId`. (optional, default to 'desc')
+ * @param string|null $status Filter the records by `status` of the scheduled email batch or message. Not valid when identifier is `messageId`. (optional)
+ * @param int|null $limit Number of documents returned per page. Not valid when identifier is `messageId`. (optional, default to 100)
+ * @param int|null $offset Index of the first document on the page. Not valid when identifier is `messageId`. (optional, default to 0)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getScheduledEmailById'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetScheduledEmailById200Response|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function getScheduledEmailByBatchId($batchId, $startDate = null, $endDate = null, $sort = 'desc', $status = null, $limit = '100', $offset = '0')
+ public function getScheduledEmailById(
+ string $identifier,
+ ?\DateTime $startDate = null,
+ ?\DateTime $endDate = null,
+ ?string $sort = 'desc',
+ ?string $status = null,
+ ?int $limit = 100,
+ ?int $offset = 0,
+ string $contentType = self::contentTypes['getScheduledEmailById'][0]
+ ): \Brevo\Client\Models\GetScheduledEmailById200Response
{
- list($response) = $this->getScheduledEmailByBatchIdWithHttpInfo($batchId, $startDate, $endDate, $sort, $status, $limit, $offset);
+ list($response) = $this->getScheduledEmailByIdWithHttpInfo($identifier, $startDate, $endDate, $sort, $status, $limit, $offset, $contentType);
return $response;
}
/**
- * Operation getScheduledEmailByBatchIdWithHttpInfo
+ * Operation getScheduledEmailByIdWithHttpInfo
*
- * Fetch scheduled emails by batchId
+ * Fetch scheduled emails by batchId or messageId
*
- * @param string $batchId The batchId of scheduled emails batch (Should be a valid UUIDv4) (required)
- * @param \DateTime $startDate Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional)
- * @param \DateTime $endDate Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param string $status Filter the records by `status` of the scheduled email batch or message. (optional)
- * @param int $limit Number of documents returned per page (optional, default to 100)
- * @param int $offset Index of the first document on the page (optional, default to 0)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetScheduledEmailByBatchId, HTTP status code, HTTP response headers (array of strings)
+ * @param string $identifier The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. (required)
+ * @param \DateTime|null $startDate Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional)
+ * @param \DateTime|null $endDate Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed. Not valid when identifier is `messageId`. (optional, default to 'desc')
+ * @param string|null $status Filter the records by `status` of the scheduled email batch or message. Not valid when identifier is `messageId`. (optional)
+ * @param int|null $limit Number of documents returned per page. Not valid when identifier is `messageId`. (optional, default to 100)
+ * @param int|null $offset Index of the first document on the page. Not valid when identifier is `messageId`. (optional, default to 0)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getScheduledEmailById'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetScheduledEmailById200Response|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getScheduledEmailByBatchIdWithHttpInfo($batchId, $startDate = null, $endDate = null, $sort = 'desc', $status = null, $limit = '100', $offset = '0')
+ public function getScheduledEmailByIdWithHttpInfo(
+ string $identifier,
+ ?\DateTime $startDate = null,
+ ?\DateTime $endDate = null,
+ ?string $sort = 'desc',
+ ?string $status = null,
+ ?int $limit = 100,
+ ?int $offset = 0,
+ string $contentType = self::contentTypes['getScheduledEmailById'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetScheduledEmailByBatchId';
- $request = $this->getScheduledEmailByBatchIdRequest($batchId, $startDate, $endDate, $sort, $status, $limit, $offset);
+ $request = $this->getScheduledEmailByIdRequest($identifier, $startDate, $endDate, $sort, $status, $limit, $offset, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -2609,382 +3196,138 @@ public function getScheduledEmailByBatchIdWithHttpInfo($batchId, $startDate = nu
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
);
- }
-
- $statusCode = $response->getStatusCode();
-
- if ($statusCode < 200 || $statusCode > 299) {
+ } catch (ConnectException $e) {
throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
- } else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
- }
- }
+ $statusCode = $response->getStatusCode();
- return [
- ObjectSerializer::deserialize($content, $returnType, []),
- $response->getStatusCode(),
- $response->getHeaders()
- ];
- } catch (ApiException $e) {
- switch ($e->getCode()) {
+ switch($statusCode) {
case 200:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\GetScheduledEmailByBatchId',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 400:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- }
- throw $e;
- }
- }
-
- /**
- * Operation getScheduledEmailByBatchIdAsync
- *
- * Fetch scheduled emails by batchId
- *
- * @param string $batchId The batchId of scheduled emails batch (Should be a valid UUIDv4) (required)
- * @param \DateTime $startDate Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional)
- * @param \DateTime $endDate Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param string $status Filter the records by `status` of the scheduled email batch or message. (optional)
- * @param int $limit Number of documents returned per page (optional, default to 100)
- * @param int $offset Index of the first document on the page (optional, default to 0)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getScheduledEmailByBatchIdAsync($batchId, $startDate = null, $endDate = null, $sort = 'desc', $status = null, $limit = '100', $offset = '0')
- {
- return $this->getScheduledEmailByBatchIdAsyncWithHttpInfo($batchId, $startDate, $endDate, $sort, $status, $limit, $offset)
- ->then(
- function ($response) {
- return $response[0];
- }
- );
- }
-
- /**
- * Operation getScheduledEmailByBatchIdAsyncWithHttpInfo
- *
- * Fetch scheduled emails by batchId
- *
- * @param string $batchId The batchId of scheduled emails batch (Should be a valid UUIDv4) (required)
- * @param \DateTime $startDate Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional)
- * @param \DateTime $endDate Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param string $status Filter the records by `status` of the scheduled email batch or message. (optional)
- * @param int $limit Number of documents returned per page (optional, default to 100)
- * @param int $offset Index of the first document on the page (optional, default to 0)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
- */
- public function getScheduledEmailByBatchIdAsyncWithHttpInfo($batchId, $startDate = null, $endDate = null, $sort = 'desc', $status = null, $limit = '100', $offset = '0')
- {
- $returnType = '\Brevo\Client\Model\GetScheduledEmailByBatchId';
- $request = $this->getScheduledEmailByBatchIdRequest($batchId, $startDate, $endDate, $sort, $status, $limit, $offset);
-
- return $this->client
- ->sendAsync($request, $this->createHttpClientOption())
- ->then(
- function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array('\Brevo\Client\Models\GetScheduledEmailById200Response', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
- if ($returnType !== 'string') {
- $content = json_decode($content);
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetScheduledEmailById200Response' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_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, []),
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetScheduledEmailById200Response', []),
$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(),
- $response->getBody()
- );
- }
- );
- }
-
- /**
- * Create request for operation 'getScheduledEmailByBatchId'
- *
- * @param string $batchId The batchId of scheduled emails batch (Should be a valid UUIDv4) (required)
- * @param \DateTime $startDate Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional)
- * @param \DateTime $endDate Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param string $status Filter the records by `status` of the scheduled email batch or message. (optional)
- * @param int $limit Number of documents returned per page (optional, default to 100)
- * @param int $offset Index of the first document on the page (optional, default to 0)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Psr7\Request
- */
- protected function getScheduledEmailByBatchIdRequest($batchId, $startDate = null, $endDate = null, $sort = 'desc', $status = null, $limit = '100', $offset = '0')
- {
- // verify the required parameter 'batchId' is set
- if ($batchId === null || (is_array($batchId) && count($batchId) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $batchId when calling getScheduledEmailByBatchId'
- );
- }
- if ($limit !== null && $limit > 500) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling TransactionalEmailsApi.getScheduledEmailByBatchId, must be smaller than or equal to 500.');
- }
- if ($limit !== null && $limit < 0) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling TransactionalEmailsApi.getScheduledEmailByBatchId, must be bigger than or equal to 0.');
- }
-
-
- $resourcePath = '/smtp/emailStatus/{batchId}';
- $formParams = [];
- $queryParams = [];
- $headerParams = [];
- $httpBody = '';
- $multipart = false;
-
- // query params
- if ($startDate !== null) {
- $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate);
- }
- // query params
- if ($endDate !== null) {
- $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate);
- }
- // query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
- // query params
- if ($status !== null) {
- $queryParams['status'] = ObjectSerializer::toQueryValue($status);
- }
- // query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
- // query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
-
- // path params
- if ($batchId !== null) {
- $resourcePath = str_replace(
- '{' . 'batchId' . '}',
- ObjectSerializer::toPathValue($batchId),
- $resourcePath
- );
- }
-
- // body params
- $_tempBody = null;
-
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
- // for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
- if ($multipart) {
- $multipartContents = [];
- foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $formParamValue
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
];
- }
- // for HTTP post (form)
- $httpBody = new MultipartStream($multipartContents);
-
- } elseif ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
- } else {
- // for HTTP post (form)
- $httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
- }
- }
-
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('api-key');
- if ($apiKey !== null) {
- $headers['api-key'] = $apiKey;
- }
- // this endpoint requires API key authentication
- $apiKey = $this->config->getApiKeyWithPrefix('partner-key');
- if ($apiKey !== null) {
- $headers['partner-key'] = $apiKey;
- }
-
- $defaultHeaders = [];
- if ($this->config->getUserAgent()) {
- $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
- }
-
- $headers = array_merge(
- $defaultHeaders,
- $headerParams,
- $headers
- );
-
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
- return new Request(
- 'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
- $headers,
- $httpBody
- );
- }
-
- /**
- * Operation getScheduledEmailByMessageId
- *
- * Fetch scheduled email by messageId
- *
- * @param string $messageId The messageId of scheduled email (required)
- * @param \DateTime $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional)
- * @param \DateTime $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetScheduledEmailByMessageId
- */
- public function getScheduledEmailByMessageId($messageId, $startDate = null, $endDate = null)
- {
- list($response) = $this->getScheduledEmailByMessageIdWithHttpInfo($messageId, $startDate, $endDate);
- return $response;
- }
-
- /**
- * Operation getScheduledEmailByMessageIdWithHttpInfo
- *
- * Fetch scheduled email by messageId
- *
- * @param string $messageId The messageId of scheduled email (required)
- * @param \DateTime $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional)
- * @param \DateTime $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetScheduledEmailByMessageId, HTTP status code, HTTP response headers (array of strings)
- */
- public function getScheduledEmailByMessageIdWithHttpInfo($messageId, $startDate = null, $endDate = null)
- {
- $returnType = '\Brevo\Client\Model\GetScheduledEmailByMessageId';
- $request = $this->getScheduledEmailByMessageIdRequest($messageId, $startDate, $endDate);
-
- try {
- $options = $this->createHttpClientOption();
- try {
- $response = $this->client->send($request, $options);
- } catch (RequestException $e) {
- throw new ApiException(
- "[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
- );
- }
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
- $statusCode = $response->getStatusCode();
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetScheduledEmailById200Response';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -2999,7 +3342,7 @@ public function getScheduledEmailByMessageIdWithHttpInfo($messageId, $startDate
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetScheduledEmailByMessageId',
+ '\Brevo\Client\Models\GetScheduledEmailById200Response',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -3007,7 +3350,7 @@ public function getScheduledEmailByMessageIdWithHttpInfo($messageId, $startDate
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -3015,7 +3358,7 @@ public function getScheduledEmailByMessageIdWithHttpInfo($messageId, $startDate
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -3026,20 +3369,34 @@ public function getScheduledEmailByMessageIdWithHttpInfo($messageId, $startDate
}
/**
- * Operation getScheduledEmailByMessageIdAsync
- *
- * Fetch scheduled email by messageId
+ * Operation getScheduledEmailByIdAsync
*
- * @param string $messageId The messageId of scheduled email (required)
- * @param \DateTime $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional)
- * @param \DateTime $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
+ * Fetch scheduled emails by batchId or messageId
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @param string $identifier The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. (required)
+ * @param \DateTime|null $startDate Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional)
+ * @param \DateTime|null $endDate Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed. Not valid when identifier is `messageId`. (optional, default to 'desc')
+ * @param string|null $status Filter the records by `status` of the scheduled email batch or message. Not valid when identifier is `messageId`. (optional)
+ * @param int|null $limit Number of documents returned per page. Not valid when identifier is `messageId`. (optional, default to 100)
+ * @param int|null $offset Index of the first document on the page. Not valid when identifier is `messageId`. (optional, default to 0)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getScheduledEmailById'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getScheduledEmailByMessageIdAsync($messageId, $startDate = null, $endDate = null)
+ public function getScheduledEmailByIdAsync(
+ string $identifier,
+ ?\DateTime $startDate = null,
+ ?\DateTime $endDate = null,
+ ?string $sort = 'desc',
+ ?string $status = null,
+ ?int $limit = 100,
+ ?int $offset = 0,
+ string $contentType = self::contentTypes['getScheduledEmailById'][0]
+ ): PromiseInterface
{
- return $this->getScheduledEmailByMessageIdAsyncWithHttpInfo($messageId, $startDate, $endDate)
+ return $this->getScheduledEmailByIdAsyncWithHttpInfo($identifier, $startDate, $endDate, $sort, $status, $limit, $offset, $contentType)
->then(
function ($response) {
return $response[0];
@@ -3048,31 +3405,45 @@ function ($response) {
}
/**
- * Operation getScheduledEmailByMessageIdAsyncWithHttpInfo
- *
- * Fetch scheduled email by messageId
+ * Operation getScheduledEmailByIdAsyncWithHttpInfo
*
- * @param string $messageId The messageId of scheduled email (required)
- * @param \DateTime $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional)
- * @param \DateTime $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
+ * Fetch scheduled emails by batchId or messageId
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @param string $identifier The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. (required)
+ * @param \DateTime|null $startDate Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional)
+ * @param \DateTime|null $endDate Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed. Not valid when identifier is `messageId`. (optional, default to 'desc')
+ * @param string|null $status Filter the records by `status` of the scheduled email batch or message. Not valid when identifier is `messageId`. (optional)
+ * @param int|null $limit Number of documents returned per page. Not valid when identifier is `messageId`. (optional, default to 100)
+ * @param int|null $offset Index of the first document on the page. Not valid when identifier is `messageId`. (optional, default to 0)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getScheduledEmailById'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getScheduledEmailByMessageIdAsyncWithHttpInfo($messageId, $startDate = null, $endDate = null)
+ public function getScheduledEmailByIdAsyncWithHttpInfo(
+ $identifier,
+ $startDate = null,
+ $endDate = null,
+ $sort = 'desc',
+ $status = null,
+ $limit = 100,
+ $offset = 0,
+ string $contentType = self::contentTypes['getScheduledEmailById'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetScheduledEmailByMessageId';
- $request = $this->getScheduledEmailByMessageIdRequest($messageId, $startDate, $endDate);
+ $returnType = '\Brevo\Client\Models\GetScheduledEmailById200Response';
+ $request = $this->getScheduledEmailByIdRequest($identifier, $startDate, $endDate, $sort, $status, $limit, $offset, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -3095,32 +3466,60 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
}
/**
- * Create request for operation 'getScheduledEmailByMessageId'
- *
- * @param string $messageId The messageId of scheduled email (required)
- * @param \DateTime $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional)
- * @param \DateTime $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
+ * Create request for operation 'getScheduledEmailById'
*
- * @throws \InvalidArgumentException
+ * @param string $identifier The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. (required)
+ * @param \DateTime|null $startDate Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional)
+ * @param \DateTime|null $endDate Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed. Not valid when identifier is `messageId`. (optional, default to 'desc')
+ * @param string|null $status Filter the records by `status` of the scheduled email batch or message. Not valid when identifier is `messageId`. (optional)
+ * @param int|null $limit Number of documents returned per page. Not valid when identifier is `messageId`. (optional, default to 100)
+ * @param int|null $offset Index of the first document on the page. Not valid when identifier is `messageId`. (optional, default to 0)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getScheduledEmailById'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getScheduledEmailByMessageIdRequest($messageId, $startDate = null, $endDate = null)
+ public function getScheduledEmailByIdRequest(
+ $identifier,
+ $startDate = null,
+ $endDate = null,
+ $sort = 'desc',
+ $status = null,
+ $limit = 100,
+ $offset = 0,
+ string $contentType = self::contentTypes['getScheduledEmailById'][0]
+ ): Request
{
- // verify the required parameter 'messageId' is set
- if ($messageId === null || (is_array($messageId) && count($messageId) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $messageId when calling getScheduledEmailByMessageId'
+
+ // verify the required parameter 'identifier' is set
+ if ($identifier === null || (is_array($identifier) && count($identifier) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $identifier when calling getScheduledEmailById'
);
}
- $resourcePath = '/smtp/emailStatus/{messageId}';
+
+
+
+
+ if ($limit !== null && $limit > 500) {
+ throw new InvalidArgumentException('invalid value for "$limit" when calling TransactionalEmailsApi.getScheduledEmailById, must be smaller than or equal to 500.');
+ }
+ if ($limit !== null && $limit < 0) {
+ throw new InvalidArgumentException('invalid value for "$limit" when calling TransactionalEmailsApi.getScheduledEmailById, must be bigger than or equal to 0.');
+ }
+
+
+
+ $resourcePath = '/smtp/emailStatus/{identifier}';
$formParams = [];
$queryParams = [];
$headerParams = [];
@@ -3128,70 +3527,99 @@ protected function getScheduledEmailByMessageIdRequest($messageId, $startDate =
$multipart = false;
// query params
- if ($startDate !== null) {
- $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $startDate,
+ 'startDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($endDate !== null) {
- $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $endDate,
+ 'endDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $status,
+ 'status', // 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(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
// path params
- if ($messageId !== null) {
+ if ($identifier !== null) {
$resourcePath = str_replace(
- '{' . 'messageId' . '}',
- ObjectSerializer::toPathValue($messageId),
+ '{' . 'identifier' . '}',
+ ObjectSerializer::toPathValue($identifier),
$resourcePath
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -3217,10 +3645,11 @@ protected function getScheduledEmailByMessageIdRequest($messageId, $startDate =
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -3231,21 +3660,31 @@ protected function getScheduledEmailByMessageIdRequest($messageId, $startDate =
*
* Get your transactional email activity aggregated per day
*
- * @param int $limit Number of documents returned per page (optional, default to 10)
- * @param int $offset Index of the first document on the page (optional, default to 0)
- * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional)
- * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional)
- * @param string $tag Tag of the emails (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetReports
+ * @param int|null $limit Number of documents returned per page (optional, default to 10)
+ * @param int|null $offset Index of the first document on the page (optional, default to 0)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD) (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD) (optional)
+ * @param int|null $days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional)
+ * @param string|null $tag Tag of the emails (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSmtpReport'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetReports|\Brevo\Client\Models\ErrorModel
*/
- public function getSmtpReport($limit = '10', $offset = '0', $startDate = null, $endDate = null, $days = null, $tag = null, $sort = 'desc')
+ public function getSmtpReport(
+ ?int $limit = 10,
+ ?int $offset = 0,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $days = null,
+ ?string $tag = null,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getSmtpReport'][0]
+ ): \Brevo\Client\Models\GetReports
{
- list($response) = $this->getSmtpReportWithHttpInfo($limit, $offset, $startDate, $endDate, $days, $tag, $sort);
+ list($response) = $this->getSmtpReportWithHttpInfo($limit, $offset, $startDate, $endDate, $days, $tag, $sort, $contentType);
return $response;
}
@@ -3254,22 +3693,31 @@ public function getSmtpReport($limit = '10', $offset = '0', $startDate = null, $
*
* Get your transactional email activity aggregated per day
*
- * @param int $limit Number of documents returned per page (optional, default to 10)
- * @param int $offset Index of the first document on the page (optional, default to 0)
- * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional)
- * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional)
- * @param string $tag Tag of the emails (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetReports, HTTP status code, HTTP response headers (array of strings)
+ * @param int|null $limit Number of documents returned per page (optional, default to 10)
+ * @param int|null $offset Index of the first document on the page (optional, default to 0)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD) (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD) (optional)
+ * @param int|null $days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional)
+ * @param string|null $tag Tag of the emails (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSmtpReport'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetReports|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getSmtpReportWithHttpInfo($limit = '10', $offset = '0', $startDate = null, $endDate = null, $days = null, $tag = null, $sort = 'desc')
+ public function getSmtpReportWithHttpInfo(
+ ?int $limit = 10,
+ ?int $offset = 0,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $days = null,
+ ?string $tag = null,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getSmtpReport'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetReports';
- $request = $this->getSmtpReportRequest($limit, $offset, $startDate, $endDate, $days, $tag, $sort);
+ $request = $this->getSmtpReportRequest($limit, $offset, $startDate, $endDate, $days, $tag, $sort, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -3278,34 +3726,111 @@ public function getSmtpReportWithHttpInfo($limit = '10', $offset = '0', $startDa
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetReports', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetReports' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetReports', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetReports';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -3320,7 +3845,7 @@ public function getSmtpReportWithHttpInfo($limit = '10', $offset = '0', $startDa
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetReports',
+ '\Brevo\Client\Models\GetReports',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -3328,7 +3853,7 @@ public function getSmtpReportWithHttpInfo($limit = '10', $offset = '0', $startDa
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -3343,20 +3868,30 @@ public function getSmtpReportWithHttpInfo($limit = '10', $offset = '0', $startDa
*
* Get your transactional email activity aggregated per day
*
- * @param int $limit Number of documents returned per page (optional, default to 10)
- * @param int $offset Index of the first document on the page (optional, default to 0)
- * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional)
- * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional)
- * @param string $tag Tag of the emails (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @param int|null $limit Number of documents returned per page (optional, default to 10)
+ * @param int|null $offset Index of the first document on the page (optional, default to 0)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD) (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD) (optional)
+ * @param int|null $days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional)
+ * @param string|null $tag Tag of the emails (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSmtpReport'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getSmtpReportAsync($limit = '10', $offset = '0', $startDate = null, $endDate = null, $days = null, $tag = null, $sort = 'desc')
+ public function getSmtpReportAsync(
+ ?int $limit = 10,
+ ?int $offset = 0,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $days = null,
+ ?string $tag = null,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getSmtpReport'][0]
+ ): PromiseInterface
{
- return $this->getSmtpReportAsyncWithHttpInfo($limit, $offset, $startDate, $endDate, $days, $tag, $sort)
+ return $this->getSmtpReportAsyncWithHttpInfo($limit, $offset, $startDate, $endDate, $days, $tag, $sort, $contentType)
->then(
function ($response) {
return $response[0];
@@ -3369,31 +3904,41 @@ function ($response) {
*
* Get your transactional email activity aggregated per day
*
- * @param int $limit Number of documents returned per page (optional, default to 10)
- * @param int $offset Index of the first document on the page (optional, default to 0)
- * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional)
- * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional)
- * @param string $tag Tag of the emails (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @param int|null $limit Number of documents returned per page (optional, default to 10)
+ * @param int|null $offset Index of the first document on the page (optional, default to 0)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD) (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD) (optional)
+ * @param int|null $days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional)
+ * @param string|null $tag Tag of the emails (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSmtpReport'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getSmtpReportAsyncWithHttpInfo($limit = '10', $offset = '0', $startDate = null, $endDate = null, $days = null, $tag = null, $sort = 'desc')
+ public function getSmtpReportAsyncWithHttpInfo(
+ $limit = 10,
+ $offset = 0,
+ $startDate = null,
+ $endDate = null,
+ $days = null,
+ $tag = null,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getSmtpReport'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetReports';
- $request = $this->getSmtpReportRequest($limit, $offset, $startDate, $endDate, $days, $tag, $sort);
+ $returnType = '\Brevo\Client\Models\GetReports';
+ $request = $this->getSmtpReportRequest($limit, $offset, $startDate, $endDate, $days, $tag, $sort, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -3416,7 +3961,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -3425,25 +3970,42 @@ function ($exception) {
/**
* Create request for operation 'getSmtpReport'
*
- * @param int $limit Number of documents returned per page (optional, default to 10)
- * @param int $offset Index of the first document on the page (optional, default to 0)
- * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional)
- * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional)
- * @param string $tag Tag of the emails (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number of documents returned per page (optional, default to 10)
+ * @param int|null $offset Index of the first document on the page (optional, default to 0)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD) (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD) (optional)
+ * @param int|null $days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional)
+ * @param string|null $tag Tag of the emails (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSmtpReport'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getSmtpReportRequest($limit = '10', $offset = '0', $startDate = null, $endDate = null, $days = null, $tag = null, $sort = 'desc')
+ public function getSmtpReportRequest(
+ $limit = 10,
+ $offset = 0,
+ $startDate = null,
+ $endDate = null,
+ $days = null,
+ $tag = null,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getSmtpReport'][0]
+ ): Request
{
+
if ($limit !== null && $limit > 30) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling TransactionalEmailsApi.getSmtpReport, must be smaller than or equal to 30.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling TransactionalEmailsApi.getSmtpReport, must be smaller than or equal to 30.');
}
if ($limit !== null && $limit < 0) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling TransactionalEmailsApi.getSmtpReport, must be bigger than or equal to 0.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling TransactionalEmailsApi.getSmtpReport, must be bigger than or equal to 0.');
}
+
+
+
+
+
+
$resourcePath = '/smtp/statistics/reports';
@@ -3454,82 +4016,100 @@ protected function getSmtpReportRequest($limit = '10', $offset = '0', $startDate
$multipart = false;
// query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($startDate !== null) {
- $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $startDate,
+ 'startDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($endDate !== null) {
- $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $endDate,
+ 'endDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($days !== null) {
- $queryParams['days'] = ObjectSerializer::toQueryValue($days);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $days,
+ 'days', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($tag !== null) {
- $queryParams['tag'] = ObjectSerializer::toQueryValue($tag);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $tag,
+ 'tag', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -3555,10 +4135,11 @@ protected function getSmtpReportRequest($limit = '10', $offset = '0', $startDate
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -3570,14 +4151,18 @@ protected function getSmtpReportRequest($limit = '10', $offset = '0', $startDate
* Returns the template information
*
* @param int $templateId id of the template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSmtpTemplate'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetSmtpTemplateOverview
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetSmtpTemplateOverview|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function getSmtpTemplate($templateId)
+ public function getSmtpTemplate(
+ int $templateId,
+ string $contentType = self::contentTypes['getSmtpTemplate'][0]
+ ): \Brevo\Client\Models\GetSmtpTemplateOverview
{
- list($response) = $this->getSmtpTemplateWithHttpInfo($templateId);
+ list($response) = $this->getSmtpTemplateWithHttpInfo($templateId, $contentType);
return $response;
}
@@ -3587,15 +4172,18 @@ public function getSmtpTemplate($templateId)
* Returns the template information
*
* @param int $templateId id of the template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSmtpTemplate'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetSmtpTemplateOverview, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetSmtpTemplateOverview|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getSmtpTemplateWithHttpInfo($templateId)
+ public function getSmtpTemplateWithHttpInfo(
+ int $templateId,
+ string $contentType = self::contentTypes['getSmtpTemplate'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetSmtpTemplateOverview';
- $request = $this->getSmtpTemplateRequest($templateId);
+ $request = $this->getSmtpTemplateRequest($templateId, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -3604,34 +4192,138 @@ public function getSmtpTemplateWithHttpInfo($templateId)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetSmtpTemplateOverview', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetSmtpTemplateOverview' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetSmtpTemplateOverview', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetSmtpTemplateOverview';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -3646,23 +4338,23 @@ public function getSmtpTemplateWithHttpInfo($templateId)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetSmtpTemplateOverview',
+ '\Brevo\Client\Models\GetSmtpTemplateOverview',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 404:
+ case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 400:
+ case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -3678,13 +4370,17 @@ public function getSmtpTemplateWithHttpInfo($templateId)
* Returns the template information
*
* @param int $templateId id of the template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSmtpTemplate'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getSmtpTemplateAsync($templateId)
+ public function getSmtpTemplateAsync(
+ int $templateId,
+ string $contentType = self::contentTypes['getSmtpTemplate'][0]
+ ): PromiseInterface
{
- return $this->getSmtpTemplateAsyncWithHttpInfo($templateId)
+ return $this->getSmtpTemplateAsyncWithHttpInfo($templateId, $contentType)
->then(
function ($response) {
return $response[0];
@@ -3698,24 +4394,28 @@ function ($response) {
* Returns the template information
*
* @param int $templateId id of the template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSmtpTemplate'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getSmtpTemplateAsyncWithHttpInfo($templateId)
+ public function getSmtpTemplateAsyncWithHttpInfo(
+ $templateId,
+ string $contentType = self::contentTypes['getSmtpTemplate'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetSmtpTemplateOverview';
- $request = $this->getSmtpTemplateRequest($templateId);
+ $returnType = '\Brevo\Client\Models\GetSmtpTemplateOverview';
+ $request = $this->getSmtpTemplateRequest($templateId, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -3738,7 +4438,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -3748,19 +4448,25 @@ function ($exception) {
* Create request for operation 'getSmtpTemplate'
*
* @param int $templateId id of the template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSmtpTemplate'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getSmtpTemplateRequest($templateId)
+ public function getSmtpTemplateRequest(
+ $templateId,
+ string $contentType = self::contentTypes['getSmtpTemplate'][0]
+ ): Request
{
+
// verify the required parameter 'templateId' is set
if ($templateId === null || (is_array($templateId) && count($templateId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $templateId when calling getSmtpTemplate'
);
}
+
$resourcePath = '/smtp/templates/{templateId}';
$formParams = [];
$queryParams = [];
@@ -3769,6 +4475,7 @@ protected function getSmtpTemplateRequest($templateId)
$multipart = false;
+
// path params
if ($templateId !== null) {
$resourcePath = str_replace(
@@ -3778,53 +4485,35 @@ protected function getSmtpTemplateRequest($templateId)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -3850,10 +4539,11 @@ protected function getSmtpTemplateRequest($templateId)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -3864,18 +4554,25 @@ protected function getSmtpTemplateRequest($templateId)
*
* Get the list of email templates
*
- * @param bool $templateStatus Filter on the status of the template. Active = true, inactive = false (optional)
- * @param int $limit Number of documents returned per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param bool|null $templateStatus Filter on the status of the template. Active = true, inactive = false (optional)
+ * @param int|null $limit Number of documents returned per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSmtpTemplates'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetSmtpTemplates
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetSmtpTemplates|\Brevo\Client\Models\ErrorModel
*/
- public function getSmtpTemplates($templateStatus = null, $limit = '50', $offset = '0', $sort = 'desc')
+ public function getSmtpTemplates(
+ ?bool $templateStatus = null,
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getSmtpTemplates'][0]
+ ): \Brevo\Client\Models\GetSmtpTemplates
{
- list($response) = $this->getSmtpTemplatesWithHttpInfo($templateStatus, $limit, $offset, $sort);
+ list($response) = $this->getSmtpTemplatesWithHttpInfo($templateStatus, $limit, $offset, $sort, $contentType);
return $response;
}
@@ -3884,19 +4581,25 @@ public function getSmtpTemplates($templateStatus = null, $limit = '50', $offset
*
* Get the list of email templates
*
- * @param bool $templateStatus Filter on the status of the template. Active = true, inactive = false (optional)
- * @param int $limit Number of documents returned per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param bool|null $templateStatus Filter on the status of the template. Active = true, inactive = false (optional)
+ * @param int|null $limit Number of documents returned per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSmtpTemplates'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetSmtpTemplates, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetSmtpTemplates|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getSmtpTemplatesWithHttpInfo($templateStatus = null, $limit = '50', $offset = '0', $sort = 'desc')
+ public function getSmtpTemplatesWithHttpInfo(
+ ?bool $templateStatus = null,
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getSmtpTemplates'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetSmtpTemplates';
- $request = $this->getSmtpTemplatesRequest($templateStatus, $limit, $offset, $sort);
+ $request = $this->getSmtpTemplatesRequest($templateStatus, $limit, $offset, $sort, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -3905,34 +4608,111 @@ public function getSmtpTemplatesWithHttpInfo($templateStatus = null, $limit = '5
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetSmtpTemplates', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetSmtpTemplates' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetSmtpTemplates', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetSmtpTemplates';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -3947,7 +4727,7 @@ public function getSmtpTemplatesWithHttpInfo($templateStatus = null, $limit = '5
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetSmtpTemplates',
+ '\Brevo\Client\Models\GetSmtpTemplates',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -3955,7 +4735,7 @@ public function getSmtpTemplatesWithHttpInfo($templateStatus = null, $limit = '5
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -3970,17 +4750,24 @@ public function getSmtpTemplatesWithHttpInfo($templateStatus = null, $limit = '5
*
* Get the list of email templates
*
- * @param bool $templateStatus Filter on the status of the template. Active = true, inactive = false (optional)
- * @param int $limit Number of documents returned per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param bool|null $templateStatus Filter on the status of the template. Active = true, inactive = false (optional)
+ * @param int|null $limit Number of documents returned per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSmtpTemplates'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getSmtpTemplatesAsync($templateStatus = null, $limit = '50', $offset = '0', $sort = 'desc')
+ public function getSmtpTemplatesAsync(
+ ?bool $templateStatus = null,
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getSmtpTemplates'][0]
+ ): PromiseInterface
{
- return $this->getSmtpTemplatesAsyncWithHttpInfo($templateStatus, $limit, $offset, $sort)
+ return $this->getSmtpTemplatesAsyncWithHttpInfo($templateStatus, $limit, $offset, $sort, $contentType)
->then(
function ($response) {
return $response[0];
@@ -3993,28 +4780,35 @@ function ($response) {
*
* Get the list of email templates
*
- * @param bool $templateStatus Filter on the status of the template. Active = true, inactive = false (optional)
- * @param int $limit Number of documents returned per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param bool|null $templateStatus Filter on the status of the template. Active = true, inactive = false (optional)
+ * @param int|null $limit Number of documents returned per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSmtpTemplates'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getSmtpTemplatesAsyncWithHttpInfo($templateStatus = null, $limit = '50', $offset = '0', $sort = 'desc')
+ public function getSmtpTemplatesAsyncWithHttpInfo(
+ $templateStatus = null,
+ $limit = 50,
+ $offset = 0,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getSmtpTemplates'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetSmtpTemplates';
- $request = $this->getSmtpTemplatesRequest($templateStatus, $limit, $offset, $sort);
+ $returnType = '\Brevo\Client\Models\GetSmtpTemplates';
+ $request = $this->getSmtpTemplatesRequest($templateStatus, $limit, $offset, $sort, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -4037,7 +4831,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -4046,22 +4840,33 @@ function ($exception) {
/**
* Create request for operation 'getSmtpTemplates'
*
- * @param bool $templateStatus Filter on the status of the template. Active = true, inactive = false (optional)
- * @param int $limit Number of documents returned per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param bool|null $templateStatus Filter on the status of the template. Active = true, inactive = false (optional)
+ * @param int|null $limit Number of documents returned per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSmtpTemplates'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getSmtpTemplatesRequest($templateStatus = null, $limit = '50', $offset = '0', $sort = 'desc')
+ public function getSmtpTemplatesRequest(
+ $templateStatus = null,
+ $limit = 50,
+ $offset = 0,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getSmtpTemplates'][0]
+ ): Request
{
+
+
if ($limit !== null && $limit > 1000) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling TransactionalEmailsApi.getSmtpTemplates, must be smaller than or equal to 1000.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling TransactionalEmailsApi.getSmtpTemplates, must be smaller than or equal to 1000.');
}
if ($limit !== null && $limit < 0) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling TransactionalEmailsApi.getSmtpTemplates, must be bigger than or equal to 0.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling TransactionalEmailsApi.getSmtpTemplates, must be bigger than or equal to 0.');
}
+
+
$resourcePath = '/smtp/templates';
@@ -4072,70 +4877,73 @@ protected function getSmtpTemplatesRequest($templateStatus = null, $limit = '50'
$multipart = false;
// query params
- if ($templateStatus !== null) {
- $queryParams['templateStatus'] = ObjectSerializer::toQueryValue($templateStatus);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $templateStatus,
+ 'templateStatus', // param base name
+ 'boolean', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -4161,10 +4969,11 @@ protected function getSmtpTemplatesRequest($templateStatus = null, $limit = '50'
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -4175,20 +4984,29 @@ protected function getSmtpTemplatesRequest($templateStatus = null, $limit = '50'
*
* Get the list of blocked or unsubscribed transactional contacts
*
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts (optional)
- * @param int $limit Number of documents returned per page (optional, default to 50)
- * @param int $offset Index of the first document on the page (optional, default to 0)
- * @param string[] $senders Comma separated list of emails of the senders from which contacts are blocked or unsubscribed (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetTransacBlockedContacts
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts (optional)
+ * @param int|null $limit Number of documents returned per page (optional, default to 50)
+ * @param int|null $offset Index of the first document on the page (optional, default to 0)
+ * @param string[]|null $senders Comma separated list of emails of the senders from which contacts are blocked or unsubscribed (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTransacBlockedContacts'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetTransacBlockedContacts|\Brevo\Client\Models\ErrorModel
*/
- public function getTransacBlockedContacts($startDate = null, $endDate = null, $limit = '50', $offset = '0', $senders = null, $sort = 'desc')
+ public function getTransacBlockedContacts(
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?array $senders = null,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getTransacBlockedContacts'][0]
+ ): \Brevo\Client\Models\GetTransacBlockedContacts
{
- list($response) = $this->getTransacBlockedContactsWithHttpInfo($startDate, $endDate, $limit, $offset, $senders, $sort);
+ list($response) = $this->getTransacBlockedContactsWithHttpInfo($startDate, $endDate, $limit, $offset, $senders, $sort, $contentType);
return $response;
}
@@ -4197,21 +5015,29 @@ public function getTransacBlockedContacts($startDate = null, $endDate = null, $l
*
* Get the list of blocked or unsubscribed transactional contacts
*
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts (optional)
- * @param int $limit Number of documents returned per page (optional, default to 50)
- * @param int $offset Index of the first document on the page (optional, default to 0)
- * @param string[] $senders Comma separated list of emails of the senders from which contacts are blocked or unsubscribed (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetTransacBlockedContacts, HTTP status code, HTTP response headers (array of strings)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts (optional)
+ * @param int|null $limit Number of documents returned per page (optional, default to 50)
+ * @param int|null $offset Index of the first document on the page (optional, default to 0)
+ * @param string[]|null $senders Comma separated list of emails of the senders from which contacts are blocked or unsubscribed (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTransacBlockedContacts'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetTransacBlockedContacts|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getTransacBlockedContactsWithHttpInfo($startDate = null, $endDate = null, $limit = '50', $offset = '0', $senders = null, $sort = 'desc')
+ public function getTransacBlockedContactsWithHttpInfo(
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?array $senders = null,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getTransacBlockedContacts'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetTransacBlockedContacts';
- $request = $this->getTransacBlockedContactsRequest($startDate, $endDate, $limit, $offset, $senders, $sort);
+ $request = $this->getTransacBlockedContactsRequest($startDate, $endDate, $limit, $offset, $senders, $sort, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -4220,34 +5046,111 @@ public function getTransacBlockedContactsWithHttpInfo($startDate = null, $endDat
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetTransacBlockedContacts', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetTransacBlockedContacts' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetTransacBlockedContacts', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetTransacBlockedContacts';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -4262,7 +5165,7 @@ public function getTransacBlockedContactsWithHttpInfo($startDate = null, $endDat
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetTransacBlockedContacts',
+ '\Brevo\Client\Models\GetTransacBlockedContacts',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -4270,7 +5173,7 @@ public function getTransacBlockedContactsWithHttpInfo($startDate = null, $endDat
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -4285,19 +5188,28 @@ public function getTransacBlockedContactsWithHttpInfo($startDate = null, $endDat
*
* Get the list of blocked or unsubscribed transactional contacts
*
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts (optional)
- * @param int $limit Number of documents returned per page (optional, default to 50)
- * @param int $offset Index of the first document on the page (optional, default to 0)
- * @param string[] $senders Comma separated list of emails of the senders from which contacts are blocked or unsubscribed (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts (optional)
+ * @param int|null $limit Number of documents returned per page (optional, default to 50)
+ * @param int|null $offset Index of the first document on the page (optional, default to 0)
+ * @param string[]|null $senders Comma separated list of emails of the senders from which contacts are blocked or unsubscribed (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTransacBlockedContacts'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getTransacBlockedContactsAsync($startDate = null, $endDate = null, $limit = '50', $offset = '0', $senders = null, $sort = 'desc')
+ public function getTransacBlockedContactsAsync(
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?array $senders = null,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getTransacBlockedContacts'][0]
+ ): PromiseInterface
{
- return $this->getTransacBlockedContactsAsyncWithHttpInfo($startDate, $endDate, $limit, $offset, $senders, $sort)
+ return $this->getTransacBlockedContactsAsyncWithHttpInfo($startDate, $endDate, $limit, $offset, $senders, $sort, $contentType)
->then(
function ($response) {
return $response[0];
@@ -4310,30 +5222,39 @@ function ($response) {
*
* Get the list of blocked or unsubscribed transactional contacts
*
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts (optional)
- * @param int $limit Number of documents returned per page (optional, default to 50)
- * @param int $offset Index of the first document on the page (optional, default to 0)
- * @param string[] $senders Comma separated list of emails of the senders from which contacts are blocked or unsubscribed (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts (optional)
+ * @param int|null $limit Number of documents returned per page (optional, default to 50)
+ * @param int|null $offset Index of the first document on the page (optional, default to 0)
+ * @param string[]|null $senders Comma separated list of emails of the senders from which contacts are blocked or unsubscribed (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTransacBlockedContacts'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getTransacBlockedContactsAsyncWithHttpInfo($startDate = null, $endDate = null, $limit = '50', $offset = '0', $senders = null, $sort = 'desc')
+ public function getTransacBlockedContactsAsyncWithHttpInfo(
+ $startDate = null,
+ $endDate = null,
+ $limit = 50,
+ $offset = 0,
+ $senders = null,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getTransacBlockedContacts'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetTransacBlockedContacts';
- $request = $this->getTransacBlockedContactsRequest($startDate, $endDate, $limit, $offset, $senders, $sort);
+ $returnType = '\Brevo\Client\Models\GetTransacBlockedContacts';
+ $request = $this->getTransacBlockedContactsRequest($startDate, $endDate, $limit, $offset, $senders, $sort, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -4356,7 +5277,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -4365,24 +5286,39 @@ function ($exception) {
/**
* Create request for operation 'getTransacBlockedContacts'
*
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts (optional)
- * @param int $limit Number of documents returned per page (optional, default to 50)
- * @param int $offset Index of the first document on the page (optional, default to 0)
- * @param string[] $senders Comma separated list of emails of the senders from which contacts are blocked or unsubscribed (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts (optional)
+ * @param int|null $limit Number of documents returned per page (optional, default to 50)
+ * @param int|null $offset Index of the first document on the page (optional, default to 0)
+ * @param string[]|null $senders Comma separated list of emails of the senders from which contacts are blocked or unsubscribed (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTransacBlockedContacts'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getTransacBlockedContactsRequest($startDate = null, $endDate = null, $limit = '50', $offset = '0', $senders = null, $sort = 'desc')
+ public function getTransacBlockedContactsRequest(
+ $startDate = null,
+ $endDate = null,
+ $limit = 50,
+ $offset = 0,
+ $senders = null,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getTransacBlockedContacts'][0]
+ ): Request
{
+
+
+
if ($limit !== null && $limit > 100) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling TransactionalEmailsApi.getTransacBlockedContacts, must be smaller than or equal to 100.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling TransactionalEmailsApi.getTransacBlockedContacts, must be smaller than or equal to 100.');
}
if ($limit !== null && $limit < 0) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling TransactionalEmailsApi.getTransacBlockedContacts, must be bigger than or equal to 0.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling TransactionalEmailsApi.getTransacBlockedContacts, must be bigger than or equal to 0.');
}
+
+
+
$resourcePath = '/smtp/blockedContacts';
@@ -4393,81 +5329,91 @@ protected function getTransacBlockedContactsRequest($startDate = null, $endDate
$multipart = false;
// query params
- if ($startDate !== null) {
- $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $startDate,
+ 'startDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($endDate !== null) {
- $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $endDate,
+ 'endDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if (is_array($senders)) {
- $queryParams['senders'] = $senders;
- } else
- if ($senders !== null) {
- $queryParams['senders'] = ObjectSerializer::toQueryValue($senders);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $senders,
+ 'senders', // param base name
+ 'array', // openApiType
+ 'form', // style
+ false, // explode
+ false // required
+ ) ?? []);
// query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -4493,10 +5439,11 @@ protected function getTransacBlockedContactsRequest($startDate = null, $endDate
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -4508,14 +5455,18 @@ protected function getTransacBlockedContactsRequest($startDate = null, $endDate
* Get the personalized content of a sent transactional email
*
* @param string $uuid Unique id of the transactional email that has been sent to a particular contact (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTransacEmailContent'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetTransacEmailContent
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetTransacEmailContent
*/
- public function getTransacEmailContent($uuid)
+ public function getTransacEmailContent(
+ string $uuid,
+ string $contentType = self::contentTypes['getTransacEmailContent'][0]
+ ): \Brevo\Client\Models\GetTransacEmailContent
{
- list($response) = $this->getTransacEmailContentWithHttpInfo($uuid);
+ list($response) = $this->getTransacEmailContentWithHttpInfo($uuid, $contentType);
return $response;
}
@@ -4525,15 +5476,18 @@ public function getTransacEmailContent($uuid)
* Get the personalized content of a sent transactional email
*
* @param string $uuid Unique id of the transactional email that has been sent to a particular contact (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTransacEmailContent'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetTransacEmailContent, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetTransacEmailContent, HTTP status code, HTTP response headers (array of strings)
*/
- public function getTransacEmailContentWithHttpInfo($uuid)
+ public function getTransacEmailContentWithHttpInfo(
+ string $uuid,
+ string $contentType = self::contentTypes['getTransacEmailContent'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetTransacEmailContent';
- $request = $this->getTransacEmailContentRequest($uuid);
+ $request = $this->getTransacEmailContentRequest($uuid, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -4542,34 +5496,84 @@ public function getTransacEmailContentWithHttpInfo($uuid)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
- $e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
+ (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 (in_array('\Brevo\Client\Models\GetTransacEmailContent', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetTransacEmailContent' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetTransacEmailContent', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetTransacEmailContent';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -4584,7 +5588,7 @@ public function getTransacEmailContentWithHttpInfo($uuid)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetTransacEmailContent',
+ '\Brevo\Client\Models\GetTransacEmailContent',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -4600,13 +5604,17 @@ public function getTransacEmailContentWithHttpInfo($uuid)
* Get the personalized content of a sent transactional email
*
* @param string $uuid Unique id of the transactional email that has been sent to a particular contact (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTransacEmailContent'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getTransacEmailContentAsync($uuid)
+ public function getTransacEmailContentAsync(
+ string $uuid,
+ string $contentType = self::contentTypes['getTransacEmailContent'][0]
+ ): PromiseInterface
{
- return $this->getTransacEmailContentAsyncWithHttpInfo($uuid)
+ return $this->getTransacEmailContentAsyncWithHttpInfo($uuid, $contentType)
->then(
function ($response) {
return $response[0];
@@ -4620,24 +5628,28 @@ function ($response) {
* Get the personalized content of a sent transactional email
*
* @param string $uuid Unique id of the transactional email that has been sent to a particular contact (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTransacEmailContent'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getTransacEmailContentAsyncWithHttpInfo($uuid)
+ public function getTransacEmailContentAsyncWithHttpInfo(
+ $uuid,
+ string $contentType = self::contentTypes['getTransacEmailContent'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetTransacEmailContent';
- $request = $this->getTransacEmailContentRequest($uuid);
+ $returnType = '\Brevo\Client\Models\GetTransacEmailContent';
+ $request = $this->getTransacEmailContentRequest($uuid, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -4660,7 +5672,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -4670,19 +5682,25 @@ function ($exception) {
* Create request for operation 'getTransacEmailContent'
*
* @param string $uuid Unique id of the transactional email that has been sent to a particular contact (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTransacEmailContent'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getTransacEmailContentRequest($uuid)
+ public function getTransacEmailContentRequest(
+ $uuid,
+ string $contentType = self::contentTypes['getTransacEmailContent'][0]
+ ): Request
{
+
// verify the required parameter 'uuid' is set
if ($uuid === null || (is_array($uuid) && count($uuid) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $uuid when calling getTransacEmailContent'
);
}
+
$resourcePath = '/smtp/emails/{uuid}';
$formParams = [];
$queryParams = [];
@@ -4691,6 +5709,7 @@ protected function getTransacEmailContentRequest($uuid)
$multipart = false;
+
// path params
if ($uuid !== null) {
$resourcePath = str_replace(
@@ -4700,53 +5719,35 @@ protected function getTransacEmailContentRequest($uuid)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -4772,10 +5773,11 @@ protected function getTransacEmailContentRequest($uuid)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -4786,22 +5788,33 @@ protected function getTransacEmailContentRequest($uuid)
*
* Get the list of transactional emails on the basis of allowed filters
*
- * @param string $email Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. (optional)
- * @param int $templateId Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email. (optional)
- * @param string $messageId Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. (optional)
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param int $limit Number of documents returned per page (optional, default to 500)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetTransacEmailsList
+ * @param string|null $email **Mandatory if templateId and messageId are not passed in query filters.** Email address to which transactional email has been sent. (optional)
+ * @param int|null $templateId **Mandatory if email and messageId are not passed in query filters.** Id of the template that was used to compose transactional email. (optional)
+ * @param string|null $messageId **Mandatory if templateId and email are not passed in query filters.** Message ID of the transactional email sent. (optional)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) from which you want to fetch the list. **Maximum time period that can be selected is one month**. (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) till which you want to fetch the list. **Maximum time period that can be selected is one month.** (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param int|null $limit Number of documents returned per page (optional, default to 500)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTransacEmailsList'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetTransacEmailsList|\Brevo\Client\Models\ErrorModel
*/
- public function getTransacEmailsList($email = null, $templateId = null, $messageId = null, $startDate = null, $endDate = null, $sort = 'desc', $limit = '500', $offset = '0')
+ public function getTransacEmailsList(
+ ?string $email = null,
+ ?int $templateId = null,
+ ?string $messageId = null,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?string $sort = 'desc',
+ ?int $limit = 500,
+ ?int $offset = 0,
+ string $contentType = self::contentTypes['getTransacEmailsList'][0]
+ ): \Brevo\Client\Models\GetTransacEmailsList
{
- list($response) = $this->getTransacEmailsListWithHttpInfo($email, $templateId, $messageId, $startDate, $endDate, $sort, $limit, $offset);
+ list($response) = $this->getTransacEmailsListWithHttpInfo($email, $templateId, $messageId, $startDate, $endDate, $sort, $limit, $offset, $contentType);
return $response;
}
@@ -4810,23 +5823,33 @@ public function getTransacEmailsList($email = null, $templateId = null, $message
*
* Get the list of transactional emails on the basis of allowed filters
*
- * @param string $email Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. (optional)
- * @param int $templateId Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email. (optional)
- * @param string $messageId Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. (optional)
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param int $limit Number of documents returned per page (optional, default to 500)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetTransacEmailsList, HTTP status code, HTTP response headers (array of strings)
+ * @param string|null $email **Mandatory if templateId and messageId are not passed in query filters.** Email address to which transactional email has been sent. (optional)
+ * @param int|null $templateId **Mandatory if email and messageId are not passed in query filters.** Id of the template that was used to compose transactional email. (optional)
+ * @param string|null $messageId **Mandatory if templateId and email are not passed in query filters.** Message ID of the transactional email sent. (optional)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) from which you want to fetch the list. **Maximum time period that can be selected is one month**. (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) till which you want to fetch the list. **Maximum time period that can be selected is one month.** (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param int|null $limit Number of documents returned per page (optional, default to 500)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTransacEmailsList'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetTransacEmailsList|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getTransacEmailsListWithHttpInfo($email = null, $templateId = null, $messageId = null, $startDate = null, $endDate = null, $sort = 'desc', $limit = '500', $offset = '0')
+ public function getTransacEmailsListWithHttpInfo(
+ ?string $email = null,
+ ?int $templateId = null,
+ ?string $messageId = null,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?string $sort = 'desc',
+ ?int $limit = 500,
+ ?int $offset = 0,
+ string $contentType = self::contentTypes['getTransacEmailsList'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetTransacEmailsList';
- $request = $this->getTransacEmailsListRequest($email, $templateId, $messageId, $startDate, $endDate, $sort, $limit, $offset);
+ $request = $this->getTransacEmailsListRequest($email, $templateId, $messageId, $startDate, $endDate, $sort, $limit, $offset, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -4835,34 +5858,111 @@ public function getTransacEmailsListWithHttpInfo($email = null, $templateId = nu
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetTransacEmailsList', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetTransacEmailsList' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetTransacEmailsList', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetTransacEmailsList';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -4877,7 +5977,7 @@ public function getTransacEmailsListWithHttpInfo($email = null, $templateId = nu
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetTransacEmailsList',
+ '\Brevo\Client\Models\GetTransacEmailsList',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -4885,7 +5985,7 @@ public function getTransacEmailsListWithHttpInfo($email = null, $templateId = nu
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -4900,21 +6000,32 @@ public function getTransacEmailsListWithHttpInfo($email = null, $templateId = nu
*
* Get the list of transactional emails on the basis of allowed filters
*
- * @param string $email Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. (optional)
- * @param int $templateId Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email. (optional)
- * @param string $messageId Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. (optional)
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param int $limit Number of documents returned per page (optional, default to 500)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @param string|null $email **Mandatory if templateId and messageId are not passed in query filters.** Email address to which transactional email has been sent. (optional)
+ * @param int|null $templateId **Mandatory if email and messageId are not passed in query filters.** Id of the template that was used to compose transactional email. (optional)
+ * @param string|null $messageId **Mandatory if templateId and email are not passed in query filters.** Message ID of the transactional email sent. (optional)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) from which you want to fetch the list. **Maximum time period that can be selected is one month**. (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) till which you want to fetch the list. **Maximum time period that can be selected is one month.** (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param int|null $limit Number of documents returned per page (optional, default to 500)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTransacEmailsList'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getTransacEmailsListAsync($email = null, $templateId = null, $messageId = null, $startDate = null, $endDate = null, $sort = 'desc', $limit = '500', $offset = '0')
+ public function getTransacEmailsListAsync(
+ ?string $email = null,
+ ?int $templateId = null,
+ ?string $messageId = null,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?string $sort = 'desc',
+ ?int $limit = 500,
+ ?int $offset = 0,
+ string $contentType = self::contentTypes['getTransacEmailsList'][0]
+ ): PromiseInterface
{
- return $this->getTransacEmailsListAsyncWithHttpInfo($email, $templateId, $messageId, $startDate, $endDate, $sort, $limit, $offset)
+ return $this->getTransacEmailsListAsyncWithHttpInfo($email, $templateId, $messageId, $startDate, $endDate, $sort, $limit, $offset, $contentType)
->then(
function ($response) {
return $response[0];
@@ -4927,32 +6038,43 @@ function ($response) {
*
* Get the list of transactional emails on the basis of allowed filters
*
- * @param string $email Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. (optional)
- * @param int $templateId Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email. (optional)
- * @param string $messageId Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. (optional)
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param int $limit Number of documents returned per page (optional, default to 500)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @param string|null $email **Mandatory if templateId and messageId are not passed in query filters.** Email address to which transactional email has been sent. (optional)
+ * @param int|null $templateId **Mandatory if email and messageId are not passed in query filters.** Id of the template that was used to compose transactional email. (optional)
+ * @param string|null $messageId **Mandatory if templateId and email are not passed in query filters.** Message ID of the transactional email sent. (optional)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) from which you want to fetch the list. **Maximum time period that can be selected is one month**. (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) till which you want to fetch the list. **Maximum time period that can be selected is one month.** (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param int|null $limit Number of documents returned per page (optional, default to 500)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTransacEmailsList'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getTransacEmailsListAsyncWithHttpInfo($email = null, $templateId = null, $messageId = null, $startDate = null, $endDate = null, $sort = 'desc', $limit = '500', $offset = '0')
+ public function getTransacEmailsListAsyncWithHttpInfo(
+ $email = null,
+ $templateId = null,
+ $messageId = null,
+ $startDate = null,
+ $endDate = null,
+ $sort = 'desc',
+ $limit = 500,
+ $offset = 0,
+ string $contentType = self::contentTypes['getTransacEmailsList'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetTransacEmailsList';
- $request = $this->getTransacEmailsListRequest($email, $templateId, $messageId, $startDate, $endDate, $sort, $limit, $offset);
+ $returnType = '\Brevo\Client\Models\GetTransacEmailsList';
+ $request = $this->getTransacEmailsListRequest($email, $templateId, $messageId, $startDate, $endDate, $sort, $limit, $offset, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -4975,7 +6097,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -4984,26 +6106,45 @@ function ($exception) {
/**
* Create request for operation 'getTransacEmailsList'
*
- * @param string $email Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. (optional)
- * @param int $templateId Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email. (optional)
- * @param string $messageId Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. (optional)
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param int $limit Number of documents returned per page (optional, default to 500)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- *
- * @throws \InvalidArgumentException
+ * @param string|null $email **Mandatory if templateId and messageId are not passed in query filters.** Email address to which transactional email has been sent. (optional)
+ * @param int|null $templateId **Mandatory if email and messageId are not passed in query filters.** Id of the template that was used to compose transactional email. (optional)
+ * @param string|null $messageId **Mandatory if templateId and email are not passed in query filters.** Message ID of the transactional email sent. (optional)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) from which you want to fetch the list. **Maximum time period that can be selected is one month**. (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) till which you want to fetch the list. **Maximum time period that can be selected is one month.** (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param int|null $limit Number of documents returned per page (optional, default to 500)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTransacEmailsList'] to see the possible values for this operation
+ *
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getTransacEmailsListRequest($email = null, $templateId = null, $messageId = null, $startDate = null, $endDate = null, $sort = 'desc', $limit = '500', $offset = '0')
+ public function getTransacEmailsListRequest(
+ $email = null,
+ $templateId = null,
+ $messageId = null,
+ $startDate = null,
+ $endDate = null,
+ $sort = 'desc',
+ $limit = 500,
+ $offset = 0,
+ string $contentType = self::contentTypes['getTransacEmailsList'][0]
+ ): Request
{
+
+
+
+
+
+
+
if ($limit !== null && $limit > 1000) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling TransactionalEmailsApi.getTransacEmailsList, must be smaller than or equal to 1000.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling TransactionalEmailsApi.getTransacEmailsList, must be smaller than or equal to 1000.');
}
if ($limit !== null && $limit < 0) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling TransactionalEmailsApi.getTransacEmailsList, must be bigger than or equal to 0.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling TransactionalEmailsApi.getTransacEmailsList, must be bigger than or equal to 0.');
}
+
$resourcePath = '/smtp/emails';
@@ -5014,86 +6155,109 @@ protected function getTransacEmailsListRequest($email = null, $templateId = null
$multipart = false;
// query params
- if ($email !== null) {
- $queryParams['email'] = ObjectSerializer::toQueryValue($email);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $email,
+ 'email', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($templateId !== null) {
- $queryParams['templateId'] = ObjectSerializer::toQueryValue($templateId);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $templateId,
+ 'templateId', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($messageId !== null) {
- $queryParams['messageId'] = ObjectSerializer::toQueryValue($messageId);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $messageId,
+ 'messageId', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($startDate !== null) {
- $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $startDate,
+ 'startDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($endDate !== null) {
- $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $endDate,
+ 'endDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -5119,10 +6283,11 @@ protected function getTransacEmailsListRequest($email = null, $templateId = null
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -5134,15 +6299,20 @@ protected function getTransacEmailsListRequest($email = null, $templateId = null
* Send a template to your test list
*
* @param int $templateId Id of the template (required)
- * @param \Brevo\Client\Model\SendTestEmail $sendTestEmail sendTestEmail (required)
+ * @param \Brevo\Client\Models\SendTestEmail $sendTestEmail sendTestEmail (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTestTemplate'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function sendTestTemplate($templateId, $sendTestEmail)
+ public function sendTestTemplate(
+ int $templateId,
+ \Brevo\Client\Models\SendTestEmail $sendTestEmail,
+ string $contentType = self::contentTypes['sendTestTemplate'][0]
+ ): void
{
- $this->sendTestTemplateWithHttpInfo($templateId, $sendTestEmail);
+ $this->sendTestTemplateWithHttpInfo($templateId, $sendTestEmail, $contentType);
}
/**
@@ -5151,16 +6321,20 @@ public function sendTestTemplate($templateId, $sendTestEmail)
* Send a template to your test list
*
* @param int $templateId Id of the template (required)
- * @param \Brevo\Client\Model\SendTestEmail $sendTestEmail (required)
+ * @param \Brevo\Client\Models\SendTestEmail $sendTestEmail (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTestTemplate'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function sendTestTemplateWithHttpInfo($templateId, $sendTestEmail)
+ public function sendTestTemplateWithHttpInfo(
+ int $templateId,
+ \Brevo\Client\Models\SendTestEmail $sendTestEmail,
+ string $contentType = self::contentTypes['sendTestTemplate'][0]
+ ): array
{
- $returnType = '';
- $request = $this->sendTestTemplateRequest($templateId, $sendTestEmail);
+ $request = $this->sendTestTemplateRequest($templateId, $sendTestEmail, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -5169,26 +6343,21 @@ public function sendTestTemplateWithHttpInfo($templateId, $sendTestEmail)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -5197,7 +6366,7 @@ public function sendTestTemplateWithHttpInfo($templateId, $sendTestEmail)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\PostSendFailed',
+ '\Brevo\Client\Models\PostSendFailed',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -5205,7 +6374,7 @@ public function sendTestTemplateWithHttpInfo($templateId, $sendTestEmail)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -5221,14 +6390,19 @@ public function sendTestTemplateWithHttpInfo($templateId, $sendTestEmail)
* Send a template to your test list
*
* @param int $templateId Id of the template (required)
- * @param \Brevo\Client\Model\SendTestEmail $sendTestEmail (required)
+ * @param \Brevo\Client\Models\SendTestEmail $sendTestEmail (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTestTemplate'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function sendTestTemplateAsync($templateId, $sendTestEmail)
+ public function sendTestTemplateAsync(
+ int $templateId,
+ \Brevo\Client\Models\SendTestEmail $sendTestEmail,
+ string $contentType = self::contentTypes['sendTestTemplate'][0]
+ ): PromiseInterface
{
- return $this->sendTestTemplateAsyncWithHttpInfo($templateId, $sendTestEmail)
+ return $this->sendTestTemplateAsyncWithHttpInfo($templateId, $sendTestEmail, $contentType)
->then(
function ($response) {
return $response[0];
@@ -5242,15 +6416,21 @@ function ($response) {
* Send a template to your test list
*
* @param int $templateId Id of the template (required)
- * @param \Brevo\Client\Model\SendTestEmail $sendTestEmail (required)
+ * @param \Brevo\Client\Models\SendTestEmail $sendTestEmail (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTestTemplate'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function sendTestTemplateAsyncWithHttpInfo($templateId, $sendTestEmail)
+ public function sendTestTemplateAsyncWithHttpInfo(
+ $templateId,
+ $sendTestEmail,
+ string $contentType = self::contentTypes['sendTestTemplate'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->sendTestTemplateRequest($templateId, $sendTestEmail);
+ $request = $this->sendTestTemplateRequest($templateId, $sendTestEmail, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -5269,7 +6449,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -5279,26 +6459,34 @@ function ($exception) {
* Create request for operation 'sendTestTemplate'
*
* @param int $templateId Id of the template (required)
- * @param \Brevo\Client\Model\SendTestEmail $sendTestEmail (required)
+ * @param \Brevo\Client\Models\SendTestEmail $sendTestEmail (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTestTemplate'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function sendTestTemplateRequest($templateId, $sendTestEmail)
+ public function sendTestTemplateRequest(
+ $templateId,
+ $sendTestEmail,
+ string $contentType = self::contentTypes['sendTestTemplate'][0]
+ ): Request
{
+
// verify the required parameter 'templateId' is set
if ($templateId === null || (is_array($templateId) && count($templateId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $templateId when calling sendTestTemplate'
);
}
+
// verify the required parameter 'sendTestEmail' is set
if ($sendTestEmail === null || (is_array($sendTestEmail) && count($sendTestEmail) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $sendTestEmail when calling sendTestTemplate'
);
}
+
$resourcePath = '/smtp/templates/{templateId}/sendTest';
$formParams = [];
$queryParams = [];
@@ -5307,6 +6495,7 @@ protected function sendTestTemplateRequest($templateId, $sendTestEmail)
$multipart = false;
+
// path params
if ($templateId !== null) {
$resourcePath = str_replace(
@@ -5316,56 +6505,42 @@ protected function sendTestTemplateRequest($templateId, $sendTestEmail)
);
}
- // body params
- $_tempBody = null;
- if (isset($sendTestEmail)) {
- $_tempBody = $sendTestEmail;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($sendTestEmail)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($sendTestEmail));
+ } else {
+ $httpBody = $sendTestEmail;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -5391,10 +6566,11 @@ protected function sendTestTemplateRequest($templateId, $sendTestEmail)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -5405,15 +6581,19 @@ protected function sendTestTemplateRequest($templateId, $sendTestEmail)
*
* Send a transactional email
*
- * @param \Brevo\Client\Model\SendSmtpEmail $sendSmtpEmail Values to send a transactional email (required)
+ * @param \Brevo\Client\Models\SendSmtpEmail $sendSmtpEmail Values to send a transactional email (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTransacEmail'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\CreateSmtpEmail
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CreateSmtpEmail|\Brevo\Client\Models\ScheduleSmtpEmail|\Brevo\Client\Models\ErrorModel
*/
- public function sendTransacEmail($sendSmtpEmail)
+ public function sendTransacEmail(
+ \Brevo\Client\Models\SendSmtpEmail $sendSmtpEmail,
+ string $contentType = self::contentTypes['sendTransacEmail'][0]
+ ): \Brevo\Client\Models\CreateSmtpEmail
{
- list($response) = $this->sendTransacEmailWithHttpInfo($sendSmtpEmail);
+ list($response) = $this->sendTransacEmailWithHttpInfo($sendSmtpEmail, $contentType);
return $response;
}
@@ -5422,16 +6602,19 @@ public function sendTransacEmail($sendSmtpEmail)
*
* Send a transactional email
*
- * @param \Brevo\Client\Model\SendSmtpEmail $sendSmtpEmail Values to send a transactional email (required)
+ * @param \Brevo\Client\Models\SendSmtpEmail $sendSmtpEmail Values to send a transactional email (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTransacEmail'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\CreateSmtpEmail, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CreateSmtpEmail|\Brevo\Client\Models\ScheduleSmtpEmail|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function sendTransacEmailWithHttpInfo($sendSmtpEmail)
+ public function sendTransacEmailWithHttpInfo(
+ \Brevo\Client\Models\SendSmtpEmail $sendSmtpEmail,
+ string $contentType = self::contentTypes['sendTransacEmail'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\CreateSmtpEmail';
- $request = $this->sendTransacEmailRequest($sendSmtpEmail);
+ $request = $this->sendTransacEmailRequest($sendSmtpEmail, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -5440,34 +6623,138 @@ public function sendTransacEmailWithHttpInfo($sendSmtpEmail)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 201:
+ if (in_array('\Brevo\Client\Models\CreateSmtpEmail', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CreateSmtpEmail' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CreateSmtpEmail', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 202:
+ if (in_array('\Brevo\Client\Models\ScheduleSmtpEmail', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ScheduleSmtpEmail' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ScheduleSmtpEmail', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CreateSmtpEmail';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -5482,7 +6769,7 @@ public function sendTransacEmailWithHttpInfo($sendSmtpEmail)
case 201:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\CreateSmtpEmail',
+ '\Brevo\Client\Models\CreateSmtpEmail',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -5490,7 +6777,7 @@ public function sendTransacEmailWithHttpInfo($sendSmtpEmail)
case 202:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ScheduleSmtpEmail',
+ '\Brevo\Client\Models\ScheduleSmtpEmail',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -5498,7 +6785,7 @@ public function sendTransacEmailWithHttpInfo($sendSmtpEmail)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -5513,14 +6800,18 @@ public function sendTransacEmailWithHttpInfo($sendSmtpEmail)
*
* Send a transactional email
*
- * @param \Brevo\Client\Model\SendSmtpEmail $sendSmtpEmail Values to send a transactional email (required)
+ * @param \Brevo\Client\Models\SendSmtpEmail $sendSmtpEmail Values to send a transactional email (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTransacEmail'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function sendTransacEmailAsync($sendSmtpEmail)
+ public function sendTransacEmailAsync(
+ \Brevo\Client\Models\SendSmtpEmail $sendSmtpEmail,
+ string $contentType = self::contentTypes['sendTransacEmail'][0]
+ ): PromiseInterface
{
- return $this->sendTransacEmailAsyncWithHttpInfo($sendSmtpEmail)
+ return $this->sendTransacEmailAsyncWithHttpInfo($sendSmtpEmail, $contentType)
->then(
function ($response) {
return $response[0];
@@ -5533,25 +6824,29 @@ function ($response) {
*
* Send a transactional email
*
- * @param \Brevo\Client\Model\SendSmtpEmail $sendSmtpEmail Values to send a transactional email (required)
+ * @param \Brevo\Client\Models\SendSmtpEmail $sendSmtpEmail Values to send a transactional email (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTransacEmail'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function sendTransacEmailAsyncWithHttpInfo($sendSmtpEmail)
+ public function sendTransacEmailAsyncWithHttpInfo(
+ $sendSmtpEmail,
+ string $contentType = self::contentTypes['sendTransacEmail'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\CreateSmtpEmail';
- $request = $this->sendTransacEmailRequest($sendSmtpEmail);
+ $returnType = '\Brevo\Client\Models\CreateSmtpEmail';
+ $request = $this->sendTransacEmailRequest($sendSmtpEmail, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -5574,7 +6869,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -5583,20 +6878,26 @@ function ($exception) {
/**
* Create request for operation 'sendTransacEmail'
*
- * @param \Brevo\Client\Model\SendSmtpEmail $sendSmtpEmail Values to send a transactional email (required)
+ * @param \Brevo\Client\Models\SendSmtpEmail $sendSmtpEmail Values to send a transactional email (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTransacEmail'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function sendTransacEmailRequest($sendSmtpEmail)
+ public function sendTransacEmailRequest(
+ $sendSmtpEmail,
+ string $contentType = self::contentTypes['sendTransacEmail'][0]
+ ): Request
{
+
// verify the required parameter 'sendSmtpEmail' is set
if ($sendSmtpEmail === null || (is_array($sendSmtpEmail) && count($sendSmtpEmail) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $sendSmtpEmail when calling sendTransacEmail'
);
}
+
$resourcePath = '/smtp/email';
$formParams = [];
$queryParams = [];
@@ -5606,56 +6907,43 @@ protected function sendTransacEmailRequest($sendSmtpEmail)
- // body params
- $_tempBody = null;
- if (isset($sendSmtpEmail)) {
- $_tempBody = $sendSmtpEmail;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($sendSmtpEmail)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($sendSmtpEmail));
+ } else {
+ $httpBody = $sendSmtpEmail;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -5681,10 +6969,11 @@ protected function sendTransacEmailRequest($sendSmtpEmail)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -5696,14 +6985,18 @@ protected function sendTransacEmailRequest($sendSmtpEmail)
* Unblock or resubscribe a transactional contact
*
* @param string $email contact email (urlencoded) to unblock. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smtpBlockedContactsEmailDelete'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function smtpBlockedContactsEmailDelete($email)
+ public function smtpBlockedContactsEmailDelete(
+ string $email,
+ string $contentType = self::contentTypes['smtpBlockedContactsEmailDelete'][0]
+ ): void
{
- $this->smtpBlockedContactsEmailDeleteWithHttpInfo($email);
+ $this->smtpBlockedContactsEmailDeleteWithHttpInfo($email, $contentType);
}
/**
@@ -5712,15 +7005,18 @@ public function smtpBlockedContactsEmailDelete($email)
* Unblock or resubscribe a transactional contact
*
* @param string $email contact email (urlencoded) to unblock. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smtpBlockedContactsEmailDelete'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function smtpBlockedContactsEmailDeleteWithHttpInfo($email)
+ public function smtpBlockedContactsEmailDeleteWithHttpInfo(
+ string $email,
+ string $contentType = self::contentTypes['smtpBlockedContactsEmailDelete'][0]
+ ): array
{
- $returnType = '';
- $request = $this->smtpBlockedContactsEmailDeleteRequest($email);
+ $request = $this->smtpBlockedContactsEmailDeleteRequest($email, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -5729,26 +7025,21 @@ public function smtpBlockedContactsEmailDeleteWithHttpInfo($email)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -5757,7 +7048,7 @@ public function smtpBlockedContactsEmailDeleteWithHttpInfo($email)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -5765,7 +7056,7 @@ public function smtpBlockedContactsEmailDeleteWithHttpInfo($email)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -5781,13 +7072,17 @@ public function smtpBlockedContactsEmailDeleteWithHttpInfo($email)
* Unblock or resubscribe a transactional contact
*
* @param string $email contact email (urlencoded) to unblock. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smtpBlockedContactsEmailDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function smtpBlockedContactsEmailDeleteAsync($email)
+ public function smtpBlockedContactsEmailDeleteAsync(
+ string $email,
+ string $contentType = self::contentTypes['smtpBlockedContactsEmailDelete'][0]
+ ): PromiseInterface
{
- return $this->smtpBlockedContactsEmailDeleteAsyncWithHttpInfo($email)
+ return $this->smtpBlockedContactsEmailDeleteAsyncWithHttpInfo($email, $contentType)
->then(
function ($response) {
return $response[0];
@@ -5801,14 +7096,19 @@ function ($response) {
* Unblock or resubscribe a transactional contact
*
* @param string $email contact email (urlencoded) to unblock. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smtpBlockedContactsEmailDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function smtpBlockedContactsEmailDeleteAsyncWithHttpInfo($email)
+ public function smtpBlockedContactsEmailDeleteAsyncWithHttpInfo(
+ $email,
+ string $contentType = self::contentTypes['smtpBlockedContactsEmailDelete'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->smtpBlockedContactsEmailDeleteRequest($email);
+ $request = $this->smtpBlockedContactsEmailDeleteRequest($email, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -5827,7 +7127,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -5837,19 +7137,25 @@ function ($exception) {
* Create request for operation 'smtpBlockedContactsEmailDelete'
*
* @param string $email contact email (urlencoded) to unblock. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smtpBlockedContactsEmailDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function smtpBlockedContactsEmailDeleteRequest($email)
+ public function smtpBlockedContactsEmailDeleteRequest(
+ $email,
+ string $contentType = self::contentTypes['smtpBlockedContactsEmailDelete'][0]
+ ): Request
{
+
// verify the required parameter 'email' is set
if ($email === null || (is_array($email) && count($email) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $email when calling smtpBlockedContactsEmailDelete'
);
}
+
$resourcePath = '/smtp/blockedContacts/{email}';
$formParams = [];
$queryParams = [];
@@ -5858,6 +7164,7 @@ protected function smtpBlockedContactsEmailDeleteRequest($email)
$multipart = false;
+
// path params
if ($email !== null) {
$resourcePath = str_replace(
@@ -5867,53 +7174,35 @@ protected function smtpBlockedContactsEmailDeleteRequest($email)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -5939,10 +7228,11 @@ protected function smtpBlockedContactsEmailDeleteRequest($email)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -5954,14 +7244,18 @@ protected function smtpBlockedContactsEmailDeleteRequest($email)
* Delete an SMTP transactional log
*
* @param string $identifier MessageId or Email of the transactional log(s) to delete (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smtpLogIdentifierDelete'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function smtpLogIdentifierDelete($identifier)
+ public function smtpLogIdentifierDelete(
+ string $identifier,
+ string $contentType = self::contentTypes['smtpLogIdentifierDelete'][0]
+ ): void
{
- $this->smtpLogIdentifierDeleteWithHttpInfo($identifier);
+ $this->smtpLogIdentifierDeleteWithHttpInfo($identifier, $contentType);
}
/**
@@ -5970,15 +7264,18 @@ public function smtpLogIdentifierDelete($identifier)
* Delete an SMTP transactional log
*
* @param string $identifier MessageId or Email of the transactional log(s) to delete (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smtpLogIdentifierDelete'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function smtpLogIdentifierDeleteWithHttpInfo($identifier)
+ public function smtpLogIdentifierDeleteWithHttpInfo(
+ string $identifier,
+ string $contentType = self::contentTypes['smtpLogIdentifierDelete'][0]
+ ): array
{
- $returnType = '';
- $request = $this->smtpLogIdentifierDeleteRequest($identifier);
+ $request = $this->smtpLogIdentifierDeleteRequest($identifier, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -5987,43 +7284,38 @@ public function smtpLogIdentifierDeleteWithHttpInfo($identifier)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
} catch (ApiException $e) {
switch ($e->getCode()) {
- case 404:
+ case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 400:
+ case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -6039,13 +7331,17 @@ public function smtpLogIdentifierDeleteWithHttpInfo($identifier)
* Delete an SMTP transactional log
*
* @param string $identifier MessageId or Email of the transactional log(s) to delete (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smtpLogIdentifierDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function smtpLogIdentifierDeleteAsync($identifier)
+ public function smtpLogIdentifierDeleteAsync(
+ string $identifier,
+ string $contentType = self::contentTypes['smtpLogIdentifierDelete'][0]
+ ): PromiseInterface
{
- return $this->smtpLogIdentifierDeleteAsyncWithHttpInfo($identifier)
+ return $this->smtpLogIdentifierDeleteAsyncWithHttpInfo($identifier, $contentType)
->then(
function ($response) {
return $response[0];
@@ -6059,14 +7355,19 @@ function ($response) {
* Delete an SMTP transactional log
*
* @param string $identifier MessageId or Email of the transactional log(s) to delete (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smtpLogIdentifierDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function smtpLogIdentifierDeleteAsyncWithHttpInfo($identifier)
+ public function smtpLogIdentifierDeleteAsyncWithHttpInfo(
+ $identifier,
+ string $contentType = self::contentTypes['smtpLogIdentifierDelete'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->smtpLogIdentifierDeleteRequest($identifier);
+ $request = $this->smtpLogIdentifierDeleteRequest($identifier, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -6085,7 +7386,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -6095,19 +7396,25 @@ function ($exception) {
* Create request for operation 'smtpLogIdentifierDelete'
*
* @param string $identifier MessageId or Email of the transactional log(s) to delete (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['smtpLogIdentifierDelete'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function smtpLogIdentifierDeleteRequest($identifier)
+ public function smtpLogIdentifierDeleteRequest(
+ $identifier,
+ string $contentType = self::contentTypes['smtpLogIdentifierDelete'][0]
+ ): Request
{
+
// verify the required parameter 'identifier' is set
if ($identifier === null || (is_array($identifier) && count($identifier) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $identifier when calling smtpLogIdentifierDelete'
);
}
+
$resourcePath = '/smtp/log/{identifier}';
$formParams = [];
$queryParams = [];
@@ -6116,6 +7423,7 @@ protected function smtpLogIdentifierDeleteRequest($identifier)
$multipart = false;
+
// path params
if ($identifier !== null) {
$resourcePath = str_replace(
@@ -6125,53 +7433,35 @@ protected function smtpLogIdentifierDeleteRequest($identifier)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -6197,10 +7487,11 @@ protected function smtpLogIdentifierDeleteRequest($identifier)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -6212,15 +7503,20 @@ protected function smtpLogIdentifierDeleteRequest($identifier)
* Update an email template
*
* @param int $templateId id of the template (required)
- * @param \Brevo\Client\Model\UpdateSmtpTemplate $smtpTemplate values to update in transactional email template (required)
+ * @param \Brevo\Client\Models\UpdateSmtpTemplate $updateSmtpTemplate values to update in transactional email template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSmtpTemplate'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function updateSmtpTemplate($templateId, $smtpTemplate)
+ public function updateSmtpTemplate(
+ int $templateId,
+ \Brevo\Client\Models\UpdateSmtpTemplate $updateSmtpTemplate,
+ string $contentType = self::contentTypes['updateSmtpTemplate'][0]
+ ): void
{
- $this->updateSmtpTemplateWithHttpInfo($templateId, $smtpTemplate);
+ $this->updateSmtpTemplateWithHttpInfo($templateId, $updateSmtpTemplate, $contentType);
}
/**
@@ -6229,16 +7525,20 @@ public function updateSmtpTemplate($templateId, $smtpTemplate)
* Update an email template
*
* @param int $templateId id of the template (required)
- * @param \Brevo\Client\Model\UpdateSmtpTemplate $smtpTemplate values to update in transactional email template (required)
+ * @param \Brevo\Client\Models\UpdateSmtpTemplate $updateSmtpTemplate values to update in transactional email template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSmtpTemplate'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function updateSmtpTemplateWithHttpInfo($templateId, $smtpTemplate)
+ public function updateSmtpTemplateWithHttpInfo(
+ int $templateId,
+ \Brevo\Client\Models\UpdateSmtpTemplate $updateSmtpTemplate,
+ string $contentType = self::contentTypes['updateSmtpTemplate'][0]
+ ): array
{
- $returnType = '';
- $request = $this->updateSmtpTemplateRequest($templateId, $smtpTemplate);
+ $request = $this->updateSmtpTemplateRequest($templateId, $updateSmtpTemplate, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -6247,26 +7547,21 @@ public function updateSmtpTemplateWithHttpInfo($templateId, $smtpTemplate)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -6275,7 +7570,7 @@ public function updateSmtpTemplateWithHttpInfo($templateId, $smtpTemplate)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -6283,7 +7578,7 @@ public function updateSmtpTemplateWithHttpInfo($templateId, $smtpTemplate)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -6299,14 +7594,19 @@ public function updateSmtpTemplateWithHttpInfo($templateId, $smtpTemplate)
* Update an email template
*
* @param int $templateId id of the template (required)
- * @param \Brevo\Client\Model\UpdateSmtpTemplate $smtpTemplate values to update in transactional email template (required)
+ * @param \Brevo\Client\Models\UpdateSmtpTemplate $updateSmtpTemplate values to update in transactional email template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSmtpTemplate'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function updateSmtpTemplateAsync($templateId, $smtpTemplate)
+ public function updateSmtpTemplateAsync(
+ int $templateId,
+ \Brevo\Client\Models\UpdateSmtpTemplate $updateSmtpTemplate,
+ string $contentType = self::contentTypes['updateSmtpTemplate'][0]
+ ): PromiseInterface
{
- return $this->updateSmtpTemplateAsyncWithHttpInfo($templateId, $smtpTemplate)
+ return $this->updateSmtpTemplateAsyncWithHttpInfo($templateId, $updateSmtpTemplate, $contentType)
->then(
function ($response) {
return $response[0];
@@ -6320,15 +7620,21 @@ function ($response) {
* Update an email template
*
* @param int $templateId id of the template (required)
- * @param \Brevo\Client\Model\UpdateSmtpTemplate $smtpTemplate values to update in transactional email template (required)
+ * @param \Brevo\Client\Models\UpdateSmtpTemplate $updateSmtpTemplate values to update in transactional email template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSmtpTemplate'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function updateSmtpTemplateAsyncWithHttpInfo($templateId, $smtpTemplate)
+ public function updateSmtpTemplateAsyncWithHttpInfo(
+ $templateId,
+ $updateSmtpTemplate,
+ string $contentType = self::contentTypes['updateSmtpTemplate'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->updateSmtpTemplateRequest($templateId, $smtpTemplate);
+ $request = $this->updateSmtpTemplateRequest($templateId, $updateSmtpTemplate, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -6347,7 +7653,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -6357,26 +7663,34 @@ function ($exception) {
* Create request for operation 'updateSmtpTemplate'
*
* @param int $templateId id of the template (required)
- * @param \Brevo\Client\Model\UpdateSmtpTemplate $smtpTemplate values to update in transactional email template (required)
+ * @param \Brevo\Client\Models\UpdateSmtpTemplate $updateSmtpTemplate values to update in transactional email template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSmtpTemplate'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function updateSmtpTemplateRequest($templateId, $smtpTemplate)
+ public function updateSmtpTemplateRequest(
+ $templateId,
+ $updateSmtpTemplate,
+ string $contentType = self::contentTypes['updateSmtpTemplate'][0]
+ ): Request
{
+
// verify the required parameter 'templateId' is set
if ($templateId === null || (is_array($templateId) && count($templateId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $templateId when calling updateSmtpTemplate'
);
}
- // verify the required parameter 'smtpTemplate' is set
- if ($smtpTemplate === null || (is_array($smtpTemplate) && count($smtpTemplate) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $smtpTemplate when calling updateSmtpTemplate'
+
+ // verify the required parameter 'updateSmtpTemplate' is set
+ if ($updateSmtpTemplate === null || (is_array($updateSmtpTemplate) && count($updateSmtpTemplate) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $updateSmtpTemplate when calling updateSmtpTemplate'
);
}
+
$resourcePath = '/smtp/templates/{templateId}';
$formParams = [];
$queryParams = [];
@@ -6385,6 +7699,7 @@ protected function updateSmtpTemplateRequest($templateId, $smtpTemplate)
$multipart = false;
+
// path params
if ($templateId !== null) {
$resourcePath = str_replace(
@@ -6394,56 +7709,42 @@ protected function updateSmtpTemplateRequest($templateId, $smtpTemplate)
);
}
- // body params
- $_tempBody = null;
- if (isset($smtpTemplate)) {
- $_tempBody = $smtpTemplate;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($updateSmtpTemplate)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($updateSmtpTemplate));
+ } else {
+ $httpBody = $updateSmtpTemplate;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -6469,10 +7770,11 @@ protected function updateSmtpTemplateRequest($templateId, $smtpTemplate)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'PUT',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -6484,7 +7786,7 @@ protected function updateSmtpTemplateRequest($templateId, $smtpTemplate)
* @throws \RuntimeException on file opening failure
* @return array of http client options
*/
- protected function createHttpClientOption()
+ protected function createHttpClientOption(): array
{
$options = [];
if ($this->config->getDebug()) {
diff --git a/lib/Api/TransactionalSMSApi.php b/lib/Api/TransactionalSMSApi.php
index c046b63..8b2996f 100644
--- a/lib/Api/TransactionalSMSApi.php
+++ b/lib/Api/TransactionalSMSApi.php
@@ -1,39 +1,41 @@
[
+ 'application/json',
+ ],
+ 'getTransacAggregatedSmsReport' => [
+ 'application/json',
+ ],
+ 'getTransacSmsReport' => [
+ 'application/json',
+ ],
+ 'sendTransacSms' => [
+ 'application/json',
+ ],
+ ];
+
+ /**
+ * @param ClientInterface|null $client
+ * @param Configuration|null $config
+ * @param HeaderSelector|null $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
+ HeaderSelector $selector = null,
+ int $hostIndex = 0
) {
$this->client = $client ?: new Client();
- $this->config = $config ?: new Configuration();
+ $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(int $hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex(): int
+ {
+ return $this->hostIndex;
}
/**
* @return Configuration
*/
- public function getConfig()
+ public function getConfig(): Configuration
{
return $this->config;
}
@@ -92,23 +137,35 @@ public function getConfig()
*
* Get all your SMS activity (unaggregated events)
*
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional)
- * @param string $phoneNumber Filter the report for a specific phone number (optional)
- * @param string $event Filter the report for specific events (optional)
- * @param string $tags Filter the report for specific tags passed as a serialized urlencoded array (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report (optional)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param int|null $days Number of days in the past including today (positive integer). **Not compatible with 'startDate' and 'endDate'** (optional)
+ * @param string|null $phoneNumber Filter the report for a specific phone number (optional)
+ * @param string|null $event Filter the report for specific events (optional)
+ * @param string|null $tags Filter the report for specific tags passed as a serialized urlencoded array (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSmsEvents'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetSmsEventReport
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetSmsEventReport|\Brevo\Client\Models\ErrorModel
*/
- public function getSmsEvents($limit = '50', $startDate = null, $endDate = null, $offset = '0', $days = null, $phoneNumber = null, $event = null, $tags = null, $sort = 'desc')
+ public function getSmsEvents(
+ ?int $limit = 50,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $offset = 0,
+ ?int $days = null,
+ ?string $phoneNumber = null,
+ ?string $event = null,
+ ?string $tags = null,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getSmsEvents'][0]
+ ): \Brevo\Client\Models\GetSmsEventReport
{
- list($response) = $this->getSmsEventsWithHttpInfo($limit, $startDate, $endDate, $offset, $days, $phoneNumber, $event, $tags, $sort);
+ list($response) = $this->getSmsEventsWithHttpInfo($limit, $startDate, $endDate, $offset, $days, $phoneNumber, $event, $tags, $sort, $contentType);
return $response;
}
@@ -117,24 +174,35 @@ public function getSmsEvents($limit = '50', $startDate = null, $endDate = null,
*
* Get all your SMS activity (unaggregated events)
*
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional)
- * @param string $phoneNumber Filter the report for a specific phone number (optional)
- * @param string $event Filter the report for specific events (optional)
- * @param string $tags Filter the report for specific tags passed as a serialized urlencoded array (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report (optional)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param int|null $days Number of days in the past including today (positive integer). **Not compatible with 'startDate' and 'endDate'** (optional)
+ * @param string|null $phoneNumber Filter the report for a specific phone number (optional)
+ * @param string|null $event Filter the report for specific events (optional)
+ * @param string|null $tags Filter the report for specific tags passed as a serialized urlencoded array (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSmsEvents'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetSmsEventReport, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetSmsEventReport|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getSmsEventsWithHttpInfo($limit = '50', $startDate = null, $endDate = null, $offset = '0', $days = null, $phoneNumber = null, $event = null, $tags = null, $sort = 'desc')
+ public function getSmsEventsWithHttpInfo(
+ ?int $limit = 50,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $offset = 0,
+ ?int $days = null,
+ ?string $phoneNumber = null,
+ ?string $event = null,
+ ?string $tags = null,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getSmsEvents'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetSmsEventReport';
- $request = $this->getSmsEventsRequest($limit, $startDate, $endDate, $offset, $days, $phoneNumber, $event, $tags, $sort);
+ $request = $this->getSmsEventsRequest($limit, $startDate, $endDate, $offset, $days, $phoneNumber, $event, $tags, $sort, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -143,34 +211,111 @@ public function getSmsEventsWithHttpInfo($limit = '50', $startDate = null, $endD
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetSmsEventReport', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetSmsEventReport' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetSmsEventReport', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetSmsEventReport';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -185,7 +330,7 @@ public function getSmsEventsWithHttpInfo($limit = '50', $startDate = null, $endD
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetSmsEventReport',
+ '\Brevo\Client\Models\GetSmsEventReport',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -193,7 +338,7 @@ public function getSmsEventsWithHttpInfo($limit = '50', $startDate = null, $endD
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -208,22 +353,34 @@ public function getSmsEventsWithHttpInfo($limit = '50', $startDate = null, $endD
*
* Get all your SMS activity (unaggregated events)
*
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional)
- * @param string $phoneNumber Filter the report for a specific phone number (optional)
- * @param string $event Filter the report for specific events (optional)
- * @param string $tags Filter the report for specific tags passed as a serialized urlencoded array (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report (optional)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param int|null $days Number of days in the past including today (positive integer). **Not compatible with 'startDate' and 'endDate'** (optional)
+ * @param string|null $phoneNumber Filter the report for a specific phone number (optional)
+ * @param string|null $event Filter the report for specific events (optional)
+ * @param string|null $tags Filter the report for specific tags passed as a serialized urlencoded array (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSmsEvents'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getSmsEventsAsync($limit = '50', $startDate = null, $endDate = null, $offset = '0', $days = null, $phoneNumber = null, $event = null, $tags = null, $sort = 'desc')
+ public function getSmsEventsAsync(
+ ?int $limit = 50,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $offset = 0,
+ ?int $days = null,
+ ?string $phoneNumber = null,
+ ?string $event = null,
+ ?string $tags = null,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getSmsEvents'][0]
+ ): PromiseInterface
{
- return $this->getSmsEventsAsyncWithHttpInfo($limit, $startDate, $endDate, $offset, $days, $phoneNumber, $event, $tags, $sort)
+ return $this->getSmsEventsAsyncWithHttpInfo($limit, $startDate, $endDate, $offset, $days, $phoneNumber, $event, $tags, $sort, $contentType)
->then(
function ($response) {
return $response[0];
@@ -236,33 +393,45 @@ function ($response) {
*
* Get all your SMS activity (unaggregated events)
*
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional)
- * @param string $phoneNumber Filter the report for a specific phone number (optional)
- * @param string $event Filter the report for specific events (optional)
- * @param string $tags Filter the report for specific tags passed as a serialized urlencoded array (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report (optional)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param int|null $days Number of days in the past including today (positive integer). **Not compatible with 'startDate' and 'endDate'** (optional)
+ * @param string|null $phoneNumber Filter the report for a specific phone number (optional)
+ * @param string|null $event Filter the report for specific events (optional)
+ * @param string|null $tags Filter the report for specific tags passed as a serialized urlencoded array (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSmsEvents'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getSmsEventsAsyncWithHttpInfo($limit = '50', $startDate = null, $endDate = null, $offset = '0', $days = null, $phoneNumber = null, $event = null, $tags = null, $sort = 'desc')
+ public function getSmsEventsAsyncWithHttpInfo(
+ $limit = 50,
+ $startDate = null,
+ $endDate = null,
+ $offset = 0,
+ $days = null,
+ $phoneNumber = null,
+ $event = null,
+ $tags = null,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getSmsEvents'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetSmsEventReport';
- $request = $this->getSmsEventsRequest($limit, $startDate, $endDate, $offset, $days, $phoneNumber, $event, $tags, $sort);
+ $returnType = '\Brevo\Client\Models\GetSmsEventReport';
+ $request = $this->getSmsEventsRequest($limit, $startDate, $endDate, $offset, $days, $phoneNumber, $event, $tags, $sort, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -285,7 +454,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -294,24 +463,48 @@ function ($exception) {
/**
* Create request for operation 'getSmsEvents'
*
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional)
- * @param int $offset Index of the first document of the page (optional, default to 0)
- * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional)
- * @param string $phoneNumber Filter the report for a specific phone number (optional)
- * @param string $event Filter the report for specific events (optional)
- * @param string $tags Filter the report for specific tags passed as a serialized urlencoded array (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report (optional)
+ * @param int|null $offset Index of the first document of the page (optional, default to 0)
+ * @param int|null $days Number of days in the past including today (positive integer). **Not compatible with 'startDate' and 'endDate'** (optional)
+ * @param string|null $phoneNumber Filter the report for a specific phone number (optional)
+ * @param string|null $event Filter the report for specific events (optional)
+ * @param string|null $tags Filter the report for specific tags passed as a serialized urlencoded array (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSmsEvents'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getSmsEventsRequest($limit = '50', $startDate = null, $endDate = null, $offset = '0', $days = null, $phoneNumber = null, $event = null, $tags = null, $sort = 'desc')
+ public function getSmsEventsRequest(
+ $limit = 50,
+ $startDate = null,
+ $endDate = null,
+ $offset = 0,
+ $days = null,
+ $phoneNumber = null,
+ $event = null,
+ $tags = null,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getSmsEvents'][0]
+ ): Request
{
+
if ($limit !== null && $limit > 100) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling TransactionalSMSApi.getSmsEvents, must be smaller than or equal to 100.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling TransactionalSMSApi.getSmsEvents, must be smaller than or equal to 100.');
}
+ if ($limit !== null && $limit < 0) {
+ throw new InvalidArgumentException('invalid value for "$limit" when calling TransactionalSMSApi.getSmsEvents, must be bigger than or equal to 0.');
+ }
+
+
+
+
+
+
+
+
$resourcePath = '/transactionalSMS/statistics/events';
@@ -322,90 +515,118 @@ protected function getSmsEventsRequest($limit = '50', $startDate = null, $endDat
$multipart = false;
// query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($startDate !== null) {
- $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $startDate,
+ 'startDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($endDate !== null) {
- $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $endDate,
+ 'endDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($days !== null) {
- $queryParams['days'] = ObjectSerializer::toQueryValue($days);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $days,
+ 'days', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($phoneNumber !== null) {
- $queryParams['phoneNumber'] = ObjectSerializer::toQueryValue($phoneNumber);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $phoneNumber,
+ 'phoneNumber', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($event !== null) {
- $queryParams['event'] = ObjectSerializer::toQueryValue($event);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $event,
+ 'event', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($tags !== null) {
- $queryParams['tags'] = ObjectSerializer::toQueryValue($tags);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $tags,
+ 'tags', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -431,10 +652,11 @@ protected function getSmsEventsRequest($limit = '50', $startDate = null, $endDat
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -445,18 +667,25 @@ protected function getSmsEventsRequest($limit = '50', $startDate = null, $endDat
*
* Get your SMS activity aggregated over a period of time
*
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional)
- * @param int $days Number of days in the past including today (positive integer). Not compatible with startDate and endDate (optional)
- * @param string $tag Filter on a tag (optional)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report (optional)
+ * @param int|null $days Number of days in the past including today (positive integer). **Not compatible with startDate and endDate** (optional)
+ * @param string|null $tag Filter on a tag (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTransacAggregatedSmsReport'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetTransacAggregatedSmsReport
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetTransacAggregatedSmsReport|\Brevo\Client\Models\ErrorModel
*/
- public function getTransacAggregatedSmsReport($startDate = null, $endDate = null, $days = null, $tag = null)
+ public function getTransacAggregatedSmsReport(
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $days = null,
+ ?string $tag = null,
+ string $contentType = self::contentTypes['getTransacAggregatedSmsReport'][0]
+ ): \Brevo\Client\Models\GetTransacAggregatedSmsReport
{
- list($response) = $this->getTransacAggregatedSmsReportWithHttpInfo($startDate, $endDate, $days, $tag);
+ list($response) = $this->getTransacAggregatedSmsReportWithHttpInfo($startDate, $endDate, $days, $tag, $contentType);
return $response;
}
@@ -465,19 +694,25 @@ public function getTransacAggregatedSmsReport($startDate = null, $endDate = null
*
* Get your SMS activity aggregated over a period of time
*
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional)
- * @param int $days Number of days in the past including today (positive integer). Not compatible with startDate and endDate (optional)
- * @param string $tag Filter on a tag (optional)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report (optional)
+ * @param int|null $days Number of days in the past including today (positive integer). **Not compatible with startDate and endDate** (optional)
+ * @param string|null $tag Filter on a tag (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTransacAggregatedSmsReport'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetTransacAggregatedSmsReport, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetTransacAggregatedSmsReport|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getTransacAggregatedSmsReportWithHttpInfo($startDate = null, $endDate = null, $days = null, $tag = null)
+ public function getTransacAggregatedSmsReportWithHttpInfo(
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $days = null,
+ ?string $tag = null,
+ string $contentType = self::contentTypes['getTransacAggregatedSmsReport'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetTransacAggregatedSmsReport';
- $request = $this->getTransacAggregatedSmsReportRequest($startDate, $endDate, $days, $tag);
+ $request = $this->getTransacAggregatedSmsReportRequest($startDate, $endDate, $days, $tag, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -486,34 +721,111 @@ public function getTransacAggregatedSmsReportWithHttpInfo($startDate = null, $en
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetTransacAggregatedSmsReport', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetTransacAggregatedSmsReport' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetTransacAggregatedSmsReport', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetTransacAggregatedSmsReport';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -528,7 +840,7 @@ public function getTransacAggregatedSmsReportWithHttpInfo($startDate = null, $en
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetTransacAggregatedSmsReport',
+ '\Brevo\Client\Models\GetTransacAggregatedSmsReport',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -536,7 +848,7 @@ public function getTransacAggregatedSmsReportWithHttpInfo($startDate = null, $en
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -551,17 +863,24 @@ public function getTransacAggregatedSmsReportWithHttpInfo($startDate = null, $en
*
* Get your SMS activity aggregated over a period of time
*
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional)
- * @param int $days Number of days in the past including today (positive integer). Not compatible with startDate and endDate (optional)
- * @param string $tag Filter on a tag (optional)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report (optional)
+ * @param int|null $days Number of days in the past including today (positive integer). **Not compatible with startDate and endDate** (optional)
+ * @param string|null $tag Filter on a tag (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTransacAggregatedSmsReport'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getTransacAggregatedSmsReportAsync($startDate = null, $endDate = null, $days = null, $tag = null)
+ public function getTransacAggregatedSmsReportAsync(
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $days = null,
+ ?string $tag = null,
+ string $contentType = self::contentTypes['getTransacAggregatedSmsReport'][0]
+ ): PromiseInterface
{
- return $this->getTransacAggregatedSmsReportAsyncWithHttpInfo($startDate, $endDate, $days, $tag)
+ return $this->getTransacAggregatedSmsReportAsyncWithHttpInfo($startDate, $endDate, $days, $tag, $contentType)
->then(
function ($response) {
return $response[0];
@@ -574,28 +893,35 @@ function ($response) {
*
* Get your SMS activity aggregated over a period of time
*
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional)
- * @param int $days Number of days in the past including today (positive integer). Not compatible with startDate and endDate (optional)
- * @param string $tag Filter on a tag (optional)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report (optional)
+ * @param int|null $days Number of days in the past including today (positive integer). **Not compatible with startDate and endDate** (optional)
+ * @param string|null $tag Filter on a tag (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTransacAggregatedSmsReport'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getTransacAggregatedSmsReportAsyncWithHttpInfo($startDate = null, $endDate = null, $days = null, $tag = null)
+ public function getTransacAggregatedSmsReportAsyncWithHttpInfo(
+ $startDate = null,
+ $endDate = null,
+ $days = null,
+ $tag = null,
+ string $contentType = self::contentTypes['getTransacAggregatedSmsReport'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetTransacAggregatedSmsReport';
- $request = $this->getTransacAggregatedSmsReportRequest($startDate, $endDate, $days, $tag);
+ $returnType = '\Brevo\Client\Models\GetTransacAggregatedSmsReport';
+ $request = $this->getTransacAggregatedSmsReportRequest($startDate, $endDate, $days, $tag, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -618,7 +944,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -627,17 +953,29 @@ function ($exception) {
/**
* Create request for operation 'getTransacAggregatedSmsReport'
*
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional)
- * @param int $days Number of days in the past including today (positive integer). Not compatible with startDate and endDate (optional)
- * @param string $tag Filter on a tag (optional)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report (optional)
+ * @param int|null $days Number of days in the past including today (positive integer). **Not compatible with startDate and endDate** (optional)
+ * @param string|null $tag Filter on a tag (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTransacAggregatedSmsReport'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getTransacAggregatedSmsReportRequest($startDate = null, $endDate = null, $days = null, $tag = null)
+ public function getTransacAggregatedSmsReportRequest(
+ $startDate = null,
+ $endDate = null,
+ $days = null,
+ $tag = null,
+ string $contentType = self::contentTypes['getTransacAggregatedSmsReport'][0]
+ ): Request
{
+
+
+
+
+
$resourcePath = '/transactionalSMS/statistics/aggregatedReport';
$formParams = [];
$queryParams = [];
@@ -646,70 +984,73 @@ protected function getTransacAggregatedSmsReportRequest($startDate = null, $endD
$multipart = false;
// query params
- if ($startDate !== null) {
- $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $startDate,
+ 'startDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($endDate !== null) {
- $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $endDate,
+ 'endDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($days !== null) {
- $queryParams['days'] = ObjectSerializer::toQueryValue($days);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $days,
+ 'days', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($tag !== null) {
- $queryParams['tag'] = ObjectSerializer::toQueryValue($tag);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $tag,
+ 'tag', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -735,10 +1076,11 @@ protected function getTransacAggregatedSmsReportRequest($startDate = null, $endD
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -749,19 +1091,27 @@ protected function getTransacAggregatedSmsReportRequest($startDate = null, $endD
*
* Get your SMS activity aggregated per day
*
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional)
- * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional)
- * @param string $tag Filter on a tag (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report (optional)
+ * @param int|null $days Number of days in the past including today (positive integer). **Not compatible with 'startDate' and 'endDate'** (optional)
+ * @param string|null $tag Filter on a tag (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTransacSmsReport'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetTransacSmsReport
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetTransacSmsReport|\Brevo\Client\Models\ErrorModel
*/
- public function getTransacSmsReport($startDate = null, $endDate = null, $days = null, $tag = null, $sort = 'desc')
+ public function getTransacSmsReport(
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $days = null,
+ ?string $tag = null,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getTransacSmsReport'][0]
+ ): \Brevo\Client\Models\GetTransacSmsReport
{
- list($response) = $this->getTransacSmsReportWithHttpInfo($startDate, $endDate, $days, $tag, $sort);
+ list($response) = $this->getTransacSmsReportWithHttpInfo($startDate, $endDate, $days, $tag, $sort, $contentType);
return $response;
}
@@ -770,20 +1120,27 @@ public function getTransacSmsReport($startDate = null, $endDate = null, $days =
*
* Get your SMS activity aggregated per day
*
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional)
- * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional)
- * @param string $tag Filter on a tag (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report (optional)
+ * @param int|null $days Number of days in the past including today (positive integer). **Not compatible with 'startDate' and 'endDate'** (optional)
+ * @param string|null $tag Filter on a tag (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTransacSmsReport'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetTransacSmsReport, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetTransacSmsReport|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getTransacSmsReportWithHttpInfo($startDate = null, $endDate = null, $days = null, $tag = null, $sort = 'desc')
+ public function getTransacSmsReportWithHttpInfo(
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $days = null,
+ ?string $tag = null,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getTransacSmsReport'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetTransacSmsReport';
- $request = $this->getTransacSmsReportRequest($startDate, $endDate, $days, $tag, $sort);
+ $request = $this->getTransacSmsReportRequest($startDate, $endDate, $days, $tag, $sort, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -792,34 +1149,111 @@ public function getTransacSmsReportWithHttpInfo($startDate = null, $endDate = nu
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetTransacSmsReport', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetTransacSmsReport' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetTransacSmsReport', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetTransacSmsReport';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -834,7 +1268,7 @@ public function getTransacSmsReportWithHttpInfo($startDate = null, $endDate = nu
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetTransacSmsReport',
+ '\Brevo\Client\Models\GetTransacSmsReport',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -842,7 +1276,7 @@ public function getTransacSmsReportWithHttpInfo($startDate = null, $endDate = nu
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -857,18 +1291,26 @@ public function getTransacSmsReportWithHttpInfo($startDate = null, $endDate = nu
*
* Get your SMS activity aggregated per day
*
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional)
- * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional)
- * @param string $tag Filter on a tag (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report (optional)
+ * @param int|null $days Number of days in the past including today (positive integer). **Not compatible with 'startDate' and 'endDate'** (optional)
+ * @param string|null $tag Filter on a tag (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTransacSmsReport'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getTransacSmsReportAsync($startDate = null, $endDate = null, $days = null, $tag = null, $sort = 'desc')
+ public function getTransacSmsReportAsync(
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $days = null,
+ ?string $tag = null,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getTransacSmsReport'][0]
+ ): PromiseInterface
{
- return $this->getTransacSmsReportAsyncWithHttpInfo($startDate, $endDate, $days, $tag, $sort)
+ return $this->getTransacSmsReportAsyncWithHttpInfo($startDate, $endDate, $days, $tag, $sort, $contentType)
->then(
function ($response) {
return $response[0];
@@ -881,29 +1323,37 @@ function ($response) {
*
* Get your SMS activity aggregated per day
*
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional)
- * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional)
- * @param string $tag Filter on a tag (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report (optional)
+ * @param int|null $days Number of days in the past including today (positive integer). **Not compatible with 'startDate' and 'endDate'** (optional)
+ * @param string|null $tag Filter on a tag (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTransacSmsReport'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getTransacSmsReportAsyncWithHttpInfo($startDate = null, $endDate = null, $days = null, $tag = null, $sort = 'desc')
+ public function getTransacSmsReportAsyncWithHttpInfo(
+ $startDate = null,
+ $endDate = null,
+ $days = null,
+ $tag = null,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getTransacSmsReport'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetTransacSmsReport';
- $request = $this->getTransacSmsReportRequest($startDate, $endDate, $days, $tag, $sort);
+ $returnType = '\Brevo\Client\Models\GetTransacSmsReport';
+ $request = $this->getTransacSmsReportRequest($startDate, $endDate, $days, $tag, $sort, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -926,7 +1376,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -935,18 +1385,32 @@ function ($exception) {
/**
* Create request for operation 'getTransacSmsReport'
*
- * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional)
- * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional)
- * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional)
- * @param string $tag Filter on a tag (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report (optional)
+ * @param int|null $days Number of days in the past including today (positive integer). **Not compatible with 'startDate' and 'endDate'** (optional)
+ * @param string|null $tag Filter on a tag (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTransacSmsReport'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getTransacSmsReportRequest($startDate = null, $endDate = null, $days = null, $tag = null, $sort = 'desc')
+ public function getTransacSmsReportRequest(
+ $startDate = null,
+ $endDate = null,
+ $days = null,
+ $tag = null,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getTransacSmsReport'][0]
+ ): Request
{
+
+
+
+
+
+
$resourcePath = '/transactionalSMS/statistics/reports';
$formParams = [];
$queryParams = [];
@@ -955,74 +1419,82 @@ protected function getTransacSmsReportRequest($startDate = null, $endDate = null
$multipart = false;
// query params
- if ($startDate !== null) {
- $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $startDate,
+ 'startDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($endDate !== null) {
- $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $endDate,
+ 'endDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($days !== null) {
- $queryParams['days'] = ObjectSerializer::toQueryValue($days);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $days,
+ 'days', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($tag !== null) {
- $queryParams['tag'] = ObjectSerializer::toQueryValue($tag);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $tag,
+ 'tag', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1048,10 +1520,11 @@ protected function getTransacSmsReportRequest($startDate = null, $endDate = null
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1062,15 +1535,19 @@ protected function getTransacSmsReportRequest($startDate = null, $endDate = null
*
* Send SMS message to a mobile number
*
- * @param \Brevo\Client\Model\SendTransacSms $sendTransacSms Values to send a transactional SMS (required)
+ * @param \Brevo\Client\Models\SendTransacSms $sendTransacSms Values to send a transactional SMS (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTransacSms'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\SendSms
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\SendSms|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function sendTransacSms($sendTransacSms)
+ public function sendTransacSms(
+ \Brevo\Client\Models\SendTransacSms $sendTransacSms,
+ string $contentType = self::contentTypes['sendTransacSms'][0]
+ ): \Brevo\Client\Models\SendSms
{
- list($response) = $this->sendTransacSmsWithHttpInfo($sendTransacSms);
+ list($response) = $this->sendTransacSmsWithHttpInfo($sendTransacSms, $contentType);
return $response;
}
@@ -1079,16 +1556,19 @@ public function sendTransacSms($sendTransacSms)
*
* Send SMS message to a mobile number
*
- * @param \Brevo\Client\Model\SendTransacSms $sendTransacSms Values to send a transactional SMS (required)
+ * @param \Brevo\Client\Models\SendTransacSms $sendTransacSms Values to send a transactional SMS (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTransacSms'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\SendSms, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\SendSms|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function sendTransacSmsWithHttpInfo($sendTransacSms)
+ public function sendTransacSmsWithHttpInfo(
+ \Brevo\Client\Models\SendTransacSms $sendTransacSms,
+ string $contentType = self::contentTypes['sendTransacSms'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\SendSms';
- $request = $this->sendTransacSmsRequest($sendTransacSms);
+ $request = $this->sendTransacSmsRequest($sendTransacSms, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1097,34 +1577,138 @@ public function sendTransacSmsWithHttpInfo($sendTransacSms)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 201:
+ if (in_array('\Brevo\Client\Models\SendSms', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\SendSms' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\SendSms', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 402:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\SendSms';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1139,7 +1723,7 @@ public function sendTransacSmsWithHttpInfo($sendTransacSms)
case 201:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\SendSms',
+ '\Brevo\Client\Models\SendSms',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1147,7 +1731,7 @@ public function sendTransacSmsWithHttpInfo($sendTransacSms)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1155,7 +1739,7 @@ public function sendTransacSmsWithHttpInfo($sendTransacSms)
case 402:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1170,14 +1754,18 @@ public function sendTransacSmsWithHttpInfo($sendTransacSms)
*
* Send SMS message to a mobile number
*
- * @param \Brevo\Client\Model\SendTransacSms $sendTransacSms Values to send a transactional SMS (required)
+ * @param \Brevo\Client\Models\SendTransacSms $sendTransacSms Values to send a transactional SMS (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTransacSms'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function sendTransacSmsAsync($sendTransacSms)
+ public function sendTransacSmsAsync(
+ \Brevo\Client\Models\SendTransacSms $sendTransacSms,
+ string $contentType = self::contentTypes['sendTransacSms'][0]
+ ): PromiseInterface
{
- return $this->sendTransacSmsAsyncWithHttpInfo($sendTransacSms)
+ return $this->sendTransacSmsAsyncWithHttpInfo($sendTransacSms, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1190,25 +1778,29 @@ function ($response) {
*
* Send SMS message to a mobile number
*
- * @param \Brevo\Client\Model\SendTransacSms $sendTransacSms Values to send a transactional SMS (required)
+ * @param \Brevo\Client\Models\SendTransacSms $sendTransacSms Values to send a transactional SMS (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTransacSms'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function sendTransacSmsAsyncWithHttpInfo($sendTransacSms)
+ public function sendTransacSmsAsyncWithHttpInfo(
+ $sendTransacSms,
+ string $contentType = self::contentTypes['sendTransacSms'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\SendSms';
- $request = $this->sendTransacSmsRequest($sendTransacSms);
+ $returnType = '\Brevo\Client\Models\SendSms';
+ $request = $this->sendTransacSmsRequest($sendTransacSms, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1231,7 +1823,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1240,20 +1832,26 @@ function ($exception) {
/**
* Create request for operation 'sendTransacSms'
*
- * @param \Brevo\Client\Model\SendTransacSms $sendTransacSms Values to send a transactional SMS (required)
+ * @param \Brevo\Client\Models\SendTransacSms $sendTransacSms Values to send a transactional SMS (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTransacSms'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function sendTransacSmsRequest($sendTransacSms)
+ public function sendTransacSmsRequest(
+ $sendTransacSms,
+ string $contentType = self::contentTypes['sendTransacSms'][0]
+ ): Request
{
+
// verify the required parameter 'sendTransacSms' is set
if ($sendTransacSms === null || (is_array($sendTransacSms) && count($sendTransacSms) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $sendTransacSms when calling sendTransacSms'
);
}
+
$resourcePath = '/transactionalSMS/sms';
$formParams = [];
$queryParams = [];
@@ -1263,56 +1861,43 @@ protected function sendTransacSmsRequest($sendTransacSms)
- // body params
- $_tempBody = null;
- if (isset($sendTransacSms)) {
- $_tempBody = $sendTransacSms;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($sendTransacSms)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($sendTransacSms));
+ } else {
+ $httpBody = $sendTransacSms;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1338,10 +1923,11 @@ protected function sendTransacSmsRequest($sendTransacSms)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1353,7 +1939,7 @@ protected function sendTransacSmsRequest($sendTransacSms)
* @throws \RuntimeException on file opening failure
* @return array of http client options
*/
- protected function createHttpClientOption()
+ protected function createHttpClientOption(): array
{
$options = [];
if ($this->config->getDebug()) {
diff --git a/lib/Api/TransactionalWhatsAppApi.php b/lib/Api/TransactionalWhatsAppApi.php
index 3bec4c2..524e389 100644
--- a/lib/Api/TransactionalWhatsAppApi.php
+++ b/lib/Api/TransactionalWhatsAppApi.php
@@ -1,39 +1,41 @@
[
+ 'application/json',
+ ],
+ 'sendWhatsappMessage' => [
+ 'application/json',
+ ],
+ ];
+
+ /**
+ * @param ClientInterface|null $client
+ * @param Configuration|null $config
+ * @param HeaderSelector|null $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
+ HeaderSelector $selector = null,
+ int $hostIndex = 0
) {
$this->client = $client ?: new Client();
- $this->config = $config ?: new Configuration();
+ $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(int $hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex(): int
+ {
+ return $this->hostIndex;
}
/**
* @return Configuration
*/
- public function getConfig()
+ public function getConfig(): Configuration
{
return $this->config;
}
@@ -92,22 +131,33 @@ public function getConfig()
*
* Get all your WhatsApp activity (unaggregated events)
*
- * @param int $limit Number limitation for the result returned (optional, default to 2500)
- * @param int $offset Beginning point in the list to retrieve from (optional, default to 0)
- * @param string $startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
- * @param string $endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
- * @param int $days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional)
- * @param string $contactNumber Filter results for specific contact (WhatsApp Number with country code. Example, 85264318721) (optional)
- * @param string $event Filter the report for a specific event type (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number limitation for the result returned (optional, default to 2500)
+ * @param int|null $offset Beginning point in the list to retrieve from (optional, default to 0)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
+ * @param int|null $days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional)
+ * @param string|null $contactNumber Filter results for specific contact (WhatsApp Number with country code. Example, 85264318721) (optional)
+ * @param string|null $event Filter the report for a specific event type (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWhatsappEventReport'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetWhatsappEventReport
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetWhatsappEventReport|\Brevo\Client\Models\ErrorModel
*/
- public function getWhatsappEventReport($limit = '2500', $offset = '0', $startDate = null, $endDate = null, $days = null, $contactNumber = null, $event = null, $sort = 'desc')
+ public function getWhatsappEventReport(
+ ?int $limit = 2500,
+ ?int $offset = 0,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $days = null,
+ ?string $contactNumber = null,
+ ?string $event = null,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getWhatsappEventReport'][0]
+ ): \Brevo\Client\Models\GetWhatsappEventReport
{
- list($response) = $this->getWhatsappEventReportWithHttpInfo($limit, $offset, $startDate, $endDate, $days, $contactNumber, $event, $sort);
+ list($response) = $this->getWhatsappEventReportWithHttpInfo($limit, $offset, $startDate, $endDate, $days, $contactNumber, $event, $sort, $contentType);
return $response;
}
@@ -116,23 +166,33 @@ public function getWhatsappEventReport($limit = '2500', $offset = '0', $startDat
*
* Get all your WhatsApp activity (unaggregated events)
*
- * @param int $limit Number limitation for the result returned (optional, default to 2500)
- * @param int $offset Beginning point in the list to retrieve from (optional, default to 0)
- * @param string $startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
- * @param string $endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
- * @param int $days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional)
- * @param string $contactNumber Filter results for specific contact (WhatsApp Number with country code. Example, 85264318721) (optional)
- * @param string $event Filter the report for a specific event type (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number limitation for the result returned (optional, default to 2500)
+ * @param int|null $offset Beginning point in the list to retrieve from (optional, default to 0)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
+ * @param int|null $days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional)
+ * @param string|null $contactNumber Filter results for specific contact (WhatsApp Number with country code. Example, 85264318721) (optional)
+ * @param string|null $event Filter the report for a specific event type (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWhatsappEventReport'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetWhatsappEventReport, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetWhatsappEventReport|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getWhatsappEventReportWithHttpInfo($limit = '2500', $offset = '0', $startDate = null, $endDate = null, $days = null, $contactNumber = null, $event = null, $sort = 'desc')
+ public function getWhatsappEventReportWithHttpInfo(
+ ?int $limit = 2500,
+ ?int $offset = 0,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $days = null,
+ ?string $contactNumber = null,
+ ?string $event = null,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getWhatsappEventReport'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetWhatsappEventReport';
- $request = $this->getWhatsappEventReportRequest($limit, $offset, $startDate, $endDate, $days, $contactNumber, $event, $sort);
+ $request = $this->getWhatsappEventReportRequest($limit, $offset, $startDate, $endDate, $days, $contactNumber, $event, $sort, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -141,34 +201,111 @@ public function getWhatsappEventReportWithHttpInfo($limit = '2500', $offset = '0
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetWhatsappEventReport', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetWhatsappEventReport' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetWhatsappEventReport', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetWhatsappEventReport';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -183,7 +320,7 @@ public function getWhatsappEventReportWithHttpInfo($limit = '2500', $offset = '0
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetWhatsappEventReport',
+ '\Brevo\Client\Models\GetWhatsappEventReport',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -191,7 +328,7 @@ public function getWhatsappEventReportWithHttpInfo($limit = '2500', $offset = '0
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -206,21 +343,32 @@ public function getWhatsappEventReportWithHttpInfo($limit = '2500', $offset = '0
*
* Get all your WhatsApp activity (unaggregated events)
*
- * @param int $limit Number limitation for the result returned (optional, default to 2500)
- * @param int $offset Beginning point in the list to retrieve from (optional, default to 0)
- * @param string $startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
- * @param string $endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
- * @param int $days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional)
- * @param string $contactNumber Filter results for specific contact (WhatsApp Number with country code. Example, 85264318721) (optional)
- * @param string $event Filter the report for a specific event type (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number limitation for the result returned (optional, default to 2500)
+ * @param int|null $offset Beginning point in the list to retrieve from (optional, default to 0)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
+ * @param int|null $days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional)
+ * @param string|null $contactNumber Filter results for specific contact (WhatsApp Number with country code. Example, 85264318721) (optional)
+ * @param string|null $event Filter the report for a specific event type (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWhatsappEventReport'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getWhatsappEventReportAsync($limit = '2500', $offset = '0', $startDate = null, $endDate = null, $days = null, $contactNumber = null, $event = null, $sort = 'desc')
+ public function getWhatsappEventReportAsync(
+ ?int $limit = 2500,
+ ?int $offset = 0,
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $days = null,
+ ?string $contactNumber = null,
+ ?string $event = null,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getWhatsappEventReport'][0]
+ ): PromiseInterface
{
- return $this->getWhatsappEventReportAsyncWithHttpInfo($limit, $offset, $startDate, $endDate, $days, $contactNumber, $event, $sort)
+ return $this->getWhatsappEventReportAsyncWithHttpInfo($limit, $offset, $startDate, $endDate, $days, $contactNumber, $event, $sort, $contentType)
->then(
function ($response) {
return $response[0];
@@ -233,32 +381,43 @@ function ($response) {
*
* Get all your WhatsApp activity (unaggregated events)
*
- * @param int $limit Number limitation for the result returned (optional, default to 2500)
- * @param int $offset Beginning point in the list to retrieve from (optional, default to 0)
- * @param string $startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
- * @param string $endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
- * @param int $days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional)
- * @param string $contactNumber Filter results for specific contact (WhatsApp Number with country code. Example, 85264318721) (optional)
- * @param string $event Filter the report for a specific event type (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number limitation for the result returned (optional, default to 2500)
+ * @param int|null $offset Beginning point in the list to retrieve from (optional, default to 0)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
+ * @param int|null $days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional)
+ * @param string|null $contactNumber Filter results for specific contact (WhatsApp Number with country code. Example, 85264318721) (optional)
+ * @param string|null $event Filter the report for a specific event type (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWhatsappEventReport'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getWhatsappEventReportAsyncWithHttpInfo($limit = '2500', $offset = '0', $startDate = null, $endDate = null, $days = null, $contactNumber = null, $event = null, $sort = 'desc')
+ public function getWhatsappEventReportAsyncWithHttpInfo(
+ $limit = 2500,
+ $offset = 0,
+ $startDate = null,
+ $endDate = null,
+ $days = null,
+ $contactNumber = null,
+ $event = null,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getWhatsappEventReport'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetWhatsappEventReport';
- $request = $this->getWhatsappEventReportRequest($limit, $offset, $startDate, $endDate, $days, $contactNumber, $event, $sort);
+ $returnType = '\Brevo\Client\Models\GetWhatsappEventReport';
+ $request = $this->getWhatsappEventReportRequest($limit, $offset, $startDate, $endDate, $days, $contactNumber, $event, $sort, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -281,7 +440,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -290,26 +449,45 @@ function ($exception) {
/**
* Create request for operation 'getWhatsappEventReport'
*
- * @param int $limit Number limitation for the result returned (optional, default to 2500)
- * @param int $offset Beginning point in the list to retrieve from (optional, default to 0)
- * @param string $startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
- * @param string $endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
- * @param int $days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional)
- * @param string $contactNumber Filter results for specific contact (WhatsApp Number with country code. Example, 85264318721) (optional)
- * @param string $event Filter the report for a specific event type (optional)
- * @param string $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param int|null $limit Number limitation for the result returned (optional, default to 2500)
+ * @param int|null $offset Beginning point in the list to retrieve from (optional, default to 0)
+ * @param string|null $startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional)
+ * @param string|null $endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional)
+ * @param int|null $days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional)
+ * @param string|null $contactNumber Filter results for specific contact (WhatsApp Number with country code. Example, 85264318721) (optional)
+ * @param string|null $event Filter the report for a specific event type (optional)
+ * @param string|null $sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWhatsappEventReport'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getWhatsappEventReportRequest($limit = '2500', $offset = '0', $startDate = null, $endDate = null, $days = null, $contactNumber = null, $event = null, $sort = 'desc')
+ public function getWhatsappEventReportRequest(
+ $limit = 2500,
+ $offset = 0,
+ $startDate = null,
+ $endDate = null,
+ $days = null,
+ $contactNumber = null,
+ $event = null,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getWhatsappEventReport'][0]
+ ): Request
{
+
if ($limit !== null && $limit > 5000) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling TransactionalWhatsAppApi.getWhatsappEventReport, must be smaller than or equal to 5000.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling TransactionalWhatsAppApi.getWhatsappEventReport, must be smaller than or equal to 5000.');
}
if ($limit !== null && $limit < 0) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling TransactionalWhatsAppApi.getWhatsappEventReport, must be bigger than or equal to 0.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling TransactionalWhatsAppApi.getWhatsappEventReport, must be bigger than or equal to 0.');
}
+
+
+
+
+
+
+
$resourcePath = '/whatsapp/statistics/events';
@@ -320,86 +498,109 @@ protected function getWhatsappEventReportRequest($limit = '2500', $offset = '0',
$multipart = false;
// query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($startDate !== null) {
- $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $startDate,
+ 'startDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($endDate !== null) {
- $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $endDate,
+ 'endDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($days !== null) {
- $queryParams['days'] = ObjectSerializer::toQueryValue($days);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $days,
+ 'days', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($contactNumber !== null) {
- $queryParams['contactNumber'] = ObjectSerializer::toQueryValue($contactNumber);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $contactNumber,
+ 'contactNumber', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($event !== null) {
- $queryParams['event'] = ObjectSerializer::toQueryValue($event);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $event,
+ 'event', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -425,10 +626,11 @@ protected function getWhatsappEventReportRequest($limit = '2500', $offset = '0',
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -439,15 +641,19 @@ protected function getWhatsappEventReportRequest($limit = '2500', $offset = '0',
*
* Send a WhatsApp message
*
- * @param \Brevo\Client\Model\SendWhatsappMessage $sendWhatsappMessage Values to send WhatsApp message (required)
+ * @param \Brevo\Client\Models\SendWhatsappMessageRequest $sendWhatsappMessageRequest Values to send WhatsApp message (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendWhatsappMessage'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\InlineResponse2014
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\SendWhatsappMessage201Response|\Brevo\Client\Models\ErrorModel
*/
- public function sendWhatsappMessage($sendWhatsappMessage)
+ public function sendWhatsappMessage(
+ \Brevo\Client\Models\SendWhatsappMessageRequest $sendWhatsappMessageRequest,
+ string $contentType = self::contentTypes['sendWhatsappMessage'][0]
+ ): \Brevo\Client\Models\SendWhatsappMessage201Response
{
- list($response) = $this->sendWhatsappMessageWithHttpInfo($sendWhatsappMessage);
+ list($response) = $this->sendWhatsappMessageWithHttpInfo($sendWhatsappMessageRequest, $contentType);
return $response;
}
@@ -456,16 +662,19 @@ public function sendWhatsappMessage($sendWhatsappMessage)
*
* Send a WhatsApp message
*
- * @param \Brevo\Client\Model\SendWhatsappMessage $sendWhatsappMessage Values to send WhatsApp message (required)
+ * @param \Brevo\Client\Models\SendWhatsappMessageRequest $sendWhatsappMessageRequest Values to send WhatsApp message (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendWhatsappMessage'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\InlineResponse2014, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\SendWhatsappMessage201Response|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function sendWhatsappMessageWithHttpInfo($sendWhatsappMessage)
+ public function sendWhatsappMessageWithHttpInfo(
+ \Brevo\Client\Models\SendWhatsappMessageRequest $sendWhatsappMessageRequest,
+ string $contentType = self::contentTypes['sendWhatsappMessage'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\InlineResponse2014';
- $request = $this->sendWhatsappMessageRequest($sendWhatsappMessage);
+ $request = $this->sendWhatsappMessageRequest($sendWhatsappMessageRequest, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -474,34 +683,111 @@ public function sendWhatsappMessageWithHttpInfo($sendWhatsappMessage)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 201:
+ if (in_array('\Brevo\Client\Models\SendWhatsappMessage201Response', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\SendWhatsappMessage201Response' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\SendWhatsappMessage201Response', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\SendWhatsappMessage201Response';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -516,7 +802,7 @@ public function sendWhatsappMessageWithHttpInfo($sendWhatsappMessage)
case 201:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\InlineResponse2014',
+ '\Brevo\Client\Models\SendWhatsappMessage201Response',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -524,7 +810,7 @@ public function sendWhatsappMessageWithHttpInfo($sendWhatsappMessage)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -539,14 +825,18 @@ public function sendWhatsappMessageWithHttpInfo($sendWhatsappMessage)
*
* Send a WhatsApp message
*
- * @param \Brevo\Client\Model\SendWhatsappMessage $sendWhatsappMessage Values to send WhatsApp message (required)
+ * @param \Brevo\Client\Models\SendWhatsappMessageRequest $sendWhatsappMessageRequest Values to send WhatsApp message (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendWhatsappMessage'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function sendWhatsappMessageAsync($sendWhatsappMessage)
+ public function sendWhatsappMessageAsync(
+ \Brevo\Client\Models\SendWhatsappMessageRequest $sendWhatsappMessageRequest,
+ string $contentType = self::contentTypes['sendWhatsappMessage'][0]
+ ): PromiseInterface
{
- return $this->sendWhatsappMessageAsyncWithHttpInfo($sendWhatsappMessage)
+ return $this->sendWhatsappMessageAsyncWithHttpInfo($sendWhatsappMessageRequest, $contentType)
->then(
function ($response) {
return $response[0];
@@ -559,25 +849,29 @@ function ($response) {
*
* Send a WhatsApp message
*
- * @param \Brevo\Client\Model\SendWhatsappMessage $sendWhatsappMessage Values to send WhatsApp message (required)
+ * @param \Brevo\Client\Models\SendWhatsappMessageRequest $sendWhatsappMessageRequest Values to send WhatsApp message (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendWhatsappMessage'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function sendWhatsappMessageAsyncWithHttpInfo($sendWhatsappMessage)
+ public function sendWhatsappMessageAsyncWithHttpInfo(
+ $sendWhatsappMessageRequest,
+ string $contentType = self::contentTypes['sendWhatsappMessage'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\InlineResponse2014';
- $request = $this->sendWhatsappMessageRequest($sendWhatsappMessage);
+ $returnType = '\Brevo\Client\Models\SendWhatsappMessage201Response';
+ $request = $this->sendWhatsappMessageRequest($sendWhatsappMessageRequest, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -600,7 +894,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -609,20 +903,26 @@ function ($exception) {
/**
* Create request for operation 'sendWhatsappMessage'
*
- * @param \Brevo\Client\Model\SendWhatsappMessage $sendWhatsappMessage Values to send WhatsApp message (required)
+ * @param \Brevo\Client\Models\SendWhatsappMessageRequest $sendWhatsappMessageRequest Values to send WhatsApp message (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendWhatsappMessage'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function sendWhatsappMessageRequest($sendWhatsappMessage)
+ public function sendWhatsappMessageRequest(
+ $sendWhatsappMessageRequest,
+ string $contentType = self::contentTypes['sendWhatsappMessage'][0]
+ ): Request
{
- // verify the required parameter 'sendWhatsappMessage' is set
- if ($sendWhatsappMessage === null || (is_array($sendWhatsappMessage) && count($sendWhatsappMessage) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $sendWhatsappMessage when calling sendWhatsappMessage'
+
+ // verify the required parameter 'sendWhatsappMessageRequest' is set
+ if ($sendWhatsappMessageRequest === null || (is_array($sendWhatsappMessageRequest) && count($sendWhatsappMessageRequest) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $sendWhatsappMessageRequest when calling sendWhatsappMessage'
);
}
+
$resourcePath = '/whatsapp/sendMessage';
$formParams = [];
$queryParams = [];
@@ -632,56 +932,43 @@ protected function sendWhatsappMessageRequest($sendWhatsappMessage)
- // body params
- $_tempBody = null;
- if (isset($sendWhatsappMessage)) {
- $_tempBody = $sendWhatsappMessage;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($sendWhatsappMessageRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($sendWhatsappMessageRequest));
+ } else {
+ $httpBody = $sendWhatsappMessageRequest;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -707,10 +994,11 @@ protected function sendWhatsappMessageRequest($sendWhatsappMessage)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -722,7 +1010,7 @@ protected function sendWhatsappMessageRequest($sendWhatsappMessage)
* @throws \RuntimeException on file opening failure
* @return array of http client options
*/
- protected function createHttpClientOption()
+ protected function createHttpClientOption(): array
{
$options = [];
if ($this->config->getDebug()) {
diff --git a/lib/Api/UserApi.php b/lib/Api/UserApi.php
index 34298d7..31816b3 100644
--- a/lib/Api/UserApi.php
+++ b/lib/Api/UserApi.php
@@ -1,39 +1,41 @@
[
+ 'application/json',
+ ],
+ 'getInvitedUsersList' => [
+ 'application/json',
+ ],
+ 'getUserPermission' => [
+ 'application/json',
+ ],
+ 'inviteuser' => [
+ 'application/json',
+ ],
+ 'putRevokeUserPermission' => [
+ 'application/json',
+ ],
+ 'putresendcancelinvitation' => [
+ 'application/json',
+ ],
+ ];
+
+ /**
+ * @param ClientInterface|null $client
+ * @param Configuration|null $config
+ * @param HeaderSelector|null $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
+ HeaderSelector $selector = null,
+ int $hostIndex = 0
) {
$this->client = $client ?: new Client();
- $this->config = $config ?: new Configuration();
+ $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(int $hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex(): int
+ {
+ return $this->hostIndex;
}
/**
* @return Configuration
*/
- public function getConfig()
+ public function getConfig(): Configuration
{
return $this->config;
}
@@ -92,15 +143,19 @@ public function getConfig()
*
* Update permission for a user
*
- * @param \Brevo\Client\Model\Inviteuser $updatePermissions Values to update permissions for an invited user (required)
+ * @param \Brevo\Client\Models\Inviteuser $inviteuser Values to create an invitation (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['editUserPermission'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\Inviteuser
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\UpdateUserResponse|\Brevo\Client\Models\ErrorModel
*/
- public function editUserPermission($updatePermissions)
+ public function editUserPermission(
+ \Brevo\Client\Models\Inviteuser $inviteuser,
+ string $contentType = self::contentTypes['editUserPermission'][0]
+ ): \Brevo\Client\Models\UpdateUserResponse
{
- list($response) = $this->editUserPermissionWithHttpInfo($updatePermissions);
+ list($response) = $this->editUserPermissionWithHttpInfo($inviteuser, $contentType);
return $response;
}
@@ -109,16 +164,19 @@ public function editUserPermission($updatePermissions)
*
* Update permission for a user
*
- * @param \Brevo\Client\Model\Inviteuser $updatePermissions Values to update permissions for an invited user (required)
+ * @param \Brevo\Client\Models\Inviteuser $inviteuser Values to create an invitation (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['editUserPermission'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\Inviteuser, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\UpdateUserResponse|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function editUserPermissionWithHttpInfo($updatePermissions)
+ public function editUserPermissionWithHttpInfo(
+ \Brevo\Client\Models\Inviteuser $inviteuser,
+ string $contentType = self::contentTypes['editUserPermission'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\Inviteuser';
- $request = $this->editUserPermissionRequest($updatePermissions);
+ $request = $this->editUserPermissionRequest($inviteuser, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -127,34 +185,111 @@ public function editUserPermissionWithHttpInfo($updatePermissions)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\UpdateUserResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\UpdateUserResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\UpdateUserResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\UpdateUserResponse';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -169,15 +304,15 @@ public function editUserPermissionWithHttpInfo($updatePermissions)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\Inviteuser',
+ '\Brevo\Client\Models\UpdateUserResponse',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 403:
+ case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -192,14 +327,18 @@ public function editUserPermissionWithHttpInfo($updatePermissions)
*
* Update permission for a user
*
- * @param \Brevo\Client\Model\Inviteuser $updatePermissions Values to update permissions for an invited user (required)
+ * @param \Brevo\Client\Models\Inviteuser $inviteuser Values to create an invitation (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['editUserPermission'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function editUserPermissionAsync($updatePermissions)
+ public function editUserPermissionAsync(
+ \Brevo\Client\Models\Inviteuser $inviteuser,
+ string $contentType = self::contentTypes['editUserPermission'][0]
+ ): PromiseInterface
{
- return $this->editUserPermissionAsyncWithHttpInfo($updatePermissions)
+ return $this->editUserPermissionAsyncWithHttpInfo($inviteuser, $contentType)
->then(
function ($response) {
return $response[0];
@@ -212,25 +351,29 @@ function ($response) {
*
* Update permission for a user
*
- * @param \Brevo\Client\Model\Inviteuser $updatePermissions Values to update permissions for an invited user (required)
+ * @param \Brevo\Client\Models\Inviteuser $inviteuser Values to create an invitation (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['editUserPermission'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function editUserPermissionAsyncWithHttpInfo($updatePermissions)
+ public function editUserPermissionAsyncWithHttpInfo(
+ $inviteuser,
+ string $contentType = self::contentTypes['editUserPermission'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\Inviteuser';
- $request = $this->editUserPermissionRequest($updatePermissions);
+ $returnType = '\Brevo\Client\Models\UpdateUserResponse';
+ $request = $this->editUserPermissionRequest($inviteuser, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -253,7 +396,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -262,20 +405,26 @@ function ($exception) {
/**
* Create request for operation 'editUserPermission'
*
- * @param \Brevo\Client\Model\Inviteuser $updatePermissions Values to update permissions for an invited user (required)
+ * @param \Brevo\Client\Models\Inviteuser $inviteuser Values to create an invitation (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['editUserPermission'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function editUserPermissionRequest($updatePermissions)
+ public function editUserPermissionRequest(
+ $inviteuser,
+ string $contentType = self::contentTypes['editUserPermission'][0]
+ ): Request
{
- // verify the required parameter 'updatePermissions' is set
- if ($updatePermissions === null || (is_array($updatePermissions) && count($updatePermissions) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $updatePermissions when calling editUserPermission'
+
+ // verify the required parameter 'inviteuser' is set
+ if ($inviteuser === null || (is_array($inviteuser) && count($inviteuser) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $inviteuser when calling editUserPermission'
);
}
+
$resourcePath = '/organization/user/update/permissions';
$formParams = [];
$queryParams = [];
@@ -285,56 +434,43 @@ protected function editUserPermissionRequest($updatePermissions)
- // body params
- $_tempBody = null;
- if (isset($updatePermissions)) {
- $_tempBody = $updatePermissions;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($inviteuser)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($inviteuser));
+ } else {
+ $httpBody = $inviteuser;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -360,10 +496,11 @@ protected function editUserPermissionRequest($updatePermissions)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -374,14 +511,17 @@ protected function editUserPermissionRequest($updatePermissions)
*
* Get the list of all your users
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInvitedUsersList'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetInvitedUsersList
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetInvitedUsersList|\Brevo\Client\Models\ErrorModel
*/
- public function getInvitedUsersList()
+ public function getInvitedUsersList(
+ string $contentType = self::contentTypes['getInvitedUsersList'][0]
+ ): \Brevo\Client\Models\GetInvitedUsersList
{
- list($response) = $this->getInvitedUsersListWithHttpInfo();
+ list($response) = $this->getInvitedUsersListWithHttpInfo($contentType);
return $response;
}
@@ -390,15 +530,17 @@ public function getInvitedUsersList()
*
* Get the list of all your users
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInvitedUsersList'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetInvitedUsersList, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetInvitedUsersList|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getInvitedUsersListWithHttpInfo()
+ public function getInvitedUsersListWithHttpInfo(
+ string $contentType = self::contentTypes['getInvitedUsersList'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetInvitedUsersList';
- $request = $this->getInvitedUsersListRequest();
+ $request = $this->getInvitedUsersListRequest($contentType);
try {
$options = $this->createHttpClientOption();
@@ -407,34 +549,111 @@ public function getInvitedUsersListWithHttpInfo()
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetInvitedUsersList', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetInvitedUsersList' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetInvitedUsersList', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetInvitedUsersList';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -449,7 +668,7 @@ public function getInvitedUsersListWithHttpInfo()
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetInvitedUsersList',
+ '\Brevo\Client\Models\GetInvitedUsersList',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -457,7 +676,7 @@ public function getInvitedUsersListWithHttpInfo()
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -472,13 +691,16 @@ public function getInvitedUsersListWithHttpInfo()
*
* Get the list of all your users
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInvitedUsersList'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getInvitedUsersListAsync()
+ public function getInvitedUsersListAsync(
+ string $contentType = self::contentTypes['getInvitedUsersList'][0]
+ ): PromiseInterface
{
- return $this->getInvitedUsersListAsyncWithHttpInfo()
+ return $this->getInvitedUsersListAsyncWithHttpInfo($contentType)
->then(
function ($response) {
return $response[0];
@@ -491,24 +713,27 @@ function ($response) {
*
* Get the list of all your users
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInvitedUsersList'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getInvitedUsersListAsyncWithHttpInfo()
+ public function getInvitedUsersListAsyncWithHttpInfo(
+ string $contentType = self::contentTypes['getInvitedUsersList'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetInvitedUsersList';
- $request = $this->getInvitedUsersListRequest();
+ $returnType = '\Brevo\Client\Models\GetInvitedUsersList';
+ $request = $this->getInvitedUsersListRequest($contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -531,7 +756,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -540,13 +765,17 @@ function ($exception) {
/**
* Create request for operation 'getInvitedUsersList'
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInvitedUsersList'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getInvitedUsersListRequest()
+ public function getInvitedUsersListRequest(
+ string $contentType = self::contentTypes['getInvitedUsersList'][0]
+ ): Request
{
+
$resourcePath = '/organization/invited/users';
$formParams = [];
$queryParams = [];
@@ -556,53 +785,36 @@ protected function getInvitedUsersListRequest()
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -628,10 +840,11 @@ protected function getInvitedUsersListRequest()
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -643,14 +856,18 @@ protected function getInvitedUsersListRequest()
* Check user permission
*
* @param string $email Email of the invited user. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserPermission'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetUserPermission
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetUserPermission|\Brevo\Client\Models\ErrorModel
*/
- public function getUserPermission($email)
+ public function getUserPermission(
+ string $email,
+ string $contentType = self::contentTypes['getUserPermission'][0]
+ ): \Brevo\Client\Models\GetUserPermission
{
- list($response) = $this->getUserPermissionWithHttpInfo($email);
+ list($response) = $this->getUserPermissionWithHttpInfo($email, $contentType);
return $response;
}
@@ -660,15 +877,18 @@ public function getUserPermission($email)
* Check user permission
*
* @param string $email Email of the invited user. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserPermission'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetUserPermission, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetUserPermission|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getUserPermissionWithHttpInfo($email)
+ public function getUserPermissionWithHttpInfo(
+ string $email,
+ string $contentType = self::contentTypes['getUserPermission'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetUserPermission';
- $request = $this->getUserPermissionRequest($email);
+ $request = $this->getUserPermissionRequest($email, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -677,34 +897,111 @@ public function getUserPermissionWithHttpInfo($email)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetUserPermission', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetUserPermission' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetUserPermission', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetUserPermission';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -719,7 +1016,7 @@ public function getUserPermissionWithHttpInfo($email)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetUserPermission',
+ '\Brevo\Client\Models\GetUserPermission',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -727,7 +1024,7 @@ public function getUserPermissionWithHttpInfo($email)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -743,13 +1040,17 @@ public function getUserPermissionWithHttpInfo($email)
* Check user permission
*
* @param string $email Email of the invited user. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserPermission'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getUserPermissionAsync($email)
+ public function getUserPermissionAsync(
+ string $email,
+ string $contentType = self::contentTypes['getUserPermission'][0]
+ ): PromiseInterface
{
- return $this->getUserPermissionAsyncWithHttpInfo($email)
+ return $this->getUserPermissionAsyncWithHttpInfo($email, $contentType)
->then(
function ($response) {
return $response[0];
@@ -763,24 +1064,28 @@ function ($response) {
* Check user permission
*
* @param string $email Email of the invited user. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserPermission'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getUserPermissionAsyncWithHttpInfo($email)
+ public function getUserPermissionAsyncWithHttpInfo(
+ $email,
+ string $contentType = self::contentTypes['getUserPermission'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetUserPermission';
- $request = $this->getUserPermissionRequest($email);
+ $returnType = '\Brevo\Client\Models\GetUserPermission';
+ $request = $this->getUserPermissionRequest($email, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -803,7 +1108,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -813,19 +1118,25 @@ function ($exception) {
* Create request for operation 'getUserPermission'
*
* @param string $email Email of the invited user. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserPermission'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getUserPermissionRequest($email)
+ public function getUserPermissionRequest(
+ $email,
+ string $contentType = self::contentTypes['getUserPermission'][0]
+ ): Request
{
+
// verify the required parameter 'email' is set
if ($email === null || (is_array($email) && count($email) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $email when calling getUserPermission'
);
}
+
$resourcePath = '/organization/user/{email}/permissions';
$formParams = [];
$queryParams = [];
@@ -834,6 +1145,7 @@ protected function getUserPermissionRequest($email)
$multipart = false;
+
// path params
if ($email !== null) {
$resourcePath = str_replace(
@@ -843,53 +1155,35 @@ protected function getUserPermissionRequest($email)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -915,10 +1209,11 @@ protected function getUserPermissionRequest($email)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -929,15 +1224,19 @@ protected function getUserPermissionRequest($email)
*
* Send invitation to user
*
- * @param \Brevo\Client\Model\Inviteuser $sendInvitation Values to create an invitation (required)
+ * @param \Brevo\Client\Models\Inviteuser $inviteuser Values to create an invitation (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['inviteuser'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\Inviteuser
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\InviteuserResponse|\Brevo\Client\Models\ErrorModel
*/
- public function inviteuser($sendInvitation)
+ public function inviteuser(
+ \Brevo\Client\Models\Inviteuser $inviteuser,
+ string $contentType = self::contentTypes['inviteuser'][0]
+ ): \Brevo\Client\Models\InviteuserResponse
{
- list($response) = $this->inviteuserWithHttpInfo($sendInvitation);
+ list($response) = $this->inviteuserWithHttpInfo($inviteuser, $contentType);
return $response;
}
@@ -946,16 +1245,19 @@ public function inviteuser($sendInvitation)
*
* Send invitation to user
*
- * @param \Brevo\Client\Model\Inviteuser $sendInvitation Values to create an invitation (required)
+ * @param \Brevo\Client\Models\Inviteuser $inviteuser Values to create an invitation (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['inviteuser'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\Inviteuser, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\InviteuserResponse|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function inviteuserWithHttpInfo($sendInvitation)
+ public function inviteuserWithHttpInfo(
+ \Brevo\Client\Models\Inviteuser $inviteuser,
+ string $contentType = self::contentTypes['inviteuser'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\Inviteuser';
- $request = $this->inviteuserRequest($sendInvitation);
+ $request = $this->inviteuserRequest($inviteuser, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -964,34 +1266,111 @@ public function inviteuserWithHttpInfo($sendInvitation)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\InviteuserResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\InviteuserResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\InviteuserResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\InviteuserResponse';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1006,7 +1385,7 @@ public function inviteuserWithHttpInfo($sendInvitation)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\Inviteuser',
+ '\Brevo\Client\Models\InviteuserResponse',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1014,7 +1393,7 @@ public function inviteuserWithHttpInfo($sendInvitation)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1029,14 +1408,18 @@ public function inviteuserWithHttpInfo($sendInvitation)
*
* Send invitation to user
*
- * @param \Brevo\Client\Model\Inviteuser $sendInvitation Values to create an invitation (required)
+ * @param \Brevo\Client\Models\Inviteuser $inviteuser Values to create an invitation (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['inviteuser'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function inviteuserAsync($sendInvitation)
+ public function inviteuserAsync(
+ \Brevo\Client\Models\Inviteuser $inviteuser,
+ string $contentType = self::contentTypes['inviteuser'][0]
+ ): PromiseInterface
{
- return $this->inviteuserAsyncWithHttpInfo($sendInvitation)
+ return $this->inviteuserAsyncWithHttpInfo($inviteuser, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1049,25 +1432,29 @@ function ($response) {
*
* Send invitation to user
*
- * @param \Brevo\Client\Model\Inviteuser $sendInvitation Values to create an invitation (required)
+ * @param \Brevo\Client\Models\Inviteuser $inviteuser Values to create an invitation (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['inviteuser'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function inviteuserAsyncWithHttpInfo($sendInvitation)
+ public function inviteuserAsyncWithHttpInfo(
+ $inviteuser,
+ string $contentType = self::contentTypes['inviteuser'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\Inviteuser';
- $request = $this->inviteuserRequest($sendInvitation);
+ $returnType = '\Brevo\Client\Models\InviteuserResponse';
+ $request = $this->inviteuserRequest($inviteuser, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1090,7 +1477,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1099,20 +1486,26 @@ function ($exception) {
/**
* Create request for operation 'inviteuser'
*
- * @param \Brevo\Client\Model\Inviteuser $sendInvitation Values to create an invitation (required)
+ * @param \Brevo\Client\Models\Inviteuser $inviteuser Values to create an invitation (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['inviteuser'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function inviteuserRequest($sendInvitation)
+ public function inviteuserRequest(
+ $inviteuser,
+ string $contentType = self::contentTypes['inviteuser'][0]
+ ): Request
{
- // verify the required parameter 'sendInvitation' is set
- if ($sendInvitation === null || (is_array($sendInvitation) && count($sendInvitation) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $sendInvitation when calling inviteuser'
+
+ // verify the required parameter 'inviteuser' is set
+ if ($inviteuser === null || (is_array($inviteuser) && count($inviteuser) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $inviteuser when calling inviteuser'
);
}
+
$resourcePath = '/organization/user/invitation/send';
$formParams = [];
$queryParams = [];
@@ -1122,56 +1515,43 @@ protected function inviteuserRequest($sendInvitation)
- // body params
- $_tempBody = null;
- if (isset($sendInvitation)) {
- $_tempBody = $sendInvitation;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($inviteuser)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($inviteuser));
+ } else {
+ $httpBody = $inviteuser;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1197,10 +1577,11 @@ protected function inviteuserRequest($sendInvitation)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1212,14 +1593,18 @@ protected function inviteuserRequest($sendInvitation)
* Revoke user permission
*
* @param string $email Email of the invited user. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putRevokeUserPermission'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\PutRevokeUserPermission
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\PutRevokeUserPermissionResponse|\Brevo\Client\Models\ErrorModel
*/
- public function putRevokeUserPermission($email)
+ public function putRevokeUserPermission(
+ string $email,
+ string $contentType = self::contentTypes['putRevokeUserPermission'][0]
+ ): \Brevo\Client\Models\PutRevokeUserPermissionResponse
{
- list($response) = $this->putRevokeUserPermissionWithHttpInfo($email);
+ list($response) = $this->putRevokeUserPermissionWithHttpInfo($email, $contentType);
return $response;
}
@@ -1229,15 +1614,18 @@ public function putRevokeUserPermission($email)
* Revoke user permission
*
* @param string $email Email of the invited user. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putRevokeUserPermission'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\PutRevokeUserPermission, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\PutRevokeUserPermissionResponse|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function putRevokeUserPermissionWithHttpInfo($email)
+ public function putRevokeUserPermissionWithHttpInfo(
+ string $email,
+ string $contentType = self::contentTypes['putRevokeUserPermission'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\PutRevokeUserPermission';
- $request = $this->putRevokeUserPermissionRequest($email);
+ $request = $this->putRevokeUserPermissionRequest($email, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1246,34 +1634,111 @@ public function putRevokeUserPermissionWithHttpInfo($email)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\PutRevokeUserPermissionResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\PutRevokeUserPermissionResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\PutRevokeUserPermissionResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\PutRevokeUserPermissionResponse';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1288,7 +1753,7 @@ public function putRevokeUserPermissionWithHttpInfo($email)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\PutRevokeUserPermission',
+ '\Brevo\Client\Models\PutRevokeUserPermissionResponse',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1296,7 +1761,7 @@ public function putRevokeUserPermissionWithHttpInfo($email)
case 403:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1312,13 +1777,17 @@ public function putRevokeUserPermissionWithHttpInfo($email)
* Revoke user permission
*
* @param string $email Email of the invited user. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putRevokeUserPermission'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function putRevokeUserPermissionAsync($email)
+ public function putRevokeUserPermissionAsync(
+ string $email,
+ string $contentType = self::contentTypes['putRevokeUserPermission'][0]
+ ): PromiseInterface
{
- return $this->putRevokeUserPermissionAsyncWithHttpInfo($email)
+ return $this->putRevokeUserPermissionAsyncWithHttpInfo($email, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1332,24 +1801,28 @@ function ($response) {
* Revoke user permission
*
* @param string $email Email of the invited user. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putRevokeUserPermission'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function putRevokeUserPermissionAsyncWithHttpInfo($email)
+ public function putRevokeUserPermissionAsyncWithHttpInfo(
+ $email,
+ string $contentType = self::contentTypes['putRevokeUserPermission'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\PutRevokeUserPermission';
- $request = $this->putRevokeUserPermissionRequest($email);
+ $returnType = '\Brevo\Client\Models\PutRevokeUserPermissionResponse';
+ $request = $this->putRevokeUserPermissionRequest($email, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1372,7 +1845,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1382,19 +1855,25 @@ function ($exception) {
* Create request for operation 'putRevokeUserPermission'
*
* @param string $email Email of the invited user. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putRevokeUserPermission'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function putRevokeUserPermissionRequest($email)
+ public function putRevokeUserPermissionRequest(
+ $email,
+ string $contentType = self::contentTypes['putRevokeUserPermission'][0]
+ ): Request
{
+
// verify the required parameter 'email' is set
if ($email === null || (is_array($email) && count($email) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $email when calling putRevokeUserPermission'
);
}
+
$resourcePath = '/organization/user/invitation/revoke/{email}';
$formParams = [];
$queryParams = [];
@@ -1403,6 +1882,7 @@ protected function putRevokeUserPermissionRequest($email)
$multipart = false;
+
// path params
if ($email !== null) {
$resourcePath = str_replace(
@@ -1412,53 +1892,35 @@ protected function putRevokeUserPermissionRequest($email)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1484,10 +1946,11 @@ protected function putRevokeUserPermissionRequest($email)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'PUT',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1500,14 +1963,19 @@ protected function putRevokeUserPermissionRequest($email)
*
* @param string $action action (required)
* @param string $email Email of the invited user. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putresendcancelinvitation'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\Putresendcancelinvitation
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\PutresendcancelinvitationResponse|\Brevo\Client\Models\ErrorModel
*/
- public function putresendcancelinvitation($action, $email)
+ public function putresendcancelinvitation(
+ string $action,
+ string $email,
+ string $contentType = self::contentTypes['putresendcancelinvitation'][0]
+ ): \Brevo\Client\Models\PutresendcancelinvitationResponse
{
- list($response) = $this->putresendcancelinvitationWithHttpInfo($action, $email);
+ list($response) = $this->putresendcancelinvitationWithHttpInfo($action, $email, $contentType);
return $response;
}
@@ -1518,15 +1986,19 @@ public function putresendcancelinvitation($action, $email)
*
* @param string $action action (required)
* @param string $email Email of the invited user. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putresendcancelinvitation'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\Putresendcancelinvitation, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\PutresendcancelinvitationResponse|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function putresendcancelinvitationWithHttpInfo($action, $email)
+ public function putresendcancelinvitationWithHttpInfo(
+ string $action,
+ string $email,
+ string $contentType = self::contentTypes['putresendcancelinvitation'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\Putresendcancelinvitation';
- $request = $this->putresendcancelinvitationRequest($action, $email);
+ $request = $this->putresendcancelinvitationRequest($action, $email, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1535,34 +2007,111 @@ public function putresendcancelinvitationWithHttpInfo($action, $email)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\PutresendcancelinvitationResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\PutresendcancelinvitationResponse' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\PutresendcancelinvitationResponse', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\PutresendcancelinvitationResponse';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1577,7 +2126,7 @@ public function putresendcancelinvitationWithHttpInfo($action, $email)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\Putresendcancelinvitation',
+ '\Brevo\Client\Models\PutresendcancelinvitationResponse',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1585,7 +2134,7 @@ public function putresendcancelinvitationWithHttpInfo($action, $email)
case 403:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1602,13 +2151,18 @@ public function putresendcancelinvitationWithHttpInfo($action, $email)
*
* @param string $action action (required)
* @param string $email Email of the invited user. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putresendcancelinvitation'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function putresendcancelinvitationAsync($action, $email)
+ public function putresendcancelinvitationAsync(
+ string $action,
+ string $email,
+ string $contentType = self::contentTypes['putresendcancelinvitation'][0]
+ ): PromiseInterface
{
- return $this->putresendcancelinvitationAsyncWithHttpInfo($action, $email)
+ return $this->putresendcancelinvitationAsyncWithHttpInfo($action, $email, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1623,24 +2177,29 @@ function ($response) {
*
* @param string $action action (required)
* @param string $email Email of the invited user. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putresendcancelinvitation'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function putresendcancelinvitationAsyncWithHttpInfo($action, $email)
+ public function putresendcancelinvitationAsyncWithHttpInfo(
+ $action,
+ $email,
+ string $contentType = self::contentTypes['putresendcancelinvitation'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\Putresendcancelinvitation';
- $request = $this->putresendcancelinvitationRequest($action, $email);
+ $returnType = '\Brevo\Client\Models\PutresendcancelinvitationResponse';
+ $request = $this->putresendcancelinvitationRequest($action, $email, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1663,7 +2222,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1674,25 +2233,33 @@ function ($exception) {
*
* @param string $action action (required)
* @param string $email Email of the invited user. (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putresendcancelinvitation'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function putresendcancelinvitationRequest($action, $email)
+ public function putresendcancelinvitationRequest(
+ $action,
+ $email,
+ string $contentType = self::contentTypes['putresendcancelinvitation'][0]
+ ): Request
{
+
// verify the required parameter 'action' is set
if ($action === null || (is_array($action) && count($action) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $action when calling putresendcancelinvitation'
);
}
+
// verify the required parameter 'email' is set
if ($email === null || (is_array($email) && count($email) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $email when calling putresendcancelinvitation'
);
}
+
$resourcePath = '/organization/user/invitation/{action}/{email}';
$formParams = [];
$queryParams = [];
@@ -1701,6 +2268,7 @@ protected function putresendcancelinvitationRequest($action, $email)
$multipart = false;
+
// path params
if ($action !== null) {
$resourcePath = str_replace(
@@ -1718,53 +2286,35 @@ protected function putresendcancelinvitationRequest($action, $email)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1790,10 +2340,11 @@ protected function putresendcancelinvitationRequest($action, $email)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'PUT',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1805,7 +2356,7 @@ protected function putresendcancelinvitationRequest($action, $email)
* @throws \RuntimeException on file opening failure
* @return array of http client options
*/
- protected function createHttpClientOption()
+ protected function createHttpClientOption(): array
{
$options = [];
if ($this->config->getDebug()) {
diff --git a/lib/Api/WebhooksApi.php b/lib/Api/WebhooksApi.php
index 67c6096..6488f4f 100644
--- a/lib/Api/WebhooksApi.php
+++ b/lib/Api/WebhooksApi.php
@@ -1,39 +1,41 @@
[
+ 'application/json',
+ ],
+ 'deleteWebhook' => [
+ 'application/json',
+ ],
+ 'exportWebhooksHistory' => [
+ 'application/json',
+ ],
+ 'getWebhook' => [
+ 'application/json',
+ ],
+ 'getWebhooks' => [
+ 'application/json',
+ ],
+ 'updateWebhook' => [
+ 'application/json',
+ ],
+ ];
+
+ /**
+ * @param ClientInterface|null $client
+ * @param Configuration|null $config
+ * @param HeaderSelector|null $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
+ HeaderSelector $selector = null,
+ int $hostIndex = 0
) {
$this->client = $client ?: new Client();
- $this->config = $config ?: new Configuration();
+ $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(int $hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex(): int
+ {
+ return $this->hostIndex;
}
/**
* @return Configuration
*/
- public function getConfig()
+ public function getConfig(): Configuration
{
return $this->config;
}
@@ -92,15 +143,19 @@ public function getConfig()
*
* Create a webhook
*
- * @param \Brevo\Client\Model\CreateWebhook $createWebhook Values to create a webhook (required)
+ * @param \Brevo\Client\Models\CreateWebhook $createWebhook Values to create a webhook (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createWebhook'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\CreateModel
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CreateModel|\Brevo\Client\Models\ErrorModel
*/
- public function createWebhook($createWebhook)
+ public function createWebhook(
+ \Brevo\Client\Models\CreateWebhook $createWebhook,
+ string $contentType = self::contentTypes['createWebhook'][0]
+ ): \Brevo\Client\Models\CreateModel
{
- list($response) = $this->createWebhookWithHttpInfo($createWebhook);
+ list($response) = $this->createWebhookWithHttpInfo($createWebhook, $contentType);
return $response;
}
@@ -109,16 +164,19 @@ public function createWebhook($createWebhook)
*
* Create a webhook
*
- * @param \Brevo\Client\Model\CreateWebhook $createWebhook Values to create a webhook (required)
+ * @param \Brevo\Client\Models\CreateWebhook $createWebhook Values to create a webhook (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createWebhook'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\CreateModel, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CreateModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function createWebhookWithHttpInfo($createWebhook)
+ public function createWebhookWithHttpInfo(
+ \Brevo\Client\Models\CreateWebhook $createWebhook,
+ string $contentType = self::contentTypes['createWebhook'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\CreateModel';
- $request = $this->createWebhookRequest($createWebhook);
+ $request = $this->createWebhookRequest($createWebhook, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -127,34 +185,111 @@ public function createWebhookWithHttpInfo($createWebhook)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 201:
+ if (in_array('\Brevo\Client\Models\CreateModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CreateModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CreateModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CreateModel';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -169,7 +304,7 @@ public function createWebhookWithHttpInfo($createWebhook)
case 201:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\CreateModel',
+ '\Brevo\Client\Models\CreateModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -177,7 +312,7 @@ public function createWebhookWithHttpInfo($createWebhook)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -192,14 +327,18 @@ public function createWebhookWithHttpInfo($createWebhook)
*
* Create a webhook
*
- * @param \Brevo\Client\Model\CreateWebhook $createWebhook Values to create a webhook (required)
+ * @param \Brevo\Client\Models\CreateWebhook $createWebhook Values to create a webhook (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createWebhook'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createWebhookAsync($createWebhook)
+ public function createWebhookAsync(
+ \Brevo\Client\Models\CreateWebhook $createWebhook,
+ string $contentType = self::contentTypes['createWebhook'][0]
+ ): PromiseInterface
{
- return $this->createWebhookAsyncWithHttpInfo($createWebhook)
+ return $this->createWebhookAsyncWithHttpInfo($createWebhook, $contentType)
->then(
function ($response) {
return $response[0];
@@ -212,25 +351,29 @@ function ($response) {
*
* Create a webhook
*
- * @param \Brevo\Client\Model\CreateWebhook $createWebhook Values to create a webhook (required)
+ * @param \Brevo\Client\Models\CreateWebhook $createWebhook Values to create a webhook (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createWebhook'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createWebhookAsyncWithHttpInfo($createWebhook)
+ public function createWebhookAsyncWithHttpInfo(
+ $createWebhook,
+ string $contentType = self::contentTypes['createWebhook'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\CreateModel';
- $request = $this->createWebhookRequest($createWebhook);
+ $returnType = '\Brevo\Client\Models\CreateModel';
+ $request = $this->createWebhookRequest($createWebhook, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -253,7 +396,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -262,20 +405,26 @@ function ($exception) {
/**
* Create request for operation 'createWebhook'
*
- * @param \Brevo\Client\Model\CreateWebhook $createWebhook Values to create a webhook (required)
+ * @param \Brevo\Client\Models\CreateWebhook $createWebhook Values to create a webhook (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createWebhook'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function createWebhookRequest($createWebhook)
+ public function createWebhookRequest(
+ $createWebhook,
+ string $contentType = self::contentTypes['createWebhook'][0]
+ ): Request
{
+
// verify the required parameter 'createWebhook' is set
if ($createWebhook === null || (is_array($createWebhook) && count($createWebhook) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $createWebhook when calling createWebhook'
);
}
+
$resourcePath = '/webhooks';
$formParams = [];
$queryParams = [];
@@ -285,56 +434,43 @@ protected function createWebhookRequest($createWebhook)
- // body params
- $_tempBody = null;
- if (isset($createWebhook)) {
- $_tempBody = $createWebhook;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($createWebhook)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createWebhook));
+ } else {
+ $httpBody = $createWebhook;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -360,10 +496,11 @@ protected function createWebhookRequest($createWebhook)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -375,14 +512,18 @@ protected function createWebhookRequest($createWebhook)
* Delete a webhook
*
* @param int $webhookId Id of the webhook (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteWebhook'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function deleteWebhook($webhookId)
+ public function deleteWebhook(
+ int $webhookId,
+ string $contentType = self::contentTypes['deleteWebhook'][0]
+ ): void
{
- $this->deleteWebhookWithHttpInfo($webhookId);
+ $this->deleteWebhookWithHttpInfo($webhookId, $contentType);
}
/**
@@ -391,15 +532,18 @@ public function deleteWebhook($webhookId)
* Delete a webhook
*
* @param int $webhookId Id of the webhook (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteWebhook'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function deleteWebhookWithHttpInfo($webhookId)
+ public function deleteWebhookWithHttpInfo(
+ int $webhookId,
+ string $contentType = self::contentTypes['deleteWebhook'][0]
+ ): array
{
- $returnType = '';
- $request = $this->deleteWebhookRequest($webhookId);
+ $request = $this->deleteWebhookRequest($webhookId, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -408,43 +552,38 @@ public function deleteWebhookWithHttpInfo($webhookId)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
} catch (ApiException $e) {
switch ($e->getCode()) {
- case 404:
+ case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 400:
+ case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -460,13 +599,17 @@ public function deleteWebhookWithHttpInfo($webhookId)
* Delete a webhook
*
* @param int $webhookId Id of the webhook (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteWebhook'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteWebhookAsync($webhookId)
+ public function deleteWebhookAsync(
+ int $webhookId,
+ string $contentType = self::contentTypes['deleteWebhook'][0]
+ ): PromiseInterface
{
- return $this->deleteWebhookAsyncWithHttpInfo($webhookId)
+ return $this->deleteWebhookAsyncWithHttpInfo($webhookId, $contentType)
->then(
function ($response) {
return $response[0];
@@ -480,14 +623,19 @@ function ($response) {
* Delete a webhook
*
* @param int $webhookId Id of the webhook (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteWebhook'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteWebhookAsyncWithHttpInfo($webhookId)
+ public function deleteWebhookAsyncWithHttpInfo(
+ $webhookId,
+ string $contentType = self::contentTypes['deleteWebhook'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->deleteWebhookRequest($webhookId);
+ $request = $this->deleteWebhookRequest($webhookId, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -506,7 +654,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -516,19 +664,25 @@ function ($exception) {
* Create request for operation 'deleteWebhook'
*
* @param int $webhookId Id of the webhook (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteWebhook'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function deleteWebhookRequest($webhookId)
+ public function deleteWebhookRequest(
+ $webhookId,
+ string $contentType = self::contentTypes['deleteWebhook'][0]
+ ): Request
{
+
// verify the required parameter 'webhookId' is set
if ($webhookId === null || (is_array($webhookId) && count($webhookId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $webhookId when calling deleteWebhook'
);
}
+
$resourcePath = '/webhooks/{webhookId}';
$formParams = [];
$queryParams = [];
@@ -537,6 +691,7 @@ protected function deleteWebhookRequest($webhookId)
$multipart = false;
+
// path params
if ($webhookId !== null) {
$resourcePath = str_replace(
@@ -546,53 +701,35 @@ protected function deleteWebhookRequest($webhookId)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -618,10 +755,11 @@ protected function deleteWebhookRequest($webhookId)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -632,15 +770,19 @@ protected function deleteWebhookRequest($webhookId)
*
* Export all webhook events
*
- * @param \Brevo\Client\Model\ExportWebhooksHistory $exportWebhookHistory Values to submit for webhooks history (required)
+ * @param \Brevo\Client\Models\ExportWebhooksHistoryRequest $exportWebhooksHistoryRequest Values to submit for webhooks history (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportWebhooksHistory'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\CreatedProcessId
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CreatedProcessId|\Brevo\Client\Models\ErrorModel
*/
- public function exportWebhooksHistory($exportWebhookHistory)
+ public function exportWebhooksHistory(
+ \Brevo\Client\Models\ExportWebhooksHistoryRequest $exportWebhooksHistoryRequest,
+ string $contentType = self::contentTypes['exportWebhooksHistory'][0]
+ ): \Brevo\Client\Models\CreatedProcessId
{
- list($response) = $this->exportWebhooksHistoryWithHttpInfo($exportWebhookHistory);
+ list($response) = $this->exportWebhooksHistoryWithHttpInfo($exportWebhooksHistoryRequest, $contentType);
return $response;
}
@@ -649,16 +791,19 @@ public function exportWebhooksHistory($exportWebhookHistory)
*
* Export all webhook events
*
- * @param \Brevo\Client\Model\ExportWebhooksHistory $exportWebhookHistory Values to submit for webhooks history (required)
+ * @param \Brevo\Client\Models\ExportWebhooksHistoryRequest $exportWebhooksHistoryRequest Values to submit for webhooks history (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportWebhooksHistory'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\CreatedProcessId, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CreatedProcessId|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function exportWebhooksHistoryWithHttpInfo($exportWebhookHistory)
+ public function exportWebhooksHistoryWithHttpInfo(
+ \Brevo\Client\Models\ExportWebhooksHistoryRequest $exportWebhooksHistoryRequest,
+ string $contentType = self::contentTypes['exportWebhooksHistory'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\CreatedProcessId';
- $request = $this->exportWebhooksHistoryRequest($exportWebhookHistory);
+ $request = $this->exportWebhooksHistoryRequest($exportWebhooksHistoryRequest, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -667,34 +812,111 @@ public function exportWebhooksHistoryWithHttpInfo($exportWebhookHistory)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 202:
+ if (in_array('\Brevo\Client\Models\CreatedProcessId', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CreatedProcessId' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CreatedProcessId', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CreatedProcessId';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -709,7 +931,7 @@ public function exportWebhooksHistoryWithHttpInfo($exportWebhookHistory)
case 202:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\CreatedProcessId',
+ '\Brevo\Client\Models\CreatedProcessId',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -717,7 +939,7 @@ public function exportWebhooksHistoryWithHttpInfo($exportWebhookHistory)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -732,14 +954,18 @@ public function exportWebhooksHistoryWithHttpInfo($exportWebhookHistory)
*
* Export all webhook events
*
- * @param \Brevo\Client\Model\ExportWebhooksHistory $exportWebhookHistory Values to submit for webhooks history (required)
+ * @param \Brevo\Client\Models\ExportWebhooksHistoryRequest $exportWebhooksHistoryRequest Values to submit for webhooks history (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportWebhooksHistory'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function exportWebhooksHistoryAsync($exportWebhookHistory)
+ public function exportWebhooksHistoryAsync(
+ \Brevo\Client\Models\ExportWebhooksHistoryRequest $exportWebhooksHistoryRequest,
+ string $contentType = self::contentTypes['exportWebhooksHistory'][0]
+ ): PromiseInterface
{
- return $this->exportWebhooksHistoryAsyncWithHttpInfo($exportWebhookHistory)
+ return $this->exportWebhooksHistoryAsyncWithHttpInfo($exportWebhooksHistoryRequest, $contentType)
->then(
function ($response) {
return $response[0];
@@ -752,25 +978,29 @@ function ($response) {
*
* Export all webhook events
*
- * @param \Brevo\Client\Model\ExportWebhooksHistory $exportWebhookHistory Values to submit for webhooks history (required)
+ * @param \Brevo\Client\Models\ExportWebhooksHistoryRequest $exportWebhooksHistoryRequest Values to submit for webhooks history (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportWebhooksHistory'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function exportWebhooksHistoryAsyncWithHttpInfo($exportWebhookHistory)
+ public function exportWebhooksHistoryAsyncWithHttpInfo(
+ $exportWebhooksHistoryRequest,
+ string $contentType = self::contentTypes['exportWebhooksHistory'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\CreatedProcessId';
- $request = $this->exportWebhooksHistoryRequest($exportWebhookHistory);
+ $returnType = '\Brevo\Client\Models\CreatedProcessId';
+ $request = $this->exportWebhooksHistoryRequest($exportWebhooksHistoryRequest, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -793,7 +1023,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -802,20 +1032,26 @@ function ($exception) {
/**
* Create request for operation 'exportWebhooksHistory'
*
- * @param \Brevo\Client\Model\ExportWebhooksHistory $exportWebhookHistory Values to submit for webhooks history (required)
+ * @param \Brevo\Client\Models\ExportWebhooksHistoryRequest $exportWebhooksHistoryRequest Values to submit for webhooks history (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportWebhooksHistory'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function exportWebhooksHistoryRequest($exportWebhookHistory)
+ public function exportWebhooksHistoryRequest(
+ $exportWebhooksHistoryRequest,
+ string $contentType = self::contentTypes['exportWebhooksHistory'][0]
+ ): Request
{
- // verify the required parameter 'exportWebhookHistory' is set
- if ($exportWebhookHistory === null || (is_array($exportWebhookHistory) && count($exportWebhookHistory) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $exportWebhookHistory when calling exportWebhooksHistory'
+
+ // verify the required parameter 'exportWebhooksHistoryRequest' is set
+ if ($exportWebhooksHistoryRequest === null || (is_array($exportWebhooksHistoryRequest) && count($exportWebhooksHistoryRequest) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $exportWebhooksHistoryRequest when calling exportWebhooksHistory'
);
}
+
$resourcePath = '/webhooks/export';
$formParams = [];
$queryParams = [];
@@ -825,56 +1061,43 @@ protected function exportWebhooksHistoryRequest($exportWebhookHistory)
- // body params
- $_tempBody = null;
- if (isset($exportWebhookHistory)) {
- $_tempBody = $exportWebhookHistory;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($exportWebhooksHistoryRequest)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($exportWebhooksHistoryRequest));
+ } else {
+ $httpBody = $exportWebhooksHistoryRequest;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -900,10 +1123,11 @@ protected function exportWebhooksHistoryRequest($exportWebhookHistory)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -915,14 +1139,18 @@ protected function exportWebhooksHistoryRequest($exportWebhookHistory)
* Get a webhook details
*
* @param int $webhookId Id of the webhook (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWebhook'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetWebhook
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetWebhook|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function getWebhook($webhookId)
+ public function getWebhook(
+ int $webhookId,
+ string $contentType = self::contentTypes['getWebhook'][0]
+ ): \Brevo\Client\Models\GetWebhook
{
- list($response) = $this->getWebhookWithHttpInfo($webhookId);
+ list($response) = $this->getWebhookWithHttpInfo($webhookId, $contentType);
return $response;
}
@@ -932,15 +1160,18 @@ public function getWebhook($webhookId)
* Get a webhook details
*
* @param int $webhookId Id of the webhook (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWebhook'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetWebhook, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetWebhook|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getWebhookWithHttpInfo($webhookId)
+ public function getWebhookWithHttpInfo(
+ int $webhookId,
+ string $contentType = self::contentTypes['getWebhook'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetWebhook';
- $request = $this->getWebhookRequest($webhookId);
+ $request = $this->getWebhookRequest($webhookId, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -949,34 +1180,138 @@ public function getWebhookWithHttpInfo($webhookId)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetWebhook', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetWebhook' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetWebhook', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetWebhook';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -991,23 +1326,23 @@ public function getWebhookWithHttpInfo($webhookId)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetWebhook',
+ '\Brevo\Client\Models\GetWebhook',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 404:
+ case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
- case 400:
+ case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1023,13 +1358,17 @@ public function getWebhookWithHttpInfo($webhookId)
* Get a webhook details
*
* @param int $webhookId Id of the webhook (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWebhook'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getWebhookAsync($webhookId)
+ public function getWebhookAsync(
+ int $webhookId,
+ string $contentType = self::contentTypes['getWebhook'][0]
+ ): PromiseInterface
{
- return $this->getWebhookAsyncWithHttpInfo($webhookId)
+ return $this->getWebhookAsyncWithHttpInfo($webhookId, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1043,24 +1382,28 @@ function ($response) {
* Get a webhook details
*
* @param int $webhookId Id of the webhook (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWebhook'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getWebhookAsyncWithHttpInfo($webhookId)
+ public function getWebhookAsyncWithHttpInfo(
+ $webhookId,
+ string $contentType = self::contentTypes['getWebhook'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetWebhook';
- $request = $this->getWebhookRequest($webhookId);
+ $returnType = '\Brevo\Client\Models\GetWebhook';
+ $request = $this->getWebhookRequest($webhookId, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1083,7 +1426,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1093,19 +1436,25 @@ function ($exception) {
* Create request for operation 'getWebhook'
*
* @param int $webhookId Id of the webhook (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWebhook'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getWebhookRequest($webhookId)
+ public function getWebhookRequest(
+ $webhookId,
+ string $contentType = self::contentTypes['getWebhook'][0]
+ ): Request
{
+
// verify the required parameter 'webhookId' is set
if ($webhookId === null || (is_array($webhookId) && count($webhookId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $webhookId when calling getWebhook'
);
}
+
$resourcePath = '/webhooks/{webhookId}';
$formParams = [];
$queryParams = [];
@@ -1114,6 +1463,7 @@ protected function getWebhookRequest($webhookId)
$multipart = false;
+
// path params
if ($webhookId !== null) {
$resourcePath = str_replace(
@@ -1123,53 +1473,35 @@ protected function getWebhookRequest($webhookId)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1195,10 +1527,11 @@ protected function getWebhookRequest($webhookId)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1209,16 +1542,21 @@ protected function getWebhookRequest($webhookId)
*
* Get all webhooks
*
- * @param string $type Filter on webhook type (optional, default to transactional)
- * @param string $sort Sort the results in the ascending/descending order of webhook creation (optional, default to desc)
+ * @param string|null $type Filter on webhook type (optional, default to 'transactional')
+ * @param string|null $sort Sort the results in the ascending/descending order of webhook creation (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWebhooks'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetWebhooks
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetWebhooks|\Brevo\Client\Models\ErrorModel
*/
- public function getWebhooks($type = 'transactional', $sort = 'desc')
+ public function getWebhooks(
+ ?string $type = 'transactional',
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getWebhooks'][0]
+ ): \Brevo\Client\Models\GetWebhooks
{
- list($response) = $this->getWebhooksWithHttpInfo($type, $sort);
+ list($response) = $this->getWebhooksWithHttpInfo($type, $sort, $contentType);
return $response;
}
@@ -1227,17 +1565,21 @@ public function getWebhooks($type = 'transactional', $sort = 'desc')
*
* Get all webhooks
*
- * @param string $type Filter on webhook type (optional, default to transactional)
- * @param string $sort Sort the results in the ascending/descending order of webhook creation (optional, default to desc)
+ * @param string|null $type Filter on webhook type (optional, default to 'transactional')
+ * @param string|null $sort Sort the results in the ascending/descending order of webhook creation (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWebhooks'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetWebhooks, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetWebhooks|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getWebhooksWithHttpInfo($type = 'transactional', $sort = 'desc')
+ public function getWebhooksWithHttpInfo(
+ ?string $type = 'transactional',
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getWebhooks'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetWebhooks';
- $request = $this->getWebhooksRequest($type, $sort);
+ $request = $this->getWebhooksRequest($type, $sort, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1246,34 +1588,111 @@ public function getWebhooksWithHttpInfo($type = 'transactional', $sort = 'desc')
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetWebhooks', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetWebhooks' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetWebhooks', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetWebhooks';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1288,7 +1707,7 @@ public function getWebhooksWithHttpInfo($type = 'transactional', $sort = 'desc')
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetWebhooks',
+ '\Brevo\Client\Models\GetWebhooks',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1296,7 +1715,7 @@ public function getWebhooksWithHttpInfo($type = 'transactional', $sort = 'desc')
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1311,15 +1730,20 @@ public function getWebhooksWithHttpInfo($type = 'transactional', $sort = 'desc')
*
* Get all webhooks
*
- * @param string $type Filter on webhook type (optional, default to transactional)
- * @param string $sort Sort the results in the ascending/descending order of webhook creation (optional, default to desc)
+ * @param string|null $type Filter on webhook type (optional, default to 'transactional')
+ * @param string|null $sort Sort the results in the ascending/descending order of webhook creation (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWebhooks'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getWebhooksAsync($type = 'transactional', $sort = 'desc')
+ public function getWebhooksAsync(
+ ?string $type = 'transactional',
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getWebhooks'][0]
+ ): PromiseInterface
{
- return $this->getWebhooksAsyncWithHttpInfo($type, $sort)
+ return $this->getWebhooksAsyncWithHttpInfo($type, $sort, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1332,26 +1756,31 @@ function ($response) {
*
* Get all webhooks
*
- * @param string $type Filter on webhook type (optional, default to transactional)
- * @param string $sort Sort the results in the ascending/descending order of webhook creation (optional, default to desc)
+ * @param string|null $type Filter on webhook type (optional, default to 'transactional')
+ * @param string|null $sort Sort the results in the ascending/descending order of webhook creation (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWebhooks'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getWebhooksAsyncWithHttpInfo($type = 'transactional', $sort = 'desc')
+ public function getWebhooksAsyncWithHttpInfo(
+ $type = 'transactional',
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getWebhooks'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetWebhooks';
- $request = $this->getWebhooksRequest($type, $sort);
+ $returnType = '\Brevo\Client\Models\GetWebhooks';
+ $request = $this->getWebhooksRequest($type, $sort, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1374,7 +1803,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1383,15 +1812,23 @@ function ($exception) {
/**
* Create request for operation 'getWebhooks'
*
- * @param string $type Filter on webhook type (optional, default to transactional)
- * @param string $sort Sort the results in the ascending/descending order of webhook creation (optional, default to desc)
+ * @param string|null $type Filter on webhook type (optional, default to 'transactional')
+ * @param string|null $sort Sort the results in the ascending/descending order of webhook creation (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWebhooks'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getWebhooksRequest($type = 'transactional', $sort = 'desc')
+ public function getWebhooksRequest(
+ $type = 'transactional',
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getWebhooks'][0]
+ ): Request
{
+
+
+
$resourcePath = '/webhooks';
$formParams = [];
$queryParams = [];
@@ -1400,62 +1837,55 @@ protected function getWebhooksRequest($type = 'transactional', $sort = 'desc')
$multipart = false;
// query params
- if ($type !== null) {
- $queryParams['type'] = ObjectSerializer::toQueryValue($type);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $type,
+ 'type', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1481,10 +1911,11 @@ protected function getWebhooksRequest($type = 'transactional', $sort = 'desc')
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1496,15 +1927,20 @@ protected function getWebhooksRequest($type = 'transactional', $sort = 'desc')
* Update a webhook
*
* @param int $webhookId Id of the webhook (required)
- * @param \Brevo\Client\Model\UpdateWebhook $updateWebhook Values to update a webhook (required)
+ * @param \Brevo\Client\Models\UpdateWebhook $updateWebhook Values to update a webhook (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWebhook'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function updateWebhook($webhookId, $updateWebhook)
+ public function updateWebhook(
+ int $webhookId,
+ \Brevo\Client\Models\UpdateWebhook $updateWebhook,
+ string $contentType = self::contentTypes['updateWebhook'][0]
+ ): void
{
- $this->updateWebhookWithHttpInfo($webhookId, $updateWebhook);
+ $this->updateWebhookWithHttpInfo($webhookId, $updateWebhook, $contentType);
}
/**
@@ -1513,16 +1949,20 @@ public function updateWebhook($webhookId, $updateWebhook)
* Update a webhook
*
* @param int $webhookId Id of the webhook (required)
- * @param \Brevo\Client\Model\UpdateWebhook $updateWebhook Values to update a webhook (required)
+ * @param \Brevo\Client\Models\UpdateWebhook $updateWebhook Values to update a webhook (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWebhook'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function updateWebhookWithHttpInfo($webhookId, $updateWebhook)
+ public function updateWebhookWithHttpInfo(
+ int $webhookId,
+ \Brevo\Client\Models\UpdateWebhook $updateWebhook,
+ string $contentType = self::contentTypes['updateWebhook'][0]
+ ): array
{
- $returnType = '';
- $request = $this->updateWebhookRequest($webhookId, $updateWebhook);
+ $request = $this->updateWebhookRequest($webhookId, $updateWebhook, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1531,26 +1971,21 @@ public function updateWebhookWithHttpInfo($webhookId, $updateWebhook)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -1559,7 +1994,7 @@ public function updateWebhookWithHttpInfo($webhookId, $updateWebhook)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1567,7 +2002,7 @@ public function updateWebhookWithHttpInfo($webhookId, $updateWebhook)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1583,14 +2018,19 @@ public function updateWebhookWithHttpInfo($webhookId, $updateWebhook)
* Update a webhook
*
* @param int $webhookId Id of the webhook (required)
- * @param \Brevo\Client\Model\UpdateWebhook $updateWebhook Values to update a webhook (required)
+ * @param \Brevo\Client\Models\UpdateWebhook $updateWebhook Values to update a webhook (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWebhook'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function updateWebhookAsync($webhookId, $updateWebhook)
+ public function updateWebhookAsync(
+ int $webhookId,
+ \Brevo\Client\Models\UpdateWebhook $updateWebhook,
+ string $contentType = self::contentTypes['updateWebhook'][0]
+ ): PromiseInterface
{
- return $this->updateWebhookAsyncWithHttpInfo($webhookId, $updateWebhook)
+ return $this->updateWebhookAsyncWithHttpInfo($webhookId, $updateWebhook, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1604,15 +2044,21 @@ function ($response) {
* Update a webhook
*
* @param int $webhookId Id of the webhook (required)
- * @param \Brevo\Client\Model\UpdateWebhook $updateWebhook Values to update a webhook (required)
+ * @param \Brevo\Client\Models\UpdateWebhook $updateWebhook Values to update a webhook (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWebhook'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function updateWebhookAsyncWithHttpInfo($webhookId, $updateWebhook)
+ public function updateWebhookAsyncWithHttpInfo(
+ $webhookId,
+ $updateWebhook,
+ string $contentType = self::contentTypes['updateWebhook'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->updateWebhookRequest($webhookId, $updateWebhook);
+ $request = $this->updateWebhookRequest($webhookId, $updateWebhook, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -1631,7 +2077,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1641,26 +2087,34 @@ function ($exception) {
* Create request for operation 'updateWebhook'
*
* @param int $webhookId Id of the webhook (required)
- * @param \Brevo\Client\Model\UpdateWebhook $updateWebhook Values to update a webhook (required)
+ * @param \Brevo\Client\Models\UpdateWebhook $updateWebhook Values to update a webhook (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWebhook'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function updateWebhookRequest($webhookId, $updateWebhook)
+ public function updateWebhookRequest(
+ $webhookId,
+ $updateWebhook,
+ string $contentType = self::contentTypes['updateWebhook'][0]
+ ): Request
{
+
// verify the required parameter 'webhookId' is set
if ($webhookId === null || (is_array($webhookId) && count($webhookId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $webhookId when calling updateWebhook'
);
}
+
// verify the required parameter 'updateWebhook' is set
if ($updateWebhook === null || (is_array($updateWebhook) && count($updateWebhook) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $updateWebhook when calling updateWebhook'
);
}
+
$resourcePath = '/webhooks/{webhookId}';
$formParams = [];
$queryParams = [];
@@ -1669,6 +2123,7 @@ protected function updateWebhookRequest($webhookId, $updateWebhook)
$multipart = false;
+
// path params
if ($webhookId !== null) {
$resourcePath = str_replace(
@@ -1678,56 +2133,42 @@ protected function updateWebhookRequest($webhookId, $updateWebhook)
);
}
- // body params
- $_tempBody = null;
- if (isset($updateWebhook)) {
- $_tempBody = $updateWebhook;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($updateWebhook)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($updateWebhook));
+ } else {
+ $httpBody = $updateWebhook;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1753,10 +2194,11 @@ protected function updateWebhookRequest($webhookId, $updateWebhook)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'PUT',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1768,7 +2210,7 @@ protected function updateWebhookRequest($webhookId, $updateWebhook)
* @throws \RuntimeException on file opening failure
* @return array of http client options
*/
- protected function createHttpClientOption()
+ protected function createHttpClientOption(): array
{
$options = [];
if ($this->config->getDebug()) {
diff --git a/lib/Api/WhatsAppCampaignsApi.php b/lib/Api/WhatsAppCampaignsApi.php
index e6430a0..d9ba2d5 100644
--- a/lib/Api/WhatsAppCampaignsApi.php
+++ b/lib/Api/WhatsAppCampaignsApi.php
@@ -1,39 +1,41 @@
[
+ 'application/json',
+ ],
+ 'createWhatsAppTemplate' => [
+ 'application/json',
+ ],
+ 'deleteWhatsAppCampaign' => [
+ 'application/json',
+ ],
+ 'getWhatsAppCampaign' => [
+ 'application/json',
+ ],
+ 'getWhatsAppCampaigns' => [
+ 'application/json',
+ ],
+ 'getWhatsAppConfig' => [
+ 'application/json',
+ ],
+ 'getWhatsAppTemplates' => [
+ 'application/json',
+ ],
+ 'sendWhatsAppTemplateApproval' => [
+ 'application/json',
+ ],
+ 'updateWhatsAppCampaign' => [
+ 'application/json',
+ ],
+ ];
+
+ /**
+ * @param ClientInterface|null $client
+ * @param Configuration|null $config
+ * @param HeaderSelector|null $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
+ HeaderSelector $selector = null,
+ int $hostIndex = 0
) {
$this->client = $client ?: new Client();
- $this->config = $config ?: new Configuration();
+ $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(int $hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex(): int
+ {
+ return $this->hostIndex;
}
/**
* @return Configuration
*/
- public function getConfig()
+ public function getConfig(): Configuration
{
return $this->config;
}
@@ -92,15 +152,19 @@ public function getConfig()
*
* Create and Send a WhatsApp campaign
*
- * @param \Brevo\Client\Model\CreateWhatsAppCampaign $whatsAppCampaigns Values to create a campaign (required)
+ * @param \Brevo\Client\Models\CreateWhatsAppCampaign $createWhatsAppCampaign Values to create a WhatsApp Campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createWhatsAppCampaign'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\CreateModel
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CreateModel|\Brevo\Client\Models\ErrorModel
*/
- public function createWhatsAppCampaign($whatsAppCampaigns)
+ public function createWhatsAppCampaign(
+ \Brevo\Client\Models\CreateWhatsAppCampaign $createWhatsAppCampaign,
+ string $contentType = self::contentTypes['createWhatsAppCampaign'][0]
+ ): \Brevo\Client\Models\CreateModel
{
- list($response) = $this->createWhatsAppCampaignWithHttpInfo($whatsAppCampaigns);
+ list($response) = $this->createWhatsAppCampaignWithHttpInfo($createWhatsAppCampaign, $contentType);
return $response;
}
@@ -109,16 +173,19 @@ public function createWhatsAppCampaign($whatsAppCampaigns)
*
* Create and Send a WhatsApp campaign
*
- * @param \Brevo\Client\Model\CreateWhatsAppCampaign $whatsAppCampaigns Values to create a campaign (required)
+ * @param \Brevo\Client\Models\CreateWhatsAppCampaign $createWhatsAppCampaign Values to create a WhatsApp Campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createWhatsAppCampaign'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\CreateModel, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CreateModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function createWhatsAppCampaignWithHttpInfo($whatsAppCampaigns)
+ public function createWhatsAppCampaignWithHttpInfo(
+ \Brevo\Client\Models\CreateWhatsAppCampaign $createWhatsAppCampaign,
+ string $contentType = self::contentTypes['createWhatsAppCampaign'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\CreateModel';
- $request = $this->createWhatsAppCampaignRequest($whatsAppCampaigns);
+ $request = $this->createWhatsAppCampaignRequest($createWhatsAppCampaign, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -127,34 +194,111 @@ public function createWhatsAppCampaignWithHttpInfo($whatsAppCampaigns)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 201:
+ if (in_array('\Brevo\Client\Models\CreateModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CreateModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CreateModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CreateModel';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -169,7 +313,7 @@ public function createWhatsAppCampaignWithHttpInfo($whatsAppCampaigns)
case 201:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\CreateModel',
+ '\Brevo\Client\Models\CreateModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -177,7 +321,7 @@ public function createWhatsAppCampaignWithHttpInfo($whatsAppCampaigns)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -192,14 +336,18 @@ public function createWhatsAppCampaignWithHttpInfo($whatsAppCampaigns)
*
* Create and Send a WhatsApp campaign
*
- * @param \Brevo\Client\Model\CreateWhatsAppCampaign $whatsAppCampaigns Values to create a campaign (required)
+ * @param \Brevo\Client\Models\CreateWhatsAppCampaign $createWhatsAppCampaign Values to create a WhatsApp Campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createWhatsAppCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createWhatsAppCampaignAsync($whatsAppCampaigns)
+ public function createWhatsAppCampaignAsync(
+ \Brevo\Client\Models\CreateWhatsAppCampaign $createWhatsAppCampaign,
+ string $contentType = self::contentTypes['createWhatsAppCampaign'][0]
+ ): PromiseInterface
{
- return $this->createWhatsAppCampaignAsyncWithHttpInfo($whatsAppCampaigns)
+ return $this->createWhatsAppCampaignAsyncWithHttpInfo($createWhatsAppCampaign, $contentType)
->then(
function ($response) {
return $response[0];
@@ -212,25 +360,29 @@ function ($response) {
*
* Create and Send a WhatsApp campaign
*
- * @param \Brevo\Client\Model\CreateWhatsAppCampaign $whatsAppCampaigns Values to create a campaign (required)
+ * @param \Brevo\Client\Models\CreateWhatsAppCampaign $createWhatsAppCampaign Values to create a WhatsApp Campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createWhatsAppCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createWhatsAppCampaignAsyncWithHttpInfo($whatsAppCampaigns)
+ public function createWhatsAppCampaignAsyncWithHttpInfo(
+ $createWhatsAppCampaign,
+ string $contentType = self::contentTypes['createWhatsAppCampaign'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\CreateModel';
- $request = $this->createWhatsAppCampaignRequest($whatsAppCampaigns);
+ $returnType = '\Brevo\Client\Models\CreateModel';
+ $request = $this->createWhatsAppCampaignRequest($createWhatsAppCampaign, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -253,7 +405,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -262,20 +414,26 @@ function ($exception) {
/**
* Create request for operation 'createWhatsAppCampaign'
*
- * @param \Brevo\Client\Model\CreateWhatsAppCampaign $whatsAppCampaigns Values to create a campaign (required)
+ * @param \Brevo\Client\Models\CreateWhatsAppCampaign $createWhatsAppCampaign Values to create a WhatsApp Campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createWhatsAppCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function createWhatsAppCampaignRequest($whatsAppCampaigns)
+ public function createWhatsAppCampaignRequest(
+ $createWhatsAppCampaign,
+ string $contentType = self::contentTypes['createWhatsAppCampaign'][0]
+ ): Request
{
- // verify the required parameter 'whatsAppCampaigns' is set
- if ($whatsAppCampaigns === null || (is_array($whatsAppCampaigns) && count($whatsAppCampaigns) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $whatsAppCampaigns when calling createWhatsAppCampaign'
+
+ // verify the required parameter 'createWhatsAppCampaign' is set
+ if ($createWhatsAppCampaign === null || (is_array($createWhatsAppCampaign) && count($createWhatsAppCampaign) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $createWhatsAppCampaign when calling createWhatsAppCampaign'
);
}
+
$resourcePath = '/whatsappCampaigns';
$formParams = [];
$queryParams = [];
@@ -285,56 +443,43 @@ protected function createWhatsAppCampaignRequest($whatsAppCampaigns)
- // body params
- $_tempBody = null;
- if (isset($whatsAppCampaigns)) {
- $_tempBody = $whatsAppCampaigns;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($createWhatsAppCampaign)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createWhatsAppCampaign));
+ } else {
+ $httpBody = $createWhatsAppCampaign;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -360,10 +505,11 @@ protected function createWhatsAppCampaignRequest($whatsAppCampaigns)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -374,15 +520,19 @@ protected function createWhatsAppCampaignRequest($whatsAppCampaigns)
*
* Create a WhatsApp template
*
- * @param \Brevo\Client\Model\CreateWhatsAppTemplate $whatsAppTemplates Values to create a template (required)
+ * @param \Brevo\Client\Models\CreateWhatsAppTemplate $createWhatsAppTemplate Values to create a WhatsApp template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createWhatsAppTemplate'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\CreateModel
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\CreateModel|\Brevo\Client\Models\ErrorModel
*/
- public function createWhatsAppTemplate($whatsAppTemplates)
+ public function createWhatsAppTemplate(
+ \Brevo\Client\Models\CreateWhatsAppTemplate $createWhatsAppTemplate,
+ string $contentType = self::contentTypes['createWhatsAppTemplate'][0]
+ ): \Brevo\Client\Models\CreateModel
{
- list($response) = $this->createWhatsAppTemplateWithHttpInfo($whatsAppTemplates);
+ list($response) = $this->createWhatsAppTemplateWithHttpInfo($createWhatsAppTemplate, $contentType);
return $response;
}
@@ -391,16 +541,19 @@ public function createWhatsAppTemplate($whatsAppTemplates)
*
* Create a WhatsApp template
*
- * @param \Brevo\Client\Model\CreateWhatsAppTemplate $whatsAppTemplates Values to create a template (required)
+ * @param \Brevo\Client\Models\CreateWhatsAppTemplate $createWhatsAppTemplate Values to create a WhatsApp template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createWhatsAppTemplate'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\CreateModel, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\CreateModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function createWhatsAppTemplateWithHttpInfo($whatsAppTemplates)
+ public function createWhatsAppTemplateWithHttpInfo(
+ \Brevo\Client\Models\CreateWhatsAppTemplate $createWhatsAppTemplate,
+ string $contentType = self::contentTypes['createWhatsAppTemplate'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\CreateModel';
- $request = $this->createWhatsAppTemplateRequest($whatsAppTemplates);
+ $request = $this->createWhatsAppTemplateRequest($createWhatsAppTemplate, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -409,34 +562,111 @@ public function createWhatsAppTemplateWithHttpInfo($whatsAppTemplates)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 201:
+ if (in_array('\Brevo\Client\Models\CreateModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\CreateModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\CreateModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\CreateModel';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -451,7 +681,7 @@ public function createWhatsAppTemplateWithHttpInfo($whatsAppTemplates)
case 201:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\CreateModel',
+ '\Brevo\Client\Models\CreateModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -459,7 +689,7 @@ public function createWhatsAppTemplateWithHttpInfo($whatsAppTemplates)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -474,14 +704,18 @@ public function createWhatsAppTemplateWithHttpInfo($whatsAppTemplates)
*
* Create a WhatsApp template
*
- * @param \Brevo\Client\Model\CreateWhatsAppTemplate $whatsAppTemplates Values to create a template (required)
+ * @param \Brevo\Client\Models\CreateWhatsAppTemplate $createWhatsAppTemplate Values to create a WhatsApp template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createWhatsAppTemplate'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createWhatsAppTemplateAsync($whatsAppTemplates)
+ public function createWhatsAppTemplateAsync(
+ \Brevo\Client\Models\CreateWhatsAppTemplate $createWhatsAppTemplate,
+ string $contentType = self::contentTypes['createWhatsAppTemplate'][0]
+ ): PromiseInterface
{
- return $this->createWhatsAppTemplateAsyncWithHttpInfo($whatsAppTemplates)
+ return $this->createWhatsAppTemplateAsyncWithHttpInfo($createWhatsAppTemplate, $contentType)
->then(
function ($response) {
return $response[0];
@@ -494,25 +728,29 @@ function ($response) {
*
* Create a WhatsApp template
*
- * @param \Brevo\Client\Model\CreateWhatsAppTemplate $whatsAppTemplates Values to create a template (required)
+ * @param \Brevo\Client\Models\CreateWhatsAppTemplate $createWhatsAppTemplate Values to create a WhatsApp template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createWhatsAppTemplate'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function createWhatsAppTemplateAsyncWithHttpInfo($whatsAppTemplates)
+ public function createWhatsAppTemplateAsyncWithHttpInfo(
+ $createWhatsAppTemplate,
+ string $contentType = self::contentTypes['createWhatsAppTemplate'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\CreateModel';
- $request = $this->createWhatsAppTemplateRequest($whatsAppTemplates);
+ $returnType = '\Brevo\Client\Models\CreateModel';
+ $request = $this->createWhatsAppTemplateRequest($createWhatsAppTemplate, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -535,7 +773,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -544,21 +782,27 @@ function ($exception) {
/**
* Create request for operation 'createWhatsAppTemplate'
*
- * @param \Brevo\Client\Model\CreateWhatsAppTemplate $whatsAppTemplates Values to create a template (required)
+ * @param \Brevo\Client\Models\CreateWhatsAppTemplate $createWhatsAppTemplate Values to create a WhatsApp template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createWhatsAppTemplate'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function createWhatsAppTemplateRequest($whatsAppTemplates)
+ public function createWhatsAppTemplateRequest(
+ $createWhatsAppTemplate,
+ string $contentType = self::contentTypes['createWhatsAppTemplate'][0]
+ ): Request
{
- // verify the required parameter 'whatsAppTemplates' is set
- if ($whatsAppTemplates === null || (is_array($whatsAppTemplates) && count($whatsAppTemplates) === 0)) {
- throw new \InvalidArgumentException(
- 'Missing the required parameter $whatsAppTemplates when calling createWhatsAppTemplate'
+
+ // verify the required parameter 'createWhatsAppTemplate' is set
+ if ($createWhatsAppTemplate === null || (is_array($createWhatsAppTemplate) && count($createWhatsAppTemplate) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $createWhatsAppTemplate when calling createWhatsAppTemplate'
);
}
- $resourcePath = '/whatsppCampaigns/template';
+
+ $resourcePath = '/whatsappCampaigns/template';
$formParams = [];
$queryParams = [];
$headerParams = [];
@@ -567,56 +811,43 @@ protected function createWhatsAppTemplateRequest($whatsAppTemplates)
- // body params
- $_tempBody = null;
- if (isset($whatsAppTemplates)) {
- $_tempBody = $whatsAppTemplates;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($createWhatsAppTemplate)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createWhatsAppTemplate));
+ } else {
+ $httpBody = $createWhatsAppTemplate;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -642,10 +873,11 @@ protected function createWhatsAppTemplateRequest($whatsAppTemplates)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -657,14 +889,18 @@ protected function createWhatsAppTemplateRequest($whatsAppTemplates)
* Delete a WhatsApp campaign
*
* @param int $campaignId id of the campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteWhatsAppCampaign'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function deleteWhatsAppCampaign($campaignId)
+ public function deleteWhatsAppCampaign(
+ int $campaignId,
+ string $contentType = self::contentTypes['deleteWhatsAppCampaign'][0]
+ ): void
{
- $this->deleteWhatsAppCampaignWithHttpInfo($campaignId);
+ $this->deleteWhatsAppCampaignWithHttpInfo($campaignId, $contentType);
}
/**
@@ -673,15 +909,18 @@ public function deleteWhatsAppCampaign($campaignId)
* Delete a WhatsApp campaign
*
* @param int $campaignId id of the campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteWhatsAppCampaign'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function deleteWhatsAppCampaignWithHttpInfo($campaignId)
+ public function deleteWhatsAppCampaignWithHttpInfo(
+ int $campaignId,
+ string $contentType = self::contentTypes['deleteWhatsAppCampaign'][0]
+ ): array
{
- $returnType = '';
- $request = $this->deleteWhatsAppCampaignRequest($campaignId);
+ $request = $this->deleteWhatsAppCampaignRequest($campaignId, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -690,26 +929,21 @@ public function deleteWhatsAppCampaignWithHttpInfo($campaignId)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -718,7 +952,7 @@ public function deleteWhatsAppCampaignWithHttpInfo($campaignId)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -726,7 +960,7 @@ public function deleteWhatsAppCampaignWithHttpInfo($campaignId)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -742,13 +976,17 @@ public function deleteWhatsAppCampaignWithHttpInfo($campaignId)
* Delete a WhatsApp campaign
*
* @param int $campaignId id of the campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteWhatsAppCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteWhatsAppCampaignAsync($campaignId)
+ public function deleteWhatsAppCampaignAsync(
+ int $campaignId,
+ string $contentType = self::contentTypes['deleteWhatsAppCampaign'][0]
+ ): PromiseInterface
{
- return $this->deleteWhatsAppCampaignAsyncWithHttpInfo($campaignId)
+ return $this->deleteWhatsAppCampaignAsyncWithHttpInfo($campaignId, $contentType)
->then(
function ($response) {
return $response[0];
@@ -762,14 +1000,19 @@ function ($response) {
* Delete a WhatsApp campaign
*
* @param int $campaignId id of the campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteWhatsAppCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function deleteWhatsAppCampaignAsyncWithHttpInfo($campaignId)
+ public function deleteWhatsAppCampaignAsyncWithHttpInfo(
+ $campaignId,
+ string $contentType = self::contentTypes['deleteWhatsAppCampaign'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->deleteWhatsAppCampaignRequest($campaignId);
+ $request = $this->deleteWhatsAppCampaignRequest($campaignId, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -788,7 +1031,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -798,19 +1041,25 @@ function ($exception) {
* Create request for operation 'deleteWhatsAppCampaign'
*
* @param int $campaignId id of the campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteWhatsAppCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function deleteWhatsAppCampaignRequest($campaignId)
+ public function deleteWhatsAppCampaignRequest(
+ $campaignId,
+ string $contentType = self::contentTypes['deleteWhatsAppCampaign'][0]
+ ): Request
{
+
// verify the required parameter 'campaignId' is set
if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $campaignId when calling deleteWhatsAppCampaign'
);
}
+
$resourcePath = '/whatsappCampaigns/{campaignId}';
$formParams = [];
$queryParams = [];
@@ -819,6 +1068,7 @@ protected function deleteWhatsAppCampaignRequest($campaignId)
$multipart = false;
+
// path params
if ($campaignId !== null) {
$resourcePath = str_replace(
@@ -828,53 +1078,35 @@ protected function deleteWhatsAppCampaignRequest($campaignId)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -900,10 +1132,11 @@ protected function deleteWhatsAppCampaignRequest($campaignId)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'DELETE',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -915,14 +1148,18 @@ protected function deleteWhatsAppCampaignRequest($campaignId)
* Get a WhatsApp campaign
*
* @param int $campaignId Id of the campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWhatsAppCampaign'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetWhatsappCampaignOverview
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetWhatsappCampaignOverview|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel
*/
- public function getWhatsAppCampaign($campaignId)
+ public function getWhatsAppCampaign(
+ int $campaignId,
+ string $contentType = self::contentTypes['getWhatsAppCampaign'][0]
+ ): \Brevo\Client\Models\GetWhatsappCampaignOverview
{
- list($response) = $this->getWhatsAppCampaignWithHttpInfo($campaignId);
+ list($response) = $this->getWhatsAppCampaignWithHttpInfo($campaignId, $contentType);
return $response;
}
@@ -932,15 +1169,18 @@ public function getWhatsAppCampaign($campaignId)
* Get a WhatsApp campaign
*
* @param int $campaignId Id of the campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWhatsAppCampaign'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetWhatsappCampaignOverview, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetWhatsappCampaignOverview|\Brevo\Client\Models\ErrorModel|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getWhatsAppCampaignWithHttpInfo($campaignId)
+ public function getWhatsAppCampaignWithHttpInfo(
+ int $campaignId,
+ string $contentType = self::contentTypes['getWhatsAppCampaign'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetWhatsappCampaignOverview';
- $request = $this->getWhatsAppCampaignRequest($campaignId);
+ $request = $this->getWhatsAppCampaignRequest($campaignId, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -949,34 +1189,138 @@ public function getWhatsAppCampaignWithHttpInfo($campaignId)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetWhatsappCampaignOverview', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetWhatsappCampaignOverview' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetWhatsappCampaignOverview', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetWhatsappCampaignOverview';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -991,7 +1335,7 @@ public function getWhatsAppCampaignWithHttpInfo($campaignId)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetWhatsappCampaignOverview',
+ '\Brevo\Client\Models\GetWhatsappCampaignOverview',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -999,7 +1343,7 @@ public function getWhatsAppCampaignWithHttpInfo($campaignId)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1007,7 +1351,7 @@ public function getWhatsAppCampaignWithHttpInfo($campaignId)
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1023,13 +1367,17 @@ public function getWhatsAppCampaignWithHttpInfo($campaignId)
* Get a WhatsApp campaign
*
* @param int $campaignId Id of the campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWhatsAppCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getWhatsAppCampaignAsync($campaignId)
+ public function getWhatsAppCampaignAsync(
+ int $campaignId,
+ string $contentType = self::contentTypes['getWhatsAppCampaign'][0]
+ ): PromiseInterface
{
- return $this->getWhatsAppCampaignAsyncWithHttpInfo($campaignId)
+ return $this->getWhatsAppCampaignAsyncWithHttpInfo($campaignId, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1043,24 +1391,28 @@ function ($response) {
* Get a WhatsApp campaign
*
* @param int $campaignId Id of the campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWhatsAppCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getWhatsAppCampaignAsyncWithHttpInfo($campaignId)
+ public function getWhatsAppCampaignAsyncWithHttpInfo(
+ $campaignId,
+ string $contentType = self::contentTypes['getWhatsAppCampaign'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetWhatsappCampaignOverview';
- $request = $this->getWhatsAppCampaignRequest($campaignId);
+ $returnType = '\Brevo\Client\Models\GetWhatsappCampaignOverview';
+ $request = $this->getWhatsAppCampaignRequest($campaignId, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1083,7 +1435,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1093,19 +1445,25 @@ function ($exception) {
* Create request for operation 'getWhatsAppCampaign'
*
* @param int $campaignId Id of the campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWhatsAppCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getWhatsAppCampaignRequest($campaignId)
+ public function getWhatsAppCampaignRequest(
+ $campaignId,
+ string $contentType = self::contentTypes['getWhatsAppCampaign'][0]
+ ): Request
{
+
// verify the required parameter 'campaignId' is set
if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $campaignId when calling getWhatsAppCampaign'
);
}
+
$resourcePath = '/whatsappCampaigns/{campaignId}';
$formParams = [];
$queryParams = [];
@@ -1114,6 +1472,7 @@ protected function getWhatsAppCampaignRequest($campaignId)
$multipart = false;
+
// path params
if ($campaignId !== null) {
$resourcePath = str_replace(
@@ -1123,53 +1482,35 @@ protected function getWhatsAppCampaignRequest($campaignId)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1195,10 +1536,11 @@ protected function getWhatsAppCampaignRequest($campaignId)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1209,19 +1551,27 @@ protected function getWhatsAppCampaignRequest($campaignId)
*
* Return all your created WhatsApp campaigns
*
- * @param string $startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the campaigns created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
- * @param string $endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the campaigns created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param string|null $startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the WhatsApp campaigns created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
+ * @param string|null $endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the WhatsApp campaigns created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWhatsAppCampaigns'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetWhatsappCampaigns
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetWhatsappCampaigns|\Brevo\Client\Models\ErrorModel
*/
- public function getWhatsAppCampaigns($startDate = null, $endDate = null, $limit = '50', $offset = '0', $sort = 'desc')
+ public function getWhatsAppCampaigns(
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getWhatsAppCampaigns'][0]
+ ): \Brevo\Client\Models\GetWhatsappCampaigns
{
- list($response) = $this->getWhatsAppCampaignsWithHttpInfo($startDate, $endDate, $limit, $offset, $sort);
+ list($response) = $this->getWhatsAppCampaignsWithHttpInfo($startDate, $endDate, $limit, $offset, $sort, $contentType);
return $response;
}
@@ -1230,20 +1580,27 @@ public function getWhatsAppCampaigns($startDate = null, $endDate = null, $limit
*
* Return all your created WhatsApp campaigns
*
- * @param string $startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the campaigns created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
- * @param string $endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the campaigns created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param string|null $startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the WhatsApp campaigns created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
+ * @param string|null $endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the WhatsApp campaigns created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWhatsAppCampaigns'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetWhatsappCampaigns, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetWhatsappCampaigns|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getWhatsAppCampaignsWithHttpInfo($startDate = null, $endDate = null, $limit = '50', $offset = '0', $sort = 'desc')
+ public function getWhatsAppCampaignsWithHttpInfo(
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getWhatsAppCampaigns'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetWhatsappCampaigns';
- $request = $this->getWhatsAppCampaignsRequest($startDate, $endDate, $limit, $offset, $sort);
+ $request = $this->getWhatsAppCampaignsRequest($startDate, $endDate, $limit, $offset, $sort, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1252,34 +1609,111 @@ public function getWhatsAppCampaignsWithHttpInfo($startDate = null, $endDate = n
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetWhatsappCampaigns', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetWhatsappCampaigns' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetWhatsappCampaigns', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetWhatsappCampaigns';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1294,7 +1728,7 @@ public function getWhatsAppCampaignsWithHttpInfo($startDate = null, $endDate = n
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetWhatsappCampaigns',
+ '\Brevo\Client\Models\GetWhatsappCampaigns',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1302,7 +1736,7 @@ public function getWhatsAppCampaignsWithHttpInfo($startDate = null, $endDate = n
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1317,18 +1751,26 @@ public function getWhatsAppCampaignsWithHttpInfo($startDate = null, $endDate = n
*
* Return all your created WhatsApp campaigns
*
- * @param string $startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the campaigns created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
- * @param string $endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the campaigns created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param string|null $startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the WhatsApp campaigns created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
+ * @param string|null $endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the WhatsApp campaigns created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWhatsAppCampaigns'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getWhatsAppCampaignsAsync($startDate = null, $endDate = null, $limit = '50', $offset = '0', $sort = 'desc')
+ public function getWhatsAppCampaignsAsync(
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ string $contentType = self::contentTypes['getWhatsAppCampaigns'][0]
+ ): PromiseInterface
{
- return $this->getWhatsAppCampaignsAsyncWithHttpInfo($startDate, $endDate, $limit, $offset, $sort)
+ return $this->getWhatsAppCampaignsAsyncWithHttpInfo($startDate, $endDate, $limit, $offset, $sort, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1341,29 +1783,37 @@ function ($response) {
*
* Return all your created WhatsApp campaigns
*
- * @param string $startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the campaigns created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
- * @param string $endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the campaigns created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param string|null $startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the WhatsApp campaigns created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
+ * @param string|null $endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the WhatsApp campaigns created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWhatsAppCampaigns'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getWhatsAppCampaignsAsyncWithHttpInfo($startDate = null, $endDate = null, $limit = '50', $offset = '0', $sort = 'desc')
+ public function getWhatsAppCampaignsAsyncWithHttpInfo(
+ $startDate = null,
+ $endDate = null,
+ $limit = 50,
+ $offset = 0,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getWhatsAppCampaigns'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetWhatsappCampaigns';
- $request = $this->getWhatsAppCampaignsRequest($startDate, $endDate, $limit, $offset, $sort);
+ $returnType = '\Brevo\Client\Models\GetWhatsappCampaigns';
+ $request = $this->getWhatsAppCampaignsRequest($startDate, $endDate, $limit, $offset, $sort, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1386,7 +1836,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1395,23 +1845,36 @@ function ($exception) {
/**
* Create request for operation 'getWhatsAppCampaigns'
*
- * @param string $startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the campaigns created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
- * @param string $endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the campaigns created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed (optional, default to desc)
+ * @param string|null $startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the WhatsApp campaigns created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
+ * @param string|null $endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the WhatsApp campaigns created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWhatsAppCampaigns'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getWhatsAppCampaignsRequest($startDate = null, $endDate = null, $limit = '50', $offset = '0', $sort = 'desc')
+ public function getWhatsAppCampaignsRequest(
+ $startDate = null,
+ $endDate = null,
+ $limit = 50,
+ $offset = 0,
+ $sort = 'desc',
+ string $contentType = self::contentTypes['getWhatsAppCampaigns'][0]
+ ): Request
{
+
+
+
if ($limit !== null && $limit > 100) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling WhatsAppCampaignsApi.getWhatsAppCampaigns, must be smaller than or equal to 100.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling WhatsAppCampaignsApi.getWhatsAppCampaigns, must be smaller than or equal to 100.');
}
if ($limit !== null && $limit < 0) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling WhatsAppCampaignsApi.getWhatsAppCampaigns, must be bigger than or equal to 0.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling WhatsAppCampaignsApi.getWhatsAppCampaigns, must be bigger than or equal to 0.');
}
+
+
$resourcePath = '/whatsappCampaigns';
@@ -1422,74 +1885,82 @@ protected function getWhatsAppCampaignsRequest($startDate = null, $endDate = nul
$multipart = false;
// query params
- if ($startDate !== null) {
- $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $startDate,
+ 'startDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($endDate !== null) {
- $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $endDate,
+ 'endDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1515,10 +1986,11 @@ protected function getWhatsAppCampaignsRequest($startDate = null, $endDate = nul
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1529,14 +2001,17 @@ protected function getWhatsAppCampaignsRequest($startDate = null, $endDate = nul
*
* Get your WhatsApp API account information
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWhatsAppConfig'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetWhatsAppConfig
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetWhatsAppConfig|\Brevo\Client\Models\ErrorModel
*/
- public function getWhatsAppConfig()
+ public function getWhatsAppConfig(
+ string $contentType = self::contentTypes['getWhatsAppConfig'][0]
+ ): \Brevo\Client\Models\GetWhatsAppConfig
{
- list($response) = $this->getWhatsAppConfigWithHttpInfo();
+ list($response) = $this->getWhatsAppConfigWithHttpInfo($contentType);
return $response;
}
@@ -1545,15 +2020,17 @@ public function getWhatsAppConfig()
*
* Get your WhatsApp API account information
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWhatsAppConfig'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetWhatsAppConfig, HTTP status code, HTTP response headers (array of strings)
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetWhatsAppConfig|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getWhatsAppConfigWithHttpInfo()
+ public function getWhatsAppConfigWithHttpInfo(
+ string $contentType = self::contentTypes['getWhatsAppConfig'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetWhatsAppConfig';
- $request = $this->getWhatsAppConfigRequest();
+ $request = $this->getWhatsAppConfigRequest($contentType);
try {
$options = $this->createHttpClientOption();
@@ -1562,34 +2039,111 @@ public function getWhatsAppConfigWithHttpInfo()
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetWhatsAppConfig', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetWhatsAppConfig' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetWhatsAppConfig', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetWhatsAppConfig';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1604,7 +2158,7 @@ public function getWhatsAppConfigWithHttpInfo()
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetWhatsAppConfig',
+ '\Brevo\Client\Models\GetWhatsAppConfig',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1612,7 +2166,7 @@ public function getWhatsAppConfigWithHttpInfo()
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1627,13 +2181,16 @@ public function getWhatsAppConfigWithHttpInfo()
*
* Get your WhatsApp API account information
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWhatsAppConfig'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getWhatsAppConfigAsync()
+ public function getWhatsAppConfigAsync(
+ string $contentType = self::contentTypes['getWhatsAppConfig'][0]
+ ): PromiseInterface
{
- return $this->getWhatsAppConfigAsyncWithHttpInfo()
+ return $this->getWhatsAppConfigAsyncWithHttpInfo($contentType)
->then(
function ($response) {
return $response[0];
@@ -1646,24 +2203,27 @@ function ($response) {
*
* Get your WhatsApp API account information
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWhatsAppConfig'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getWhatsAppConfigAsyncWithHttpInfo()
+ public function getWhatsAppConfigAsyncWithHttpInfo(
+ string $contentType = self::contentTypes['getWhatsAppConfig'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetWhatsAppConfig';
- $request = $this->getWhatsAppConfigRequest();
+ $returnType = '\Brevo\Client\Models\GetWhatsAppConfig';
+ $request = $this->getWhatsAppConfigRequest($contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1686,7 +2246,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1695,13 +2255,17 @@ function ($exception) {
/**
* Create request for operation 'getWhatsAppConfig'
*
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWhatsAppConfig'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getWhatsAppConfigRequest()
+ public function getWhatsAppConfigRequest(
+ string $contentType = self::contentTypes['getWhatsAppConfig'][0]
+ ): Request
{
+
$resourcePath = '/whatsappCampaigns/config';
$formParams = [];
$queryParams = [];
@@ -1711,53 +2275,36 @@ protected function getWhatsAppConfigRequest()
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -1783,10 +2330,11 @@ protected function getWhatsAppConfigRequest()
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -1797,20 +2345,29 @@ protected function getWhatsAppConfigRequest()
*
* Return all your created WhatsApp templates
*
- * @param string $startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
- * @param string $endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param string $source source of the template (optional)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return \Brevo\Client\Model\GetWATemplates
+ * @param string|null $startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
+ * @param string|null $endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string|null $source source of the template (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWhatsAppTemplates'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return \Brevo\Client\Models\GetWhatsappTemplates|\Brevo\Client\Models\ErrorModel
*/
- public function getWhatsAppTemplates($startDate = null, $endDate = null, $limit = '50', $offset = '0', $sort = 'desc', $source = null)
+ public function getWhatsAppTemplates(
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ ?string $source = null,
+ string $contentType = self::contentTypes['getWhatsAppTemplates'][0]
+ ): \Brevo\Client\Models\GetWhatsappTemplates
{
- list($response) = $this->getWhatsAppTemplatesWithHttpInfo($startDate, $endDate, $limit, $offset, $sort, $source);
+ list($response) = $this->getWhatsAppTemplatesWithHttpInfo($startDate, $endDate, $limit, $offset, $sort, $source, $contentType);
return $response;
}
@@ -1819,21 +2376,29 @@ public function getWhatsAppTemplates($startDate = null, $endDate = null, $limit
*
* Return all your created WhatsApp templates
*
- * @param string $startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
- * @param string $endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param string $source source of the template (optional)
- *
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
- * @return array of \Brevo\Client\Model\GetWATemplates, HTTP status code, HTTP response headers (array of strings)
+ * @param string|null $startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
+ * @param string|null $endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string|null $source source of the template (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWhatsAppTemplates'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return array of \Brevo\Client\Models\GetWhatsappTemplates|\Brevo\Client\Models\ErrorModel, HTTP status code, HTTP response headers (array of strings)
*/
- public function getWhatsAppTemplatesWithHttpInfo($startDate = null, $endDate = null, $limit = '50', $offset = '0', $sort = 'desc', $source = null)
+ public function getWhatsAppTemplatesWithHttpInfo(
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ ?string $source = null,
+ string $contentType = self::contentTypes['getWhatsAppTemplates'][0]
+ ): array
{
- $returnType = '\Brevo\Client\Model\GetWATemplates';
- $request = $this->getWhatsAppTemplatesRequest($startDate, $endDate, $limit, $offset, $sort, $source);
+ $request = $this->getWhatsAppTemplatesRequest($startDate, $endDate, $limit, $offset, $sort, $source, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -1842,34 +2407,111 @@ public function getWhatsAppTemplatesWithHttpInfo($startDate = null, $endDate = n
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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 (in_array('\Brevo\Client\Models\GetWhatsappTemplates', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\GetWhatsappTemplates' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\GetWhatsappTemplates', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if (in_array('\Brevo\Client\Models\ErrorModel', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Brevo\Client\Models\ErrorModel' !== 'string') {
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Brevo\Client\Models\ErrorModel', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
- $request->getUri()
+ (string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ $returnType = '\Brevo\Client\Models\GetWhatsappTemplates';
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
- $content = json_decode($content);
+ try {
+ $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+ } catch (\JsonException $exception) {
+ throw new ApiException(
+ sprintf(
+ 'Error JSON decoding server response (%s)',
+ $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ $content
+ );
+ }
}
}
@@ -1884,7 +2526,7 @@ public function getWhatsAppTemplatesWithHttpInfo($startDate = null, $endDate = n
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\GetWATemplates',
+ '\Brevo\Client\Models\GetWhatsappTemplates',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1892,7 +2534,7 @@ public function getWhatsAppTemplatesWithHttpInfo($startDate = null, $endDate = n
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -1907,19 +2549,28 @@ public function getWhatsAppTemplatesWithHttpInfo($startDate = null, $endDate = n
*
* Return all your created WhatsApp templates
*
- * @param string $startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
- * @param string $endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param string $source source of the template (optional)
+ * @param string|null $startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
+ * @param string|null $endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string|null $source source of the template (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWhatsAppTemplates'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getWhatsAppTemplatesAsync($startDate = null, $endDate = null, $limit = '50', $offset = '0', $sort = 'desc', $source = null)
+ public function getWhatsAppTemplatesAsync(
+ ?string $startDate = null,
+ ?string $endDate = null,
+ ?int $limit = 50,
+ ?int $offset = 0,
+ ?string $sort = 'desc',
+ ?string $source = null,
+ string $contentType = self::contentTypes['getWhatsAppTemplates'][0]
+ ): PromiseInterface
{
- return $this->getWhatsAppTemplatesAsyncWithHttpInfo($startDate, $endDate, $limit, $offset, $sort, $source)
+ return $this->getWhatsAppTemplatesAsyncWithHttpInfo($startDate, $endDate, $limit, $offset, $sort, $source, $contentType)
->then(
function ($response) {
return $response[0];
@@ -1932,30 +2583,39 @@ function ($response) {
*
* Return all your created WhatsApp templates
*
- * @param string $startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
- * @param string $endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param string $source source of the template (optional)
- *
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @param string|null $startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
+ * @param string|null $endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string|null $source source of the template (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWhatsAppTemplates'] to see the possible values for this operation
+ *
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function getWhatsAppTemplatesAsyncWithHttpInfo($startDate = null, $endDate = null, $limit = '50', $offset = '0', $sort = 'desc', $source = null)
+ public function getWhatsAppTemplatesAsyncWithHttpInfo(
+ $startDate = null,
+ $endDate = null,
+ $limit = 50,
+ $offset = 0,
+ $sort = 'desc',
+ $source = null,
+ string $contentType = self::contentTypes['getWhatsAppTemplates'][0]
+ ): PromiseInterface
{
- $returnType = '\Brevo\Client\Model\GetWATemplates';
- $request = $this->getWhatsAppTemplatesRequest($startDate, $endDate, $limit, $offset, $sort, $source);
+ $returnType = '\Brevo\Client\Models\GetWhatsappTemplates';
+ $request = $this->getWhatsAppTemplatesRequest($startDate, $endDate, $limit, $offset, $sort, $source, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
- $responseBody = $response->getBody();
- if ($returnType === '\SplFileObject') {
- $content = $responseBody; //stream goes to serializer
+ if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
+ $content = $response->getBody(); //stream goes to serializer
} else {
- $content = $responseBody->getContents();
+ $content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
@@ -1978,7 +2638,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -1987,24 +2647,39 @@ function ($exception) {
/**
* Create request for operation 'getWhatsAppTemplates'
*
- * @param string $startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
- * @param string $endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
- * @param int $limit Number of documents per page (optional, default to 50)
- * @param int $offset Index of the first document in the page (optional, default to 0)
- * @param string $sort Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed (optional, default to desc)
- * @param string $source source of the template (optional)
+ * @param string|null $startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
+ * @param string|null $endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** (optional)
+ * @param int|null $limit Number of documents per page (optional, default to 50)
+ * @param int|null $offset Index of the first document in the page (optional, default to 0)
+ * @param string|null $sort Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed (optional, default to 'desc')
+ * @param string|null $source source of the template (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWhatsAppTemplates'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function getWhatsAppTemplatesRequest($startDate = null, $endDate = null, $limit = '50', $offset = '0', $sort = 'desc', $source = null)
+ public function getWhatsAppTemplatesRequest(
+ $startDate = null,
+ $endDate = null,
+ $limit = 50,
+ $offset = 0,
+ $sort = 'desc',
+ $source = null,
+ string $contentType = self::contentTypes['getWhatsAppTemplates'][0]
+ ): Request
{
+
+
+
if ($limit !== null && $limit > 100) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling WhatsAppCampaignsApi.getWhatsAppTemplates, must be smaller than or equal to 100.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling WhatsAppCampaignsApi.getWhatsAppTemplates, must be smaller than or equal to 100.');
}
if ($limit !== null && $limit < 0) {
- throw new \InvalidArgumentException('invalid value for "$limit" when calling WhatsAppCampaignsApi.getWhatsAppTemplates, must be bigger than or equal to 0.');
+ throw new InvalidArgumentException('invalid value for "$limit" when calling WhatsAppCampaignsApi.getWhatsAppTemplates, must be bigger than or equal to 0.');
}
+
+
+
$resourcePath = '/whatsappCampaigns/template-list';
@@ -2015,78 +2690,91 @@ protected function getWhatsAppTemplatesRequest($startDate = null, $endDate = nul
$multipart = false;
// query params
- if ($startDate !== null) {
- $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $startDate,
+ 'startDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($endDate !== null) {
- $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $endDate,
+ 'endDate', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($limit !== null) {
- $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($offset !== null) {
- $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $offset,
+ 'offset', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($sort !== null) {
- $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $sort,
+ 'sort', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
// query params
- if ($source !== null) {
- $queryParams['source'] = ObjectSerializer::toQueryValue($source);
- }
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $source,
+ 'source', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -2112,10 +2800,11 @@ protected function getWhatsAppTemplatesRequest($startDate = null, $endDate = nul
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'GET',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -2126,15 +2815,19 @@ protected function getWhatsAppTemplatesRequest($startDate = null, $endDate = nul
*
* Send your WhatsApp template for approval
*
- * @param int $templateId id of the campaign (required)
+ * @param int $templateId id of the template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendWhatsAppTemplateApproval'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function sendWhatsAppTemplateApproval($templateId)
+ public function sendWhatsAppTemplateApproval(
+ int $templateId,
+ string $contentType = self::contentTypes['sendWhatsAppTemplateApproval'][0]
+ ): void
{
- $this->sendWhatsAppTemplateApprovalWithHttpInfo($templateId);
+ $this->sendWhatsAppTemplateApprovalWithHttpInfo($templateId, $contentType);
}
/**
@@ -2142,16 +2835,19 @@ public function sendWhatsAppTemplateApproval($templateId)
*
* Send your WhatsApp template for approval
*
- * @param int $templateId id of the campaign (required)
+ * @param int $templateId id of the template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendWhatsAppTemplateApproval'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function sendWhatsAppTemplateApprovalWithHttpInfo($templateId)
+ public function sendWhatsAppTemplateApprovalWithHttpInfo(
+ int $templateId,
+ string $contentType = self::contentTypes['sendWhatsAppTemplateApproval'][0]
+ ): array
{
- $returnType = '';
- $request = $this->sendWhatsAppTemplateApprovalRequest($templateId);
+ $request = $this->sendWhatsAppTemplateApprovalRequest($templateId, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -2160,26 +2856,21 @@ public function sendWhatsAppTemplateApprovalWithHttpInfo($templateId)
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -2188,7 +2879,7 @@ public function sendWhatsAppTemplateApprovalWithHttpInfo($templateId)
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2203,14 +2894,18 @@ public function sendWhatsAppTemplateApprovalWithHttpInfo($templateId)
*
* Send your WhatsApp template for approval
*
- * @param int $templateId id of the campaign (required)
+ * @param int $templateId id of the template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendWhatsAppTemplateApproval'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function sendWhatsAppTemplateApprovalAsync($templateId)
+ public function sendWhatsAppTemplateApprovalAsync(
+ int $templateId,
+ string $contentType = self::contentTypes['sendWhatsAppTemplateApproval'][0]
+ ): PromiseInterface
{
- return $this->sendWhatsAppTemplateApprovalAsyncWithHttpInfo($templateId)
+ return $this->sendWhatsAppTemplateApprovalAsyncWithHttpInfo($templateId, $contentType)
->then(
function ($response) {
return $response[0];
@@ -2223,15 +2918,20 @@ function ($response) {
*
* Send your WhatsApp template for approval
*
- * @param int $templateId id of the campaign (required)
+ * @param int $templateId id of the template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendWhatsAppTemplateApproval'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function sendWhatsAppTemplateApprovalAsyncWithHttpInfo($templateId)
+ public function sendWhatsAppTemplateApprovalAsyncWithHttpInfo(
+ $templateId,
+ string $contentType = self::contentTypes['sendWhatsAppTemplateApproval'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->sendWhatsAppTemplateApprovalRequest($templateId);
+ $request = $this->sendWhatsAppTemplateApprovalRequest($templateId, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -2250,7 +2950,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -2259,20 +2959,26 @@ function ($exception) {
/**
* Create request for operation 'sendWhatsAppTemplateApproval'
*
- * @param int $templateId id of the campaign (required)
+ * @param int $templateId id of the template (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendWhatsAppTemplateApproval'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function sendWhatsAppTemplateApprovalRequest($templateId)
+ public function sendWhatsAppTemplateApprovalRequest(
+ $templateId,
+ string $contentType = self::contentTypes['sendWhatsAppTemplateApproval'][0]
+ ): Request
{
+
// verify the required parameter 'templateId' is set
if ($templateId === null || (is_array($templateId) && count($templateId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $templateId when calling sendWhatsAppTemplateApproval'
);
}
+
$resourcePath = '/whatsappCampaigns/template/approval/{templateId}';
$formParams = [];
$queryParams = [];
@@ -2281,6 +2987,7 @@ protected function sendWhatsAppTemplateApprovalRequest($templateId)
$multipart = false;
+
// path params
if ($templateId !== null) {
$resourcePath = str_replace(
@@ -2290,53 +2997,35 @@ protected function sendWhatsAppTemplateApprovalRequest($templateId)
);
}
- // body params
- $_tempBody = null;
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
- }
- } elseif (count($formParams) > 0) {
+ if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -2362,10 +3051,11 @@ protected function sendWhatsAppTemplateApprovalRequest($templateId)
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -2376,16 +3066,21 @@ protected function sendWhatsAppTemplateApprovalRequest($templateId)
*
* Update a WhatsApp campaign
*
- * @param int $campaignId Id of the campaign (required)
- * @param \Brevo\Client\Model\UpdateWhatsAppCampaign $whatsAppCampaign values to update WhatsApp Campaign (optional)
+ * @param int $campaignId id of the campaign (required)
+ * @param \Brevo\Client\Models\UpdateWhatsAppCampaign $updateWhatsAppCampaign Values to update a WhatsApp Campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWhatsAppCampaign'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return void
*/
- public function updateWhatsAppCampaign($campaignId, $whatsAppCampaign = null)
+ public function updateWhatsAppCampaign(
+ int $campaignId,
+ \Brevo\Client\Models\UpdateWhatsAppCampaign $updateWhatsAppCampaign,
+ string $contentType = self::contentTypes['updateWhatsAppCampaign'][0]
+ ): void
{
- $this->updateWhatsAppCampaignWithHttpInfo($campaignId, $whatsAppCampaign);
+ $this->updateWhatsAppCampaignWithHttpInfo($campaignId, $updateWhatsAppCampaign, $contentType);
}
/**
@@ -2393,17 +3088,21 @@ public function updateWhatsAppCampaign($campaignId, $whatsAppCampaign = null)
*
* Update a WhatsApp campaign
*
- * @param int $campaignId Id of the campaign (required)
- * @param \Brevo\Client\Model\UpdateWhatsAppCampaign $whatsAppCampaign values to update WhatsApp Campaign (optional)
+ * @param int $campaignId id of the campaign (required)
+ * @param \Brevo\Client\Models\UpdateWhatsAppCampaign $updateWhatsAppCampaign Values to update a WhatsApp Campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWhatsAppCampaign'] to see the possible values for this operation
*
- * @throws \Brevo\Client\ApiException on non-2xx response
- * @throws \InvalidArgumentException
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
- public function updateWhatsAppCampaignWithHttpInfo($campaignId, $whatsAppCampaign = null)
+ public function updateWhatsAppCampaignWithHttpInfo(
+ int $campaignId,
+ \Brevo\Client\Models\UpdateWhatsAppCampaign $updateWhatsAppCampaign,
+ string $contentType = self::contentTypes['updateWhatsAppCampaign'][0]
+ ): array
{
- $returnType = '';
- $request = $this->updateWhatsAppCampaignRequest($campaignId, $whatsAppCampaign);
+ $request = $this->updateWhatsAppCampaignRequest($campaignId, $updateWhatsAppCampaign, $contentType);
try {
$options = $this->createHttpClientOption();
@@ -2412,26 +3111,21 @@ public function updateWhatsAppCampaignWithHttpInfo($campaignId, $whatsAppCampaig
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
- $e->getCode(),
+ (int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
- $e->getResponse() ? $e->getResponse()->getBody()->getContents() : 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();
- if ($statusCode < 200 || $statusCode > 299) {
- throw new ApiException(
- sprintf(
- '[%d] Error connecting to the API (%s)',
- $statusCode,
- $request->getUri()
- ),
- $statusCode,
- $response->getHeaders(),
- $response->getBody()
- );
- }
return [null, $statusCode, $response->getHeaders()];
@@ -2440,15 +3134,7 @@ public function updateWhatsAppCampaignWithHttpInfo($campaignId, $whatsAppCampaig
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
- $e->getResponseHeaders()
- );
- $e->setResponseObject($data);
- break;
- case 404:
- $data = ObjectSerializer::deserialize(
- $e->getResponseBody(),
- '\Brevo\Client\Model\ErrorModel',
+ '\Brevo\Client\Models\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@@ -2463,15 +3149,20 @@ public function updateWhatsAppCampaignWithHttpInfo($campaignId, $whatsAppCampaig
*
* Update a WhatsApp campaign
*
- * @param int $campaignId Id of the campaign (required)
- * @param \Brevo\Client\Model\UpdateWhatsAppCampaign $whatsAppCampaign values to update WhatsApp Campaign (optional)
+ * @param int $campaignId id of the campaign (required)
+ * @param \Brevo\Client\Models\UpdateWhatsAppCampaign $updateWhatsAppCampaign Values to update a WhatsApp Campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWhatsAppCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function updateWhatsAppCampaignAsync($campaignId, $whatsAppCampaign = null)
+ public function updateWhatsAppCampaignAsync(
+ int $campaignId,
+ \Brevo\Client\Models\UpdateWhatsAppCampaign $updateWhatsAppCampaign,
+ string $contentType = self::contentTypes['updateWhatsAppCampaign'][0]
+ ): PromiseInterface
{
- return $this->updateWhatsAppCampaignAsyncWithHttpInfo($campaignId, $whatsAppCampaign)
+ return $this->updateWhatsAppCampaignAsyncWithHttpInfo($campaignId, $updateWhatsAppCampaign, $contentType)
->then(
function ($response) {
return $response[0];
@@ -2484,16 +3175,22 @@ function ($response) {
*
* Update a WhatsApp campaign
*
- * @param int $campaignId Id of the campaign (required)
- * @param \Brevo\Client\Model\UpdateWhatsAppCampaign $whatsAppCampaign values to update WhatsApp Campaign (optional)
+ * @param int $campaignId id of the campaign (required)
+ * @param \Brevo\Client\Models\UpdateWhatsAppCampaign $updateWhatsAppCampaign Values to update a WhatsApp Campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWhatsAppCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
- * @return \GuzzleHttp\Promise\PromiseInterface
+ * @throws ApiException on non-2xx response or if the response body is not in the expected format
+ * @throws InvalidArgumentException
+ * @return PromiseInterface
*/
- public function updateWhatsAppCampaignAsyncWithHttpInfo($campaignId, $whatsAppCampaign = null)
+ public function updateWhatsAppCampaignAsyncWithHttpInfo(
+ $campaignId,
+ $updateWhatsAppCampaign,
+ string $contentType = self::contentTypes['updateWhatsAppCampaign'][0]
+ ): PromiseInterface
{
$returnType = '';
- $request = $this->updateWhatsAppCampaignRequest($campaignId, $whatsAppCampaign);
+ $request = $this->updateWhatsAppCampaignRequest($campaignId, $updateWhatsAppCampaign, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
@@ -2512,7 +3209,7 @@ function ($exception) {
),
$statusCode,
$response->getHeaders(),
- $response->getBody()
+ (string) $response->getBody()
);
}
);
@@ -2521,21 +3218,35 @@ function ($exception) {
/**
* Create request for operation 'updateWhatsAppCampaign'
*
- * @param int $campaignId Id of the campaign (required)
- * @param \Brevo\Client\Model\UpdateWhatsAppCampaign $whatsAppCampaign values to update WhatsApp Campaign (optional)
+ * @param int $campaignId id of the campaign (required)
+ * @param \Brevo\Client\Models\UpdateWhatsAppCampaign $updateWhatsAppCampaign Values to update a WhatsApp Campaign (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWhatsAppCampaign'] to see the possible values for this operation
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
- protected function updateWhatsAppCampaignRequest($campaignId, $whatsAppCampaign = null)
+ public function updateWhatsAppCampaignRequest(
+ $campaignId,
+ $updateWhatsAppCampaign,
+ string $contentType = self::contentTypes['updateWhatsAppCampaign'][0]
+ ): Request
{
+
// verify the required parameter 'campaignId' is set
if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'Missing the required parameter $campaignId when calling updateWhatsAppCampaign'
);
}
+ // verify the required parameter 'updateWhatsAppCampaign' is set
+ if ($updateWhatsAppCampaign === null || (is_array($updateWhatsAppCampaign) && count($updateWhatsAppCampaign) === 0)) {
+ throw new InvalidArgumentException(
+ 'Missing the required parameter $updateWhatsAppCampaign when calling updateWhatsAppCampaign'
+ );
+ }
+
+
$resourcePath = '/whatsappCampaigns/{campaignId}';
$formParams = [];
$queryParams = [];
@@ -2544,6 +3255,7 @@ protected function updateWhatsAppCampaignRequest($campaignId, $whatsAppCampaign
$multipart = false;
+
// path params
if ($campaignId !== null) {
$resourcePath = str_replace(
@@ -2553,56 +3265,42 @@ protected function updateWhatsAppCampaignRequest($campaignId, $whatsAppCampaign
);
}
- // body params
- $_tempBody = null;
- if (isset($whatsAppCampaign)) {
- $_tempBody = $whatsAppCampaign;
- }
- if ($multipart) {
- $headers = $this->headerSelector->selectHeadersForMultipart(
- ['application/json']
- );
- } else {
- $headers = $this->headerSelector->selectHeaders(
- ['application/json'],
- ['application/json']
- );
- }
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
// for model (json/xml)
- if (isset($_tempBody)) {
- // $_tempBody is the method argument, if present
- $httpBody = $_tempBody;
-
- if($headers['Content-Type'] === 'application/json') {
- // \stdClass has no __toString(), so we should encode it manually
- if ($httpBody instanceof \stdClass) {
- $httpBody = \GuzzleHttp\json_encode($httpBody);
- }
- // array has no __toString(), so we should encode it manually
- if(is_array($httpBody)) {
- $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
- }
+ if (isset($updateWhatsAppCampaign)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($updateWhatsAppCampaign));
+ } else {
+ $httpBody = $updateWhatsAppCampaign;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
- $multipartContents[] = [
- 'name' => $formParamName,
- 'contents' => $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 ($headers['Content-Type'] === 'application/json') {
- $httpBody = \GuzzleHttp\json_encode($formParams);
-
+ } 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 = \GuzzleHttp\Psr7\Query::build($formParams);
+ $httpBody = ObjectSerializer::buildQuery($formParams);
}
}
@@ -2628,10 +3326,11 @@ protected function updateWhatsAppCampaignRequest($campaignId, $whatsAppCampaign
$headers
);
- $query = \GuzzleHttp\Psr7\Query::build($queryParams);
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'PUT',
- $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
@@ -2643,7 +3342,7 @@ protected function updateWhatsAppCampaignRequest($campaignId, $whatsAppCampaign
* @throws \RuntimeException on file opening failure
* @return array of http client options
*/
- protected function createHttpClientOption()
+ protected function createHttpClientOption(): array
{
$options = [];
if ($this->config->getDebug()) {
diff --git a/lib/ApiException.php b/lib/ApiException.php
index 4469789..793c615 100644
--- a/lib/ApiException.php
+++ b/lib/ApiException.php
@@ -1,76 +1,74 @@
responseHeaders = $responseHeaders;
@@ -80,9 +78,9 @@ public function __construct($message = "", $code = 0, $responseHeaders = [], $re
/**
* Gets the HTTP response header
*
- * @return string[]|null HTTP response header
+ * @return string[][]|null HTTP response header
*/
- public function getResponseHeaders()
+ public function getResponseHeaders(): ?array
{
return $this->responseHeaders;
}
@@ -90,31 +88,31 @@ public function getResponseHeaders()
/**
* Gets the HTTP body of the server response either as Json or string
*
- * @return mixed HTTP body of the server response either as \stdClass or string
+ * @return stdClass|string|null HTTP body of the server response either as \stdClass or string
*/
- public function getResponseBody()
+ public function getResponseBody(): stdClass|string|null
{
return $this->responseBody;
}
/**
- * Sets the deseralized response object (during deserialization)
+ * Sets the deserialized response object (during deserialization)
*
* @param mixed $obj Deserialized response object
*
* @return void
*/
- public function setResponseObject($obj)
+ public function setResponseObject(mixed $obj): void
{
$this->responseObject = $obj;
}
/**
- * Gets the deseralized response object (during deserialization)
+ * Gets the deserialized response object (during deserialization)
*
* @return mixed the deserialized response object
*/
- public function getResponseObject()
+ public function getResponseObject(): mixed
{
return $this->responseObject;
}
diff --git a/lib/Configuration.php b/lib/Configuration.php
index 802870f..a9c8e02 100644
--- a/lib/Configuration.php
+++ b/lib/Configuration.php
@@ -1,118 +1,127 @@
tempFolderPath = sys_get_temp_dir();
- $this->userAgent = 'brevo_clientAPI/v' . $GLOBALS['version'] . '/php';
}
/**
@@ -131,7 +139,7 @@ public function __construct()
*
* @return $this
*/
- public function setApiKey($apiKeyIdentifier, $key)
+ public function setApiKey(string $apiKeyIdentifier, string $key): static
{
$this->apiKeys[$apiKeyIdentifier] = $key;
return $this;
@@ -142,11 +150,11 @@ public function setApiKey($apiKeyIdentifier, $key)
*
* @param string $apiKeyIdentifier API key identifier (authentication scheme)
*
- * @return string API key or token
+ * @return null|string API key or token
*/
- public function getApiKey($apiKeyIdentifier)
+ public function getApiKey(string $apiKeyIdentifier): ?string
{
- return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null;
+ return $this->apiKeys[$apiKeyIdentifier] ?? null;
}
/**
@@ -157,7 +165,7 @@ public function getApiKey($apiKeyIdentifier)
*
* @return $this
*/
- public function setApiKeyPrefix($apiKeyIdentifier, $prefix)
+ public function setApiKeyPrefix(string $apiKeyIdentifier, string $prefix): static
{
$this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix;
return $this;
@@ -168,11 +176,11 @@ public function setApiKeyPrefix($apiKeyIdentifier, $prefix)
*
* @param string $apiKeyIdentifier API key identifier (authentication scheme)
*
- * @return string
+ * @return null|string
*/
- public function getApiKeyPrefix($apiKeyIdentifier)
+ public function getApiKeyPrefix(string $apiKeyIdentifier): ?string
{
- return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null;
+ return $this->apiKeyPrefixes[$apiKeyIdentifier] ?? null;
}
/**
@@ -182,7 +190,7 @@ public function getApiKeyPrefix($apiKeyIdentifier)
*
* @return $this
*/
- public function setAccessToken($accessToken)
+ public function setAccessToken(string $accessToken): static
{
$this->accessToken = $accessToken;
return $this;
@@ -193,11 +201,35 @@ public function setAccessToken($accessToken)
*
* @return string Access token for OAuth
*/
- public function getAccessToken()
+ public function getAccessToken(): string
{
return $this->accessToken;
}
+ /**
+ * Sets boolean format for query string.
+ *
+ * @param string $booleanFormat Boolean format for query string
+ *
+ * @return $this
+ */
+ public function setBooleanFormatForQueryString(string $booleanFormat): static
+ {
+ $this->booleanFormatForQueryString = $booleanFormat;
+
+ return $this;
+ }
+
+ /**
+ * Gets boolean format for query string.
+ *
+ * @return string Boolean format for query string
+ */
+ public function getBooleanFormatForQueryString(): string
+ {
+ return $this->booleanFormatForQueryString;
+ }
+
/**
* Sets the username for HTTP basic authentication
*
@@ -205,7 +237,7 @@ public function getAccessToken()
*
* @return $this
*/
- public function setUsername($username)
+ public function setUsername(string $username): static
{
$this->username = $username;
return $this;
@@ -216,7 +248,7 @@ public function setUsername($username)
*
* @return string Username for HTTP basic authentication
*/
- public function getUsername()
+ public function getUsername(): string
{
return $this->username;
}
@@ -228,7 +260,7 @@ public function getUsername()
*
* @return $this
*/
- public function setPassword($password)
+ public function setPassword(string $password): static
{
$this->password = $password;
return $this;
@@ -239,7 +271,7 @@ public function setPassword($password)
*
* @return string Password for HTTP basic authentication
*/
- public function getPassword()
+ public function getPassword(): string
{
return $this->password;
}
@@ -251,7 +283,7 @@ public function getPassword()
*
* @return $this
*/
- public function setHost($host)
+ public function setHost(string $host): static
{
$this->host = $host;
return $this;
@@ -262,7 +294,7 @@ public function setHost($host)
*
* @return string Host
*/
- public function getHost()
+ public function getHost(): string
{
return $this->host;
}
@@ -272,15 +304,11 @@ public function getHost()
*
* @param string $userAgent the user agent of the api client
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
* @return $this
*/
- public function setUserAgent($userAgent)
+ public function setUserAgent(string $userAgent): static
{
- if (!is_string($userAgent)) {
- throw new \InvalidArgumentException('User-agent must be a string.');
- }
-
$this->userAgent = $userAgent;
return $this;
}
@@ -290,7 +318,7 @@ public function setUserAgent($userAgent)
*
* @return string user agent
*/
- public function getUserAgent()
+ public function getUserAgent(): string
{
return $this->userAgent;
}
@@ -302,7 +330,7 @@ public function getUserAgent()
*
* @return $this
*/
- public function setDebug($debug)
+ public function setDebug(bool $debug): static
{
$this->debug = $debug;
return $this;
@@ -313,7 +341,7 @@ public function setDebug($debug)
*
* @return bool
*/
- public function getDebug()
+ public function getDebug(): bool
{
return $this->debug;
}
@@ -325,7 +353,7 @@ public function getDebug()
*
* @return $this
*/
- public function setDebugFile($debugFile)
+ public function setDebugFile(string $debugFile): static
{
$this->debugFile = $debugFile;
return $this;
@@ -336,7 +364,7 @@ public function setDebugFile($debugFile)
*
* @return string
*/
- public function getDebugFile()
+ public function getDebugFile(): string
{
return $this->debugFile;
}
@@ -348,7 +376,7 @@ public function getDebugFile()
*
* @return $this
*/
- public function setTempFolderPath($tempFolderPath)
+ public function setTempFolderPath(string $tempFolderPath): static
{
$this->tempFolderPath = $tempFolderPath;
return $this;
@@ -359,7 +387,7 @@ public function setTempFolderPath($tempFolderPath)
*
* @return string Temp folder path
*/
- public function getTempFolderPath()
+ public function getTempFolderPath(): string
{
return $this->tempFolderPath;
}
@@ -369,7 +397,7 @@ public function getTempFolderPath()
*
* @return Configuration
*/
- public static function getDefaultConfiguration()
+ public static function getDefaultConfiguration(): Configuration
{
if (self::$defaultConfiguration === null) {
self::$defaultConfiguration = new Configuration();
@@ -379,13 +407,13 @@ public static function getDefaultConfiguration()
}
/**
- * Sets the detault configuration instance
+ * Sets the default configuration instance
*
* @param Configuration $config An instance of the Configuration Object
*
* @return void
*/
- public static function setDefaultConfiguration(Configuration $config)
+ public static function setDefaultConfiguration(Configuration $config): void
{
self::$defaultConfiguration = $config;
}
@@ -395,12 +423,13 @@ public static function setDefaultConfiguration(Configuration $config)
*
* @return string The report for debugging
*/
- public static function toDebugReport()
+ public static function toDebugReport(): string
{
$report = 'PHP SDK (Brevo\Client) Debug Report:' . PHP_EOL;
$report .= ' OS: ' . php_uname() . PHP_EOL;
$report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL;
- $report .= ' OpenAPI Spec Version: 3.0.0' . PHP_EOL;
+ $report .= ' The version of the OpenAPI document: 3.0.0' . PHP_EOL;
+ $report .= ' SDK Package Version: 3.0.0' . PHP_EOL;
$report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL;
return $report;
@@ -411,9 +440,9 @@ public static function toDebugReport()
*
* @param string $apiKeyIdentifier name of apikey
*
- * @return string API key with the prefix
+ * @return null|string API key with the prefix
*/
- public function getApiKeyWithPrefix($apiKeyIdentifier)
+ public function getApiKeyWithPrefix(string $apiKeyIdentifier): ?string
{
$prefix = $this->getApiKeyPrefix($apiKeyIdentifier);
$apiKey = $this->getApiKey($apiKeyIdentifier);
@@ -430,4 +459,70 @@ public function getApiKeyWithPrefix($apiKeyIdentifier)
return $keyWithPrefix;
}
+
+ /**
+ * Returns an array of host settings
+ *
+ * @return array an array of host settings
+ */
+ public function getHostSettings(): array
+ {
+ return [
+ [
+ "url" => "https://api.brevo.com/v3",
+ "description" => "No description provided",
+ ]
+ ];
+ }
+
+ /**
+ * Returns URL based on host settings, index and variables
+ *
+ * @param array $hostSettings array of host settings, generated from getHostSettings() or equivalent from the API clients
+ * @param int $hostIndex index of the host settings
+ * @param array|null $variables hash of variable and the corresponding value (optional)
+ * @return string URL based on host settings
+ */
+ public static function getHostString(array $hostSettings, int $hostIndex, array $variables = null): string
+ {
+ if (null === $variables) {
+ $variables = [];
+ }
+
+ // check array index out of bound
+ if ($hostIndex < 0 || $hostIndex >= count($hostSettings)) {
+ throw new InvalidArgumentException("Invalid index $hostIndex when selecting the host. Must be less than ".count($hostSettings));
+ }
+
+ $host = $hostSettings[$hostIndex];
+ $url = $host["url"];
+
+ // go through variable and assign a value
+ foreach ($host["variables"] ?? [] as $name => $variable) {
+ if (array_key_exists($name, $variables)) { // check to see if it's in the variables provided by the user
+ if (!isset($variable['enum_values']) || in_array($variables[$name], $variable["enum_values"], true)) { // check to see if the value is in the enum
+ $url = str_replace("{".$name."}", $variables[$name], $url);
+ } else {
+ throw new InvalidArgumentException("The variable `$name` in the host URL has invalid value ".$variables[$name].". Must be ".join(',', $variable["enum_values"]).".");
+ }
+ } else {
+ // use default value
+ $url = str_replace("{".$name."}", $variable["default_value"], $url);
+ }
+ }
+
+ return $url;
+ }
+
+ /**
+ * Returns URL based on the index and variables
+ *
+ * @param int $index index of the host settings
+ * @param array|null $variables hash of variable and the corresponding value (optional)
+ * @return string URL based on host settings
+ */
+ public function getHostFromSettings(int $index, ?array $variables = null): string
+ {
+ return self::getHostString($this->getHostSettings(), $index, $variables);
+ }
}
diff --git a/lib/HeaderSelector.php b/lib/HeaderSelector.php
index 34df7df..4bf6f1a 100644
--- a/lib/HeaderSelector.php
+++ b/lib/HeaderSelector.php
@@ -1,52 +1,48 @@
selectContentTypeHeader($contentTypes);
+ if (!$isMultipart) {
+ if($contentType === '') {
+ $contentType = 'application/json';
+ }
+
+ $headers['Content-Type'] = $contentType;
+ }
+
return $headers;
}
/**
- * @param string[] $accept
- * @return array
+ * Return the header 'Accept' based on an array of Accept provided.
+ *
+ * @param string[] $accept Array of header
+ *
+ * @return null|string Accept (e.g. application/json)
*/
- public function selectHeadersForMultipart($accept)
+ private function selectAcceptHeader(array $accept): ?string
{
- $headers = $this->selectHeaders($accept, []);
+ # filter out empty entries
+ $accept = array_filter($accept);
- unset($headers['Content-Type']);
- return $headers;
+ if (count($accept) === 0) {
+ return null;
+ }
+
+ # If there's only one Accept header, just use it
+ if (count($accept) === 1) {
+ return reset($accept);
+ }
+
+ # If none of the available Accept headers is of type "json", then just use all them
+ $headersWithJson = preg_grep('~(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$~', $accept);
+ if (count($headersWithJson) === 0) {
+ return implode(',', $accept);
+ }
+
+ # If we got here, then we need add quality values (weight), as described in IETF RFC 9110, Items 12.4.2/12.5.1,
+ # to give the highest priority to json-like headers - recalculating the existing ones, if needed
+ return $this->getAcceptHeaderWithAdjustedWeight($accept, $headersWithJson);
+ }
+
+ /**
+ * Create an Accept header string from the given "Accept" headers array, recalculating all weights
+ *
+ * @param string[] $accept Array of Accept Headers
+ * @param string[] $headersWithJson Array of Accept Headers of type "json"
+ *
+ * @return string "Accept" Header (e.g. "application/json, text/html; q=0.9")
+ */
+ private function getAcceptHeaderWithAdjustedWeight(array $accept, array $headersWithJson): string
+ {
+ $processedHeaders = [
+ 'withApplicationJson' => [],
+ 'withJson' => [],
+ 'withoutJson' => [],
+ ];
+
+ foreach ($accept as $header) {
+
+ $headerData = $this->getHeaderAndWeight($header);
+
+ if (stripos($headerData['header'], 'application/json') === 0) {
+ $processedHeaders['withApplicationJson'][] = $headerData;
+ } elseif (in_array($header, $headersWithJson, true)) {
+ $processedHeaders['withJson'][] = $headerData;
+ } else {
+ $processedHeaders['withoutJson'][] = $headerData;
+ }
+ }
+
+ $acceptHeaders = [];
+ $currentWeight = 1000;
+
+ $hasMoreThan28Headers = count($accept) > 28;
+
+ foreach($processedHeaders as $headers) {
+ if (count($headers) > 0) {
+ $acceptHeaders[] = $this->adjustWeight($headers, $currentWeight, $hasMoreThan28Headers);
+ }
+ }
+
+ $acceptHeaders = array_merge(...$acceptHeaders);
+
+ return implode(',', $acceptHeaders);
}
/**
- * Return the header 'Accept' based on an array of Accept provided
+ * Given an Accept header, returns an associative array splitting the header and its weight
*
- * @param string[] $accept Array of header
+ * @param string $header "Accept" Header
*
- * @return string Accept (e.g. application/json)
+ * @return array with the header and its weight
*/
- private function selectAcceptHeader($accept)
+ private function getHeaderAndWeight(string $header): array
{
- if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) {
- return null;
- } elseif (preg_grep("/application\/json/i", $accept)) {
- return 'application/json';
+ # matches headers with weight, splitting the header and the weight in $outputArray
+ if (preg_match('/(.*);\s*q=(1(?:\.0+)?|0\.\d+)$/', $header, $outputArray) === 1) {
+ $headerData = [
+ 'header' => $outputArray[1],
+ 'weight' => (int)($outputArray[2] * 1000),
+ ];
} else {
- return implode(',', $accept);
+ $headerData = [
+ 'header' => trim($header),
+ 'weight' => 1000,
+ ];
+ }
+
+ return $headerData;
+ }
+
+ /**
+ * @param array[] $headers
+ * @param float $currentWeight
+ * @param bool $hasMoreThan28Headers
+ * @return string[] array of adjusted "Accept" headers
+ */
+ private function adjustWeight(array $headers, float &$currentWeight, bool $hasMoreThan28Headers): array
+ {
+ usort($headers, function (array $a, array $b) {
+ return $b['weight'] - $a['weight'];
+ });
+
+ $acceptHeaders = [];
+ foreach ($headers as $index => $header) {
+ if($index > 0 && $headers[$index - 1]['weight'] > $header['weight'])
+ {
+ $currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers);
+ }
+
+ $weight = $currentWeight;
+
+ $acceptHeaders[] = $this->buildAcceptHeader($header['header'], $weight);
+ }
+
+ $currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers);
+
+ return $acceptHeaders;
+ }
+
+ /**
+ * @param string $header
+ * @param int $weight
+ * @return string
+ */
+ private function buildAcceptHeader(string $header, int $weight): string
+ {
+ if($weight === 1000) {
+ return $header;
}
+
+ return trim($header, '; ') . ';q=' . rtrim(sprintf('%0.3f', $weight / 1000), '0');
}
/**
- * Return the content type based on an array of content-type provided
+ * Calculate the next weight, based on the current one.
+ *
+ * If there are less than 28 "Accept" headers, the weights will be decreased by 1 on its highest significant digit, using the
+ * following formula:
+ *
+ * next weight = current weight - 10 ^ (floor(log(current weight - 1)))
*
- * @param string[] $contentType Array fo content-type
+ * ( current weight minus ( 10 raised to the power of ( floor of (log to the base 10 of ( current weight minus 1 ) ) ) ) )
*
- * @return string Content-Type (e.g. application/json)
+ * Starting from 1000, this generates the following series:
+ *
+ * 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1
+ *
+ * The resulting quality codes are closer to the average "normal" usage of them (like "q=0.9", "q=0.8" and so on), but it only works
+ * if there is a maximum of 28 "Accept" headers. If we have more than that (which is extremely unlikely), then we fall back to a 1-by-1
+ * decrement rule, which will result in quality codes like "q=0.999", "q=0.998" etc.
+ *
+ * @param int $currentWeight varying from 1 to 1000 (will be divided by 1000 to build the quality value)
+ * @param bool $hasMoreThan28Headers
+ * @return int
*/
- private function selectContentTypeHeader($contentType)
+ public function getNextWeight(int $currentWeight, bool $hasMoreThan28Headers): int
{
- if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) {
- return 'application/json';
- } elseif (preg_grep("/application\/json/i", $contentType)) {
- return 'application/json';
- } else {
- return implode(',', $contentType);
+ if ($currentWeight <= 1) {
+ return 1;
}
+
+ if ($hasMoreThan28Headers) {
+ return $currentWeight - 1;
+ }
+
+ return $currentWeight - 10 ** floor( log10($currentWeight - 1) );
}
}
-
diff --git a/lib/Model/AbTestCampaignResult.php b/lib/Model/AbTestCampaignResult.php
deleted file mode 100644
index b9695a3..0000000
--- a/lib/Model/AbTestCampaignResult.php
+++ /dev/null
@@ -1,585 +0,0 @@
- 'string',
- 'winningCriteria' => 'string',
- 'winningSubjectLine' => 'string',
- 'openRate' => 'string',
- 'clickRate' => 'string',
- 'winningVersionRate' => 'string',
- 'statistics' => '\Brevo\Client\Model\AbTestCampaignResultStatistics',
- 'clickedLinks' => '\Brevo\Client\Model\AbTestCampaignResultClickedLinks'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'winningVersion' => null,
- 'winningCriteria' => null,
- 'winningSubjectLine' => null,
- 'openRate' => null,
- 'clickRate' => null,
- 'winningVersionRate' => null,
- 'statistics' => null,
- 'clickedLinks' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'winningVersion' => 'winningVersion',
- 'winningCriteria' => 'winningCriteria',
- 'winningSubjectLine' => 'winningSubjectLine',
- 'openRate' => 'openRate',
- 'clickRate' => 'clickRate',
- 'winningVersionRate' => 'winningVersionRate',
- 'statistics' => 'statistics',
- 'clickedLinks' => 'clickedLinks'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'winningVersion' => 'setWinningVersion',
- 'winningCriteria' => 'setWinningCriteria',
- 'winningSubjectLine' => 'setWinningSubjectLine',
- 'openRate' => 'setOpenRate',
- 'clickRate' => 'setClickRate',
- 'winningVersionRate' => 'setWinningVersionRate',
- 'statistics' => 'setStatistics',
- 'clickedLinks' => 'setClickedLinks'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'winningVersion' => 'getWinningVersion',
- 'winningCriteria' => 'getWinningCriteria',
- 'winningSubjectLine' => 'getWinningSubjectLine',
- 'openRate' => 'getOpenRate',
- 'clickRate' => 'getClickRate',
- 'winningVersionRate' => 'getWinningVersionRate',
- 'statistics' => 'getStatistics',
- 'clickedLinks' => 'getClickedLinks'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const WINNING_VERSION_NOT_AVAILABLE = 'notAvailable';
- const WINNING_VERSION_PENDING = 'pending';
- const WINNING_VERSION_TIE = 'tie';
- const WINNING_VERSION_A = 'A';
- const WINNING_VERSION_B = 'B';
- const WINNING_CRITERIA_OPEN = 'Open';
- const WINNING_CRITERIA_CLICK = 'Click';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getWinningVersionAllowableValues()
- {
- return [
- self::WINNING_VERSION_NOT_AVAILABLE,
- self::WINNING_VERSION_PENDING,
- self::WINNING_VERSION_TIE,
- self::WINNING_VERSION_A,
- self::WINNING_VERSION_B,
- ];
- }
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getWinningCriteriaAllowableValues()
- {
- return [
- self::WINNING_CRITERIA_OPEN,
- self::WINNING_CRITERIA_CLICK,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['winningVersion'] = isset($data['winningVersion']) ? $data['winningVersion'] : null;
- $this->container['winningCriteria'] = isset($data['winningCriteria']) ? $data['winningCriteria'] : null;
- $this->container['winningSubjectLine'] = isset($data['winningSubjectLine']) ? $data['winningSubjectLine'] : null;
- $this->container['openRate'] = isset($data['openRate']) ? $data['openRate'] : null;
- $this->container['clickRate'] = isset($data['clickRate']) ? $data['clickRate'] : null;
- $this->container['winningVersionRate'] = isset($data['winningVersionRate']) ? $data['winningVersionRate'] : null;
- $this->container['statistics'] = isset($data['statistics']) ? $data['statistics'] : null;
- $this->container['clickedLinks'] = isset($data['clickedLinks']) ? $data['clickedLinks'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- $allowedValues = $this->getWinningVersionAllowableValues();
- if (!is_null($this->container['winningVersion']) && !in_array($this->container['winningVersion'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'winningVersion', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- $allowedValues = $this->getWinningCriteriaAllowableValues();
- if (!is_null($this->container['winningCriteria']) && !in_array($this->container['winningCriteria'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'winningCriteria', must be one of '%s'",
- 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 winningVersion
- *
- * @return string
- */
- public function getWinningVersion()
- {
- return $this->container['winningVersion'];
- }
-
- /**
- * Sets winningVersion
- *
- * @param string $winningVersion Winning Campaign Info. pending = Campaign has been picked for sending and winning version is yet to be decided, tie = A tie happened between both the versions, notAvailable = Campaign has not yet been picked for sending.
- *
- * @return $this
- */
- public function setWinningVersion($winningVersion)
- {
- $allowedValues = $this->getWinningVersionAllowableValues();
- if (!is_null($winningVersion) && !in_array($winningVersion, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'winningVersion', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['winningVersion'] = $winningVersion;
-
- return $this;
- }
-
- /**
- * Gets winningCriteria
- *
- * @return string
- */
- public function getWinningCriteria()
- {
- return $this->container['winningCriteria'];
- }
-
- /**
- * Sets winningCriteria
- *
- * @param string $winningCriteria Criteria choosen for winning version (Open/Click)
- *
- * @return $this
- */
- public function setWinningCriteria($winningCriteria)
- {
- $allowedValues = $this->getWinningCriteriaAllowableValues();
- if (!is_null($winningCriteria) && !in_array($winningCriteria, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'winningCriteria', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['winningCriteria'] = $winningCriteria;
-
- return $this;
- }
-
- /**
- * Gets winningSubjectLine
- *
- * @return string
- */
- public function getWinningSubjectLine()
- {
- return $this->container['winningSubjectLine'];
- }
-
- /**
- * Sets winningSubjectLine
- *
- * @param string $winningSubjectLine Subject Line of current winning version
- *
- * @return $this
- */
- public function setWinningSubjectLine($winningSubjectLine)
- {
- $this->container['winningSubjectLine'] = $winningSubjectLine;
-
- return $this;
- }
-
- /**
- * Gets openRate
- *
- * @return string
- */
- public function getOpenRate()
- {
- return $this->container['openRate'];
- }
-
- /**
- * Sets openRate
- *
- * @param string $openRate Open rate for current winning version
- *
- * @return $this
- */
- public function setOpenRate($openRate)
- {
- $this->container['openRate'] = $openRate;
-
- return $this;
- }
-
- /**
- * Gets clickRate
- *
- * @return string
- */
- public function getClickRate()
- {
- return $this->container['clickRate'];
- }
-
- /**
- * Sets clickRate
- *
- * @param string $clickRate Click rate for current winning version
- *
- * @return $this
- */
- public function setClickRate($clickRate)
- {
- $this->container['clickRate'] = $clickRate;
-
- return $this;
- }
-
- /**
- * Gets winningVersionRate
- *
- * @return string
- */
- public function getWinningVersionRate()
- {
- return $this->container['winningVersionRate'];
- }
-
- /**
- * Sets winningVersionRate
- *
- * @param string $winningVersionRate Open/Click rate for the winner version
- *
- * @return $this
- */
- public function setWinningVersionRate($winningVersionRate)
- {
- $this->container['winningVersionRate'] = $winningVersionRate;
-
- return $this;
- }
-
- /**
- * Gets statistics
- *
- * @return \Brevo\Client\Model\AbTestCampaignResultStatistics
- */
- public function getStatistics()
- {
- return $this->container['statistics'];
- }
-
- /**
- * Sets statistics
- *
- * @param \Brevo\Client\Model\AbTestCampaignResultStatistics $statistics statistics
- *
- * @return $this
- */
- public function setStatistics($statistics)
- {
- $this->container['statistics'] = $statistics;
-
- return $this;
- }
-
- /**
- * Gets clickedLinks
- *
- * @return \Brevo\Client\Model\AbTestCampaignResultClickedLinks
- */
- public function getClickedLinks()
- {
- return $this->container['clickedLinks'];
- }
-
- /**
- * Sets clickedLinks
- *
- * @param \Brevo\Client\Model\AbTestCampaignResultClickedLinks $clickedLinks clickedLinks
- *
- * @return $this
- */
- public function setClickedLinks($clickedLinks)
- {
- $this->container['clickedLinks'] = $clickedLinks;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/AbTestCampaignResultClickedLinks.php b/lib/Model/AbTestCampaignResultClickedLinks.php
deleted file mode 100644
index 55733e5..0000000
--- a/lib/Model/AbTestCampaignResultClickedLinks.php
+++ /dev/null
@@ -1,341 +0,0 @@
- '\Brevo\Client\Model\AbTestVersionClicks',
- 'versionB' => '\Brevo\Client\Model\AbTestVersionClicks'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'versionA' => null,
- 'versionB' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'versionA' => 'Version A',
- 'versionB' => 'Version B'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'versionA' => 'setVersionA',
- 'versionB' => 'setVersionB'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'versionA' => 'getVersionA',
- 'versionB' => 'getVersionB'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['versionA'] = isset($data['versionA']) ? $data['versionA'] : null;
- $this->container['versionB'] = isset($data['versionB']) ? $data['versionB'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['versionA'] === null) {
- $invalidProperties[] = "'versionA' can't be null";
- }
- if ($this->container['versionB'] === null) {
- $invalidProperties[] = "'versionB' 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 versionA
- *
- * @return \Brevo\Client\Model\AbTestVersionClicks
- */
- public function getVersionA()
- {
- return $this->container['versionA'];
- }
-
- /**
- * Sets versionA
- *
- * @param \Brevo\Client\Model\AbTestVersionClicks $versionA versionA
- *
- * @return $this
- */
- public function setVersionA($versionA)
- {
- $this->container['versionA'] = $versionA;
-
- return $this;
- }
-
- /**
- * Gets versionB
- *
- * @return \Brevo\Client\Model\AbTestVersionClicks
- */
- public function getVersionB()
- {
- return $this->container['versionB'];
- }
-
- /**
- * Sets versionB
- *
- * @param \Brevo\Client\Model\AbTestVersionClicks $versionB versionB
- *
- * @return $this
- */
- public function setVersionB($versionB)
- {
- $this->container['versionB'] = $versionB;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/AbTestCampaignResultStatistics.php b/lib/Model/AbTestCampaignResultStatistics.php
deleted file mode 100644
index e705a7f..0000000
--- a/lib/Model/AbTestCampaignResultStatistics.php
+++ /dev/null
@@ -1,473 +0,0 @@
- '\Brevo\Client\Model\AbTestVersionStats',
- 'clicks' => '\Brevo\Client\Model\AbTestVersionStats',
- 'unsubscribed' => '\Brevo\Client\Model\AbTestVersionStats',
- 'hardBounces' => '\Brevo\Client\Model\AbTestVersionStats',
- 'softBounces' => '\Brevo\Client\Model\AbTestVersionStats',
- 'complaints' => '\Brevo\Client\Model\AbTestVersionStats'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'openers' => null,
- 'clicks' => null,
- 'unsubscribed' => null,
- 'hardBounces' => null,
- 'softBounces' => null,
- 'complaints' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'openers' => 'openers',
- 'clicks' => 'clicks',
- 'unsubscribed' => 'unsubscribed',
- 'hardBounces' => 'hardBounces',
- 'softBounces' => 'softBounces',
- 'complaints' => 'complaints'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'openers' => 'setOpeners',
- 'clicks' => 'setClicks',
- 'unsubscribed' => 'setUnsubscribed',
- 'hardBounces' => 'setHardBounces',
- 'softBounces' => 'setSoftBounces',
- 'complaints' => 'setComplaints'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'openers' => 'getOpeners',
- 'clicks' => 'getClicks',
- 'unsubscribed' => 'getUnsubscribed',
- 'hardBounces' => 'getHardBounces',
- 'softBounces' => 'getSoftBounces',
- 'complaints' => 'getComplaints'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['openers'] = isset($data['openers']) ? $data['openers'] : null;
- $this->container['clicks'] = isset($data['clicks']) ? $data['clicks'] : null;
- $this->container['unsubscribed'] = isset($data['unsubscribed']) ? $data['unsubscribed'] : null;
- $this->container['hardBounces'] = isset($data['hardBounces']) ? $data['hardBounces'] : null;
- $this->container['softBounces'] = isset($data['softBounces']) ? $data['softBounces'] : null;
- $this->container['complaints'] = isset($data['complaints']) ? $data['complaints'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['openers'] === null) {
- $invalidProperties[] = "'openers' can't be null";
- }
- if ($this->container['clicks'] === null) {
- $invalidProperties[] = "'clicks' can't be null";
- }
- if ($this->container['unsubscribed'] === null) {
- $invalidProperties[] = "'unsubscribed' can't be null";
- }
- if ($this->container['hardBounces'] === null) {
- $invalidProperties[] = "'hardBounces' can't be null";
- }
- if ($this->container['softBounces'] === null) {
- $invalidProperties[] = "'softBounces' can't be null";
- }
- if ($this->container['complaints'] === null) {
- $invalidProperties[] = "'complaints' 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 openers
- *
- * @return \Brevo\Client\Model\AbTestVersionStats
- */
- public function getOpeners()
- {
- return $this->container['openers'];
- }
-
- /**
- * Sets openers
- *
- * @param \Brevo\Client\Model\AbTestVersionStats $openers openers
- *
- * @return $this
- */
- public function setOpeners($openers)
- {
- $this->container['openers'] = $openers;
-
- return $this;
- }
-
- /**
- * Gets clicks
- *
- * @return \Brevo\Client\Model\AbTestVersionStats
- */
- public function getClicks()
- {
- return $this->container['clicks'];
- }
-
- /**
- * Sets clicks
- *
- * @param \Brevo\Client\Model\AbTestVersionStats $clicks clicks
- *
- * @return $this
- */
- public function setClicks($clicks)
- {
- $this->container['clicks'] = $clicks;
-
- return $this;
- }
-
- /**
- * Gets unsubscribed
- *
- * @return \Brevo\Client\Model\AbTestVersionStats
- */
- public function getUnsubscribed()
- {
- return $this->container['unsubscribed'];
- }
-
- /**
- * Sets unsubscribed
- *
- * @param \Brevo\Client\Model\AbTestVersionStats $unsubscribed unsubscribed
- *
- * @return $this
- */
- public function setUnsubscribed($unsubscribed)
- {
- $this->container['unsubscribed'] = $unsubscribed;
-
- return $this;
- }
-
- /**
- * Gets hardBounces
- *
- * @return \Brevo\Client\Model\AbTestVersionStats
- */
- public function getHardBounces()
- {
- return $this->container['hardBounces'];
- }
-
- /**
- * Sets hardBounces
- *
- * @param \Brevo\Client\Model\AbTestVersionStats $hardBounces hardBounces
- *
- * @return $this
- */
- public function setHardBounces($hardBounces)
- {
- $this->container['hardBounces'] = $hardBounces;
-
- return $this;
- }
-
- /**
- * Gets softBounces
- *
- * @return \Brevo\Client\Model\AbTestVersionStats
- */
- public function getSoftBounces()
- {
- return $this->container['softBounces'];
- }
-
- /**
- * Sets softBounces
- *
- * @param \Brevo\Client\Model\AbTestVersionStats $softBounces softBounces
- *
- * @return $this
- */
- public function setSoftBounces($softBounces)
- {
- $this->container['softBounces'] = $softBounces;
-
- return $this;
- }
-
- /**
- * Gets complaints
- *
- * @return \Brevo\Client\Model\AbTestVersionStats
- */
- public function getComplaints()
- {
- return $this->container['complaints'];
- }
-
- /**
- * Sets complaints
- *
- * @param \Brevo\Client\Model\AbTestVersionStats $complaints complaints
- *
- * @return $this
- */
- public function setComplaints($complaints)
- {
- $this->container['complaints'] = $complaints;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/AbTestVersionClicks.php b/lib/Model/AbTestVersionClicks.php
deleted file mode 100644
index 451cb82..0000000
--- a/lib/Model/AbTestVersionClicks.php
+++ /dev/null
@@ -1,281 +0,0 @@
-listInvalidProperties()) === 0;
- }
-
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/AbTestVersionClicksInner.php b/lib/Model/AbTestVersionClicksInner.php
deleted file mode 100644
index f1ef63d..0000000
--- a/lib/Model/AbTestVersionClicksInner.php
+++ /dev/null
@@ -1,374 +0,0 @@
- 'string',
- 'clicksCount' => 'int',
- 'clickRate' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'link' => null,
- 'clicksCount' => 'int64',
- 'clickRate' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'link' => 'link',
- 'clicksCount' => 'clicksCount',
- 'clickRate' => 'clickRate'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'link' => 'setLink',
- 'clicksCount' => 'setClicksCount',
- 'clickRate' => 'setClickRate'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'link' => 'getLink',
- 'clicksCount' => 'getClicksCount',
- 'clickRate' => 'getClickRate'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['link'] = isset($data['link']) ? $data['link'] : null;
- $this->container['clicksCount'] = isset($data['clicksCount']) ? $data['clicksCount'] : null;
- $this->container['clickRate'] = isset($data['clickRate']) ? $data['clickRate'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['link'] === null) {
- $invalidProperties[] = "'link' can't be null";
- }
- if ($this->container['clicksCount'] === null) {
- $invalidProperties[] = "'clicksCount' can't be null";
- }
- if ($this->container['clickRate'] === null) {
- $invalidProperties[] = "'clickRate' 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 link
- *
- * @return string
- */
- public function getLink()
- {
- return $this->container['link'];
- }
-
- /**
- * Sets link
- *
- * @param string $link URL of the link
- *
- * @return $this
- */
- public function setLink($link)
- {
- $this->container['link'] = $link;
-
- return $this;
- }
-
- /**
- * Gets clicksCount
- *
- * @return int
- */
- public function getClicksCount()
- {
- return $this->container['clicksCount'];
- }
-
- /**
- * Sets clicksCount
- *
- * @param int $clicksCount Number of times a link is clicked
- *
- * @return $this
- */
- public function setClicksCount($clicksCount)
- {
- $this->container['clicksCount'] = $clicksCount;
-
- return $this;
- }
-
- /**
- * Gets clickRate
- *
- * @return string
- */
- public function getClickRate()
- {
- return $this->container['clickRate'];
- }
-
- /**
- * Sets clickRate
- *
- * @param string $clickRate Percentage of clicks of link with respect to total clicks
- *
- * @return $this
- */
- public function setClickRate($clickRate)
- {
- $this->container['clickRate'] = $clickRate;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/AbTestVersionStats.php b/lib/Model/AbTestVersionStats.php
deleted file mode 100644
index 7e93076..0000000
--- a/lib/Model/AbTestVersionStats.php
+++ /dev/null
@@ -1,342 +0,0 @@
- 'string',
- 'versionB' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'versionA' => null,
- 'versionB' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'versionA' => 'Version A',
- 'versionB' => 'Version B'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'versionA' => 'setVersionA',
- 'versionB' => 'setVersionB'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'versionA' => 'getVersionA',
- 'versionB' => 'getVersionB'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['versionA'] = isset($data['versionA']) ? $data['versionA'] : null;
- $this->container['versionB'] = isset($data['versionB']) ? $data['versionB'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['versionA'] === null) {
- $invalidProperties[] = "'versionA' can't be null";
- }
- if ($this->container['versionB'] === null) {
- $invalidProperties[] = "'versionB' 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 versionA
- *
- * @return string
- */
- public function getVersionA()
- {
- return $this->container['versionA'];
- }
-
- /**
- * Sets versionA
- *
- * @param string $versionA percentage of an event for version A
- *
- * @return $this
- */
- public function setVersionA($versionA)
- {
- $this->container['versionA'] = $versionA;
-
- return $this;
- }
-
- /**
- * Gets versionB
- *
- * @return string
- */
- public function getVersionB()
- {
- return $this->container['versionB'];
- }
-
- /**
- * Sets versionB
- *
- * @param string $versionB percentage of an event for version B
- *
- * @return $this
- */
- public function setVersionB($versionB)
- {
- $this->container['versionB'] = $versionB;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/AddChildDomain.php b/lib/Model/AddChildDomain.php
deleted file mode 100644
index a47f8cf..0000000
--- a/lib/Model/AddChildDomain.php
+++ /dev/null
@@ -1,305 +0,0 @@
- 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'domain' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'domain' => 'domain'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'domain' => 'setDomain'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'domain' => 'getDomain'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['domain'] = isset($data['domain']) ? $data['domain'] : null;
- }
-
- /**
- * 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 domain
- *
- * @return string
- */
- public function getDomain()
- {
- return $this->container['domain'];
- }
-
- /**
- * Sets domain
- *
- * @param string $domain Sender domain to add for a specific child account
- *
- * @return $this
- */
- public function setDomain($domain)
- {
- $this->container['domain'] = $domain;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/AddContactToList.php b/lib/Model/AddContactToList.php
deleted file mode 100644
index 5f52693..0000000
--- a/lib/Model/AddContactToList.php
+++ /dev/null
@@ -1,335 +0,0 @@
- 'string[]',
- 'ids' => 'int[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'emails' => 'email',
- 'ids' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'emails' => 'emails',
- 'ids' => 'ids'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'emails' => 'setEmails',
- 'ids' => 'setIds'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'emails' => 'getEmails',
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['emails'] = isset($data['emails']) ? $data['emails'] : null;
- $this->container['ids'] = isset($data['ids']) ? $data['ids'] : null;
- }
-
- /**
- * 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 emails
- *
- * @return string[]
- */
- public function getEmails()
- {
- return $this->container['emails'];
- }
-
- /**
- * Sets emails
- *
- * @param string[] $emails Mandatory if IDs are not passed, ignored otherwise. Emails to add to a list. You can pass a maximum of 150 emails for addition in one request. If you need to add the emails in bulk, please prefer /contacts/import api.
- *
- * @return $this
- */
- public function setEmails($emails)
- {
- $this->container['emails'] = $emails;
-
- return $this;
- }
-
- /**
- * Gets ids
- *
- * @return int[]
- */
- public function getIds()
- {
- return $this->container['ids'];
- }
-
- /**
- * Sets ids
- *
- * @param int[] $ids Mandatory if Emails are not passed, ignored otherwise. Emails to add to a list. You can pass a maximum of 150 emails for addition in one request. If you need to add the emails in bulk, please prefer /contacts/import api.
- *
- * @return $this
- */
- public function setIds($ids)
- {
- $this->container['ids'] = $ids;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/AddCredits.php b/lib/Model/AddCredits.php
deleted file mode 100644
index 6144e98..0000000
--- a/lib/Model/AddCredits.php
+++ /dev/null
@@ -1,335 +0,0 @@
- 'int',
- 'email' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'sms' => 'int64',
- 'email' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'sms' => 'sms',
- 'email' => 'email'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'sms' => 'setSms',
- 'email' => 'setEmail'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'sms' => 'getSms',
- 'email' => 'getEmail'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['sms'] = isset($data['sms']) ? $data['sms'] : null;
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- }
-
- /**
- * 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 sms
- *
- * @return int
- */
- public function getSms()
- {
- return $this->container['sms'];
- }
-
- /**
- * Sets sms
- *
- * @param int $sms Required if email credits are empty. SMS credits to be added to the child account
- *
- * @return $this
- */
- public function setSms($sms)
- {
- $this->container['sms'] = $sms;
-
- return $this;
- }
-
- /**
- * Gets email
- *
- * @return int
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param int $email Required if sms credits are empty. Email credits to be added to the child account
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/AuthenticateDomainModel.php b/lib/Model/AuthenticateDomainModel.php
deleted file mode 100644
index ad14e3e..0000000
--- a/lib/Model/AuthenticateDomainModel.php
+++ /dev/null
@@ -1,341 +0,0 @@
- 'string',
- 'message' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'domainName' => null,
- 'message' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'domainName' => 'domain_name',
- 'message' => 'message'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'domainName' => 'setDomainName',
- 'message' => 'setMessage'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'domainName' => 'getDomainName',
- 'message' => 'getMessage'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['domainName'] = isset($data['domainName']) ? $data['domainName'] : null;
- $this->container['message'] = isset($data['message']) ? $data['message'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['domainName'] === null) {
- $invalidProperties[] = "'domainName' can't be null";
- }
- if ($this->container['message'] === null) {
- $invalidProperties[] = "'message' 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 domainName
- *
- * @return string
- */
- public function getDomainName()
- {
- return $this->container['domainName'];
- }
-
- /**
- * Sets domainName
- *
- * @param string $domainName Domain
- *
- * @return $this
- */
- public function setDomainName($domainName)
- {
- $this->container['domainName'] = $domainName;
-
- return $this;
- }
-
- /**
- * Gets message
- *
- * @return string
- */
- public function getMessage()
- {
- return $this->container['message'];
- }
-
- /**
- * Sets message
- *
- * @param string $message Success message
- *
- * @return $this
- */
- public function setMessage($message)
- {
- $this->container['message'] = $message;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/BlockDomain.php b/lib/Model/BlockDomain.php
deleted file mode 100644
index 427488f..0000000
--- a/lib/Model/BlockDomain.php
+++ /dev/null
@@ -1,308 +0,0 @@
- 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'domain' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'domain' => 'domain'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'domain' => 'setDomain'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'domain' => 'getDomain'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['domain'] = isset($data['domain']) ? $data['domain'] : null;
- }
-
- /**
- * 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 name of the domain to be blocked
- *
- * @return $this
- */
- public function setDomain($domain)
- {
- $this->container['domain'] = $domain;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/Body.php b/lib/Model/Body.php
deleted file mode 100644
index 0ad0717..0000000
--- a/lib/Model/Body.php
+++ /dev/null
@@ -1,338 +0,0 @@
- 'string',
- 'subAccountIds' => 'int[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'groupName' => null,
- 'subAccountIds' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'groupName' => 'groupName',
- 'subAccountIds' => 'subAccountIds'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'groupName' => 'setGroupName',
- 'subAccountIds' => 'setSubAccountIds'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'groupName' => 'getGroupName',
- 'subAccountIds' => 'getSubAccountIds'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['groupName'] = isset($data['groupName']) ? $data['groupName'] : null;
- $this->container['subAccountIds'] = isset($data['subAccountIds']) ? $data['subAccountIds'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['groupName'] === null) {
- $invalidProperties[] = "'groupName' 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 groupName
- *
- * @return string
- */
- public function getGroupName()
- {
- return $this->container['groupName'];
- }
-
- /**
- * Sets groupName
- *
- * @param string $groupName The name of the group of sub-accounts
- *
- * @return $this
- */
- public function setGroupName($groupName)
- {
- $this->container['groupName'] = $groupName;
-
- return $this;
- }
-
- /**
- * Gets subAccountIds
- *
- * @return int[]
- */
- public function getSubAccountIds()
- {
- return $this->container['subAccountIds'];
- }
-
- /**
- * Sets subAccountIds
- *
- * @param int[] $subAccountIds Pass the list of sub-account Ids to be included in the group
- *
- * @return $this
- */
- public function setSubAccountIds($subAccountIds)
- {
- $this->container['subAccountIds'] = $subAccountIds;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/Body1.php b/lib/Model/Body1.php
deleted file mode 100644
index b1a9608..0000000
--- a/lib/Model/Body1.php
+++ /dev/null
@@ -1,338 +0,0 @@
- 'string',
- 'subAccountIds' => 'int[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'groupName' => null,
- 'subAccountIds' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'groupName' => 'groupName',
- 'subAccountIds' => 'subAccountIds'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'groupName' => 'setGroupName',
- 'subAccountIds' => 'setSubAccountIds'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'groupName' => 'getGroupName',
- 'subAccountIds' => 'getSubAccountIds'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['groupName'] = isset($data['groupName']) ? $data['groupName'] : null;
- $this->container['subAccountIds'] = isset($data['subAccountIds']) ? $data['subAccountIds'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['groupName'] === null) {
- $invalidProperties[] = "'groupName' 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 groupName
- *
- * @return string
- */
- public function getGroupName()
- {
- return $this->container['groupName'];
- }
-
- /**
- * Sets groupName
- *
- * @param string $groupName The name of the group of sub-accounts
- *
- * @return $this
- */
- public function setGroupName($groupName)
- {
- $this->container['groupName'] = $groupName;
-
- return $this;
- }
-
- /**
- * Gets subAccountIds
- *
- * @return int[]
- */
- public function getSubAccountIds()
- {
- return $this->container['subAccountIds'];
- }
-
- /**
- * Sets subAccountIds
- *
- * @param int[] $subAccountIds Pass the list of sub-account Ids to be included in the group
- *
- * @return $this
- */
- public function setSubAccountIds($subAccountIds)
- {
- $this->container['subAccountIds'] = $subAccountIds;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/Body10.php b/lib/Model/Body10.php
deleted file mode 100644
index 2e0f62f..0000000
--- a/lib/Model/Body10.php
+++ /dev/null
@@ -1,461 +0,0 @@
- 'string',
- 'text' => 'string',
- 'agentId' => 'string',
- 'receivedFrom' => 'string',
- 'agentEmail' => 'string',
- 'agentName' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'visitorId' => null,
- 'text' => null,
- 'agentId' => null,
- 'receivedFrom' => null,
- 'agentEmail' => 'email',
- 'agentName' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'visitorId' => 'visitorId',
- 'text' => 'text',
- 'agentId' => 'agentId',
- 'receivedFrom' => 'receivedFrom',
- 'agentEmail' => 'agentEmail',
- 'agentName' => 'agentName'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'visitorId' => 'setVisitorId',
- 'text' => 'setText',
- 'agentId' => 'setAgentId',
- 'receivedFrom' => 'setReceivedFrom',
- 'agentEmail' => 'setAgentEmail',
- 'agentName' => 'setAgentName'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'visitorId' => 'getVisitorId',
- 'text' => 'getText',
- 'agentId' => 'getAgentId',
- 'receivedFrom' => 'getReceivedFrom',
- 'agentEmail' => 'getAgentEmail',
- 'agentName' => 'getAgentName'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['visitorId'] = isset($data['visitorId']) ? $data['visitorId'] : null;
- $this->container['text'] = isset($data['text']) ? $data['text'] : null;
- $this->container['agentId'] = isset($data['agentId']) ? $data['agentId'] : null;
- $this->container['receivedFrom'] = isset($data['receivedFrom']) ? $data['receivedFrom'] : null;
- $this->container['agentEmail'] = isset($data['agentEmail']) ? $data['agentEmail'] : null;
- $this->container['agentName'] = isset($data['agentName']) ? $data['agentName'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['visitorId'] === null) {
- $invalidProperties[] = "'visitorId' can't be null";
- }
- if ($this->container['text'] === null) {
- $invalidProperties[] = "'text' 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 visitorId
- *
- * @return string
- */
- public function getVisitorId()
- {
- return $this->container['visitorId'];
- }
-
- /**
- * Sets visitorId
- *
- * @param string $visitorId visitor’s ID received from a webhook or generated by you to bind existing user account to Conversations
- *
- * @return $this
- */
- public function setVisitorId($visitorId)
- {
- $this->container['visitorId'] = $visitorId;
-
- return $this;
- }
-
- /**
- * Gets text
- *
- * @return string
- */
- public function getText()
- {
- return $this->container['text'];
- }
-
- /**
- * Sets text
- *
- * @param string $text message text
- *
- * @return $this
- */
- public function setText($text)
- {
- $this->container['text'] = $text;
-
- return $this;
- }
-
- /**
- * Gets agentId
- *
- * @return string
- */
- public function getAgentId()
- {
- return $this->container['agentId'];
- }
-
- /**
- * Sets agentId
- *
- * @param string $agentId agent ID. It can be found on agent’s page or received from a webhook. Alternatively, you can use `agentEmail` + `agentName` + `receivedFrom` instead (all 3 fields required).
- *
- * @return $this
- */
- public function setAgentId($agentId)
- {
- $this->container['agentId'] = $agentId;
-
- return $this;
- }
-
- /**
- * Gets receivedFrom
- *
- * @return string
- */
- public function getReceivedFrom()
- {
- return $this->container['receivedFrom'];
- }
-
- /**
- * Sets receivedFrom
- *
- * @param string $receivedFrom mark your messages to distinguish messages created by you from the others.
- *
- * @return $this
- */
- public function setReceivedFrom($receivedFrom)
- {
- $this->container['receivedFrom'] = $receivedFrom;
-
- return $this;
- }
-
- /**
- * Gets agentEmail
- *
- * @return string
- */
- public function getAgentEmail()
- {
- return $this->container['agentEmail'];
- }
-
- /**
- * Sets agentEmail
- *
- * @param string $agentEmail agent email. When sending messages from a standalone system, it’s hard to maintain a 1-to-1 relationship between the users of both systems. In this case, an agent can be specified by their email address.
- *
- * @return $this
- */
- public function setAgentEmail($agentEmail)
- {
- $this->container['agentEmail'] = $agentEmail;
-
- return $this;
- }
-
- /**
- * Gets agentName
- *
- * @return string
- */
- public function getAgentName()
- {
- return $this->container['agentName'];
- }
-
- /**
- * Sets agentName
- *
- * @param string $agentName agent name
- *
- * @return $this
- */
- public function setAgentName($agentName)
- {
- $this->container['agentName'] = $agentName;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/Body11.php b/lib/Model/Body11.php
deleted file mode 100644
index 0899cd0..0000000
--- a/lib/Model/Body11.php
+++ /dev/null
@@ -1,308 +0,0 @@
- 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'text' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'text' => 'text'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'text' => 'setText'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'text' => 'getText'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['text'] = isset($data['text']) ? $data['text'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['text'] === null) {
- $invalidProperties[] = "'text' 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 text
- *
- * @return string
- */
- public function getText()
- {
- return $this->container['text'];
- }
-
- /**
- * Sets text
- *
- * @param string $text edited message text
- *
- * @return $this
- */
- public function setText($text)
- {
- $this->container['text'] = $text;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/Body12.php b/lib/Model/Body12.php
deleted file mode 100644
index 8905dbf..0000000
--- a/lib/Model/Body12.php
+++ /dev/null
@@ -1,401 +0,0 @@
- 'string',
- 'text' => 'string',
- 'agentId' => 'string',
- 'groupId' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'visitorId' => null,
- 'text' => null,
- 'agentId' => null,
- 'groupId' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'visitorId' => 'visitorId',
- 'text' => 'text',
- 'agentId' => 'agentId',
- 'groupId' => 'groupId'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'visitorId' => 'setVisitorId',
- 'text' => 'setText',
- 'agentId' => 'setAgentId',
- 'groupId' => 'setGroupId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'visitorId' => 'getVisitorId',
- 'text' => 'getText',
- 'agentId' => 'getAgentId',
- 'groupId' => 'getGroupId'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['visitorId'] = isset($data['visitorId']) ? $data['visitorId'] : null;
- $this->container['text'] = isset($data['text']) ? $data['text'] : null;
- $this->container['agentId'] = isset($data['agentId']) ? $data['agentId'] : null;
- $this->container['groupId'] = isset($data['groupId']) ? $data['groupId'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['visitorId'] === null) {
- $invalidProperties[] = "'visitorId' can't be null";
- }
- if ($this->container['text'] === null) {
- $invalidProperties[] = "'text' 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 visitorId
- *
- * @return string
- */
- public function getVisitorId()
- {
- return $this->container['visitorId'];
- }
-
- /**
- * Sets visitorId
- *
- * @param string $visitorId visitor’s ID received from a webhook or generated by you to bind existing user account to Conversations
- *
- * @return $this
- */
- public function setVisitorId($visitorId)
- {
- $this->container['visitorId'] = $visitorId;
-
- return $this;
- }
-
- /**
- * Gets text
- *
- * @return string
- */
- public function getText()
- {
- return $this->container['text'];
- }
-
- /**
- * Sets text
- *
- * @param string $text message text
- *
- * @return $this
- */
- public function setText($text)
- {
- $this->container['text'] = $text;
-
- return $this;
- }
-
- /**
- * Gets agentId
- *
- * @return string
- */
- public function getAgentId()
- {
- return $this->container['agentId'];
- }
-
- /**
- * Sets agentId
- *
- * @param string $agentId agent ID. It can be found on agent’s page or received from a webhook. Optional if `groupId` is set.
- *
- * @return $this
- */
- public function setAgentId($agentId)
- {
- $this->container['agentId'] = $agentId;
-
- return $this;
- }
-
- /**
- * Gets groupId
- *
- * @return string
- */
- public function getGroupId()
- {
- return $this->container['groupId'];
- }
-
- /**
- * Sets groupId
- *
- * @param string $groupId group ID. It can be found on group’s page. Optional if `agentId` is set.
- *
- * @return $this
- */
- public function setGroupId($groupId)
- {
- $this->container['groupId'] = $groupId;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/Body13.php b/lib/Model/Body13.php
deleted file mode 100644
index 7a8f8d4..0000000
--- a/lib/Model/Body13.php
+++ /dev/null
@@ -1,308 +0,0 @@
- 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'text' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'text' => 'text'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'text' => 'setText'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'text' => 'getText'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['text'] = isset($data['text']) ? $data['text'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['text'] === null) {
- $invalidProperties[] = "'text' 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 text
- *
- * @return string
- */
- public function getText()
- {
- return $this->container['text'];
- }
-
- /**
- * Sets text
- *
- * @param string $text edited message text
- *
- * @return $this
- */
- public function setText($text)
- {
- $this->container['text'] = $text;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/Body14.php b/lib/Model/Body14.php
deleted file mode 100644
index 9ec924d..0000000
--- a/lib/Model/Body14.php
+++ /dev/null
@@ -1,395 +0,0 @@
- 'string',
- 'receivedFrom' => 'string',
- 'agentEmail' => 'string',
- 'agentName' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'agentId' => null,
- 'receivedFrom' => null,
- 'agentEmail' => 'email',
- 'agentName' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'agentId' => 'agentId',
- 'receivedFrom' => 'receivedFrom',
- 'agentEmail' => 'agentEmail',
- 'agentName' => 'agentName'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'agentId' => 'setAgentId',
- 'receivedFrom' => 'setReceivedFrom',
- 'agentEmail' => 'setAgentEmail',
- 'agentName' => 'setAgentName'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'agentId' => 'getAgentId',
- 'receivedFrom' => 'getReceivedFrom',
- 'agentEmail' => 'getAgentEmail',
- 'agentName' => 'getAgentName'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['agentId'] = isset($data['agentId']) ? $data['agentId'] : null;
- $this->container['receivedFrom'] = isset($data['receivedFrom']) ? $data['receivedFrom'] : null;
- $this->container['agentEmail'] = isset($data['agentEmail']) ? $data['agentEmail'] : null;
- $this->container['agentName'] = isset($data['agentName']) ? $data['agentName'] : null;
- }
-
- /**
- * 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 agentId
- *
- * @return string
- */
- public function getAgentId()
- {
- return $this->container['agentId'];
- }
-
- /**
- * Sets agentId
- *
- * @param string $agentId agent ID. It can be found on agent’s page or received from a webhook. Alternatively, you can use `agentEmail` + `agentName` + `receivedFrom` instead (all 3 fields required).
- *
- * @return $this
- */
- public function setAgentId($agentId)
- {
- $this->container['agentId'] = $agentId;
-
- return $this;
- }
-
- /**
- * Gets receivedFrom
- *
- * @return string
- */
- public function getReceivedFrom()
- {
- return $this->container['receivedFrom'];
- }
-
- /**
- * Sets receivedFrom
- *
- * @param string $receivedFrom mark your messages to distinguish messages created by you from the others.
- *
- * @return $this
- */
- public function setReceivedFrom($receivedFrom)
- {
- $this->container['receivedFrom'] = $receivedFrom;
-
- return $this;
- }
-
- /**
- * Gets agentEmail
- *
- * @return string
- */
- public function getAgentEmail()
- {
- return $this->container['agentEmail'];
- }
-
- /**
- * Sets agentEmail
- *
- * @param string $agentEmail agent email. When sending online pings from a standalone system, it’s hard to maintain a 1-to-1 relationship between the users of both systems. In this case, an agent can be specified by their email address. If there’s no agent with the specified email address in your Brevo organization, a dummy agent will be created automatically.
- *
- * @return $this
- */
- public function setAgentEmail($agentEmail)
- {
- $this->container['agentEmail'] = $agentEmail;
-
- return $this;
- }
-
- /**
- * Gets agentName
- *
- * @return string
- */
- public function getAgentName()
- {
- return $this->container['agentName'];
- }
-
- /**
- * Sets agentName
- *
- * @param string $agentName agent name.
- *
- * @return $this
- */
- public function setAgentName($agentName)
- {
- $this->container['agentName'] = $agentName;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/Body2.php b/lib/Model/Body2.php
deleted file mode 100644
index f65c38f..0000000
--- a/lib/Model/Body2.php
+++ /dev/null
@@ -1,368 +0,0 @@
- 'string',
- 'attributes' => 'object',
- 'countryCode' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'attributes' => null,
- 'countryCode' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'attributes' => 'attributes',
- 'countryCode' => 'countryCode'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'attributes' => 'setAttributes',
- 'countryCode' => 'setCountryCode'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'attributes' => 'getAttributes',
- 'countryCode' => 'getCountryCode'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null;
- $this->container['countryCode'] = isset($data['countryCode']) ? $data['countryCode'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['name'] === null) {
- $invalidProperties[] = "'name' 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of company
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets attributes
- *
- * @return object
- */
- public function getAttributes()
- {
- return $this->container['attributes'];
- }
-
- /**
- * Sets attributes
- *
- * @param object $attributes Attributes for company creation
- *
- * @return $this
- */
- public function setAttributes($attributes)
- {
- $this->container['attributes'] = $attributes;
-
- return $this;
- }
-
- /**
- * Gets countryCode
- *
- * @return int
- */
- public function getCountryCode()
- {
- return $this->container['countryCode'];
- }
-
- /**
- * Sets countryCode
- *
- * @param int $countryCode Country code if phone_number is passed in attributes.
- *
- * @return $this
- */
- public function setCountryCode($countryCode)
- {
- $this->container['countryCode'] = $countryCode;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/Body3.php b/lib/Model/Body3.php
deleted file mode 100644
index fc74d91..0000000
--- a/lib/Model/Body3.php
+++ /dev/null
@@ -1,365 +0,0 @@
- 'string',
- 'attributes' => 'object',
- 'countryCode' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'attributes' => null,
- 'countryCode' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'attributes' => 'attributes',
- 'countryCode' => 'countryCode'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'attributes' => 'setAttributes',
- 'countryCode' => 'setCountryCode'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'attributes' => 'getAttributes',
- 'countryCode' => 'getCountryCode'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null;
- $this->container['countryCode'] = isset($data['countryCode']) ? $data['countryCode'] : null;
- }
-
- /**
- * 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of company
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets attributes
- *
- * @return object
- */
- public function getAttributes()
- {
- return $this->container['attributes'];
- }
-
- /**
- * Sets attributes
- *
- * @param object $attributes Attributes for company update
- *
- * @return $this
- */
- public function setAttributes($attributes)
- {
- $this->container['attributes'] = $attributes;
-
- return $this;
- }
-
- /**
- * Gets countryCode
- *
- * @return int
- */
- public function getCountryCode()
- {
- return $this->container['countryCode'];
- }
-
- /**
- * Sets countryCode
- *
- * @param int $countryCode Country code if phone_number is passed in attributes.
- *
- * @return $this
- */
- public function setCountryCode($countryCode)
- {
- $this->container['countryCode'] = $countryCode;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/Body4.php b/lib/Model/Body4.php
deleted file mode 100644
index 70e5320..0000000
--- a/lib/Model/Body4.php
+++ /dev/null
@@ -1,395 +0,0 @@
- 'int[]',
- 'unlinkContactIds' => 'int[]',
- 'linkDealsIds' => 'string[]',
- 'unlinkDealsIds' => 'string[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'linkContactIds' => 'int64',
- 'unlinkContactIds' => 'int64',
- 'linkDealsIds' => null,
- 'unlinkDealsIds' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'linkContactIds' => 'linkContactIds',
- 'unlinkContactIds' => 'unlinkContactIds',
- 'linkDealsIds' => 'linkDealsIds',
- 'unlinkDealsIds' => 'unlinkDealsIds'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'linkContactIds' => 'setLinkContactIds',
- 'unlinkContactIds' => 'setUnlinkContactIds',
- 'linkDealsIds' => 'setLinkDealsIds',
- 'unlinkDealsIds' => 'setUnlinkDealsIds'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'linkContactIds' => 'getLinkContactIds',
- 'unlinkContactIds' => 'getUnlinkContactIds',
- 'linkDealsIds' => 'getLinkDealsIds',
- 'unlinkDealsIds' => 'getUnlinkDealsIds'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['linkContactIds'] = isset($data['linkContactIds']) ? $data['linkContactIds'] : null;
- $this->container['unlinkContactIds'] = isset($data['unlinkContactIds']) ? $data['unlinkContactIds'] : null;
- $this->container['linkDealsIds'] = isset($data['linkDealsIds']) ? $data['linkDealsIds'] : null;
- $this->container['unlinkDealsIds'] = isset($data['unlinkDealsIds']) ? $data['unlinkDealsIds'] : null;
- }
-
- /**
- * 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 linkContactIds
- *
- * @return int[]
- */
- public function getLinkContactIds()
- {
- return $this->container['linkContactIds'];
- }
-
- /**
- * Sets linkContactIds
- *
- * @param int[] $linkContactIds Contact ids for contacts to be linked with company
- *
- * @return $this
- */
- public function setLinkContactIds($linkContactIds)
- {
- $this->container['linkContactIds'] = $linkContactIds;
-
- return $this;
- }
-
- /**
- * Gets unlinkContactIds
- *
- * @return int[]
- */
- public function getUnlinkContactIds()
- {
- return $this->container['unlinkContactIds'];
- }
-
- /**
- * Sets unlinkContactIds
- *
- * @param int[] $unlinkContactIds Contact ids for contacts to be unlinked from company
- *
- * @return $this
- */
- public function setUnlinkContactIds($unlinkContactIds)
- {
- $this->container['unlinkContactIds'] = $unlinkContactIds;
-
- return $this;
- }
-
- /**
- * Gets linkDealsIds
- *
- * @return string[]
- */
- public function getLinkDealsIds()
- {
- return $this->container['linkDealsIds'];
- }
-
- /**
- * Sets linkDealsIds
- *
- * @param string[] $linkDealsIds Deals ids for deals to be linked with company
- *
- * @return $this
- */
- public function setLinkDealsIds($linkDealsIds)
- {
- $this->container['linkDealsIds'] = $linkDealsIds;
-
- return $this;
- }
-
- /**
- * Gets unlinkDealsIds
- *
- * @return string[]
- */
- public function getUnlinkDealsIds()
- {
- return $this->container['unlinkDealsIds'];
- }
-
- /**
- * Sets unlinkDealsIds
- *
- * @param string[] $unlinkDealsIds Deals ids for deals to be unlinked from company
- *
- * @return $this
- */
- public function setUnlinkDealsIds($unlinkDealsIds)
- {
- $this->container['unlinkDealsIds'] = $unlinkDealsIds;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/Body5.php b/lib/Model/Body5.php
deleted file mode 100644
index d87bba6..0000000
--- a/lib/Model/Body5.php
+++ /dev/null
@@ -1,338 +0,0 @@
- 'string',
- 'attributes' => 'object'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'attributes' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'attributes' => 'attributes'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'attributes' => 'setAttributes'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'attributes' => 'getAttributes'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['name'] === null) {
- $invalidProperties[] = "'name' 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of deal
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets attributes
- *
- * @return object
- */
- public function getAttributes()
- {
- return $this->container['attributes'];
- }
-
- /**
- * Sets attributes
- *
- * @param object $attributes Attributes for deal creation If you want to create a deal on a specific pipeline and stage you can use the following attributes `pipeline` and `deal_stage`. Pipeline and deal_stage are ids you can fetch using this endpoint `/crm/pipeline/details/{pipelineID}`
- *
- * @return $this
- */
- public function setAttributes($attributes)
- {
- $this->container['attributes'] = $attributes;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/Body6.php b/lib/Model/Body6.php
deleted file mode 100644
index 4175c72..0000000
--- a/lib/Model/Body6.php
+++ /dev/null
@@ -1,335 +0,0 @@
- 'string',
- 'attributes' => 'object'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'attributes' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'attributes' => 'attributes'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'attributes' => 'setAttributes'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'attributes' => 'getAttributes'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null;
- }
-
- /**
- * 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of deal
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets attributes
- *
- * @return object
- */
- public function getAttributes()
- {
- return $this->container['attributes'];
- }
-
- /**
- * Sets attributes
- *
- * @param object $attributes Attributes for deal update If you wish to update the pipeline of a deal you need to provide the `pipeline` and the `deal_stage`. Pipeline and deal_stage are ids you can fetch using this endpoint `/crm/pipeline/details/{pipelineID}`
- *
- * @return $this
- */
- public function setAttributes($attributes)
- {
- $this->container['attributes'] = $attributes;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/Body7.php b/lib/Model/Body7.php
deleted file mode 100644
index 30616fc..0000000
--- a/lib/Model/Body7.php
+++ /dev/null
@@ -1,395 +0,0 @@
- 'int[]',
- 'unlinkContactIds' => 'int[]',
- 'linkCompanyIds' => 'string[]',
- 'unlinkCompanyIds' => 'string[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'linkContactIds' => 'int64',
- 'unlinkContactIds' => 'int64',
- 'linkCompanyIds' => null,
- 'unlinkCompanyIds' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'linkContactIds' => 'linkContactIds',
- 'unlinkContactIds' => 'unlinkContactIds',
- 'linkCompanyIds' => 'linkCompanyIds',
- 'unlinkCompanyIds' => 'unlinkCompanyIds'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'linkContactIds' => 'setLinkContactIds',
- 'unlinkContactIds' => 'setUnlinkContactIds',
- 'linkCompanyIds' => 'setLinkCompanyIds',
- 'unlinkCompanyIds' => 'setUnlinkCompanyIds'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'linkContactIds' => 'getLinkContactIds',
- 'unlinkContactIds' => 'getUnlinkContactIds',
- 'linkCompanyIds' => 'getLinkCompanyIds',
- 'unlinkCompanyIds' => 'getUnlinkCompanyIds'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['linkContactIds'] = isset($data['linkContactIds']) ? $data['linkContactIds'] : null;
- $this->container['unlinkContactIds'] = isset($data['unlinkContactIds']) ? $data['unlinkContactIds'] : null;
- $this->container['linkCompanyIds'] = isset($data['linkCompanyIds']) ? $data['linkCompanyIds'] : null;
- $this->container['unlinkCompanyIds'] = isset($data['unlinkCompanyIds']) ? $data['unlinkCompanyIds'] : null;
- }
-
- /**
- * 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 linkContactIds
- *
- * @return int[]
- */
- public function getLinkContactIds()
- {
- return $this->container['linkContactIds'];
- }
-
- /**
- * Sets linkContactIds
- *
- * @param int[] $linkContactIds Contact ids for contacts to be linked with deal
- *
- * @return $this
- */
- public function setLinkContactIds($linkContactIds)
- {
- $this->container['linkContactIds'] = $linkContactIds;
-
- return $this;
- }
-
- /**
- * Gets unlinkContactIds
- *
- * @return int[]
- */
- public function getUnlinkContactIds()
- {
- return $this->container['unlinkContactIds'];
- }
-
- /**
- * Sets unlinkContactIds
- *
- * @param int[] $unlinkContactIds Contact ids for contacts to be unlinked from deal
- *
- * @return $this
- */
- public function setUnlinkContactIds($unlinkContactIds)
- {
- $this->container['unlinkContactIds'] = $unlinkContactIds;
-
- return $this;
- }
-
- /**
- * Gets linkCompanyIds
- *
- * @return string[]
- */
- public function getLinkCompanyIds()
- {
- return $this->container['linkCompanyIds'];
- }
-
- /**
- * Sets linkCompanyIds
- *
- * @param string[] $linkCompanyIds Company ids to be linked with deal
- *
- * @return $this
- */
- public function setLinkCompanyIds($linkCompanyIds)
- {
- $this->container['linkCompanyIds'] = $linkCompanyIds;
-
- return $this;
- }
-
- /**
- * Gets unlinkCompanyIds
- *
- * @return string[]
- */
- public function getUnlinkCompanyIds()
- {
- return $this->container['unlinkCompanyIds'];
- }
-
- /**
- * Sets unlinkCompanyIds
- *
- * @param string[] $unlinkCompanyIds Company ids to be unlinked from deal
- *
- * @return $this
- */
- public function setUnlinkCompanyIds($unlinkCompanyIds)
- {
- $this->container['unlinkCompanyIds'] = $unlinkCompanyIds;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/Body8.php b/lib/Model/Body8.php
deleted file mode 100644
index c4abdf7..0000000
--- a/lib/Model/Body8.php
+++ /dev/null
@@ -1,623 +0,0 @@
- 'string',
- 'duration' => 'int',
- 'taskTypeId' => 'string',
- 'date' => '\DateTime',
- 'notes' => 'string',
- 'done' => 'bool',
- 'assignToId' => 'string',
- 'contactsIds' => 'int[]',
- 'dealsIds' => 'string[]',
- 'companiesIds' => 'string[]',
- 'reminder' => '\Brevo\Client\Model\TaskReminder'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'duration' => 'int64',
- 'taskTypeId' => null,
- 'date' => 'date-time',
- 'notes' => null,
- 'done' => null,
- 'assignToId' => null,
- 'contactsIds' => null,
- 'dealsIds' => null,
- 'companiesIds' => null,
- 'reminder' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'duration' => 'duration',
- 'taskTypeId' => 'taskTypeId',
- 'date' => 'date',
- 'notes' => 'notes',
- 'done' => 'done',
- 'assignToId' => 'assignToId',
- 'contactsIds' => 'contactsIds',
- 'dealsIds' => 'dealsIds',
- 'companiesIds' => 'companiesIds',
- 'reminder' => 'reminder'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'duration' => 'setDuration',
- 'taskTypeId' => 'setTaskTypeId',
- 'date' => 'setDate',
- 'notes' => 'setNotes',
- 'done' => 'setDone',
- 'assignToId' => 'setAssignToId',
- 'contactsIds' => 'setContactsIds',
- 'dealsIds' => 'setDealsIds',
- 'companiesIds' => 'setCompaniesIds',
- 'reminder' => 'setReminder'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'duration' => 'getDuration',
- 'taskTypeId' => 'getTaskTypeId',
- 'date' => 'getDate',
- 'notes' => 'getNotes',
- 'done' => 'getDone',
- 'assignToId' => 'getAssignToId',
- 'contactsIds' => 'getContactsIds',
- 'dealsIds' => 'getDealsIds',
- 'companiesIds' => 'getCompaniesIds',
- 'reminder' => 'getReminder'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['duration'] = isset($data['duration']) ? $data['duration'] : null;
- $this->container['taskTypeId'] = isset($data['taskTypeId']) ? $data['taskTypeId'] : null;
- $this->container['date'] = isset($data['date']) ? $data['date'] : null;
- $this->container['notes'] = isset($data['notes']) ? $data['notes'] : null;
- $this->container['done'] = isset($data['done']) ? $data['done'] : null;
- $this->container['assignToId'] = isset($data['assignToId']) ? $data['assignToId'] : null;
- $this->container['contactsIds'] = isset($data['contactsIds']) ? $data['contactsIds'] : null;
- $this->container['dealsIds'] = isset($data['dealsIds']) ? $data['dealsIds'] : null;
- $this->container['companiesIds'] = isset($data['companiesIds']) ? $data['companiesIds'] : null;
- $this->container['reminder'] = isset($data['reminder']) ? $data['reminder'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['name'] === null) {
- $invalidProperties[] = "'name' can't be null";
- }
- if (!is_null($this->container['duration']) && ($this->container['duration'] < 0)) {
- $invalidProperties[] = "invalid value for 'duration', must be bigger than or equal to 0.";
- }
-
- if ($this->container['taskTypeId'] === null) {
- $invalidProperties[] = "'taskTypeId' can't be null";
- }
- if ($this->container['date'] === null) {
- $invalidProperties[] = "'date' 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of task
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets duration
- *
- * @return int
- */
- public function getDuration()
- {
- return $this->container['duration'];
- }
-
- /**
- * Sets duration
- *
- * @param int $duration Duration of task in milliseconds [1 minute = 60000 ms]
- *
- * @return $this
- */
- public function setDuration($duration)
- {
-
- if (!is_null($duration) && ($duration < 0)) {
- throw new \InvalidArgumentException('invalid value for $duration when calling Body8., must be bigger than or equal to 0.');
- }
-
- $this->container['duration'] = $duration;
-
- return $this;
- }
-
- /**
- * Gets taskTypeId
- *
- * @return string
- */
- public function getTaskTypeId()
- {
- return $this->container['taskTypeId'];
- }
-
- /**
- * Sets taskTypeId
- *
- * @param string $taskTypeId Id for type of task e.g Call / Email / Meeting etc.
- *
- * @return $this
- */
- public function setTaskTypeId($taskTypeId)
- {
- $this->container['taskTypeId'] = $taskTypeId;
-
- return $this;
- }
-
- /**
- * Gets date
- *
- * @return \DateTime
- */
- public function getDate()
- {
- return $this->container['date'];
- }
-
- /**
- * Sets date
- *
- * @param \DateTime $date Task due date and time
- *
- * @return $this
- */
- public function setDate($date)
- {
- $this->container['date'] = $date;
-
- return $this;
- }
-
- /**
- * Gets notes
- *
- * @return string
- */
- public function getNotes()
- {
- return $this->container['notes'];
- }
-
- /**
- * Sets notes
- *
- * @param string $notes Notes added to a task
- *
- * @return $this
- */
- public function setNotes($notes)
- {
- $this->container['notes'] = $notes;
-
- return $this;
- }
-
- /**
- * Gets done
- *
- * @return bool
- */
- public function getDone()
- {
- return $this->container['done'];
- }
-
- /**
- * Sets done
- *
- * @param bool $done Task marked as done
- *
- * @return $this
- */
- public function setDone($done)
- {
- $this->container['done'] = $done;
-
- return $this;
- }
-
- /**
- * Gets assignToId
- *
- * @return string
- */
- public function getAssignToId()
- {
- return $this->container['assignToId'];
- }
-
- /**
- * Sets assignToId
- *
- * @param string $assignToId User id to whom task is assigned
- *
- * @return $this
- */
- public function setAssignToId($assignToId)
- {
- $this->container['assignToId'] = $assignToId;
-
- return $this;
- }
-
- /**
- * Gets contactsIds
- *
- * @return int[]
- */
- public function getContactsIds()
- {
- return $this->container['contactsIds'];
- }
-
- /**
- * Sets contactsIds
- *
- * @param int[] $contactsIds Contact ids for contacts linked to this task
- *
- * @return $this
- */
- public function setContactsIds($contactsIds)
- {
- $this->container['contactsIds'] = $contactsIds;
-
- return $this;
- }
-
- /**
- * Gets dealsIds
- *
- * @return string[]
- */
- public function getDealsIds()
- {
- return $this->container['dealsIds'];
- }
-
- /**
- * Sets dealsIds
- *
- * @param string[] $dealsIds Deal ids for deals a task is linked to
- *
- * @return $this
- */
- public function setDealsIds($dealsIds)
- {
- $this->container['dealsIds'] = $dealsIds;
-
- return $this;
- }
-
- /**
- * Gets companiesIds
- *
- * @return string[]
- */
- public function getCompaniesIds()
- {
- return $this->container['companiesIds'];
- }
-
- /**
- * Sets companiesIds
- *
- * @param string[] $companiesIds Companies ids for companies a task is linked to
- *
- * @return $this
- */
- public function setCompaniesIds($companiesIds)
- {
- $this->container['companiesIds'] = $companiesIds;
-
- return $this;
- }
-
- /**
- * Gets reminder
- *
- * @return \Brevo\Client\Model\TaskReminder
- */
- public function getReminder()
- {
- return $this->container['reminder'];
- }
-
- /**
- * Sets reminder
- *
- * @param \Brevo\Client\Model\TaskReminder $reminder reminder
- *
- * @return $this
- */
- public function setReminder($reminder)
- {
- $this->container['reminder'] = $reminder;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/Body9.php b/lib/Model/Body9.php
deleted file mode 100644
index 6f12e43..0000000
--- a/lib/Model/Body9.php
+++ /dev/null
@@ -1,575 +0,0 @@
- 'string',
- 'duration' => 'int',
- 'taskTypeId' => 'string',
- 'date' => '\DateTime',
- 'notes' => 'string',
- 'done' => 'bool',
- 'assignToId' => 'string',
- 'contactsIds' => 'int[]',
- 'dealsIds' => 'string[]',
- 'companiesIds' => 'string[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'duration' => null,
- 'taskTypeId' => null,
- 'date' => 'date-time',
- 'notes' => null,
- 'done' => null,
- 'assignToId' => null,
- 'contactsIds' => null,
- 'dealsIds' => null,
- 'companiesIds' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'duration' => 'duration',
- 'taskTypeId' => 'taskTypeId',
- 'date' => 'date',
- 'notes' => 'notes',
- 'done' => 'done',
- 'assignToId' => 'assignToId',
- 'contactsIds' => 'contactsIds',
- 'dealsIds' => 'dealsIds',
- 'companiesIds' => 'companiesIds'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'duration' => 'setDuration',
- 'taskTypeId' => 'setTaskTypeId',
- 'date' => 'setDate',
- 'notes' => 'setNotes',
- 'done' => 'setDone',
- 'assignToId' => 'setAssignToId',
- 'contactsIds' => 'setContactsIds',
- 'dealsIds' => 'setDealsIds',
- 'companiesIds' => 'setCompaniesIds'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'duration' => 'getDuration',
- 'taskTypeId' => 'getTaskTypeId',
- 'date' => 'getDate',
- 'notes' => 'getNotes',
- 'done' => 'getDone',
- 'assignToId' => 'getAssignToId',
- 'contactsIds' => 'getContactsIds',
- 'dealsIds' => 'getDealsIds',
- 'companiesIds' => 'getCompaniesIds'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['duration'] = isset($data['duration']) ? $data['duration'] : null;
- $this->container['taskTypeId'] = isset($data['taskTypeId']) ? $data['taskTypeId'] : null;
- $this->container['date'] = isset($data['date']) ? $data['date'] : null;
- $this->container['notes'] = isset($data['notes']) ? $data['notes'] : null;
- $this->container['done'] = isset($data['done']) ? $data['done'] : null;
- $this->container['assignToId'] = isset($data['assignToId']) ? $data['assignToId'] : null;
- $this->container['contactsIds'] = isset($data['contactsIds']) ? $data['contactsIds'] : null;
- $this->container['dealsIds'] = isset($data['dealsIds']) ? $data['dealsIds'] : null;
- $this->container['companiesIds'] = isset($data['companiesIds']) ? $data['companiesIds'] : null;
- }
-
- /**
- * 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of task
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets duration
- *
- * @return int
- */
- public function getDuration()
- {
- return $this->container['duration'];
- }
-
- /**
- * Sets duration
- *
- * @param int $duration Duration of task in milliseconds [1 minute = 60000 ms]
- *
- * @return $this
- */
- public function setDuration($duration)
- {
- $this->container['duration'] = $duration;
-
- return $this;
- }
-
- /**
- * Gets taskTypeId
- *
- * @return string
- */
- public function getTaskTypeId()
- {
- return $this->container['taskTypeId'];
- }
-
- /**
- * Sets taskTypeId
- *
- * @param string $taskTypeId Id for type of task e.g Call / Email / Meeting etc.
- *
- * @return $this
- */
- public function setTaskTypeId($taskTypeId)
- {
- $this->container['taskTypeId'] = $taskTypeId;
-
- return $this;
- }
-
- /**
- * Gets date
- *
- * @return \DateTime
- */
- public function getDate()
- {
- return $this->container['date'];
- }
-
- /**
- * Sets date
- *
- * @param \DateTime $date Task date/time
- *
- * @return $this
- */
- public function setDate($date)
- {
- $this->container['date'] = $date;
-
- return $this;
- }
-
- /**
- * Gets notes
- *
- * @return string
- */
- public function getNotes()
- {
- return $this->container['notes'];
- }
-
- /**
- * Sets notes
- *
- * @param string $notes Notes added to a task
- *
- * @return $this
- */
- public function setNotes($notes)
- {
- $this->container['notes'] = $notes;
-
- return $this;
- }
-
- /**
- * Gets done
- *
- * @return bool
- */
- public function getDone()
- {
- return $this->container['done'];
- }
-
- /**
- * Sets done
- *
- * @param bool $done Task marked as done
- *
- * @return $this
- */
- public function setDone($done)
- {
- $this->container['done'] = $done;
-
- return $this;
- }
-
- /**
- * Gets assignToId
- *
- * @return string
- */
- public function getAssignToId()
- {
- return $this->container['assignToId'];
- }
-
- /**
- * Sets assignToId
- *
- * @param string $assignToId User id to whom task is assigned
- *
- * @return $this
- */
- public function setAssignToId($assignToId)
- {
- $this->container['assignToId'] = $assignToId;
-
- return $this;
- }
-
- /**
- * Gets contactsIds
- *
- * @return int[]
- */
- public function getContactsIds()
- {
- return $this->container['contactsIds'];
- }
-
- /**
- * Sets contactsIds
- *
- * @param int[] $contactsIds Contact ids for contacts linked to this task
- *
- * @return $this
- */
- public function setContactsIds($contactsIds)
- {
- $this->container['contactsIds'] = $contactsIds;
-
- return $this;
- }
-
- /**
- * Gets dealsIds
- *
- * @return string[]
- */
- public function getDealsIds()
- {
- return $this->container['dealsIds'];
- }
-
- /**
- * Sets dealsIds
- *
- * @param string[] $dealsIds Deal ids for deals a task is linked to
- *
- * @return $this
- */
- public function setDealsIds($dealsIds)
- {
- $this->container['dealsIds'] = $dealsIds;
-
- return $this;
- }
-
- /**
- * Gets companiesIds
- *
- * @return string[]
- */
- public function getCompaniesIds()
- {
- return $this->container['companiesIds'];
- }
-
- /**
- * Sets companiesIds
- *
- * @param string[] $companiesIds Companies ids for companies a task is linked to
- *
- * @return $this
- */
- public function setCompaniesIds($companiesIds)
- {
- $this->container['companiesIds'] = $companiesIds;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/BodyVariablesItems.php b/lib/Model/BodyVariablesItems.php
deleted file mode 100644
index f5fa31c..0000000
--- a/lib/Model/BodyVariablesItems.php
+++ /dev/null
@@ -1,280 +0,0 @@
-listInvalidProperties()) === 0;
- }
-
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CompaniesList.php b/lib/Model/CompaniesList.php
deleted file mode 100644
index f263577..0000000
--- a/lib/Model/CompaniesList.php
+++ /dev/null
@@ -1,306 +0,0 @@
- '\Brevo\Client\Model\Company[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'items' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'items' => 'items'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'items' => 'setItems'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'items' => 'getItems'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['items'] = isset($data['items']) ? $data['items'] : null;
- }
-
- /**
- * 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 items
- *
- * @return \Brevo\Client\Model\Company[]
- */
- public function getItems()
- {
- return $this->container['items'];
- }
-
- /**
- * Sets items
- *
- * @param \Brevo\Client\Model\Company[] $items List of compaies
- *
- * @return $this
- */
- public function setItems($items)
- {
- $this->container['items'] = $items;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/Company.php b/lib/Model/Company.php
deleted file mode 100644
index f0a5b0c..0000000
--- a/lib/Model/Company.php
+++ /dev/null
@@ -1,396 +0,0 @@
- 'string',
- 'attributes' => 'object',
- 'linkedContactsIds' => 'int[]',
- 'linkedDealsIds' => 'string[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => null,
- 'attributes' => null,
- 'linkedContactsIds' => null,
- 'linkedDealsIds' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'attributes' => 'attributes',
- 'linkedContactsIds' => 'linkedContactsIds',
- 'linkedDealsIds' => 'linkedDealsIds'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'attributes' => 'setAttributes',
- 'linkedContactsIds' => 'setLinkedContactsIds',
- 'linkedDealsIds' => 'setLinkedDealsIds'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'attributes' => 'getAttributes',
- 'linkedContactsIds' => 'getLinkedContactsIds',
- 'linkedDealsIds' => 'getLinkedDealsIds'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null;
- $this->container['linkedContactsIds'] = isset($data['linkedContactsIds']) ? $data['linkedContactsIds'] : null;
- $this->container['linkedDealsIds'] = isset($data['linkedDealsIds']) ? $data['linkedDealsIds'] : null;
- }
-
- /**
- * 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 id
- *
- * @return string
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param string $id Unique company id
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets attributes
- *
- * @return object
- */
- public function getAttributes()
- {
- return $this->container['attributes'];
- }
-
- /**
- * Sets attributes
- *
- * @param object $attributes Company attributes with values
- *
- * @return $this
- */
- public function setAttributes($attributes)
- {
- $this->container['attributes'] = $attributes;
-
- return $this;
- }
-
- /**
- * Gets linkedContactsIds
- *
- * @return int[]
- */
- public function getLinkedContactsIds()
- {
- return $this->container['linkedContactsIds'];
- }
-
- /**
- * Sets linkedContactsIds
- *
- * @param int[] $linkedContactsIds Contact ids for contacts linked to this company
- *
- * @return $this
- */
- public function setLinkedContactsIds($linkedContactsIds)
- {
- $this->container['linkedContactsIds'] = $linkedContactsIds;
-
- return $this;
- }
-
- /**
- * Gets linkedDealsIds
- *
- * @return string[]
- */
- public function getLinkedDealsIds()
- {
- return $this->container['linkedDealsIds'];
- }
-
- /**
- * Sets linkedDealsIds
- *
- * @param string[] $linkedDealsIds Deals ids for companies linked to this company
- *
- * @return $this
- */
- public function setLinkedDealsIds($linkedDealsIds)
- {
- $this->container['linkedDealsIds'] = $linkedDealsIds;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CompanyAttributes.php b/lib/Model/CompanyAttributes.php
deleted file mode 100644
index 1ba5907..0000000
--- a/lib/Model/CompanyAttributes.php
+++ /dev/null
@@ -1,281 +0,0 @@
-listInvalidProperties()) === 0;
- }
-
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CompanyAttributesInner.php b/lib/Model/CompanyAttributesInner.php
deleted file mode 100644
index c41cc8a..0000000
--- a/lib/Model/CompanyAttributesInner.php
+++ /dev/null
@@ -1,426 +0,0 @@
- 'string',
- 'label' => 'string',
- 'attributeTypeName' => 'string',
- 'attributeOptions' => 'object[]',
- 'isRequired' => 'bool'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'internalName' => null,
- 'label' => null,
- 'attributeTypeName' => null,
- 'attributeOptions' => null,
- 'isRequired' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'internalName' => 'internalName',
- 'label' => 'label',
- 'attributeTypeName' => 'attributeTypeName',
- 'attributeOptions' => 'attributeOptions',
- 'isRequired' => 'isRequired'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'internalName' => 'setInternalName',
- 'label' => 'setLabel',
- 'attributeTypeName' => 'setAttributeTypeName',
- 'attributeOptions' => 'setAttributeOptions',
- 'isRequired' => 'setIsRequired'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'internalName' => 'getInternalName',
- 'label' => 'getLabel',
- 'attributeTypeName' => 'getAttributeTypeName',
- 'attributeOptions' => 'getAttributeOptions',
- 'isRequired' => 'getIsRequired'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['internalName'] = isset($data['internalName']) ? $data['internalName'] : null;
- $this->container['label'] = isset($data['label']) ? $data['label'] : null;
- $this->container['attributeTypeName'] = isset($data['attributeTypeName']) ? $data['attributeTypeName'] : null;
- $this->container['attributeOptions'] = isset($data['attributeOptions']) ? $data['attributeOptions'] : null;
- $this->container['isRequired'] = isset($data['isRequired']) ? $data['isRequired'] : null;
- }
-
- /**
- * 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 internalName
- *
- * @return string
- */
- public function getInternalName()
- {
- return $this->container['internalName'];
- }
-
- /**
- * Sets internalName
- *
- * @param string $internalName internalName
- *
- * @return $this
- */
- public function setInternalName($internalName)
- {
- $this->container['internalName'] = $internalName;
-
- return $this;
- }
-
- /**
- * Gets label
- *
- * @return string
- */
- public function getLabel()
- {
- return $this->container['label'];
- }
-
- /**
- * Sets label
- *
- * @param string $label label
- *
- * @return $this
- */
- public function setLabel($label)
- {
- $this->container['label'] = $label;
-
- return $this;
- }
-
- /**
- * Gets attributeTypeName
- *
- * @return string
- */
- public function getAttributeTypeName()
- {
- return $this->container['attributeTypeName'];
- }
-
- /**
- * Sets attributeTypeName
- *
- * @param string $attributeTypeName attributeTypeName
- *
- * @return $this
- */
- public function setAttributeTypeName($attributeTypeName)
- {
- $this->container['attributeTypeName'] = $attributeTypeName;
-
- return $this;
- }
-
- /**
- * Gets attributeOptions
- *
- * @return object[]
- */
- public function getAttributeOptions()
- {
- return $this->container['attributeOptions'];
- }
-
- /**
- * Sets attributeOptions
- *
- * @param object[] $attributeOptions attributeOptions
- *
- * @return $this
- */
- public function setAttributeOptions($attributeOptions)
- {
- $this->container['attributeOptions'] = $attributeOptions;
-
- return $this;
- }
-
- /**
- * Gets isRequired
- *
- * @return bool
- */
- public function getIsRequired()
- {
- return $this->container['isRequired'];
- }
-
- /**
- * Sets isRequired
- *
- * @param bool $isRequired isRequired
- *
- * @return $this
- */
- public function setIsRequired($isRequired)
- {
- $this->container['isRequired'] = $isRequired;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/ComponentItems.php b/lib/Model/ComponentItems.php
deleted file mode 100644
index 69d5d34..0000000
--- a/lib/Model/ComponentItems.php
+++ /dev/null
@@ -1,335 +0,0 @@
- 'string',
- 'text' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'type' => null,
- 'text' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'type' => 'type',
- 'text' => 'text'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'type' => 'setType',
- 'text' => 'setText'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'type' => 'getType',
- 'text' => 'getText'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['type'] = isset($data['type']) ? $data['type'] : null;
- $this->container['text'] = isset($data['text']) ? $data['text'] : null;
- }
-
- /**
- * 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 type
- *
- * @return string
- */
- public function getType()
- {
- return $this->container['type'];
- }
-
- /**
- * Sets type
- *
- * @param string $type type
- *
- * @return $this
- */
- public function setType($type)
- {
- $this->container['type'] = $type;
-
- return $this;
- }
-
- /**
- * Gets text
- *
- * @return string
- */
- public function getText()
- {
- return $this->container['text'];
- }
-
- /**
- * Sets text
- *
- * @param string $text text
- *
- * @return $this
- */
- public function setText($text)
- {
- $this->container['text'] = $text;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/Contact.php b/lib/Model/Contact.php
deleted file mode 100644
index a000b88..0000000
--- a/lib/Model/Contact.php
+++ /dev/null
@@ -1,518 +0,0 @@
- 'object',
- 'email' => 'string',
- 'assignToId' => 'string',
- 'contactsId' => 'int',
- 'crmLists' => 'object',
- 'attributes' => 'object',
- 'createdAt' => '\DateTime',
- 'updatedAt' => '\DateTime'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'virtualNextTask' => null,
- 'email' => null,
- 'assignToId' => null,
- 'contactsId' => null,
- 'crmLists' => null,
- 'attributes' => null,
- 'createdAt' => 'date-time',
- 'updatedAt' => 'date-time'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'virtualNextTask' => 'virtualNextTask',
- 'email' => 'email',
- 'assignToId' => 'assignToId',
- 'contactsId' => 'contactsId',
- 'crmLists' => 'crmLists',
- 'attributes' => 'attributes',
- 'createdAt' => 'createdAt',
- 'updatedAt' => 'updatedAt'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'virtualNextTask' => 'setVirtualNextTask',
- 'email' => 'setEmail',
- 'assignToId' => 'setAssignToId',
- 'contactsId' => 'setContactsId',
- 'crmLists' => 'setCrmLists',
- 'attributes' => 'setAttributes',
- 'createdAt' => 'setCreatedAt',
- 'updatedAt' => 'setUpdatedAt'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'virtualNextTask' => 'getVirtualNextTask',
- 'email' => 'getEmail',
- 'assignToId' => 'getAssignToId',
- 'contactsId' => 'getContactsId',
- 'crmLists' => 'getCrmLists',
- 'attributes' => 'getAttributes',
- 'createdAt' => 'getCreatedAt',
- 'updatedAt' => 'getUpdatedAt'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['virtualNextTask'] = isset($data['virtualNextTask']) ? $data['virtualNextTask'] : null;
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['assignToId'] = isset($data['assignToId']) ? $data['assignToId'] : null;
- $this->container['contactsId'] = isset($data['contactsId']) ? $data['contactsId'] : null;
- $this->container['crmLists'] = isset($data['crmLists']) ? $data['crmLists'] : null;
- $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null;
- $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null;
- $this->container['updatedAt'] = isset($data['updatedAt']) ? $data['updatedAt'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['email'] === null) {
- $invalidProperties[] = "'email' can't be null";
- }
- if ($this->container['crmLists'] === null) {
- $invalidProperties[] = "'crmLists' 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 virtualNextTask
- *
- * @return object
- */
- public function getVirtualNextTask()
- {
- return $this->container['virtualNextTask'];
- }
-
- /**
- * Sets virtualNextTask
- *
- * @param object $virtualNextTask Next incomplete task of contact
- *
- * @return $this
- */
- public function setVirtualNextTask($virtualNextTask)
- {
- $this->container['virtualNextTask'] = $virtualNextTask;
-
- return $this;
- }
-
- /**
- * Gets email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Contact email
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets assignToId
- *
- * @return string
- */
- public function getAssignToId()
- {
- return $this->container['assignToId'];
- }
-
- /**
- * Sets assignToId
- *
- * @param string $assignToId User id to whom contact is assigned
- *
- * @return $this
- */
- public function setAssignToId($assignToId)
- {
- $this->container['assignToId'] = $assignToId;
-
- return $this;
- }
-
- /**
- * Gets contactsId
- *
- * @return int
- */
- public function getContactsId()
- {
- return $this->container['contactsId'];
- }
-
- /**
- * Sets contactsId
- *
- * @param int $contactsId Contact id
- *
- * @return $this
- */
- public function setContactsId($contactsId)
- {
- $this->container['contactsId'] = $contactsId;
-
- return $this;
- }
-
- /**
- * Gets crmLists
- *
- * @return object
- */
- public function getCrmLists()
- {
- return $this->container['crmLists'];
- }
-
- /**
- * Sets crmLists
- *
- * @param object $crmLists CRM lists in which contact is added
- *
- * @return $this
- */
- public function setCrmLists($crmLists)
- {
- $this->container['crmLists'] = $crmLists;
-
- return $this;
- }
-
- /**
- * Gets attributes
- *
- * @return object
- */
- public function getAttributes()
- {
- return $this->container['attributes'];
- }
-
- /**
- * Sets attributes
- *
- * @param object $attributes Contact attributes e.g firstname / lastname / SMS etc.
- *
- * @return $this
- */
- public function setAttributes($attributes)
- {
- $this->container['attributes'] = $attributes;
-
- return $this;
- }
-
- /**
- * Gets createdAt
- *
- * @return \DateTime
- */
- public function getCreatedAt()
- {
- return $this->container['createdAt'];
- }
-
- /**
- * Sets createdAt
- *
- * @param \DateTime $createdAt Contact created date/time
- *
- * @return $this
- */
- public function setCreatedAt($createdAt)
- {
- $this->container['createdAt'] = $createdAt;
-
- return $this;
- }
-
- /**
- * Gets updatedAt
- *
- * @return \DateTime
- */
- public function getUpdatedAt()
- {
- return $this->container['updatedAt'];
- }
-
- /**
- * Sets updatedAt
- *
- * @param \DateTime $updatedAt Contact updated date/time
- *
- * @return $this
- */
- public function setUpdatedAt($updatedAt)
- {
- $this->container['updatedAt'] = $updatedAt;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/ConversationsMessage.php b/lib/Model/ConversationsMessage.php
deleted file mode 100644
index b1eb84a..0000000
--- a/lib/Model/ConversationsMessage.php
+++ /dev/null
@@ -1,617 +0,0 @@
- 'string',
- 'type' => 'string',
- 'text' => 'string',
- 'visitorId' => 'string',
- 'agentId' => 'string',
- 'agentName' => 'string',
- 'createdAt' => 'int',
- 'isPushed' => 'bool',
- 'receivedFrom' => 'string',
- 'file' => '\Brevo\Client\Model\ConversationsMessageFile'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => null,
- 'type' => null,
- 'text' => null,
- 'visitorId' => null,
- 'agentId' => null,
- 'agentName' => null,
- 'createdAt' => 'int64',
- 'isPushed' => null,
- 'receivedFrom' => null,
- 'file' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'type' => 'type',
- 'text' => 'text',
- 'visitorId' => 'visitorId',
- 'agentId' => 'agentId',
- 'agentName' => 'agentName',
- 'createdAt' => 'createdAt',
- 'isPushed' => 'isPushed',
- 'receivedFrom' => 'receivedFrom',
- 'file' => 'file'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'type' => 'setType',
- 'text' => 'setText',
- 'visitorId' => 'setVisitorId',
- 'agentId' => 'setAgentId',
- 'agentName' => 'setAgentName',
- 'createdAt' => 'setCreatedAt',
- 'isPushed' => 'setIsPushed',
- 'receivedFrom' => 'setReceivedFrom',
- 'file' => 'setFile'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'type' => 'getType',
- 'text' => 'getText',
- 'visitorId' => 'getVisitorId',
- 'agentId' => 'getAgentId',
- 'agentName' => 'getAgentName',
- 'createdAt' => 'getCreatedAt',
- 'isPushed' => 'getIsPushed',
- 'receivedFrom' => 'getReceivedFrom',
- 'file' => 'getFile'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const TYPE_AGENT = 'agent';
- const TYPE_VISITOR = 'visitor';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getTypeAllowableValues()
- {
- return [
- self::TYPE_AGENT,
- self::TYPE_VISITOR,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['type'] = isset($data['type']) ? $data['type'] : null;
- $this->container['text'] = isset($data['text']) ? $data['text'] : null;
- $this->container['visitorId'] = isset($data['visitorId']) ? $data['visitorId'] : null;
- $this->container['agentId'] = isset($data['agentId']) ? $data['agentId'] : null;
- $this->container['agentName'] = isset($data['agentName']) ? $data['agentName'] : null;
- $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null;
- $this->container['isPushed'] = isset($data['isPushed']) ? $data['isPushed'] : null;
- $this->container['receivedFrom'] = isset($data['receivedFrom']) ? $data['receivedFrom'] : null;
- $this->container['file'] = isset($data['file']) ? $data['file'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- $allowedValues = $this->getTypeAllowableValues();
- if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'type', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- if (!is_null($this->container['createdAt']) && ($this->container['createdAt'] < 0)) {
- $invalidProperties[] = "invalid value for 'createdAt', must be bigger than or equal to 0.";
- }
-
- 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 Message ID. It can be used for further manipulations with the message.
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets type
- *
- * @return string
- */
- public function getType()
- {
- return $this->container['type'];
- }
-
- /**
- * Sets type
- *
- * @param string $type `\"agent\"` for agents’ messages, `\"visitor\"` for visitors’ messages.
- *
- * @return $this
- */
- public function setType($type)
- {
- $allowedValues = $this->getTypeAllowableValues();
- if (!is_null($type) && !in_array($type, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'type', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['type'] = $type;
-
- return $this;
- }
-
- /**
- * Gets text
- *
- * @return string
- */
- public function getText()
- {
- return $this->container['text'];
- }
-
- /**
- * Sets text
- *
- * @param string $text Message text or name of the attached file
- *
- * @return $this
- */
- public function setText($text)
- {
- $this->container['text'] = $text;
-
- return $this;
- }
-
- /**
- * Gets visitorId
- *
- * @return string
- */
- public function getVisitorId()
- {
- return $this->container['visitorId'];
- }
-
- /**
- * Sets visitorId
- *
- * @param string $visitorId visitor’s ID
- *
- * @return $this
- */
- public function setVisitorId($visitorId)
- {
- $this->container['visitorId'] = $visitorId;
-
- return $this;
- }
-
- /**
- * Gets agentId
- *
- * @return string
- */
- public function getAgentId()
- {
- return $this->container['agentId'];
- }
-
- /**
- * Sets agentId
- *
- * @param string $agentId ID of the agent on whose behalf the message was sent (only in messages sent by an agent).
- *
- * @return $this
- */
- public function setAgentId($agentId)
- {
- $this->container['agentId'] = $agentId;
-
- return $this;
- }
-
- /**
- * Gets agentName
- *
- * @return string
- */
- public function getAgentName()
- {
- return $this->container['agentName'];
- }
-
- /**
- * Sets agentName
- *
- * @param string $agentName Agent’s name as displayed to the visitor. Only in the messages sent by an agent.
- *
- * @return $this
- */
- public function setAgentName($agentName)
- {
- $this->container['agentName'] = $agentName;
-
- return $this;
- }
-
- /**
- * Gets createdAt
- *
- * @return int
- */
- public function getCreatedAt()
- {
- return $this->container['createdAt'];
- }
-
- /**
- * Sets createdAt
- *
- * @param int $createdAt Timestamp in milliseconds.
- *
- * @return $this
- */
- public function setCreatedAt($createdAt)
- {
-
- if (!is_null($createdAt) && ($createdAt < 0)) {
- throw new \InvalidArgumentException('invalid value for $createdAt when calling ConversationsMessage., must be bigger than or equal to 0.');
- }
-
- $this->container['createdAt'] = $createdAt;
-
- return $this;
- }
-
- /**
- * Gets isPushed
- *
- * @return bool
- */
- public function getIsPushed()
- {
- return $this->container['isPushed'];
- }
-
- /**
- * Sets isPushed
- *
- * @param bool $isPushed `true` for pushed messages
- *
- * @return $this
- */
- public function setIsPushed($isPushed)
- {
- $this->container['isPushed'] = $isPushed;
-
- return $this;
- }
-
- /**
- * Gets receivedFrom
- *
- * @return string
- */
- public function getReceivedFrom()
- {
- return $this->container['receivedFrom'];
- }
-
- /**
- * Sets receivedFrom
- *
- * @param string $receivedFrom In two-way integrations, messages sent via REST API can be marked with receivedFrom property and then filtered out when received in a webhook to avoid infinite loop.
- *
- * @return $this
- */
- public function setReceivedFrom($receivedFrom)
- {
- $this->container['receivedFrom'] = $receivedFrom;
-
- return $this;
- }
-
- /**
- * Gets file
- *
- * @return \Brevo\Client\Model\ConversationsMessageFile
- */
- public function getFile()
- {
- return $this->container['file'];
- }
-
- /**
- * Sets file
- *
- * @param \Brevo\Client\Model\ConversationsMessageFile $file file
- *
- * @return $this
- */
- public function setFile($file)
- {
- $this->container['file'] = $file;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/ConversationsMessageFile.php b/lib/Model/ConversationsMessageFile.php
deleted file mode 100644
index ef207ef..0000000
--- a/lib/Model/ConversationsMessageFile.php
+++ /dev/null
@@ -1,434 +0,0 @@
- 'string',
- 'size' => 'int',
- 'isImage' => 'bool',
- 'url' => 'string',
- 'imageInfo' => '\Brevo\Client\Model\ConversationsMessageFileImageInfo'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'filename' => null,
- 'size' => 'int64',
- 'isImage' => null,
- 'url' => 'url',
- 'imageInfo' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'filename' => 'filename',
- 'size' => 'size',
- 'isImage' => 'isImage',
- 'url' => 'url',
- 'imageInfo' => 'imageInfo'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'filename' => 'setFilename',
- 'size' => 'setSize',
- 'isImage' => 'setIsImage',
- 'url' => 'setUrl',
- 'imageInfo' => 'setImageInfo'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'filename' => 'getFilename',
- 'size' => 'getSize',
- 'isImage' => 'getIsImage',
- 'url' => 'getUrl',
- 'imageInfo' => 'getImageInfo'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['filename'] = isset($data['filename']) ? $data['filename'] : null;
- $this->container['size'] = isset($data['size']) ? $data['size'] : null;
- $this->container['isImage'] = isset($data['isImage']) ? $data['isImage'] : null;
- $this->container['url'] = isset($data['url']) ? $data['url'] : null;
- $this->container['imageInfo'] = isset($data['imageInfo']) ? $data['imageInfo'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if (!is_null($this->container['size']) && ($this->container['size'] < 0)) {
- $invalidProperties[] = "invalid value for 'size', must be bigger than or equal to 0.";
- }
-
- 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 filename
- *
- * @return string
- */
- public function getFilename()
- {
- return $this->container['filename'];
- }
-
- /**
- * Sets filename
- *
- * @param string $filename Name of the file
- *
- * @return $this
- */
- public function setFilename($filename)
- {
- $this->container['filename'] = $filename;
-
- return $this;
- }
-
- /**
- * Gets size
- *
- * @return int
- */
- public function getSize()
- {
- return $this->container['size'];
- }
-
- /**
- * Sets size
- *
- * @param int $size Size in bytes
- *
- * @return $this
- */
- public function setSize($size)
- {
-
- if (!is_null($size) && ($size < 0)) {
- throw new \InvalidArgumentException('invalid value for $size when calling ConversationsMessageFile., must be bigger than or equal to 0.');
- }
-
- $this->container['size'] = $size;
-
- return $this;
- }
-
- /**
- * Gets isImage
- *
- * @return bool
- */
- public function getIsImage()
- {
- return $this->container['isImage'];
- }
-
- /**
- * Sets isImage
- *
- * @param bool $isImage Whether the file is an image
- *
- * @return $this
- */
- public function setIsImage($isImage)
- {
- $this->container['isImage'] = $isImage;
-
- return $this;
- }
-
- /**
- * Gets url
- *
- * @return string
- */
- public function getUrl()
- {
- return $this->container['url'];
- }
-
- /**
- * Sets url
- *
- * @param string $url URL of the file
- *
- * @return $this
- */
- public function setUrl($url)
- {
- $this->container['url'] = $url;
-
- return $this;
- }
-
- /**
- * Gets imageInfo
- *
- * @return \Brevo\Client\Model\ConversationsMessageFileImageInfo
- */
- public function getImageInfo()
- {
- return $this->container['imageInfo'];
- }
-
- /**
- * Sets imageInfo
- *
- * @param \Brevo\Client\Model\ConversationsMessageFileImageInfo $imageInfo imageInfo
- *
- * @return $this
- */
- public function setImageInfo($imageInfo)
- {
- $this->container['imageInfo'] = $imageInfo;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/ConversationsMessageFileImageInfo.php b/lib/Model/ConversationsMessageFileImageInfo.php
deleted file mode 100644
index 2415cb4..0000000
--- a/lib/Model/ConversationsMessageFileImageInfo.php
+++ /dev/null
@@ -1,384 +0,0 @@
- 'int',
- 'height' => 'int',
- 'previewUrl' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'width' => 'int64',
- 'height' => 'int64',
- 'previewUrl' => 'url'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'width' => 'width',
- 'height' => 'height',
- 'previewUrl' => 'previewUrl'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'width' => 'setWidth',
- 'height' => 'setHeight',
- 'previewUrl' => 'setPreviewUrl'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'width' => 'getWidth',
- 'height' => 'getHeight',
- 'previewUrl' => 'getPreviewUrl'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['width'] = isset($data['width']) ? $data['width'] : null;
- $this->container['height'] = isset($data['height']) ? $data['height'] : null;
- $this->container['previewUrl'] = isset($data['previewUrl']) ? $data['previewUrl'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if (!is_null($this->container['width']) && ($this->container['width'] < 0)) {
- $invalidProperties[] = "invalid value for 'width', must be bigger than or equal to 0.";
- }
-
- if (!is_null($this->container['height']) && ($this->container['height'] < 0)) {
- $invalidProperties[] = "invalid value for 'height', must be bigger than or equal to 0.";
- }
-
- 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 width
- *
- * @return int
- */
- public function getWidth()
- {
- return $this->container['width'];
- }
-
- /**
- * Sets width
- *
- * @param int $width Width of the image
- *
- * @return $this
- */
- public function setWidth($width)
- {
-
- if (!is_null($width) && ($width < 0)) {
- throw new \InvalidArgumentException('invalid value for $width when calling ConversationsMessageFileImageInfo., must be bigger than or equal to 0.');
- }
-
- $this->container['width'] = $width;
-
- return $this;
- }
-
- /**
- * Gets height
- *
- * @return int
- */
- public function getHeight()
- {
- return $this->container['height'];
- }
-
- /**
- * Sets height
- *
- * @param int $height height of the image
- *
- * @return $this
- */
- public function setHeight($height)
- {
-
- if (!is_null($height) && ($height < 0)) {
- throw new \InvalidArgumentException('invalid value for $height when calling ConversationsMessageFileImageInfo., must be bigger than or equal to 0.');
- }
-
- $this->container['height'] = $height;
-
- return $this;
- }
-
- /**
- * Gets previewUrl
- *
- * @return string
- */
- public function getPreviewUrl()
- {
- return $this->container['previewUrl'];
- }
-
- /**
- * Sets previewUrl
- *
- * @param string $previewUrl URL of the preview
- *
- * @return $this
- */
- public function setPreviewUrl($previewUrl)
- {
- $this->container['previewUrl'] = $previewUrl;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateApiKeyRequest.php b/lib/Model/CreateApiKeyRequest.php
deleted file mode 100644
index 79f8147..0000000
--- a/lib/Model/CreateApiKeyRequest.php
+++ /dev/null
@@ -1,338 +0,0 @@
- 'int',
- 'name' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'int64',
- 'name' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'name' => 'name'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'name' => 'setName'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'name' => 'getName'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- }
-
- /**
- * 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";
- }
- 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 int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id Id of the sub-account organization
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the API key
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateApiKeyResponse.php b/lib/Model/CreateApiKeyResponse.php
deleted file mode 100644
index 828b444..0000000
--- a/lib/Model/CreateApiKeyResponse.php
+++ /dev/null
@@ -1,335 +0,0 @@
- 'string',
- 'key' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'status' => null,
- 'key' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'status' => 'status',
- 'key' => 'key'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'status' => 'setStatus',
- 'key' => 'setKey'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'status' => 'getStatus',
- 'key' => 'getKey'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['status'] = isset($data['status']) ? $data['status'] : null;
- $this->container['key'] = isset($data['key']) ? $data['key'] : null;
- }
-
- /**
- * 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 status
- *
- * @return string
- */
- public function getStatus()
- {
- return $this->container['status'];
- }
-
- /**
- * Sets status
- *
- * @param string $status Status of the API operation.
- *
- * @return $this
- */
- public function setStatus($status)
- {
- $this->container['status'] = $status;
-
- return $this;
- }
-
- /**
- * Gets key
- *
- * @return string
- */
- public function getKey()
- {
- return $this->container['key'];
- }
-
- /**
- * Sets key
- *
- * @param string $key API Key
- *
- * @return $this
- */
- public function setKey($key)
- {
- $this->container['key'] = $key;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateAttribute.php b/lib/Model/CreateAttribute.php
deleted file mode 100644
index fb695e9..0000000
--- a/lib/Model/CreateAttribute.php
+++ /dev/null
@@ -1,435 +0,0 @@
- 'string',
- 'isRecurring' => 'bool',
- 'enumeration' => '\Brevo\Client\Model\CreateAttributeEnumeration[]',
- 'type' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'value' => null,
- 'isRecurring' => null,
- 'enumeration' => null,
- 'type' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'value' => 'value',
- 'isRecurring' => 'isRecurring',
- 'enumeration' => 'enumeration',
- 'type' => 'type'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'value' => 'setValue',
- 'isRecurring' => 'setIsRecurring',
- 'enumeration' => 'setEnumeration',
- 'type' => 'setType'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'value' => 'getValue',
- 'isRecurring' => 'getIsRecurring',
- 'enumeration' => 'getEnumeration',
- 'type' => 'getType'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const TYPE_TEXT = 'text';
- const TYPE_DATE = 'date';
- const TYPE_FLOAT = 'float';
- const TYPE_BOOLEAN = 'boolean';
- const TYPE_ID = 'id';
- const TYPE_CATEGORY = 'category';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getTypeAllowableValues()
- {
- return [
- self::TYPE_TEXT,
- self::TYPE_DATE,
- self::TYPE_FLOAT,
- self::TYPE_BOOLEAN,
- self::TYPE_ID,
- self::TYPE_CATEGORY,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['value'] = isset($data['value']) ? $data['value'] : null;
- $this->container['isRecurring'] = isset($data['isRecurring']) ? $data['isRecurring'] : null;
- $this->container['enumeration'] = isset($data['enumeration']) ? $data['enumeration'] : null;
- $this->container['type'] = isset($data['type']) ? $data['type'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- $allowedValues = $this->getTypeAllowableValues();
- if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'type', must be one of '%s'",
- 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 value
- *
- * @return string
- */
- public function getValue()
- {
- return $this->container['value'];
- }
-
- /**
- * Sets value
- *
- * @param string $value Value of the attribute. Use only if the attribute's category is 'calculated' or 'global'
- *
- * @return $this
- */
- public function setValue($value)
- {
- $this->container['value'] = $value;
-
- return $this;
- }
-
- /**
- * Gets isRecurring
- *
- * @return bool
- */
- public function getIsRecurring()
- {
- return $this->container['isRecurring'];
- }
-
- /**
- * Sets isRecurring
- *
- * @param bool $isRecurring Type of the attribute. Use only if the attribute's category is 'calculated' or 'global'
- *
- * @return $this
- */
- public function setIsRecurring($isRecurring)
- {
- $this->container['isRecurring'] = $isRecurring;
-
- return $this;
- }
-
- /**
- * Gets enumeration
- *
- * @return \Brevo\Client\Model\CreateAttributeEnumeration[]
- */
- public function getEnumeration()
- {
- return $this->container['enumeration'];
- }
-
- /**
- * Sets enumeration
- *
- * @param \Brevo\Client\Model\CreateAttributeEnumeration[] $enumeration List of values and labels that the attribute can take. Use only if the attribute's category is \"category\". For example, [{\"value\":1, \"label\":\"male\"}, {\"value\":2, \"label\":\"female\"}]
- *
- * @return $this
- */
- public function setEnumeration($enumeration)
- {
- $this->container['enumeration'] = $enumeration;
-
- return $this;
- }
-
- /**
- * Gets type
- *
- * @return string
- */
- public function getType()
- {
- return $this->container['type'];
- }
-
- /**
- * Sets type
- *
- * @param string $type Type of the attribute. Use only if the attribute's category is 'normal', 'category' or 'transactional' ( type 'boolean' is only available if the category is 'normal' attribute, type 'id' is only available if the category is 'transactional' attribute & type 'category' is only available if the category is 'category' attribute )
- *
- * @return $this
- */
- public function setType($type)
- {
- $allowedValues = $this->getTypeAllowableValues();
- if (!is_null($type) && !in_array($type, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'type', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['type'] = $type;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateAttributeEnumeration.php b/lib/Model/CreateAttributeEnumeration.php
deleted file mode 100644
index b9da3d2..0000000
--- a/lib/Model/CreateAttributeEnumeration.php
+++ /dev/null
@@ -1,341 +0,0 @@
- 'int',
- 'label' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'value' => null,
- 'label' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'value' => 'value',
- 'label' => 'label'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'value' => 'setValue',
- 'label' => 'setLabel'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'value' => 'getValue',
- 'label' => 'getLabel'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['value'] = isset($data['value']) ? $data['value'] : null;
- $this->container['label'] = isset($data['label']) ? $data['label'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['value'] === null) {
- $invalidProperties[] = "'value' can't be null";
- }
- if ($this->container['label'] === null) {
- $invalidProperties[] = "'label' 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 value
- *
- * @return int
- */
- public function getValue()
- {
- return $this->container['value'];
- }
-
- /**
- * Sets value
- *
- * @param int $value Id of the value
- *
- * @return $this
- */
- public function setValue($value)
- {
- $this->container['value'] = $value;
-
- return $this;
- }
-
- /**
- * Gets label
- *
- * @return string
- */
- public function getLabel()
- {
- return $this->container['label'];
- }
-
- /**
- * Sets label
- *
- * @param string $label Label of the value
- *
- * @return $this
- */
- public function setLabel($label)
- {
- $this->container['label'] = $label;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateCategoryModel.php b/lib/Model/CreateCategoryModel.php
deleted file mode 100644
index 10995f6..0000000
--- a/lib/Model/CreateCategoryModel.php
+++ /dev/null
@@ -1,305 +0,0 @@
- 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- }
-
- /**
- * 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 id
- *
- * @return int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id ID of the category when a new category is created
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateChild.php b/lib/Model/CreateChild.php
deleted file mode 100644
index ceba8b6..0000000
--- a/lib/Model/CreateChild.php
+++ /dev/null
@@ -1,510 +0,0 @@
- 'string',
- 'firstName' => 'string',
- 'lastName' => 'string',
- 'companyName' => 'string',
- 'password' => 'string',
- 'language' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'email' => 'email',
- 'firstName' => null,
- 'lastName' => null,
- 'companyName' => null,
- 'password' => 'password',
- 'language' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'email' => 'email',
- 'firstName' => 'firstName',
- 'lastName' => 'lastName',
- 'companyName' => 'companyName',
- 'password' => 'password',
- 'language' => 'language'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'email' => 'setEmail',
- 'firstName' => 'setFirstName',
- 'lastName' => 'setLastName',
- 'companyName' => 'setCompanyName',
- 'password' => 'setPassword',
- 'language' => 'setLanguage'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'email' => 'getEmail',
- 'firstName' => 'getFirstName',
- 'lastName' => 'getLastName',
- 'companyName' => 'getCompanyName',
- 'password' => 'getPassword',
- 'language' => 'getLanguage'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const LANGUAGE_FR = 'fr';
- const LANGUAGE_ES = 'es';
- const LANGUAGE_PT = 'pt';
- const LANGUAGE_IT = 'it';
- const LANGUAGE_DE = 'de';
- const LANGUAGE_EN = 'en';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getLanguageAllowableValues()
- {
- return [
- self::LANGUAGE_FR,
- self::LANGUAGE_ES,
- self::LANGUAGE_PT,
- self::LANGUAGE_IT,
- self::LANGUAGE_DE,
- self::LANGUAGE_EN,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['firstName'] = isset($data['firstName']) ? $data['firstName'] : null;
- $this->container['lastName'] = isset($data['lastName']) ? $data['lastName'] : null;
- $this->container['companyName'] = isset($data['companyName']) ? $data['companyName'] : null;
- $this->container['password'] = isset($data['password']) ? $data['password'] : null;
- $this->container['language'] = isset($data['language']) ? $data['language'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['email'] === null) {
- $invalidProperties[] = "'email' can't be null";
- }
- if ($this->container['firstName'] === null) {
- $invalidProperties[] = "'firstName' can't be null";
- }
- if ($this->container['lastName'] === null) {
- $invalidProperties[] = "'lastName' can't be null";
- }
- if ($this->container['companyName'] === null) {
- $invalidProperties[] = "'companyName' can't be null";
- }
- if ($this->container['password'] === null) {
- $invalidProperties[] = "'password' can't be null";
- }
- $allowedValues = $this->getLanguageAllowableValues();
- if (!is_null($this->container['language']) && !in_array($this->container['language'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'language', must be one of '%s'",
- 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 email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Email address to create the child account
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets firstName
- *
- * @return string
- */
- public function getFirstName()
- {
- return $this->container['firstName'];
- }
-
- /**
- * Sets firstName
- *
- * @param string $firstName First name to use to create the child account
- *
- * @return $this
- */
- public function setFirstName($firstName)
- {
- $this->container['firstName'] = $firstName;
-
- return $this;
- }
-
- /**
- * Gets lastName
- *
- * @return string
- */
- public function getLastName()
- {
- return $this->container['lastName'];
- }
-
- /**
- * Sets lastName
- *
- * @param string $lastName Last name to use to create the child account
- *
- * @return $this
- */
- public function setLastName($lastName)
- {
- $this->container['lastName'] = $lastName;
-
- return $this;
- }
-
- /**
- * Gets companyName
- *
- * @return string
- */
- public function getCompanyName()
- {
- return $this->container['companyName'];
- }
-
- /**
- * Sets companyName
- *
- * @param string $companyName Company name to use to create the child account
- *
- * @return $this
- */
- public function setCompanyName($companyName)
- {
- $this->container['companyName'] = $companyName;
-
- return $this;
- }
-
- /**
- * Gets password
- *
- * @return string
- */
- public function getPassword()
- {
- return $this->container['password'];
- }
-
- /**
- * Sets password
- *
- * @param string $password Password for the child account to login
- *
- * @return $this
- */
- public function setPassword($password)
- {
- $this->container['password'] = $password;
-
- return $this;
- }
-
- /**
- * Gets language
- *
- * @return string
- */
- public function getLanguage()
- {
- return $this->container['language'];
- }
-
- /**
- * Sets language
- *
- * @param string $language Language of the child account
- *
- * @return $this
- */
- public function setLanguage($language)
- {
- $allowedValues = $this->getLanguageAllowableValues();
- if (!is_null($language) && !in_array($language, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'language', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['language'] = $language;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateContact.php b/lib/Model/CreateContact.php
deleted file mode 100644
index dd0b039..0000000
--- a/lib/Model/CreateContact.php
+++ /dev/null
@@ -1,515 +0,0 @@
- 'string',
- 'extId' => 'string',
- 'attributes' => 'object',
- 'emailBlacklisted' => 'bool',
- 'smsBlacklisted' => 'bool',
- 'listIds' => 'int[]',
- 'updateEnabled' => 'bool',
- 'smtpBlacklistSender' => 'string[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'email' => 'email',
- 'extId' => null,
- 'attributes' => null,
- 'emailBlacklisted' => null,
- 'smsBlacklisted' => null,
- 'listIds' => 'int64',
- 'updateEnabled' => null,
- 'smtpBlacklistSender' => 'email'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'email' => 'email',
- 'extId' => 'ext_id',
- 'attributes' => 'attributes',
- 'emailBlacklisted' => 'emailBlacklisted',
- 'smsBlacklisted' => 'smsBlacklisted',
- 'listIds' => 'listIds',
- 'updateEnabled' => 'updateEnabled',
- 'smtpBlacklistSender' => 'smtpBlacklistSender'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'email' => 'setEmail',
- 'extId' => 'setExtId',
- 'attributes' => 'setAttributes',
- 'emailBlacklisted' => 'setEmailBlacklisted',
- 'smsBlacklisted' => 'setSmsBlacklisted',
- 'listIds' => 'setListIds',
- 'updateEnabled' => 'setUpdateEnabled',
- 'smtpBlacklistSender' => 'setSmtpBlacklistSender'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'email' => 'getEmail',
- 'extId' => 'getExtId',
- 'attributes' => 'getAttributes',
- 'emailBlacklisted' => 'getEmailBlacklisted',
- 'smsBlacklisted' => 'getSmsBlacklisted',
- 'listIds' => 'getListIds',
- 'updateEnabled' => 'getUpdateEnabled',
- 'smtpBlacklistSender' => 'getSmtpBlacklistSender'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['extId'] = isset($data['extId']) ? $data['extId'] : null;
- $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null;
- $this->container['emailBlacklisted'] = isset($data['emailBlacklisted']) ? $data['emailBlacklisted'] : null;
- $this->container['smsBlacklisted'] = isset($data['smsBlacklisted']) ? $data['smsBlacklisted'] : null;
- $this->container['listIds'] = isset($data['listIds']) ? $data['listIds'] : null;
- $this->container['updateEnabled'] = isset($data['updateEnabled']) ? $data['updateEnabled'] : false;
- $this->container['smtpBlacklistSender'] = isset($data['smtpBlacklistSender']) ? $data['smtpBlacklistSender'] : null;
- }
-
- /**
- * 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 email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Email address of the user. Mandatory if \"SMS\" field is not passed in \"attributes\" parameter. Mobile Number in \"SMS\" field should be passed with proper country code. For example {\"SMS\":\"+91xxxxxxxxxx\"} or {\"SMS\":\"0091xxxxxxxxxx\"}
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets extId
- *
- * @return string
- */
- public function getExtId()
- {
- return $this->container['extId'];
- }
-
- /**
- * Sets extId
- *
- * @param string $extId Pass your own Id to create a contact.
- *
- * @return $this
- */
- public function setExtId($extId)
- {
- $this->container['extId'] = $extId;
-
- return $this;
- }
-
- /**
- * Gets attributes
- *
- * @return object
- */
- public function getAttributes()
- {
- return $this->container['attributes'];
- }
-
- /**
- * Sets attributes
- *
- * @param object $attributes Pass the set of attributes and their values. The attribute's parameter should be passed in capital letter while creating a contact. Values that don't match the attribute type (e.g. text or string in a date attribute) will be ignored.These attributes must be present in your Brevo account. For eg. {\"FNAME\":\"Elly\", \"LNAME\":\"Roger\"}
- *
- * @return $this
- */
- public function setAttributes($attributes)
- {
- $this->container['attributes'] = $attributes;
-
- return $this;
- }
-
- /**
- * Gets emailBlacklisted
- *
- * @return bool
- */
- public function getEmailBlacklisted()
- {
- return $this->container['emailBlacklisted'];
- }
-
- /**
- * Sets emailBlacklisted
- *
- * @param bool $emailBlacklisted Set this field to blacklist the contact for emails (emailBlacklisted = true)
- *
- * @return $this
- */
- public function setEmailBlacklisted($emailBlacklisted)
- {
- $this->container['emailBlacklisted'] = $emailBlacklisted;
-
- return $this;
- }
-
- /**
- * Gets smsBlacklisted
- *
- * @return bool
- */
- public function getSmsBlacklisted()
- {
- return $this->container['smsBlacklisted'];
- }
-
- /**
- * Sets smsBlacklisted
- *
- * @param bool $smsBlacklisted Set this field to blacklist the contact for SMS (smsBlacklisted = true)
- *
- * @return $this
- */
- public function setSmsBlacklisted($smsBlacklisted)
- {
- $this->container['smsBlacklisted'] = $smsBlacklisted;
-
- return $this;
- }
-
- /**
- * Gets listIds
- *
- * @return int[]
- */
- public function getListIds()
- {
- return $this->container['listIds'];
- }
-
- /**
- * Sets listIds
- *
- * @param int[] $listIds Ids of the lists to add the contact to
- *
- * @return $this
- */
- public function setListIds($listIds)
- {
- $this->container['listIds'] = $listIds;
-
- return $this;
- }
-
- /**
- * Gets updateEnabled
- *
- * @return bool
- */
- public function getUpdateEnabled()
- {
- return $this->container['updateEnabled'];
- }
-
- /**
- * Sets updateEnabled
- *
- * @param bool $updateEnabled Facilitate to update the existing contact in the same request (updateEnabled = true)
- *
- * @return $this
- */
- public function setUpdateEnabled($updateEnabled)
- {
- $this->container['updateEnabled'] = $updateEnabled;
-
- return $this;
- }
-
- /**
- * Gets smtpBlacklistSender
- *
- * @return string[]
- */
- public function getSmtpBlacklistSender()
- {
- return $this->container['smtpBlacklistSender'];
- }
-
- /**
- * Sets smtpBlacklistSender
- *
- * @param string[] $smtpBlacklistSender transactional email forbidden sender for contact. Use only for email Contact ( only available if updateEnabled = true )
- *
- * @return $this
- */
- public function setSmtpBlacklistSender($smtpBlacklistSender)
- {
- $this->container['smtpBlacklistSender'] = $smtpBlacklistSender;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateCouponCollection.php b/lib/Model/CreateCouponCollection.php
deleted file mode 100644
index d489d57..0000000
--- a/lib/Model/CreateCouponCollection.php
+++ /dev/null
@@ -1,341 +0,0 @@
- 'object',
- 'defaultCoupon' => 'object'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'defaultCoupon' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'defaultCoupon' => 'defaultCoupon'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'defaultCoupon' => 'setDefaultCoupon'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'defaultCoupon' => 'getDefaultCoupon'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['defaultCoupon'] = isset($data['defaultCoupon']) ? $data['defaultCoupon'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['name'] === null) {
- $invalidProperties[] = "'name' can't be null";
- }
- if ($this->container['defaultCoupon'] === null) {
- $invalidProperties[] = "'defaultCoupon' 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 name
- *
- * @return object
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param object $name Name of the collection with no white spaces between words
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets defaultCoupon
- *
- * @return object
- */
- public function getDefaultCoupon()
- {
- return $this->container['defaultCoupon'];
- }
-
- /**
- * Sets defaultCoupon
- *
- * @param object $defaultCoupon A default coupon to be used in case there are no coupons left
- *
- * @return $this
- */
- public function setDefaultCoupon($defaultCoupon)
- {
- $this->container['defaultCoupon'] = $defaultCoupon;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateCoupons.php b/lib/Model/CreateCoupons.php
deleted file mode 100644
index d082036..0000000
--- a/lib/Model/CreateCoupons.php
+++ /dev/null
@@ -1,341 +0,0 @@
- 'string',
- 'coupons' => 'string[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'collectionId' => 'uuidv4',
- 'coupons' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'collectionId' => 'collectionId',
- 'coupons' => 'coupons'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'collectionId' => 'setCollectionId',
- 'coupons' => 'setCoupons'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'collectionId' => 'getCollectionId',
- 'coupons' => 'getCoupons'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['collectionId'] = isset($data['collectionId']) ? $data['collectionId'] : null;
- $this->container['coupons'] = isset($data['coupons']) ? $data['coupons'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['collectionId'] === null) {
- $invalidProperties[] = "'collectionId' can't be null";
- }
- if ($this->container['coupons'] === null) {
- $invalidProperties[] = "'coupons' 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 collectionId
- *
- * @return string
- */
- public function getCollectionId()
- {
- return $this->container['collectionId'];
- }
-
- /**
- * Sets collectionId
- *
- * @param string $collectionId The id of the coupon collection for which the coupons will be created
- *
- * @return $this
- */
- public function setCollectionId($collectionId)
- {
- $this->container['collectionId'] = $collectionId;
-
- return $this;
- }
-
- /**
- * Gets coupons
- *
- * @return string[]
- */
- public function getCoupons()
- {
- return $this->container['coupons'];
- }
-
- /**
- * Sets coupons
- *
- * @param string[] $coupons coupons
- *
- * @return $this
- */
- public function setCoupons($coupons)
- {
- $this->container['coupons'] = $coupons;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateDoiContact.php b/lib/Model/CreateDoiContact.php
deleted file mode 100644
index c4df173..0000000
--- a/lib/Model/CreateDoiContact.php
+++ /dev/null
@@ -1,467 +0,0 @@
- 'string',
- 'attributes' => 'object',
- 'includeListIds' => 'int[]',
- 'excludeListIds' => 'int[]',
- 'templateId' => 'int',
- 'redirectionUrl' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'email' => 'email',
- 'attributes' => null,
- 'includeListIds' => 'int64',
- 'excludeListIds' => 'int64',
- 'templateId' => 'int64',
- 'redirectionUrl' => 'url'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'email' => 'email',
- 'attributes' => 'attributes',
- 'includeListIds' => 'includeListIds',
- 'excludeListIds' => 'excludeListIds',
- 'templateId' => 'templateId',
- 'redirectionUrl' => 'redirectionUrl'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'email' => 'setEmail',
- 'attributes' => 'setAttributes',
- 'includeListIds' => 'setIncludeListIds',
- 'excludeListIds' => 'setExcludeListIds',
- 'templateId' => 'setTemplateId',
- 'redirectionUrl' => 'setRedirectionUrl'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'email' => 'getEmail',
- 'attributes' => 'getAttributes',
- 'includeListIds' => 'getIncludeListIds',
- 'excludeListIds' => 'getExcludeListIds',
- 'templateId' => 'getTemplateId',
- 'redirectionUrl' => 'getRedirectionUrl'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null;
- $this->container['includeListIds'] = isset($data['includeListIds']) ? $data['includeListIds'] : null;
- $this->container['excludeListIds'] = isset($data['excludeListIds']) ? $data['excludeListIds'] : null;
- $this->container['templateId'] = isset($data['templateId']) ? $data['templateId'] : null;
- $this->container['redirectionUrl'] = isset($data['redirectionUrl']) ? $data['redirectionUrl'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['email'] === null) {
- $invalidProperties[] = "'email' can't be null";
- }
- if ($this->container['includeListIds'] === null) {
- $invalidProperties[] = "'includeListIds' can't be null";
- }
- if ($this->container['templateId'] === null) {
- $invalidProperties[] = "'templateId' can't be null";
- }
- if ($this->container['redirectionUrl'] === null) {
- $invalidProperties[] = "'redirectionUrl' 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 email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Email address where the confirmation email will be sent. This email address will be the identifier for all other contact attributes.
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets attributes
- *
- * @return object
- */
- public function getAttributes()
- {
- return $this->container['attributes'];
- }
-
- /**
- * Sets attributes
- *
- * @param object $attributes Pass the set of attributes and their values. These attributes must be present in your Brevo account. For eg. {'FNAME':'Elly', 'LNAME':'Roger'}
- *
- * @return $this
- */
- public function setAttributes($attributes)
- {
- $this->container['attributes'] = $attributes;
-
- return $this;
- }
-
- /**
- * Gets includeListIds
- *
- * @return int[]
- */
- public function getIncludeListIds()
- {
- return $this->container['includeListIds'];
- }
-
- /**
- * Sets includeListIds
- *
- * @param int[] $includeListIds Lists under user account where contact should be added
- *
- * @return $this
- */
- public function setIncludeListIds($includeListIds)
- {
- $this->container['includeListIds'] = $includeListIds;
-
- return $this;
- }
-
- /**
- * Gets excludeListIds
- *
- * @return int[]
- */
- public function getExcludeListIds()
- {
- return $this->container['excludeListIds'];
- }
-
- /**
- * Sets excludeListIds
- *
- * @param int[] $excludeListIds Lists under user account where contact should not be added
- *
- * @return $this
- */
- public function setExcludeListIds($excludeListIds)
- {
- $this->container['excludeListIds'] = $excludeListIds;
-
- return $this;
- }
-
- /**
- * Gets templateId
- *
- * @return int
- */
- public function getTemplateId()
- {
- return $this->container['templateId'];
- }
-
- /**
- * Sets templateId
- *
- * @param int $templateId Id of the Double opt-in (DOI) template
- *
- * @return $this
- */
- public function setTemplateId($templateId)
- {
- $this->container['templateId'] = $templateId;
-
- return $this;
- }
-
- /**
- * Gets redirectionUrl
- *
- * @return string
- */
- public function getRedirectionUrl()
- {
- return $this->container['redirectionUrl'];
- }
-
- /**
- * Sets redirectionUrl
- *
- * @param string $redirectionUrl URL of the web page that user will be redirected to after clicking on the double opt in URL. When editing your DOI template you can reference this URL by using the tag {{ params.DOIurl }}.
- *
- * @return $this
- */
- public function setRedirectionUrl($redirectionUrl)
- {
- $this->container['redirectionUrl'] = $redirectionUrl;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateDomain.php b/lib/Model/CreateDomain.php
deleted file mode 100644
index bc67da0..0000000
--- a/lib/Model/CreateDomain.php
+++ /dev/null
@@ -1,308 +0,0 @@
- 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['name'] === null) {
- $invalidProperties[] = "'name' 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Domain name
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateDomainModel.php b/lib/Model/CreateDomainModel.php
deleted file mode 100644
index edc3756..0000000
--- a/lib/Model/CreateDomainModel.php
+++ /dev/null
@@ -1,398 +0,0 @@
- 'int',
- 'domainName' => 'string',
- 'message' => 'string',
- 'dnsRecords' => '\Brevo\Client\Model\CreateDomainModelDnsRecords'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'int64',
- 'domainName' => null,
- 'message' => null,
- 'dnsRecords' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'domainName' => 'domain_name',
- 'message' => 'message',
- 'dnsRecords' => 'dns_records'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'domainName' => 'setDomainName',
- 'message' => 'setMessage',
- 'dnsRecords' => 'setDnsRecords'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'domainName' => 'getDomainName',
- 'message' => 'getMessage',
- 'dnsRecords' => 'getDnsRecords'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['domainName'] = isset($data['domainName']) ? $data['domainName'] : null;
- $this->container['message'] = isset($data['message']) ? $data['message'] : null;
- $this->container['dnsRecords'] = isset($data['dnsRecords']) ? $data['dnsRecords'] : null;
- }
-
- /**
- * 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";
- }
- 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 int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id ID of the Domain created
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets domainName
- *
- * @return string
- */
- public function getDomainName()
- {
- return $this->container['domainName'];
- }
-
- /**
- * Sets domainName
- *
- * @param string $domainName Domain
- *
- * @return $this
- */
- public function setDomainName($domainName)
- {
- $this->container['domainName'] = $domainName;
-
- return $this;
- }
-
- /**
- * Gets message
- *
- * @return string
- */
- public function getMessage()
- {
- return $this->container['message'];
- }
-
- /**
- * Sets message
- *
- * @param string $message Success message
- *
- * @return $this
- */
- public function setMessage($message)
- {
- $this->container['message'] = $message;
-
- return $this;
- }
-
- /**
- * Gets dnsRecords
- *
- * @return \Brevo\Client\Model\CreateDomainModelDnsRecords
- */
- public function getDnsRecords()
- {
- return $this->container['dnsRecords'];
- }
-
- /**
- * Sets dnsRecords
- *
- * @param \Brevo\Client\Model\CreateDomainModelDnsRecords $dnsRecords dnsRecords
- *
- * @return $this
- */
- public function setDnsRecords($dnsRecords)
- {
- $this->container['dnsRecords'] = $dnsRecords;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateDomainModelDnsRecords.php b/lib/Model/CreateDomainModelDnsRecords.php
deleted file mode 100644
index 5ba3983..0000000
--- a/lib/Model/CreateDomainModelDnsRecords.php
+++ /dev/null
@@ -1,335 +0,0 @@
- '\Brevo\Client\Model\CreateDomainModelDnsRecordsDkimRecord',
- 'brevoCode' => '\Brevo\Client\Model\CreateDomainModelDnsRecordsDkimRecord'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'dkimRecord' => null,
- 'brevoCode' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'dkimRecord' => 'dkim_record',
- 'brevoCode' => 'brevo_code'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'dkimRecord' => 'setDkimRecord',
- 'brevoCode' => 'setBrevoCode'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'dkimRecord' => 'getDkimRecord',
- 'brevoCode' => 'getBrevoCode'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['dkimRecord'] = isset($data['dkimRecord']) ? $data['dkimRecord'] : null;
- $this->container['brevoCode'] = isset($data['brevoCode']) ? $data['brevoCode'] : null;
- }
-
- /**
- * 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 dkimRecord
- *
- * @return \Brevo\Client\Model\CreateDomainModelDnsRecordsDkimRecord
- */
- public function getDkimRecord()
- {
- return $this->container['dkimRecord'];
- }
-
- /**
- * Sets dkimRecord
- *
- * @param \Brevo\Client\Model\CreateDomainModelDnsRecordsDkimRecord $dkimRecord dkimRecord
- *
- * @return $this
- */
- public function setDkimRecord($dkimRecord)
- {
- $this->container['dkimRecord'] = $dkimRecord;
-
- return $this;
- }
-
- /**
- * Gets brevoCode
- *
- * @return \Brevo\Client\Model\CreateDomainModelDnsRecordsDkimRecord
- */
- public function getBrevoCode()
- {
- return $this->container['brevoCode'];
- }
-
- /**
- * Sets brevoCode
- *
- * @param \Brevo\Client\Model\CreateDomainModelDnsRecordsDkimRecord $brevoCode brevoCode
- *
- * @return $this
- */
- public function setBrevoCode($brevoCode)
- {
- $this->container['brevoCode'] = $brevoCode;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateDomainModelDnsRecordsDkimRecord.php b/lib/Model/CreateDomainModelDnsRecordsDkimRecord.php
deleted file mode 100644
index 83bfad1..0000000
--- a/lib/Model/CreateDomainModelDnsRecordsDkimRecord.php
+++ /dev/null
@@ -1,395 +0,0 @@
- 'string',
- 'value' => 'string',
- 'hostName' => 'string',
- 'status' => 'bool'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'type' => null,
- 'value' => null,
- 'hostName' => null,
- 'status' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'type' => 'type',
- 'value' => 'value',
- 'hostName' => 'host_name',
- 'status' => 'status'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'type' => 'setType',
- 'value' => 'setValue',
- 'hostName' => 'setHostName',
- 'status' => 'setStatus'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'type' => 'getType',
- 'value' => 'getValue',
- 'hostName' => 'getHostName',
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['type'] = isset($data['type']) ? $data['type'] : null;
- $this->container['value'] = isset($data['value']) ? $data['value'] : null;
- $this->container['hostName'] = isset($data['hostName']) ? $data['hostName'] : null;
- $this->container['status'] = isset($data['status']) ? $data['status'] : null;
- }
-
- /**
- * 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 type
- *
- * @return string
- */
- public function getType()
- {
- return $this->container['type'];
- }
-
- /**
- * Sets type
- *
- * @param string $type type
- *
- * @return $this
- */
- public function setType($type)
- {
- $this->container['type'] = $type;
-
- return $this;
- }
-
- /**
- * Gets value
- *
- * @return string
- */
- public function getValue()
- {
- return $this->container['value'];
- }
-
- /**
- * Sets value
- *
- * @param string $value value
- *
- * @return $this
- */
- public function setValue($value)
- {
- $this->container['value'] = $value;
-
- return $this;
- }
-
- /**
- * Gets hostName
- *
- * @return string
- */
- public function getHostName()
- {
- return $this->container['hostName'];
- }
-
- /**
- * Sets hostName
- *
- * @param string $hostName hostName
- *
- * @return $this
- */
- public function setHostName($hostName)
- {
- $this->container['hostName'] = $hostName;
-
- return $this;
- }
-
- /**
- * Gets status
- *
- * @return bool
- */
- public function getStatus()
- {
- return $this->container['status'];
- }
-
- /**
- * Sets status
- *
- * @param bool $status status
- *
- * @return $this
- */
- public function setStatus($status)
- {
- $this->container['status'] = $status;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateEmailCampaign.php b/lib/Model/CreateEmailCampaign.php
deleted file mode 100644
index 5bb1049..0000000
--- a/lib/Model/CreateEmailCampaign.php
+++ /dev/null
@@ -1,1291 +0,0 @@
- 'string',
- 'sender' => '\Brevo\Client\Model\CreateEmailCampaignSender',
- 'name' => 'string',
- 'htmlContent' => 'string',
- 'htmlUrl' => 'string',
- 'templateId' => 'int',
- 'scheduledAt' => 'string',
- 'subject' => 'string',
- 'previewText' => 'string',
- 'replyTo' => 'string',
- 'toField' => 'string',
- 'recipients' => '\Brevo\Client\Model\CreateEmailCampaignRecipients',
- 'attachmentUrl' => 'string',
- 'inlineImageActivation' => 'bool',
- 'mirrorActive' => 'bool',
- 'footer' => 'string',
- 'header' => 'string',
- 'utmCampaign' => 'string',
- 'params' => 'object',
- 'sendAtBestTime' => 'bool',
- 'abTesting' => 'bool',
- 'subjectA' => 'string',
- 'subjectB' => 'string',
- 'splitRule' => 'int',
- 'winnerCriteria' => 'string',
- 'winnerDelay' => 'int',
- 'ipWarmupEnable' => 'bool',
- 'initialQuota' => 'int',
- 'increaseRate' => 'int',
- 'unsubscriptionPageId' => 'string',
- 'updateFormId' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'tag' => null,
- 'sender' => null,
- 'name' => null,
- 'htmlContent' => null,
- 'htmlUrl' => 'url',
- 'templateId' => 'int64',
- 'scheduledAt' => null,
- 'subject' => null,
- 'previewText' => null,
- 'replyTo' => 'email',
- 'toField' => null,
- 'recipients' => null,
- 'attachmentUrl' => 'url',
- 'inlineImageActivation' => null,
- 'mirrorActive' => null,
- 'footer' => null,
- 'header' => null,
- 'utmCampaign' => null,
- 'params' => null,
- 'sendAtBestTime' => null,
- 'abTesting' => null,
- 'subjectA' => null,
- 'subjectB' => null,
- 'splitRule' => 'int64',
- 'winnerCriteria' => null,
- 'winnerDelay' => 'int64',
- 'ipWarmupEnable' => null,
- 'initialQuota' => 'int64',
- 'increaseRate' => 'int64',
- 'unsubscriptionPageId' => null,
- 'updateFormId' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'tag' => 'tag',
- 'sender' => 'sender',
- 'name' => 'name',
- 'htmlContent' => 'htmlContent',
- 'htmlUrl' => 'htmlUrl',
- 'templateId' => 'templateId',
- 'scheduledAt' => 'scheduledAt',
- 'subject' => 'subject',
- 'previewText' => 'previewText',
- 'replyTo' => 'replyTo',
- 'toField' => 'toField',
- 'recipients' => 'recipients',
- 'attachmentUrl' => 'attachmentUrl',
- 'inlineImageActivation' => 'inlineImageActivation',
- 'mirrorActive' => 'mirrorActive',
- 'footer' => 'footer',
- 'header' => 'header',
- 'utmCampaign' => 'utmCampaign',
- 'params' => 'params',
- 'sendAtBestTime' => 'sendAtBestTime',
- 'abTesting' => 'abTesting',
- 'subjectA' => 'subjectA',
- 'subjectB' => 'subjectB',
- 'splitRule' => 'splitRule',
- 'winnerCriteria' => 'winnerCriteria',
- 'winnerDelay' => 'winnerDelay',
- 'ipWarmupEnable' => 'ipWarmupEnable',
- 'initialQuota' => 'initialQuota',
- 'increaseRate' => 'increaseRate',
- 'unsubscriptionPageId' => 'unsubscriptionPageId',
- 'updateFormId' => 'updateFormId'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'tag' => 'setTag',
- 'sender' => 'setSender',
- 'name' => 'setName',
- 'htmlContent' => 'setHtmlContent',
- 'htmlUrl' => 'setHtmlUrl',
- 'templateId' => 'setTemplateId',
- 'scheduledAt' => 'setScheduledAt',
- 'subject' => 'setSubject',
- 'previewText' => 'setPreviewText',
- 'replyTo' => 'setReplyTo',
- 'toField' => 'setToField',
- 'recipients' => 'setRecipients',
- 'attachmentUrl' => 'setAttachmentUrl',
- 'inlineImageActivation' => 'setInlineImageActivation',
- 'mirrorActive' => 'setMirrorActive',
- 'footer' => 'setFooter',
- 'header' => 'setHeader',
- 'utmCampaign' => 'setUtmCampaign',
- 'params' => 'setParams',
- 'sendAtBestTime' => 'setSendAtBestTime',
- 'abTesting' => 'setAbTesting',
- 'subjectA' => 'setSubjectA',
- 'subjectB' => 'setSubjectB',
- 'splitRule' => 'setSplitRule',
- 'winnerCriteria' => 'setWinnerCriteria',
- 'winnerDelay' => 'setWinnerDelay',
- 'ipWarmupEnable' => 'setIpWarmupEnable',
- 'initialQuota' => 'setInitialQuota',
- 'increaseRate' => 'setIncreaseRate',
- 'unsubscriptionPageId' => 'setUnsubscriptionPageId',
- 'updateFormId' => 'setUpdateFormId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'tag' => 'getTag',
- 'sender' => 'getSender',
- 'name' => 'getName',
- 'htmlContent' => 'getHtmlContent',
- 'htmlUrl' => 'getHtmlUrl',
- 'templateId' => 'getTemplateId',
- 'scheduledAt' => 'getScheduledAt',
- 'subject' => 'getSubject',
- 'previewText' => 'getPreviewText',
- 'replyTo' => 'getReplyTo',
- 'toField' => 'getToField',
- 'recipients' => 'getRecipients',
- 'attachmentUrl' => 'getAttachmentUrl',
- 'inlineImageActivation' => 'getInlineImageActivation',
- 'mirrorActive' => 'getMirrorActive',
- 'footer' => 'getFooter',
- 'header' => 'getHeader',
- 'utmCampaign' => 'getUtmCampaign',
- 'params' => 'getParams',
- 'sendAtBestTime' => 'getSendAtBestTime',
- 'abTesting' => 'getAbTesting',
- 'subjectA' => 'getSubjectA',
- 'subjectB' => 'getSubjectB',
- 'splitRule' => 'getSplitRule',
- 'winnerCriteria' => 'getWinnerCriteria',
- 'winnerDelay' => 'getWinnerDelay',
- 'ipWarmupEnable' => 'getIpWarmupEnable',
- 'initialQuota' => 'getInitialQuota',
- 'increaseRate' => 'getIncreaseRate',
- 'unsubscriptionPageId' => 'getUnsubscriptionPageId',
- 'updateFormId' => 'getUpdateFormId'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const WINNER_CRITERIA_OPEN = 'open';
- const WINNER_CRITERIA_CLICK = 'click';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getWinnerCriteriaAllowableValues()
- {
- return [
- self::WINNER_CRITERIA_OPEN,
- self::WINNER_CRITERIA_CLICK,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null;
- $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['htmlContent'] = isset($data['htmlContent']) ? $data['htmlContent'] : null;
- $this->container['htmlUrl'] = isset($data['htmlUrl']) ? $data['htmlUrl'] : null;
- $this->container['templateId'] = isset($data['templateId']) ? $data['templateId'] : null;
- $this->container['scheduledAt'] = isset($data['scheduledAt']) ? $data['scheduledAt'] : null;
- $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null;
- $this->container['previewText'] = isset($data['previewText']) ? $data['previewText'] : null;
- $this->container['replyTo'] = isset($data['replyTo']) ? $data['replyTo'] : null;
- $this->container['toField'] = isset($data['toField']) ? $data['toField'] : null;
- $this->container['recipients'] = isset($data['recipients']) ? $data['recipients'] : null;
- $this->container['attachmentUrl'] = isset($data['attachmentUrl']) ? $data['attachmentUrl'] : null;
- $this->container['inlineImageActivation'] = isset($data['inlineImageActivation']) ? $data['inlineImageActivation'] : false;
- $this->container['mirrorActive'] = isset($data['mirrorActive']) ? $data['mirrorActive'] : null;
- $this->container['footer'] = isset($data['footer']) ? $data['footer'] : null;
- $this->container['header'] = isset($data['header']) ? $data['header'] : null;
- $this->container['utmCampaign'] = isset($data['utmCampaign']) ? $data['utmCampaign'] : null;
- $this->container['params'] = isset($data['params']) ? $data['params'] : null;
- $this->container['sendAtBestTime'] = isset($data['sendAtBestTime']) ? $data['sendAtBestTime'] : false;
- $this->container['abTesting'] = isset($data['abTesting']) ? $data['abTesting'] : false;
- $this->container['subjectA'] = isset($data['subjectA']) ? $data['subjectA'] : null;
- $this->container['subjectB'] = isset($data['subjectB']) ? $data['subjectB'] : null;
- $this->container['splitRule'] = isset($data['splitRule']) ? $data['splitRule'] : null;
- $this->container['winnerCriteria'] = isset($data['winnerCriteria']) ? $data['winnerCriteria'] : null;
- $this->container['winnerDelay'] = isset($data['winnerDelay']) ? $data['winnerDelay'] : null;
- $this->container['ipWarmupEnable'] = isset($data['ipWarmupEnable']) ? $data['ipWarmupEnable'] : false;
- $this->container['initialQuota'] = isset($data['initialQuota']) ? $data['initialQuota'] : null;
- $this->container['increaseRate'] = isset($data['increaseRate']) ? $data['increaseRate'] : null;
- $this->container['unsubscriptionPageId'] = isset($data['unsubscriptionPageId']) ? $data['unsubscriptionPageId'] : null;
- $this->container['updateFormId'] = isset($data['updateFormId']) ? $data['updateFormId'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['sender'] === null) {
- $invalidProperties[] = "'sender' can't be null";
- }
- if ($this->container['name'] === null) {
- $invalidProperties[] = "'name' can't be null";
- }
- if (!is_null($this->container['splitRule']) && ($this->container['splitRule'] > 50)) {
- $invalidProperties[] = "invalid value for 'splitRule', must be smaller than or equal to 50.";
- }
-
- if (!is_null($this->container['splitRule']) && ($this->container['splitRule'] < 1)) {
- $invalidProperties[] = "invalid value for 'splitRule', must be bigger than or equal to 1.";
- }
-
- $allowedValues = $this->getWinnerCriteriaAllowableValues();
- if (!is_null($this->container['winnerCriteria']) && !in_array($this->container['winnerCriteria'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'winnerCriteria', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- if (!is_null($this->container['winnerDelay']) && ($this->container['winnerDelay'] > 168)) {
- $invalidProperties[] = "invalid value for 'winnerDelay', must be smaller than or equal to 168.";
- }
-
- if (!is_null($this->container['winnerDelay']) && ($this->container['winnerDelay'] < 1)) {
- $invalidProperties[] = "invalid value for 'winnerDelay', must be bigger than or equal to 1.";
- }
-
- if (!is_null($this->container['increaseRate']) && ($this->container['increaseRate'] > 100)) {
- $invalidProperties[] = "invalid value for 'increaseRate', must be smaller than or equal to 100.";
- }
-
- if (!is_null($this->container['increaseRate']) && ($this->container['increaseRate'] < 0)) {
- $invalidProperties[] = "invalid value for 'increaseRate', must be bigger than or equal to 0.";
- }
-
- 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 tag
- *
- * @return string
- */
- public function getTag()
- {
- return $this->container['tag'];
- }
-
- /**
- * Sets tag
- *
- * @param string $tag Tag of the campaign
- *
- * @return $this
- */
- public function setTag($tag)
- {
- $this->container['tag'] = $tag;
-
- return $this;
- }
-
- /**
- * Gets sender
- *
- * @return \Brevo\Client\Model\CreateEmailCampaignSender
- */
- public function getSender()
- {
- return $this->container['sender'];
- }
-
- /**
- * Sets sender
- *
- * @param \Brevo\Client\Model\CreateEmailCampaignSender $sender sender
- *
- * @return $this
- */
- public function setSender($sender)
- {
- $this->container['sender'] = $sender;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the campaign
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets htmlContent
- *
- * @return string
- */
- public function getHtmlContent()
- {
- return $this->container['htmlContent'];
- }
-
- /**
- * Sets htmlContent
- *
- * @param string $htmlContent Mandatory if htmlUrl and templateId are empty. Body of the message (HTML)
- *
- * @return $this
- */
- public function setHtmlContent($htmlContent)
- {
- $this->container['htmlContent'] = $htmlContent;
-
- return $this;
- }
-
- /**
- * Gets htmlUrl
- *
- * @return string
- */
- public function getHtmlUrl()
- {
- return $this->container['htmlUrl'];
- }
-
- /**
- * Sets htmlUrl
- *
- * @param string $htmlUrl Mandatory if htmlContent and templateId are empty. Url to the message (HTML)
- *
- * @return $this
- */
- public function setHtmlUrl($htmlUrl)
- {
- $this->container['htmlUrl'] = $htmlUrl;
-
- return $this;
- }
-
- /**
- * Gets templateId
- *
- * @return int
- */
- public function getTemplateId()
- {
- return $this->container['templateId'];
- }
-
- /**
- * Sets templateId
- *
- * @param int $templateId Mandatory if htmlContent and htmlUrl are empty. Id of the transactional email template with status 'active'. Used to copy only its content fetched from htmlContent/htmlUrl to an email campaign for RSS feature.
- *
- * @return $this
- */
- public function setTemplateId($templateId)
- {
- $this->container['templateId'] = $templateId;
-
- return $this;
- }
-
- /**
- * Gets scheduledAt
- *
- * @return string
- */
- public function getScheduledAt()
- {
- return $this->container['scheduledAt'];
- }
-
- /**
- * Sets scheduledAt
- *
- * @param string $scheduledAt Sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part).
- *
- * @return $this
- */
- public function setScheduledAt($scheduledAt)
- {
- $this->container['scheduledAt'] = $scheduledAt;
-
- return $this;
- }
-
- /**
- * Gets subject
- *
- * @return string
- */
- public function getSubject()
- {
- return $this->container['subject'];
- }
-
- /**
- * Sets subject
- *
- * @param string $subject Subject of the campaign. Mandatory if abTesting is false. Ignored if abTesting is true.
- *
- * @return $this
- */
- public function setSubject($subject)
- {
- $this->container['subject'] = $subject;
-
- return $this;
- }
-
- /**
- * Gets previewText
- *
- * @return string
- */
- public function getPreviewText()
- {
- return $this->container['previewText'];
- }
-
- /**
- * Sets previewText
- *
- * @param string $previewText Preview text or preheader of the email campaign
- *
- * @return $this
- */
- public function setPreviewText($previewText)
- {
- $this->container['previewText'] = $previewText;
-
- return $this;
- }
-
- /**
- * Gets replyTo
- *
- * @return string
- */
- public function getReplyTo()
- {
- return $this->container['replyTo'];
- }
-
- /**
- * Sets replyTo
- *
- * @param string $replyTo Email on which the campaign recipients will be able to reply to
- *
- * @return $this
- */
- public function setReplyTo($replyTo)
- {
- $this->container['replyTo'] = $replyTo;
-
- return $this;
- }
-
- /**
- * Gets toField
- *
- * @return string
- */
- public function getToField()
- {
- return $this->container['toField'];
- }
-
- /**
- * Sets toField
- *
- * @param string $toField To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your Brevo account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization
- *
- * @return $this
- */
- public function setToField($toField)
- {
- $this->container['toField'] = $toField;
-
- return $this;
- }
-
- /**
- * Gets recipients
- *
- * @return \Brevo\Client\Model\CreateEmailCampaignRecipients
- */
- public function getRecipients()
- {
- return $this->container['recipients'];
- }
-
- /**
- * Sets recipients
- *
- * @param \Brevo\Client\Model\CreateEmailCampaignRecipients $recipients recipients
- *
- * @return $this
- */
- public function setRecipients($recipients)
- {
- $this->container['recipients'] = $recipients;
-
- return $this;
- }
-
- /**
- * Gets attachmentUrl
- *
- * @return string
- */
- public function getAttachmentUrl()
- {
- return $this->container['attachmentUrl'];
- }
-
- /**
- * Sets attachmentUrl
- *
- * @param string $attachmentUrl Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps
- *
- * @return $this
- */
- public function setAttachmentUrl($attachmentUrl)
- {
- $this->container['attachmentUrl'] = $attachmentUrl;
-
- return $this;
- }
-
- /**
- * Gets inlineImageActivation
- *
- * @return bool
- */
- public function getInlineImageActivation()
- {
- return $this->container['inlineImageActivation'];
- }
-
- /**
- * Sets inlineImageActivation
- *
- * @param bool $inlineImageActivation Use true to embedded the images in your email. Final size of the email should be less than 4MB. Campaigns with embedded images can not be sent to more than 5000 contacts
- *
- * @return $this
- */
- public function setInlineImageActivation($inlineImageActivation)
- {
- $this->container['inlineImageActivation'] = $inlineImageActivation;
-
- return $this;
- }
-
- /**
- * Gets mirrorActive
- *
- * @return bool
- */
- public function getMirrorActive()
- {
- return $this->container['mirrorActive'];
- }
-
- /**
- * Sets mirrorActive
- *
- * @param bool $mirrorActive Use true to enable the mirror link
- *
- * @return $this
- */
- public function setMirrorActive($mirrorActive)
- {
- $this->container['mirrorActive'] = $mirrorActive;
-
- return $this;
- }
-
- /**
- * Gets footer
- *
- * @return string
- */
- public function getFooter()
- {
- return $this->container['footer'];
- }
-
- /**
- * Sets footer
- *
- * @param string $footer Footer of the email campaign
- *
- * @return $this
- */
- public function setFooter($footer)
- {
- $this->container['footer'] = $footer;
-
- return $this;
- }
-
- /**
- * Gets header
- *
- * @return string
- */
- public function getHeader()
- {
- return $this->container['header'];
- }
-
- /**
- * Sets header
- *
- * @param string $header Header of the email campaign
- *
- * @return $this
- */
- public function setHeader($header)
- {
- $this->container['header'] = $header;
-
- return $this;
- }
-
- /**
- * Gets utmCampaign
- *
- * @return string
- */
- public function getUtmCampaign()
- {
- return $this->container['utmCampaign'];
- }
-
- /**
- * Sets utmCampaign
- *
- * @param string $utmCampaign Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed
- *
- * @return $this
- */
- public function setUtmCampaign($utmCampaign)
- {
- $this->container['utmCampaign'] = $utmCampaign;
-
- return $this;
- }
-
- /**
- * Gets params
- *
- * @return object
- */
- public function getParams()
- {
- return $this->container['params'];
- }
-
- /**
- * Sets params
- *
- * @param object $params Pass the set of attributes to customize the type classic campaign. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. Only available if 'type' is 'classic'. It's considered only if campaign is in New Template Language format. The New Template Language is dependent on the values of 'subject', 'htmlContent/htmlUrl', 'sender.name' & 'toField'
- *
- * @return $this
- */
- public function setParams($params)
- {
- $this->container['params'] = $params;
-
- return $this;
- }
-
- /**
- * Gets sendAtBestTime
- *
- * @return bool
- */
- public function getSendAtBestTime()
- {
- return $this->container['sendAtBestTime'];
- }
-
- /**
- * Sets sendAtBestTime
- *
- * @param bool $sendAtBestTime Set this to true if you want to send your campaign at best time.
- *
- * @return $this
- */
- public function setSendAtBestTime($sendAtBestTime)
- {
- $this->container['sendAtBestTime'] = $sendAtBestTime;
-
- return $this;
- }
-
- /**
- * Gets abTesting
- *
- * @return bool
- */
- public function getAbTesting()
- {
- return $this->container['abTesting'];
- }
-
- /**
- * Sets abTesting
- *
- * @param bool $abTesting Status of A/B Test. abTesting = false means it is disabled, & abTesting = true means it is enabled. 'subjectA', 'subjectB', 'splitRule', 'winnerCriteria' & 'winnerDelay' will be considered when abTesting is set to true. 'subjectA' & 'subjectB' are mandatory together & 'subject' if passed is ignored. Can be set to true only if 'sendAtBestTime' is 'false'. You will be able to set up two subject lines for your campaign and send them to a random sample of your total recipients. Half of the test group will receive version A, and the other half will receive version B
- *
- * @return $this
- */
- public function setAbTesting($abTesting)
- {
- $this->container['abTesting'] = $abTesting;
-
- return $this;
- }
-
- /**
- * Gets subjectA
- *
- * @return string
- */
- public function getSubjectA()
- {
- return $this->container['subjectA'];
- }
-
- /**
- * Sets subjectA
- *
- * @param string $subjectA Subject A of the campaign. Mandatory if abTesting = true. subjectA & subjectB should have unique value
- *
- * @return $this
- */
- public function setSubjectA($subjectA)
- {
- $this->container['subjectA'] = $subjectA;
-
- return $this;
- }
-
- /**
- * Gets subjectB
- *
- * @return string
- */
- public function getSubjectB()
- {
- return $this->container['subjectB'];
- }
-
- /**
- * Sets subjectB
- *
- * @param string $subjectB Subject B of the campaign. Mandatory if abTesting = true. subjectA & subjectB should have unique value
- *
- * @return $this
- */
- public function setSubjectB($subjectB)
- {
- $this->container['subjectB'] = $subjectB;
-
- return $this;
- }
-
- /**
- * Gets splitRule
- *
- * @return int
- */
- public function getSplitRule()
- {
- return $this->container['splitRule'];
- }
-
- /**
- * Sets splitRule
- *
- * @param int $splitRule Add the size of your test groups. Mandatory if abTesting = true & 'recipients' is passed. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else
- *
- * @return $this
- */
- public function setSplitRule($splitRule)
- {
-
- if (!is_null($splitRule) && ($splitRule > 50)) {
- throw new \InvalidArgumentException('invalid value for $splitRule when calling CreateEmailCampaign., must be smaller than or equal to 50.');
- }
- if (!is_null($splitRule) && ($splitRule < 1)) {
- throw new \InvalidArgumentException('invalid value for $splitRule when calling CreateEmailCampaign., must be bigger than or equal to 1.');
- }
-
- $this->container['splitRule'] = $splitRule;
-
- return $this;
- }
-
- /**
- * Gets winnerCriteria
- *
- * @return string
- */
- public function getWinnerCriteria()
- {
- return $this->container['winnerCriteria'];
- }
-
- /**
- * Sets winnerCriteria
- *
- * @param string $winnerCriteria Choose the metrics that will determinate the winning version. Mandatory if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerCriteria' is ignored if passed
- *
- * @return $this
- */
- public function setWinnerCriteria($winnerCriteria)
- {
- $allowedValues = $this->getWinnerCriteriaAllowableValues();
- if (!is_null($winnerCriteria) && !in_array($winnerCriteria, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'winnerCriteria', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['winnerCriteria'] = $winnerCriteria;
-
- return $this;
- }
-
- /**
- * Gets winnerDelay
- *
- * @return int
- */
- public function getWinnerDelay()
- {
- return $this->container['winnerDelay'];
- }
-
- /**
- * Sets winnerDelay
- *
- * @param int $winnerDelay Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. Mandatory if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerDelay' is ignored if passed
- *
- * @return $this
- */
- public function setWinnerDelay($winnerDelay)
- {
-
- if (!is_null($winnerDelay) && ($winnerDelay > 168)) {
- throw new \InvalidArgumentException('invalid value for $winnerDelay when calling CreateEmailCampaign., must be smaller than or equal to 168.');
- }
- if (!is_null($winnerDelay) && ($winnerDelay < 1)) {
- throw new \InvalidArgumentException('invalid value for $winnerDelay when calling CreateEmailCampaign., must be bigger than or equal to 1.');
- }
-
- $this->container['winnerDelay'] = $winnerDelay;
-
- return $this;
- }
-
- /**
- * Gets ipWarmupEnable
- *
- * @return bool
- */
- public function getIpWarmupEnable()
- {
- return $this->container['ipWarmupEnable'];
- }
-
- /**
- * Sets ipWarmupEnable
- *
- * @param bool $ipWarmupEnable Available for dedicated ip clients. Set this to true if you wish to warm up your ip.
- *
- * @return $this
- */
- public function setIpWarmupEnable($ipWarmupEnable)
- {
- $this->container['ipWarmupEnable'] = $ipWarmupEnable;
-
- return $this;
- }
-
- /**
- * Gets initialQuota
- *
- * @return int
- */
- public function getInitialQuota()
- {
- return $this->container['initialQuota'];
- }
-
- /**
- * Sets initialQuota
- *
- * @param int $initialQuota Mandatory if ipWarmupEnable is set to true. Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000.
- *
- * @return $this
- */
- public function setInitialQuota($initialQuota)
- {
- $this->container['initialQuota'] = $initialQuota;
-
- return $this;
- }
-
- /**
- * Gets increaseRate
- *
- * @return int
- */
- public function getIncreaseRate()
- {
- return $this->container['increaseRate'];
- }
-
- /**
- * Sets increaseRate
- *
- * @param int $increaseRate Mandatory if ipWarmupEnable is set to true. Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%.
- *
- * @return $this
- */
- public function setIncreaseRate($increaseRate)
- {
-
- if (!is_null($increaseRate) && ($increaseRate > 100)) {
- throw new \InvalidArgumentException('invalid value for $increaseRate when calling CreateEmailCampaign., must be smaller than or equal to 100.');
- }
- if (!is_null($increaseRate) && ($increaseRate < 0)) {
- throw new \InvalidArgumentException('invalid value for $increaseRate when calling CreateEmailCampaign., must be bigger than or equal to 0.');
- }
-
- $this->container['increaseRate'] = $increaseRate;
-
- return $this;
- }
-
- /**
- * Gets unsubscriptionPageId
- *
- * @return string
- */
- public function getUnsubscriptionPageId()
- {
- return $this->container['unsubscriptionPageId'];
- }
-
- /**
- * Sets unsubscriptionPageId
- *
- * @param string $unsubscriptionPageId Enter an unsubscription page id. The page id is a 24 digit alphanumeric id that can be found in the URL when editing the page. If not entered, then the default unsubscription page will be used.
- *
- * @return $this
- */
- public function setUnsubscriptionPageId($unsubscriptionPageId)
- {
- $this->container['unsubscriptionPageId'] = $unsubscriptionPageId;
-
- return $this;
- }
-
- /**
- * Gets updateFormId
- *
- * @return string
- */
- public function getUpdateFormId()
- {
- return $this->container['updateFormId'];
- }
-
- /**
- * Sets updateFormId
- *
- * @param string $updateFormId Mandatory if templateId is used containing the {{ update_profile }} tag. Enter an update profile form id. The form id is a 24 digit alphanumeric id that can be found in the URL when editing the form. If not entered, then the default update profile form will be used.
- *
- * @return $this
- */
- public function setUpdateFormId($updateFormId)
- {
- $this->container['updateFormId'] = $updateFormId;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateEmailCampaignRecipients.php b/lib/Model/CreateEmailCampaignRecipients.php
deleted file mode 100644
index c4d1cb5..0000000
--- a/lib/Model/CreateEmailCampaignRecipients.php
+++ /dev/null
@@ -1,366 +0,0 @@
- 'int[]',
- 'listIds' => 'int[]',
- 'segmentIds' => 'int[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'exclusionListIds' => 'int64',
- 'listIds' => 'int64',
- 'segmentIds' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'exclusionListIds' => 'exclusionListIds',
- 'listIds' => 'listIds',
- 'segmentIds' => 'segmentIds'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'exclusionListIds' => 'setExclusionListIds',
- 'listIds' => 'setListIds',
- 'segmentIds' => 'setSegmentIds'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'exclusionListIds' => 'getExclusionListIds',
- 'listIds' => 'getListIds',
- 'segmentIds' => 'getSegmentIds'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['exclusionListIds'] = isset($data['exclusionListIds']) ? $data['exclusionListIds'] : null;
- $this->container['listIds'] = isset($data['listIds']) ? $data['listIds'] : null;
- $this->container['segmentIds'] = isset($data['segmentIds']) ? $data['segmentIds'] : null;
- }
-
- /**
- * 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 exclusionListIds
- *
- * @return int[]
- */
- public function getExclusionListIds()
- {
- return $this->container['exclusionListIds'];
- }
-
- /**
- * Sets exclusionListIds
- *
- * @param int[] $exclusionListIds List ids to exclude from the campaign
- *
- * @return $this
- */
- public function setExclusionListIds($exclusionListIds)
- {
- $this->container['exclusionListIds'] = $exclusionListIds;
-
- return $this;
- }
-
- /**
- * Gets listIds
- *
- * @return int[]
- */
- public function getListIds()
- {
- return $this->container['listIds'];
- }
-
- /**
- * Sets listIds
- *
- * @param int[] $listIds Mandatory if scheduledAt is not empty. List Ids to send the campaign to
- *
- * @return $this
- */
- public function setListIds($listIds)
- {
- $this->container['listIds'] = $listIds;
-
- return $this;
- }
-
- /**
- * Gets segmentIds
- *
- * @return int[]
- */
- public function getSegmentIds()
- {
- return $this->container['segmentIds'];
- }
-
- /**
- * Sets segmentIds
- *
- * @param int[] $segmentIds Mandatory if listIds are not used. Segment ids to send the campaign to.
- *
- * @return $this
- */
- public function setSegmentIds($segmentIds)
- {
- $this->container['segmentIds'] = $segmentIds;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateEmailCampaignSender.php b/lib/Model/CreateEmailCampaignSender.php
deleted file mode 100644
index 5b7185b..0000000
--- a/lib/Model/CreateEmailCampaignSender.php
+++ /dev/null
@@ -1,369 +0,0 @@
- 'string',
- 'email' => 'string',
- 'id' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'email' => 'email',
- 'id' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'email' => 'email',
- 'id' => 'id'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'email' => 'setEmail',
- 'id' => 'setId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'email' => 'getEmail',
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['email'] === null) {
- $invalidProperties[] = "'email' 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Sender Name
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Sender email
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets id
- *
- * @return int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id Select the sender for the campaign on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email).
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateExternalFeed.php b/lib/Model/CreateExternalFeed.php
deleted file mode 100644
index fa3fa2d..0000000
--- a/lib/Model/CreateExternalFeed.php
+++ /dev/null
@@ -1,601 +0,0 @@
- 'string',
- 'url' => 'string',
- 'authType' => 'string',
- 'username' => 'string',
- 'password' => 'string',
- 'token' => 'string',
- 'headers' => '\Brevo\Client\Model\GetExternalFeedByUUIDHeaders[]',
- 'maxRetries' => 'int',
- 'cache' => 'bool'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'url' => 'url',
- 'authType' => null,
- 'username' => null,
- 'password' => null,
- 'token' => null,
- 'headers' => null,
- 'maxRetries' => null,
- 'cache' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'url' => 'url',
- 'authType' => 'authType',
- 'username' => 'username',
- 'password' => 'password',
- 'token' => 'token',
- 'headers' => 'headers',
- 'maxRetries' => 'maxRetries',
- 'cache' => 'cache'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'url' => 'setUrl',
- 'authType' => 'setAuthType',
- 'username' => 'setUsername',
- 'password' => 'setPassword',
- 'token' => 'setToken',
- 'headers' => 'setHeaders',
- 'maxRetries' => 'setMaxRetries',
- 'cache' => 'setCache'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'url' => 'getUrl',
- 'authType' => 'getAuthType',
- 'username' => 'getUsername',
- 'password' => 'getPassword',
- 'token' => 'getToken',
- 'headers' => 'getHeaders',
- 'maxRetries' => 'getMaxRetries',
- 'cache' => 'getCache'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const AUTH_TYPE_BASIC = 'basic';
- const AUTH_TYPE_TOKEN = 'token';
- const AUTH_TYPE_NO_AUTH = 'noAuth';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getAuthTypeAllowableValues()
- {
- return [
- self::AUTH_TYPE_BASIC,
- self::AUTH_TYPE_TOKEN,
- self::AUTH_TYPE_NO_AUTH,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['url'] = isset($data['url']) ? $data['url'] : null;
- $this->container['authType'] = isset($data['authType']) ? $data['authType'] : 'noAuth';
- $this->container['username'] = isset($data['username']) ? $data['username'] : null;
- $this->container['password'] = isset($data['password']) ? $data['password'] : null;
- $this->container['token'] = isset($data['token']) ? $data['token'] : null;
- $this->container['headers'] = isset($data['headers']) ? $data['headers'] : null;
- $this->container['maxRetries'] = isset($data['maxRetries']) ? $data['maxRetries'] : null;
- $this->container['cache'] = isset($data['cache']) ? $data['cache'] : false;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['name'] === null) {
- $invalidProperties[] = "'name' can't be null";
- }
- if ($this->container['url'] === null) {
- $invalidProperties[] = "'url' can't be null";
- }
- $allowedValues = $this->getAuthTypeAllowableValues();
- if (!is_null($this->container['authType']) && !in_array($this->container['authType'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'authType', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- if (!is_null($this->container['maxRetries']) && ($this->container['maxRetries'] > 5)) {
- $invalidProperties[] = "invalid value for 'maxRetries', must be smaller than or equal to 5.";
- }
-
- if (!is_null($this->container['maxRetries']) && ($this->container['maxRetries'] < 0)) {
- $invalidProperties[] = "invalid value for 'maxRetries', must be bigger than or equal to 0.";
- }
-
- 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the feed
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets url
- *
- * @return string
- */
- public function getUrl()
- {
- return $this->container['url'];
- }
-
- /**
- * Sets url
- *
- * @param string $url URL of the feed
- *
- * @return $this
- */
- public function setUrl($url)
- {
- $this->container['url'] = $url;
-
- return $this;
- }
-
- /**
- * Gets authType
- *
- * @return string
- */
- public function getAuthType()
- {
- return $this->container['authType'];
- }
-
- /**
- * Sets authType
- *
- * @param string $authType Auth type of the feed: * `basic` * `token` * `noAuth`
- *
- * @return $this
- */
- public function setAuthType($authType)
- {
- $allowedValues = $this->getAuthTypeAllowableValues();
- if (!is_null($authType) && !in_array($authType, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'authType', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['authType'] = $authType;
-
- return $this;
- }
-
- /**
- * Gets username
- *
- * @return string
- */
- public function getUsername()
- {
- return $this->container['username'];
- }
-
- /**
- * Sets username
- *
- * @param string $username Username for authType `basic`
- *
- * @return $this
- */
- public function setUsername($username)
- {
- $this->container['username'] = $username;
-
- return $this;
- }
-
- /**
- * Gets password
- *
- * @return string
- */
- public function getPassword()
- {
- return $this->container['password'];
- }
-
- /**
- * Sets password
- *
- * @param string $password Password for authType `basic`
- *
- * @return $this
- */
- public function setPassword($password)
- {
- $this->container['password'] = $password;
-
- return $this;
- }
-
- /**
- * Gets token
- *
- * @return string
- */
- public function getToken()
- {
- return $this->container['token'];
- }
-
- /**
- * Sets token
- *
- * @param string $token Token for authType `token`
- *
- * @return $this
- */
- public function setToken($token)
- {
- $this->container['token'] = $token;
-
- return $this;
- }
-
- /**
- * Gets headers
- *
- * @return \Brevo\Client\Model\GetExternalFeedByUUIDHeaders[]
- */
- public function getHeaders()
- {
- return $this->container['headers'];
- }
-
- /**
- * Sets headers
- *
- * @param \Brevo\Client\Model\GetExternalFeedByUUIDHeaders[] $headers Custom headers for the feed
- *
- * @return $this
- */
- public function setHeaders($headers)
- {
- $this->container['headers'] = $headers;
-
- return $this;
- }
-
- /**
- * Gets maxRetries
- *
- * @return int
- */
- public function getMaxRetries()
- {
- return $this->container['maxRetries'];
- }
-
- /**
- * Sets maxRetries
- *
- * @param int $maxRetries Maximum number of retries on the feed url
- *
- * @return $this
- */
- public function setMaxRetries($maxRetries)
- {
-
- if (!is_null($maxRetries) && ($maxRetries > 5)) {
- throw new \InvalidArgumentException('invalid value for $maxRetries when calling CreateExternalFeed., must be smaller than or equal to 5.');
- }
- if (!is_null($maxRetries) && ($maxRetries < 0)) {
- throw new \InvalidArgumentException('invalid value for $maxRetries when calling CreateExternalFeed., must be bigger than or equal to 0.');
- }
-
- $this->container['maxRetries'] = $maxRetries;
-
- return $this;
- }
-
- /**
- * Gets cache
- *
- * @return bool
- */
- public function getCache()
- {
- return $this->container['cache'];
- }
-
- /**
- * Sets cache
- *
- * @param bool $cache Toggle caching of feed url response
- *
- * @return $this
- */
- public function setCache($cache)
- {
- $this->container['cache'] = $cache;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateList.php b/lib/Model/CreateList.php
deleted file mode 100644
index cc7f5ee..0000000
--- a/lib/Model/CreateList.php
+++ /dev/null
@@ -1,341 +0,0 @@
- 'string',
- 'folderId' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'folderId' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'folderId' => 'folderId'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'folderId' => 'setFolderId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'folderId' => 'getFolderId'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['folderId'] = isset($data['folderId']) ? $data['folderId'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['name'] === null) {
- $invalidProperties[] = "'name' can't be null";
- }
- if ($this->container['folderId'] === null) {
- $invalidProperties[] = "'folderId' 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the list
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets folderId
- *
- * @return int
- */
- public function getFolderId()
- {
- return $this->container['folderId'];
- }
-
- /**
- * Sets folderId
- *
- * @param int $folderId Id of the parent folder in which this list is to be created
- *
- * @return $this
- */
- public function setFolderId($folderId)
- {
- $this->container['folderId'] = $folderId;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateModel.php b/lib/Model/CreateModel.php
deleted file mode 100644
index 921fdd7..0000000
--- a/lib/Model/CreateModel.php
+++ /dev/null
@@ -1,308 +0,0 @@
- 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- }
-
- /**
- * 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";
- }
- 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 int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id ID of the object created
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateProductModel.php b/lib/Model/CreateProductModel.php
deleted file mode 100644
index 4d475ea..0000000
--- a/lib/Model/CreateProductModel.php
+++ /dev/null
@@ -1,305 +0,0 @@
- 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- }
-
- /**
- * 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 id
- *
- * @return int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id ID of the Product when a new product is created
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateReseller.php b/lib/Model/CreateReseller.php
deleted file mode 100644
index e9cc84d..0000000
--- a/lib/Model/CreateReseller.php
+++ /dev/null
@@ -1,338 +0,0 @@
- 'string',
- 'id' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'authKey' => null,
- 'id' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'authKey' => 'authKey',
- 'id' => 'id'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'authKey' => 'setAuthKey',
- 'id' => 'setId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'authKey' => 'getAuthKey',
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['authKey'] = isset($data['authKey']) ? $data['authKey'] : null;
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['authKey'] === null) {
- $invalidProperties[] = "'authKey' 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 authKey
- *
- * @return string
- */
- public function getAuthKey()
- {
- return $this->container['authKey'];
- }
-
- /**
- * Sets authKey
- *
- * @param string $authKey AuthKey of Reseller child created
- *
- * @return $this
- */
- public function setAuthKey($authKey)
- {
- $this->container['authKey'] = $authKey;
-
- return $this;
- }
-
- /**
- * Gets id
- *
- * @return int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id Id of Reseller child created
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateSender.php b/lib/Model/CreateSender.php
deleted file mode 100644
index 99c6e86..0000000
--- a/lib/Model/CreateSender.php
+++ /dev/null
@@ -1,371 +0,0 @@
- 'string',
- 'email' => 'string',
- 'ips' => '\Brevo\Client\Model\CreateSenderIps[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'email' => 'email',
- 'ips' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'email' => 'email',
- 'ips' => 'ips'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'email' => 'setEmail',
- 'ips' => 'setIps'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'email' => 'getEmail',
- 'ips' => 'getIps'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['ips'] = isset($data['ips']) ? $data['ips'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['name'] === null) {
- $invalidProperties[] = "'name' can't be null";
- }
- if ($this->container['email'] === null) {
- $invalidProperties[] = "'email' 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name From Name to use for the sender
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email From email to use for the sender. A verification email will be sent to this address.
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets ips
- *
- * @return \Brevo\Client\Model\CreateSenderIps[]
- */
- public function getIps()
- {
- return $this->container['ips'];
- }
-
- /**
- * Sets ips
- *
- * @param \Brevo\Client\Model\CreateSenderIps[] $ips Mandatory in case of dedicated IP, IPs to associate to the sender
- *
- * @return $this
- */
- public function setIps($ips)
- {
- $this->container['ips'] = $ips;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateSenderIps.php b/lib/Model/CreateSenderIps.php
deleted file mode 100644
index e2f5c77..0000000
--- a/lib/Model/CreateSenderIps.php
+++ /dev/null
@@ -1,387 +0,0 @@
- 'string',
- 'domain' => 'string',
- 'weight' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'ip' => null,
- 'domain' => null,
- 'weight' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'ip' => 'ip',
- 'domain' => 'domain',
- 'weight' => 'weight'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'ip' => 'setIp',
- 'domain' => 'setDomain',
- 'weight' => 'setWeight'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'ip' => 'getIp',
- 'domain' => 'getDomain',
- 'weight' => 'getWeight'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null;
- $this->container['domain'] = isset($data['domain']) ? $data['domain'] : null;
- $this->container['weight'] = isset($data['weight']) ? $data['weight'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['ip'] === null) {
- $invalidProperties[] = "'ip' can't be null";
- }
- if ($this->container['domain'] === null) {
- $invalidProperties[] = "'domain' can't be null";
- }
- if (!is_null($this->container['weight']) && ($this->container['weight'] > 100)) {
- $invalidProperties[] = "invalid value for 'weight', must be smaller than or equal to 100.";
- }
-
- if (!is_null($this->container['weight']) && ($this->container['weight'] < 1)) {
- $invalidProperties[] = "invalid value for 'weight', must be bigger than or equal to 1.";
- }
-
- 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 ip
- *
- * @return string
- */
- public function getIp()
- {
- return $this->container['ip'];
- }
-
- /**
- * Sets ip
- *
- * @param string $ip Dedicated IP available in your account
- *
- * @return $this
- */
- public function setIp($ip)
- {
- $this->container['ip'] = $ip;
-
- return $this;
- }
-
- /**
- * Gets domain
- *
- * @return string
- */
- public function getDomain()
- {
- return $this->container['domain'];
- }
-
- /**
- * Sets domain
- *
- * @param string $domain Domain of the IP
- *
- * @return $this
- */
- public function setDomain($domain)
- {
- $this->container['domain'] = $domain;
-
- return $this;
- }
-
- /**
- * Gets weight
- *
- * @return int
- */
- public function getWeight()
- {
- return $this->container['weight'];
- }
-
- /**
- * Sets weight
- *
- * @param int $weight Weight to apply to the IP. Sum of all IP weights must be 100. Should be passed for either ALL or NONE of the IPs. If it's not passed, the sending will be equally balanced on all IPs.
- *
- * @return $this
- */
- public function setWeight($weight)
- {
-
- if (!is_null($weight) && ($weight > 100)) {
- throw new \InvalidArgumentException('invalid value for $weight when calling CreateSenderIps., must be smaller than or equal to 100.');
- }
- if (!is_null($weight) && ($weight < 1)) {
- throw new \InvalidArgumentException('invalid value for $weight when calling CreateSenderIps., must be bigger than or equal to 1.');
- }
-
- $this->container['weight'] = $weight;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateSenderModel.php b/lib/Model/CreateSenderModel.php
deleted file mode 100644
index d1c6d02..0000000
--- a/lib/Model/CreateSenderModel.php
+++ /dev/null
@@ -1,368 +0,0 @@
- 'int',
- 'spfError' => 'bool',
- 'dkimError' => 'bool'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'int64',
- 'spfError' => null,
- 'dkimError' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'spfError' => 'spfError',
- 'dkimError' => 'dkimError'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'spfError' => 'setSpfError',
- 'dkimError' => 'setDkimError'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'spfError' => 'getSpfError',
- 'dkimError' => 'getDkimError'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['spfError'] = isset($data['spfError']) ? $data['spfError'] : null;
- $this->container['dkimError'] = isset($data['dkimError']) ? $data['dkimError'] : null;
- }
-
- /**
- * 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";
- }
- 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 int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id ID of the Sender created
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets spfError
- *
- * @return bool
- */
- public function getSpfError()
- {
- return $this->container['spfError'];
- }
-
- /**
- * Sets spfError
- *
- * @param bool $spfError Status of SPF configuration for the sender (true = SPF not well configured, false = SPF well configured)
- *
- * @return $this
- */
- public function setSpfError($spfError)
- {
- $this->container['spfError'] = $spfError;
-
- return $this;
- }
-
- /**
- * Gets dkimError
- *
- * @return bool
- */
- public function getDkimError()
- {
- return $this->container['dkimError'];
- }
-
- /**
- * Sets dkimError
- *
- * @param bool $dkimError Status of DKIM configuration for the sender (true = DKIM not well configured, false = DKIM well configured)
- *
- * @return $this
- */
- public function setDkimError($dkimError)
- {
- $this->container['dkimError'] = $dkimError;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateSmsCampaign.php b/lib/Model/CreateSmsCampaign.php
deleted file mode 100644
index af82549..0000000
--- a/lib/Model/CreateSmsCampaign.php
+++ /dev/null
@@ -1,532 +0,0 @@
- 'string',
- 'sender' => 'string',
- 'content' => 'string',
- 'recipients' => '\Brevo\Client\Model\CreateSmsCampaignRecipients',
- 'scheduledAt' => 'string',
- 'unicodeEnabled' => 'bool',
- 'organisationPrefix' => 'string',
- 'unsubscribeInstruction' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'sender' => null,
- 'content' => null,
- 'recipients' => null,
- 'scheduledAt' => null,
- 'unicodeEnabled' => null,
- 'organisationPrefix' => null,
- 'unsubscribeInstruction' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'sender' => 'sender',
- 'content' => 'content',
- 'recipients' => 'recipients',
- 'scheduledAt' => 'scheduledAt',
- 'unicodeEnabled' => 'unicodeEnabled',
- 'organisationPrefix' => 'organisationPrefix',
- 'unsubscribeInstruction' => 'unsubscribeInstruction'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'sender' => 'setSender',
- 'content' => 'setContent',
- 'recipients' => 'setRecipients',
- 'scheduledAt' => 'setScheduledAt',
- 'unicodeEnabled' => 'setUnicodeEnabled',
- 'organisationPrefix' => 'setOrganisationPrefix',
- 'unsubscribeInstruction' => 'setUnsubscribeInstruction'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'sender' => 'getSender',
- 'content' => 'getContent',
- 'recipients' => 'getRecipients',
- 'scheduledAt' => 'getScheduledAt',
- 'unicodeEnabled' => 'getUnicodeEnabled',
- 'organisationPrefix' => 'getOrganisationPrefix',
- 'unsubscribeInstruction' => 'getUnsubscribeInstruction'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null;
- $this->container['content'] = isset($data['content']) ? $data['content'] : null;
- $this->container['recipients'] = isset($data['recipients']) ? $data['recipients'] : null;
- $this->container['scheduledAt'] = isset($data['scheduledAt']) ? $data['scheduledAt'] : null;
- $this->container['unicodeEnabled'] = isset($data['unicodeEnabled']) ? $data['unicodeEnabled'] : false;
- $this->container['organisationPrefix'] = isset($data['organisationPrefix']) ? $data['organisationPrefix'] : null;
- $this->container['unsubscribeInstruction'] = isset($data['unsubscribeInstruction']) ? $data['unsubscribeInstruction'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['name'] === null) {
- $invalidProperties[] = "'name' can't be null";
- }
- if ($this->container['sender'] === null) {
- $invalidProperties[] = "'sender' can't be null";
- }
- if ((mb_strlen($this->container['sender']) > 15)) {
- $invalidProperties[] = "invalid value for 'sender', the character length must be smaller than or equal to 15.";
- }
-
- if ($this->container['content'] === null) {
- $invalidProperties[] = "'content' 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the campaign
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets sender
- *
- * @return string
- */
- public function getSender()
- {
- return $this->container['sender'];
- }
-
- /**
- * Sets sender
- *
- * @param string $sender Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters**
- *
- * @return $this
- */
- public function setSender($sender)
- {
- if ((mb_strlen($sender) > 15)) {
- throw new \InvalidArgumentException('invalid length for $sender when calling CreateSmsCampaign., must be smaller than or equal to 15.');
- }
-
- $this->container['sender'] = $sender;
-
- return $this;
- }
-
- /**
- * Gets content
- *
- * @return string
- */
- public function getContent()
- {
- return $this->container['content'];
- }
-
- /**
- * Sets content
- *
- * @param string $content Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS
- *
- * @return $this
- */
- public function setContent($content)
- {
- $this->container['content'] = $content;
-
- return $this;
- }
-
- /**
- * Gets recipients
- *
- * @return \Brevo\Client\Model\CreateSmsCampaignRecipients
- */
- public function getRecipients()
- {
- return $this->container['recipients'];
- }
-
- /**
- * Sets recipients
- *
- * @param \Brevo\Client\Model\CreateSmsCampaignRecipients $recipients recipients
- *
- * @return $this
- */
- public function setRecipients($recipients)
- {
- $this->container['recipients'] = $recipients;
-
- return $this;
- }
-
- /**
- * Gets scheduledAt
- *
- * @return string
- */
- public function getScheduledAt()
- {
- return $this->container['scheduledAt'];
- }
-
- /**
- * Sets scheduledAt
- *
- * @param string $scheduledAt UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.
- *
- * @return $this
- */
- public function setScheduledAt($scheduledAt)
- {
- $this->container['scheduledAt'] = $scheduledAt;
-
- return $this;
- }
-
- /**
- * Gets unicodeEnabled
- *
- * @return bool
- */
- public function getUnicodeEnabled()
- {
- return $this->container['unicodeEnabled'];
- }
-
- /**
- * Sets unicodeEnabled
- *
- * @param bool $unicodeEnabled Format of the message. It indicates whether the content should be treated as unicode or not.
- *
- * @return $this
- */
- public function setUnicodeEnabled($unicodeEnabled)
- {
- $this->container['unicodeEnabled'] = $unicodeEnabled;
-
- return $this;
- }
-
- /**
- * Gets organisationPrefix
- *
- * @return string
- */
- public function getOrganisationPrefix()
- {
- return $this->container['organisationPrefix'];
- }
-
- /**
- * Sets organisationPrefix
- *
- * @param string $organisationPrefix A recognizable prefix will ensure your audience knows who you are. Recommended by U.S. carriers. This will be added as your Brand Name before the message content. **Prefer verifying maximum length of 160 characters including this prefix in message content to avoid multiple sending of same sms.**
- *
- * @return $this
- */
- public function setOrganisationPrefix($organisationPrefix)
- {
- $this->container['organisationPrefix'] = $organisationPrefix;
-
- return $this;
- }
-
- /**
- * Gets unsubscribeInstruction
- *
- * @return string
- */
- public function getUnsubscribeInstruction()
- {
- return $this->container['unsubscribeInstruction'];
- }
-
- /**
- * Sets unsubscribeInstruction
- *
- * @param string $unsubscribeInstruction Instructions to unsubscribe from future communications. Recommended by U.S. carriers. Must include **STOP** keyword. This will be added as instructions after the end of message content. **Prefer verifying maximum length of 160 characters including this instructions in message content to avoid multiple sending of same sms.**
- *
- * @return $this
- */
- public function setUnsubscribeInstruction($unsubscribeInstruction)
- {
- $this->container['unsubscribeInstruction'] = $unsubscribeInstruction;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateSmsCampaignRecipients.php b/lib/Model/CreateSmsCampaignRecipients.php
deleted file mode 100644
index 080776a..0000000
--- a/lib/Model/CreateSmsCampaignRecipients.php
+++ /dev/null
@@ -1,338 +0,0 @@
- 'int[]',
- 'exclusionListIds' => 'int[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'listIds' => 'int64',
- 'exclusionListIds' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'listIds' => 'listIds',
- 'exclusionListIds' => 'exclusionListIds'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'listIds' => 'setListIds',
- 'exclusionListIds' => 'setExclusionListIds'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'listIds' => 'getListIds',
- 'exclusionListIds' => 'getExclusionListIds'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['listIds'] = isset($data['listIds']) ? $data['listIds'] : null;
- $this->container['exclusionListIds'] = isset($data['exclusionListIds']) ? $data['exclusionListIds'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['listIds'] === null) {
- $invalidProperties[] = "'listIds' 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 listIds
- *
- * @return int[]
- */
- public function getListIds()
- {
- return $this->container['listIds'];
- }
-
- /**
- * Sets listIds
- *
- * @param int[] $listIds Lists Ids to send the campaign to. REQUIRED if scheduledAt is not empty
- *
- * @return $this
- */
- public function setListIds($listIds)
- {
- $this->container['listIds'] = $listIds;
-
- return $this;
- }
-
- /**
- * Gets exclusionListIds
- *
- * @return int[]
- */
- public function getExclusionListIds()
- {
- return $this->container['exclusionListIds'];
- }
-
- /**
- * Sets exclusionListIds
- *
- * @param int[] $exclusionListIds List ids which have to be excluded from a campaign
- *
- * @return $this
- */
- public function setExclusionListIds($exclusionListIds)
- {
- $this->container['exclusionListIds'] = $exclusionListIds;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateSmtpEmail.php b/lib/Model/CreateSmtpEmail.php
deleted file mode 100644
index 5f2a3a5..0000000
--- a/lib/Model/CreateSmtpEmail.php
+++ /dev/null
@@ -1,335 +0,0 @@
- 'string',
- 'messageIds' => 'string[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'messageId' => null,
- 'messageIds' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'messageId' => 'messageId',
- 'messageIds' => 'messageIds'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'messageId' => 'setMessageId',
- 'messageIds' => 'setMessageIds'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'messageId' => 'getMessageId',
- 'messageIds' => 'getMessageIds'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['messageId'] = isset($data['messageId']) ? $data['messageId'] : null;
- $this->container['messageIds'] = isset($data['messageIds']) ? $data['messageIds'] : null;
- }
-
- /**
- * 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 messageId
- *
- * @return string
- */
- public function getMessageId()
- {
- return $this->container['messageId'];
- }
-
- /**
- * Sets messageId
- *
- * @param string $messageId Message ID of the transactional email sent
- *
- * @return $this
- */
- public function setMessageId($messageId)
- {
- $this->container['messageId'] = $messageId;
-
- return $this;
- }
-
- /**
- * Gets messageIds
- *
- * @return string[]
- */
- public function getMessageIds()
- {
- return $this->container['messageIds'];
- }
-
- /**
- * Sets messageIds
- *
- * @param string[] $messageIds messageIds
- *
- * @return $this
- */
- public function setMessageIds($messageIds)
- {
- $this->container['messageIds'] = $messageIds;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateSmtpTemplate.php b/lib/Model/CreateSmtpTemplate.php
deleted file mode 100644
index 1953e4f..0000000
--- a/lib/Model/CreateSmtpTemplate.php
+++ /dev/null
@@ -1,584 +0,0 @@
- 'string',
- 'sender' => '\Brevo\Client\Model\CreateSmtpTemplateSender',
- 'templateName' => 'string',
- 'htmlContent' => 'string',
- 'htmlUrl' => 'string',
- 'subject' => 'string',
- 'replyTo' => 'string',
- 'toField' => 'string',
- 'attachmentUrl' => 'string',
- 'isActive' => 'bool'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'tag' => null,
- 'sender' => null,
- 'templateName' => null,
- 'htmlContent' => null,
- 'htmlUrl' => 'url',
- 'subject' => null,
- 'replyTo' => 'email',
- 'toField' => null,
- 'attachmentUrl' => 'url',
- 'isActive' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'tag' => 'tag',
- 'sender' => 'sender',
- 'templateName' => 'templateName',
- 'htmlContent' => 'htmlContent',
- 'htmlUrl' => 'htmlUrl',
- 'subject' => 'subject',
- 'replyTo' => 'replyTo',
- 'toField' => 'toField',
- 'attachmentUrl' => 'attachmentUrl',
- 'isActive' => 'isActive'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'tag' => 'setTag',
- 'sender' => 'setSender',
- 'templateName' => 'setTemplateName',
- 'htmlContent' => 'setHtmlContent',
- 'htmlUrl' => 'setHtmlUrl',
- 'subject' => 'setSubject',
- 'replyTo' => 'setReplyTo',
- 'toField' => 'setToField',
- 'attachmentUrl' => 'setAttachmentUrl',
- 'isActive' => 'setIsActive'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'tag' => 'getTag',
- 'sender' => 'getSender',
- 'templateName' => 'getTemplateName',
- 'htmlContent' => 'getHtmlContent',
- 'htmlUrl' => 'getHtmlUrl',
- 'subject' => 'getSubject',
- 'replyTo' => 'getReplyTo',
- 'toField' => 'getToField',
- 'attachmentUrl' => 'getAttachmentUrl',
- 'isActive' => 'getIsActive'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null;
- $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null;
- $this->container['templateName'] = isset($data['templateName']) ? $data['templateName'] : null;
- $this->container['htmlContent'] = isset($data['htmlContent']) ? $data['htmlContent'] : null;
- $this->container['htmlUrl'] = isset($data['htmlUrl']) ? $data['htmlUrl'] : null;
- $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null;
- $this->container['replyTo'] = isset($data['replyTo']) ? $data['replyTo'] : null;
- $this->container['toField'] = isset($data['toField']) ? $data['toField'] : null;
- $this->container['attachmentUrl'] = isset($data['attachmentUrl']) ? $data['attachmentUrl'] : null;
- $this->container['isActive'] = isset($data['isActive']) ? $data['isActive'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['sender'] === null) {
- $invalidProperties[] = "'sender' can't be null";
- }
- if ($this->container['templateName'] === null) {
- $invalidProperties[] = "'templateName' can't be null";
- }
- if ($this->container['subject'] === null) {
- $invalidProperties[] = "'subject' 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 tag
- *
- * @return string
- */
- public function getTag()
- {
- return $this->container['tag'];
- }
-
- /**
- * Sets tag
- *
- * @param string $tag Tag of the template
- *
- * @return $this
- */
- public function setTag($tag)
- {
- $this->container['tag'] = $tag;
-
- return $this;
- }
-
- /**
- * Gets sender
- *
- * @return \Brevo\Client\Model\CreateSmtpTemplateSender
- */
- public function getSender()
- {
- return $this->container['sender'];
- }
-
- /**
- * Sets sender
- *
- * @param \Brevo\Client\Model\CreateSmtpTemplateSender $sender sender
- *
- * @return $this
- */
- public function setSender($sender)
- {
- $this->container['sender'] = $sender;
-
- return $this;
- }
-
- /**
- * Gets templateName
- *
- * @return string
- */
- public function getTemplateName()
- {
- return $this->container['templateName'];
- }
-
- /**
- * Sets templateName
- *
- * @param string $templateName Name of the template
- *
- * @return $this
- */
- public function setTemplateName($templateName)
- {
- $this->container['templateName'] = $templateName;
-
- return $this;
- }
-
- /**
- * Gets htmlContent
- *
- * @return string
- */
- public function getHtmlContent()
- {
- return $this->container['htmlContent'];
- }
-
- /**
- * Sets htmlContent
- *
- * @param string $htmlContent Body of the message (HTML version). The field must have more than 10 characters. REQUIRED if htmlUrl is empty
- *
- * @return $this
- */
- public function setHtmlContent($htmlContent)
- {
- $this->container['htmlContent'] = $htmlContent;
-
- return $this;
- }
-
- /**
- * Gets htmlUrl
- *
- * @return string
- */
- public function getHtmlUrl()
- {
- return $this->container['htmlUrl'];
- }
-
- /**
- * Sets htmlUrl
- *
- * @param string $htmlUrl Url which contents the body of the email message. REQUIRED if htmlContent is empty
- *
- * @return $this
- */
- public function setHtmlUrl($htmlUrl)
- {
- $this->container['htmlUrl'] = $htmlUrl;
-
- return $this;
- }
-
- /**
- * Gets subject
- *
- * @return string
- */
- public function getSubject()
- {
- return $this->container['subject'];
- }
-
- /**
- * Sets subject
- *
- * @param string $subject Subject of the template
- *
- * @return $this
- */
- public function setSubject($subject)
- {
- $this->container['subject'] = $subject;
-
- return $this;
- }
-
- /**
- * Gets replyTo
- *
- * @return string
- */
- public function getReplyTo()
- {
- return $this->container['replyTo'];
- }
-
- /**
- * Sets replyTo
- *
- * @param string $replyTo Email on which campaign recipients will be able to reply to
- *
- * @return $this
- */
- public function setReplyTo($replyTo)
- {
- $this->container['replyTo'] = $replyTo;
-
- return $this;
- }
-
- /**
- * Gets toField
- *
- * @return string
- */
- public function getToField()
- {
- return $this->container['toField'];
- }
-
- /**
- * Sets toField
- *
- * @param string $toField To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your Brevo account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization
- *
- * @return $this
- */
- public function setToField($toField)
- {
- $this->container['toField'] = $toField;
-
- return $this;
- }
-
- /**
- * Gets attachmentUrl
- *
- * @return string
- */
- public function getAttachmentUrl()
- {
- return $this->container['attachmentUrl'];
- }
-
- /**
- * Sets attachmentUrl
- *
- * @param string $attachmentUrl Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps
- *
- * @return $this
- */
- public function setAttachmentUrl($attachmentUrl)
- {
- $this->container['attachmentUrl'] = $attachmentUrl;
-
- return $this;
- }
-
- /**
- * Gets isActive
- *
- * @return bool
- */
- public function getIsActive()
- {
- return $this->container['isActive'];
- }
-
- /**
- * Sets isActive
- *
- * @param bool $isActive Status of template. isActive = true means template is active and isActive = false means template is inactive
- *
- * @return $this
- */
- public function setIsActive($isActive)
- {
- $this->container['isActive'] = $isActive;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateSmtpTemplateSender.php b/lib/Model/CreateSmtpTemplateSender.php
deleted file mode 100644
index e208b3a..0000000
--- a/lib/Model/CreateSmtpTemplateSender.php
+++ /dev/null
@@ -1,366 +0,0 @@
- 'string',
- 'email' => 'string',
- 'id' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'email' => 'email',
- 'id' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'email' => 'email',
- 'id' => 'id'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'email' => 'setEmail',
- 'id' => 'setId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'email' => 'getEmail',
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- }
-
- /**
- * 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the sender. If not passed, will be set to default
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Email of the sender
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets id
- *
- * @return int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id Select the sender for the template on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email).
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateSubAccount.php b/lib/Model/CreateSubAccount.php
deleted file mode 100644
index ee0fbb6..0000000
--- a/lib/Model/CreateSubAccount.php
+++ /dev/null
@@ -1,441 +0,0 @@
- 'string',
- 'email' => 'string',
- 'language' => 'string',
- 'timezone' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'companyName' => null,
- 'email' => null,
- 'language' => null,
- 'timezone' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'companyName' => 'companyName',
- 'email' => 'email',
- 'language' => 'language',
- 'timezone' => 'timezone'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'companyName' => 'setCompanyName',
- 'email' => 'setEmail',
- 'language' => 'setLanguage',
- 'timezone' => 'setTimezone'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'companyName' => 'getCompanyName',
- 'email' => 'getEmail',
- 'language' => 'getLanguage',
- 'timezone' => 'getTimezone'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const LANGUAGE_EN = 'en';
- const LANGUAGE_FR = 'fr';
- const LANGUAGE_IT = 'it';
- const LANGUAGE_ES = 'es';
- const LANGUAGE_PT = 'pt';
- const LANGUAGE_DE = 'de';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getLanguageAllowableValues()
- {
- return [
- self::LANGUAGE_EN,
- self::LANGUAGE_FR,
- self::LANGUAGE_IT,
- self::LANGUAGE_ES,
- self::LANGUAGE_PT,
- self::LANGUAGE_DE,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['companyName'] = isset($data['companyName']) ? $data['companyName'] : null;
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['language'] = isset($data['language']) ? $data['language'] : null;
- $this->container['timezone'] = isset($data['timezone']) ? $data['timezone'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['companyName'] === null) {
- $invalidProperties[] = "'companyName' can't be null";
- }
- if ($this->container['email'] === null) {
- $invalidProperties[] = "'email' can't be null";
- }
- $allowedValues = $this->getLanguageAllowableValues();
- if (!is_null($this->container['language']) && !in_array($this->container['language'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'language', must be one of '%s'",
- 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 companyName
- *
- * @return string
- */
- public function getCompanyName()
- {
- return $this->container['companyName'];
- }
-
- /**
- * Sets companyName
- *
- * @param string $companyName Set the name of the sub-account company
- *
- * @return $this
- */
- public function setCompanyName($companyName)
- {
- $this->container['companyName'] = $companyName;
-
- return $this;
- }
-
- /**
- * Gets email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Email address for the organization
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets language
- *
- * @return string
- */
- public function getLanguage()
- {
- return $this->container['language'];
- }
-
- /**
- * Sets language
- *
- * @param string $language Set the language of the sub-account
- *
- * @return $this
- */
- public function setLanguage($language)
- {
- $allowedValues = $this->getLanguageAllowableValues();
- if (!is_null($language) && !in_array($language, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'language', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['language'] = $language;
-
- return $this;
- }
-
- /**
- * Gets timezone
- *
- * @return string
- */
- public function getTimezone()
- {
- return $this->container['timezone'];
- }
-
- /**
- * Sets timezone
- *
- * @param string $timezone Set the timezone of the sub-account
- *
- * @return $this
- */
- public function setTimezone($timezone)
- {
- $this->container['timezone'] = $timezone;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateSubAccountResponse.php b/lib/Model/CreateSubAccountResponse.php
deleted file mode 100644
index f542695..0000000
--- a/lib/Model/CreateSubAccountResponse.php
+++ /dev/null
@@ -1,308 +0,0 @@
- 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- }
-
- /**
- * 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";
- }
- 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 int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id ID of the sub-account created
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateUpdateBatchCategory.php b/lib/Model/CreateUpdateBatchCategory.php
deleted file mode 100644
index 900b9aa..0000000
--- a/lib/Model/CreateUpdateBatchCategory.php
+++ /dev/null
@@ -1,338 +0,0 @@
- '\Brevo\Client\Model\CreateUpdateCategories[]',
- 'updateEnabled' => 'bool'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'categories' => null,
- 'updateEnabled' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'categories' => 'categories',
- 'updateEnabled' => 'updateEnabled'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'categories' => 'setCategories',
- 'updateEnabled' => 'setUpdateEnabled'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'categories' => 'getCategories',
- 'updateEnabled' => 'getUpdateEnabled'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['categories'] = isset($data['categories']) ? $data['categories'] : null;
- $this->container['updateEnabled'] = isset($data['updateEnabled']) ? $data['updateEnabled'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['categories'] === null) {
- $invalidProperties[] = "'categories' 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 categories
- *
- * @return \Brevo\Client\Model\CreateUpdateCategories[]
- */
- public function getCategories()
- {
- return $this->container['categories'];
- }
-
- /**
- * Sets categories
- *
- * @param \Brevo\Client\Model\CreateUpdateCategories[] $categories array of categories objects
- *
- * @return $this
- */
- public function setCategories($categories)
- {
- $this->container['categories'] = $categories;
-
- return $this;
- }
-
- /**
- * Gets updateEnabled
- *
- * @return bool
- */
- public function getUpdateEnabled()
- {
- return $this->container['updateEnabled'];
- }
-
- /**
- * Sets updateEnabled
- *
- * @param bool $updateEnabled Facilitate to update the existing categories in the same request (updateEnabled = true)
- *
- * @return $this
- */
- public function setUpdateEnabled($updateEnabled)
- {
- $this->container['updateEnabled'] = $updateEnabled;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateUpdateBatchCategoryModel.php b/lib/Model/CreateUpdateBatchCategoryModel.php
deleted file mode 100644
index 5777db1..0000000
--- a/lib/Model/CreateUpdateBatchCategoryModel.php
+++ /dev/null
@@ -1,335 +0,0 @@
- 'int',
- 'updatedCount' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'createdCount' => 'int64',
- 'updatedCount' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'createdCount' => 'createdCount',
- 'updatedCount' => 'updatedCount'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'createdCount' => 'setCreatedCount',
- 'updatedCount' => 'setUpdatedCount'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'createdCount' => 'getCreatedCount',
- 'updatedCount' => 'getUpdatedCount'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['createdCount'] = isset($data['createdCount']) ? $data['createdCount'] : null;
- $this->container['updatedCount'] = isset($data['updatedCount']) ? $data['updatedCount'] : null;
- }
-
- /**
- * 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 createdCount
- *
- * @return int
- */
- public function getCreatedCount()
- {
- return $this->container['createdCount'];
- }
-
- /**
- * Sets createdCount
- *
- * @param int $createdCount Number of the new created categories
- *
- * @return $this
- */
- public function setCreatedCount($createdCount)
- {
- $this->container['createdCount'] = $createdCount;
-
- return $this;
- }
-
- /**
- * Gets updatedCount
- *
- * @return int
- */
- public function getUpdatedCount()
- {
- return $this->container['updatedCount'];
- }
-
- /**
- * Sets updatedCount
- *
- * @param int $updatedCount Number of the existing categories updated
- *
- * @return $this
- */
- public function setUpdatedCount($updatedCount)
- {
- $this->container['updatedCount'] = $updatedCount;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateUpdateBatchProducts.php b/lib/Model/CreateUpdateBatchProducts.php
deleted file mode 100644
index 082c8d2..0000000
--- a/lib/Model/CreateUpdateBatchProducts.php
+++ /dev/null
@@ -1,338 +0,0 @@
- '\Brevo\Client\Model\CreateUpdateProducts[]',
- 'updateEnabled' => 'bool'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'products' => null,
- 'updateEnabled' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'products' => 'products',
- 'updateEnabled' => 'updateEnabled'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'products' => 'setProducts',
- 'updateEnabled' => 'setUpdateEnabled'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'products' => 'getProducts',
- 'updateEnabled' => 'getUpdateEnabled'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['products'] = isset($data['products']) ? $data['products'] : null;
- $this->container['updateEnabled'] = isset($data['updateEnabled']) ? $data['updateEnabled'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['products'] === null) {
- $invalidProperties[] = "'products' 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 products
- *
- * @return \Brevo\Client\Model\CreateUpdateProducts[]
- */
- public function getProducts()
- {
- return $this->container['products'];
- }
-
- /**
- * Sets products
- *
- * @param \Brevo\Client\Model\CreateUpdateProducts[] $products array of products objects
- *
- * @return $this
- */
- public function setProducts($products)
- {
- $this->container['products'] = $products;
-
- return $this;
- }
-
- /**
- * Gets updateEnabled
- *
- * @return bool
- */
- public function getUpdateEnabled()
- {
- return $this->container['updateEnabled'];
- }
-
- /**
- * Sets updateEnabled
- *
- * @param bool $updateEnabled Facilitate to update the existing categories in the same request (updateEnabled = true)
- *
- * @return $this
- */
- public function setUpdateEnabled($updateEnabled)
- {
- $this->container['updateEnabled'] = $updateEnabled;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateUpdateBatchProductsModel.php b/lib/Model/CreateUpdateBatchProductsModel.php
deleted file mode 100644
index e11a883..0000000
--- a/lib/Model/CreateUpdateBatchProductsModel.php
+++ /dev/null
@@ -1,335 +0,0 @@
- 'int',
- 'updatedCount' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'createdCount' => 'int64',
- 'updatedCount' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'createdCount' => 'createdCount',
- 'updatedCount' => 'updatedCount'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'createdCount' => 'setCreatedCount',
- 'updatedCount' => 'setUpdatedCount'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'createdCount' => 'getCreatedCount',
- 'updatedCount' => 'getUpdatedCount'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['createdCount'] = isset($data['createdCount']) ? $data['createdCount'] : null;
- $this->container['updatedCount'] = isset($data['updatedCount']) ? $data['updatedCount'] : null;
- }
-
- /**
- * 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 createdCount
- *
- * @return int
- */
- public function getCreatedCount()
- {
- return $this->container['createdCount'];
- }
-
- /**
- * Sets createdCount
- *
- * @param int $createdCount Number of the new created products
- *
- * @return $this
- */
- public function setCreatedCount($createdCount)
- {
- $this->container['createdCount'] = $createdCount;
-
- return $this;
- }
-
- /**
- * Gets updatedCount
- *
- * @return int
- */
- public function getUpdatedCount()
- {
- return $this->container['updatedCount'];
- }
-
- /**
- * Sets updatedCount
- *
- * @param int $updatedCount Number of the existing products updated
- *
- * @return $this
- */
- public function setUpdatedCount($updatedCount)
- {
- $this->container['updatedCount'] = $updatedCount;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateUpdateCategories.php b/lib/Model/CreateUpdateCategories.php
deleted file mode 100644
index 7aa5c11..0000000
--- a/lib/Model/CreateUpdateCategories.php
+++ /dev/null
@@ -1,398 +0,0 @@
- 'string',
- 'name' => 'string',
- 'url' => 'string',
- 'deletedAt' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'email',
- 'name' => null,
- 'url' => null,
- 'deletedAt' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'name' => 'name',
- 'url' => 'url',
- 'deletedAt' => 'deletedAt'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'name' => 'setName',
- 'url' => 'setUrl',
- 'deletedAt' => 'setDeletedAt'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'name' => 'getName',
- 'url' => 'getUrl',
- 'deletedAt' => 'getDeletedAt'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['url'] = isset($data['url']) ? $data['url'] : null;
- $this->container['deletedAt'] = isset($data['deletedAt']) ? $data['deletedAt'] : null;
- }
-
- /**
- * 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";
- }
- 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 Unique Category ID as saved in the shop
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name **Mandatory in case of creation**. Name of the Category, as displayed in the shop
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets url
- *
- * @return string
- */
- public function getUrl()
- {
- return $this->container['url'];
- }
-
- /**
- * Sets url
- *
- * @param string $url URL to the category
- *
- * @return $this
- */
- public function setUrl($url)
- {
- $this->container['url'] = $url;
-
- return $this;
- }
-
- /**
- * Gets deletedAt
- *
- * @return string
- */
- public function getDeletedAt()
- {
- return $this->container['deletedAt'];
- }
-
- /**
- * Sets deletedAt
- *
- * @param string $deletedAt UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the category deleted from the shop's database
- *
- * @return $this
- */
- public function setDeletedAt($deletedAt)
- {
- $this->container['deletedAt'] = $deletedAt;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateUpdateCategory.php b/lib/Model/CreateUpdateCategory.php
deleted file mode 100644
index 3bfdcf4..0000000
--- a/lib/Model/CreateUpdateCategory.php
+++ /dev/null
@@ -1,428 +0,0 @@
- 'string',
- 'name' => 'string',
- 'url' => 'string',
- 'updateEnabled' => 'bool',
- 'deletedAt' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'email',
- 'name' => null,
- 'url' => null,
- 'updateEnabled' => null,
- 'deletedAt' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'name' => 'name',
- 'url' => 'url',
- 'updateEnabled' => 'updateEnabled',
- 'deletedAt' => 'deletedAt'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'name' => 'setName',
- 'url' => 'setUrl',
- 'updateEnabled' => 'setUpdateEnabled',
- 'deletedAt' => 'setDeletedAt'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'name' => 'getName',
- 'url' => 'getUrl',
- 'updateEnabled' => 'getUpdateEnabled',
- 'deletedAt' => 'getDeletedAt'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['url'] = isset($data['url']) ? $data['url'] : null;
- $this->container['updateEnabled'] = isset($data['updateEnabled']) ? $data['updateEnabled'] : false;
- $this->container['deletedAt'] = isset($data['deletedAt']) ? $data['deletedAt'] : null;
- }
-
- /**
- * 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";
- }
- 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 Unique Category ID as saved in the shop
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name **Mandatory in case of creation**. Name of the Category, as displayed in the shop
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets url
- *
- * @return string
- */
- public function getUrl()
- {
- return $this->container['url'];
- }
-
- /**
- * Sets url
- *
- * @param string $url URL to the category
- *
- * @return $this
- */
- public function setUrl($url)
- {
- $this->container['url'] = $url;
-
- return $this;
- }
-
- /**
- * Gets updateEnabled
- *
- * @return bool
- */
- public function getUpdateEnabled()
- {
- return $this->container['updateEnabled'];
- }
-
- /**
- * Sets updateEnabled
- *
- * @param bool $updateEnabled Facilitate to update the existing category in the same request (updateEnabled = true)
- *
- * @return $this
- */
- public function setUpdateEnabled($updateEnabled)
- {
- $this->container['updateEnabled'] = $updateEnabled;
-
- return $this;
- }
-
- /**
- * Gets deletedAt
- *
- * @return string
- */
- public function getDeletedAt()
- {
- return $this->container['deletedAt'];
- }
-
- /**
- * Sets deletedAt
- *
- * @param string $deletedAt UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the category deleted from the shop's database
- *
- * @return $this
- */
- public function setDeletedAt($deletedAt)
- {
- $this->container['deletedAt'] = $deletedAt;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateUpdateContactModel.php b/lib/Model/CreateUpdateContactModel.php
deleted file mode 100644
index 19a6284..0000000
--- a/lib/Model/CreateUpdateContactModel.php
+++ /dev/null
@@ -1,305 +0,0 @@
- 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- }
-
- /**
- * 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 id
- *
- * @return int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id ID of the contact when a new contact is created
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateUpdateFolder.php b/lib/Model/CreateUpdateFolder.php
deleted file mode 100644
index fbad1c3..0000000
--- a/lib/Model/CreateUpdateFolder.php
+++ /dev/null
@@ -1,305 +0,0 @@
- 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- }
-
- /**
- * 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the folder
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateUpdateProduct.php b/lib/Model/CreateUpdateProduct.php
deleted file mode 100644
index 8fd883d..0000000
--- a/lib/Model/CreateUpdateProduct.php
+++ /dev/null
@@ -1,611 +0,0 @@
- 'string',
- 'name' => 'string',
- 'url' => 'string',
- 'imageUrl' => 'string',
- 'sku' => 'string',
- 'price' => 'float',
- 'categories' => 'string[]',
- 'parentId' => 'string',
- 'metaInfo' => 'map[string,string]',
- 'updateEnabled' => 'bool',
- 'deletedAt' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'string',
- 'name' => 'string',
- 'url' => 'string',
- 'imageUrl' => 'string',
- 'sku' => 'string',
- 'price' => 'float',
- 'categories' => null,
- 'parentId' => 'string',
- 'metaInfo' => null,
- 'updateEnabled' => null,
- 'deletedAt' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'name' => 'name',
- 'url' => 'url',
- 'imageUrl' => 'imageUrl',
- 'sku' => 'sku',
- 'price' => 'price',
- 'categories' => 'categories',
- 'parentId' => 'parentId',
- 'metaInfo' => 'metaInfo',
- 'updateEnabled' => 'updateEnabled',
- 'deletedAt' => 'deletedAt'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'name' => 'setName',
- 'url' => 'setUrl',
- 'imageUrl' => 'setImageUrl',
- 'sku' => 'setSku',
- 'price' => 'setPrice',
- 'categories' => 'setCategories',
- 'parentId' => 'setParentId',
- 'metaInfo' => 'setMetaInfo',
- 'updateEnabled' => 'setUpdateEnabled',
- 'deletedAt' => 'setDeletedAt'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'name' => 'getName',
- 'url' => 'getUrl',
- 'imageUrl' => 'getImageUrl',
- 'sku' => 'getSku',
- 'price' => 'getPrice',
- 'categories' => 'getCategories',
- 'parentId' => 'getParentId',
- 'metaInfo' => 'getMetaInfo',
- 'updateEnabled' => 'getUpdateEnabled',
- 'deletedAt' => 'getDeletedAt'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['url'] = isset($data['url']) ? $data['url'] : null;
- $this->container['imageUrl'] = isset($data['imageUrl']) ? $data['imageUrl'] : null;
- $this->container['sku'] = isset($data['sku']) ? $data['sku'] : null;
- $this->container['price'] = isset($data['price']) ? $data['price'] : null;
- $this->container['categories'] = isset($data['categories']) ? $data['categories'] : null;
- $this->container['parentId'] = isset($data['parentId']) ? $data['parentId'] : null;
- $this->container['metaInfo'] = isset($data['metaInfo']) ? $data['metaInfo'] : null;
- $this->container['updateEnabled'] = isset($data['updateEnabled']) ? $data['updateEnabled'] : false;
- $this->container['deletedAt'] = isset($data['deletedAt']) ? $data['deletedAt'] : null;
- }
-
- /**
- * 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['name'] === null) {
- $invalidProperties[] = "'name' 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 Product ID for which you requested the details
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Mandatory in case of creation**. Name of the product for which you requested the details
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets url
- *
- * @return string
- */
- public function getUrl()
- {
- return $this->container['url'];
- }
-
- /**
- * Sets url
- *
- * @param string $url URL to the product
- *
- * @return $this
- */
- public function setUrl($url)
- {
- $this->container['url'] = $url;
-
- return $this;
- }
-
- /**
- * Gets imageUrl
- *
- * @return string
- */
- public function getImageUrl()
- {
- return $this->container['imageUrl'];
- }
-
- /**
- * Sets imageUrl
- *
- * @param string $imageUrl Absolute URL to the cover image of the product
- *
- * @return $this
- */
- public function setImageUrl($imageUrl)
- {
- $this->container['imageUrl'] = $imageUrl;
-
- return $this;
- }
-
- /**
- * Gets sku
- *
- * @return string
- */
- public function getSku()
- {
- return $this->container['sku'];
- }
-
- /**
- * Sets sku
- *
- * @param string $sku Product identifier from the shop
- *
- * @return $this
- */
- public function setSku($sku)
- {
- $this->container['sku'] = $sku;
-
- return $this;
- }
-
- /**
- * Gets price
- *
- * @return float
- */
- public function getPrice()
- {
- return $this->container['price'];
- }
-
- /**
- * Sets price
- *
- * @param float $price Price of the product
- *
- * @return $this
- */
- public function setPrice($price)
- {
- $this->container['price'] = $price;
-
- return $this;
- }
-
- /**
- * Gets categories
- *
- * @return string[]
- */
- public function getCategories()
- {
- return $this->container['categories'];
- }
-
- /**
- * Sets categories
- *
- * @param string[] $categories Category ID-s of the product
- *
- * @return $this
- */
- public function setCategories($categories)
- {
- $this->container['categories'] = $categories;
-
- return $this;
- }
-
- /**
- * Gets parentId
- *
- * @return string
- */
- public function getParentId()
- {
- return $this->container['parentId'];
- }
-
- /**
- * Sets parentId
- *
- * @param string $parentId Parent product id of the product
- *
- * @return $this
- */
- public function setParentId($parentId)
- {
- $this->container['parentId'] = $parentId;
-
- return $this;
- }
-
- /**
- * Gets metaInfo
- *
- * @return map[string,string]
- */
- public function getMetaInfo()
- {
- return $this->container['metaInfo'];
- }
-
- /**
- * Sets metaInfo
- *
- * @param map[string,string] $metaInfo Meta data of product such as description, vendor, producer, stock level. The size of cumulative metaInfo shall not exceed **1000 KB**. Maximum length of metaInfo object can be 10.
- *
- * @return $this
- */
- public function setMetaInfo($metaInfo)
- {
- $this->container['metaInfo'] = $metaInfo;
-
- return $this;
- }
-
- /**
- * Gets updateEnabled
- *
- * @return bool
- */
- public function getUpdateEnabled()
- {
- return $this->container['updateEnabled'];
- }
-
- /**
- * Sets updateEnabled
- *
- * @param bool $updateEnabled Facilitate to update the existing category in the same request (updateEnabled = true)
- *
- * @return $this
- */
- public function setUpdateEnabled($updateEnabled)
- {
- $this->container['updateEnabled'] = $updateEnabled;
-
- return $this;
- }
-
- /**
- * Gets deletedAt
- *
- * @return string
- */
- public function getDeletedAt()
- {
- return $this->container['deletedAt'];
- }
-
- /**
- * Sets deletedAt
- *
- * @param string $deletedAt UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the product deleted from the shop's database
- *
- * @return $this
- */
- public function setDeletedAt($deletedAt)
- {
- $this->container['deletedAt'] = $deletedAt;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateUpdateProducts.php b/lib/Model/CreateUpdateProducts.php
deleted file mode 100644
index d519d05..0000000
--- a/lib/Model/CreateUpdateProducts.php
+++ /dev/null
@@ -1,581 +0,0 @@
- 'string',
- 'name' => 'string',
- 'url' => 'string',
- 'imageUrl' => 'string',
- 'sku' => 'string',
- 'price' => 'float',
- 'categories' => 'string[]',
- 'parentId' => 'string',
- 'metaInfo' => 'map[string,string]',
- 'deletedAt' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'string',
- 'name' => 'string',
- 'url' => 'string',
- 'imageUrl' => 'string',
- 'sku' => 'string',
- 'price' => 'float',
- 'categories' => null,
- 'parentId' => 'string',
- 'metaInfo' => null,
- 'deletedAt' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'name' => 'name',
- 'url' => 'url',
- 'imageUrl' => 'imageUrl',
- 'sku' => 'sku',
- 'price' => 'price',
- 'categories' => 'categories',
- 'parentId' => 'parentId',
- 'metaInfo' => 'metaInfo',
- 'deletedAt' => 'deletedAt'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'name' => 'setName',
- 'url' => 'setUrl',
- 'imageUrl' => 'setImageUrl',
- 'sku' => 'setSku',
- 'price' => 'setPrice',
- 'categories' => 'setCategories',
- 'parentId' => 'setParentId',
- 'metaInfo' => 'setMetaInfo',
- 'deletedAt' => 'setDeletedAt'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'name' => 'getName',
- 'url' => 'getUrl',
- 'imageUrl' => 'getImageUrl',
- 'sku' => 'getSku',
- 'price' => 'getPrice',
- 'categories' => 'getCategories',
- 'parentId' => 'getParentId',
- 'metaInfo' => 'getMetaInfo',
- 'deletedAt' => 'getDeletedAt'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['url'] = isset($data['url']) ? $data['url'] : null;
- $this->container['imageUrl'] = isset($data['imageUrl']) ? $data['imageUrl'] : null;
- $this->container['sku'] = isset($data['sku']) ? $data['sku'] : null;
- $this->container['price'] = isset($data['price']) ? $data['price'] : null;
- $this->container['categories'] = isset($data['categories']) ? $data['categories'] : null;
- $this->container['parentId'] = isset($data['parentId']) ? $data['parentId'] : null;
- $this->container['metaInfo'] = isset($data['metaInfo']) ? $data['metaInfo'] : null;
- $this->container['deletedAt'] = isset($data['deletedAt']) ? $data['deletedAt'] : null;
- }
-
- /**
- * 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['name'] === null) {
- $invalidProperties[] = "'name' 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 Product ID for which you requested the details
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Mandatory in case of creation**. Name of the product for which you requested the details
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets url
- *
- * @return string
- */
- public function getUrl()
- {
- return $this->container['url'];
- }
-
- /**
- * Sets url
- *
- * @param string $url URL to the product
- *
- * @return $this
- */
- public function setUrl($url)
- {
- $this->container['url'] = $url;
-
- return $this;
- }
-
- /**
- * Gets imageUrl
- *
- * @return string
- */
- public function getImageUrl()
- {
- return $this->container['imageUrl'];
- }
-
- /**
- * Sets imageUrl
- *
- * @param string $imageUrl Absolute URL to the cover image of the product
- *
- * @return $this
- */
- public function setImageUrl($imageUrl)
- {
- $this->container['imageUrl'] = $imageUrl;
-
- return $this;
- }
-
- /**
- * Gets sku
- *
- * @return string
- */
- public function getSku()
- {
- return $this->container['sku'];
- }
-
- /**
- * Sets sku
- *
- * @param string $sku Product identifier from the shop
- *
- * @return $this
- */
- public function setSku($sku)
- {
- $this->container['sku'] = $sku;
-
- return $this;
- }
-
- /**
- * Gets price
- *
- * @return float
- */
- public function getPrice()
- {
- return $this->container['price'];
- }
-
- /**
- * Sets price
- *
- * @param float $price Price of the product
- *
- * @return $this
- */
- public function setPrice($price)
- {
- $this->container['price'] = $price;
-
- return $this;
- }
-
- /**
- * Gets categories
- *
- * @return string[]
- */
- public function getCategories()
- {
- return $this->container['categories'];
- }
-
- /**
- * Sets categories
- *
- * @param string[] $categories Category ID-s of the product
- *
- * @return $this
- */
- public function setCategories($categories)
- {
- $this->container['categories'] = $categories;
-
- return $this;
- }
-
- /**
- * Gets parentId
- *
- * @return string
- */
- public function getParentId()
- {
- return $this->container['parentId'];
- }
-
- /**
- * Sets parentId
- *
- * @param string $parentId Parent product id of the product
- *
- * @return $this
- */
- public function setParentId($parentId)
- {
- $this->container['parentId'] = $parentId;
-
- return $this;
- }
-
- /**
- * Gets metaInfo
- *
- * @return map[string,string]
- */
- public function getMetaInfo()
- {
- return $this->container['metaInfo'];
- }
-
- /**
- * Sets metaInfo
- *
- * @param map[string,string] $metaInfo Meta data of product such as description, vendor, producer, stock level. The size of cumulative metaInfo shall not exceed **1000 KB**. Maximum length of metaInfo object can be 10.
- *
- * @return $this
- */
- public function setMetaInfo($metaInfo)
- {
- $this->container['metaInfo'] = $metaInfo;
-
- return $this;
- }
-
- /**
- * Gets deletedAt
- *
- * @return string
- */
- public function getDeletedAt()
- {
- return $this->container['deletedAt'];
- }
-
- /**
- * Sets deletedAt
- *
- * @param string $deletedAt UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the product deleted from the shop's database
- *
- * @return $this
- */
- public function setDeletedAt($deletedAt)
- {
- $this->container['deletedAt'] = $deletedAt;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateWebhook.php b/lib/Model/CreateWebhook.php
deleted file mode 100644
index 4f93c07..0000000
--- a/lib/Model/CreateWebhook.php
+++ /dev/null
@@ -1,609 +0,0 @@
- 'string',
- 'description' => 'string',
- 'events' => 'string[]',
- 'type' => 'string',
- 'domain' => 'string',
- 'batched' => 'bool',
- 'auth' => '\Brevo\Client\Model\GetWebhookAuth',
- 'headers' => '\Brevo\Client\Model\GetWebhookHeaders[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'url' => 'url',
- 'description' => null,
- 'events' => null,
- 'type' => null,
- 'domain' => null,
- 'batched' => null,
- 'auth' => null,
- 'headers' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'url' => 'url',
- 'description' => 'description',
- 'events' => 'events',
- 'type' => 'type',
- 'domain' => 'domain',
- 'batched' => 'batched',
- 'auth' => 'auth',
- 'headers' => 'headers'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'url' => 'setUrl',
- 'description' => 'setDescription',
- 'events' => 'setEvents',
- 'type' => 'setType',
- 'domain' => 'setDomain',
- 'batched' => 'setBatched',
- 'auth' => 'setAuth',
- 'headers' => 'setHeaders'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'url' => 'getUrl',
- 'description' => 'getDescription',
- 'events' => 'getEvents',
- 'type' => 'getType',
- 'domain' => 'getDomain',
- 'batched' => 'getBatched',
- 'auth' => 'getAuth',
- 'headers' => 'getHeaders'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const EVENTS_SENT = 'sent';
- const EVENTS_HARD_BOUNCE = 'hardBounce';
- const EVENTS_SOFT_BOUNCE = 'softBounce';
- const EVENTS_BLOCKED = 'blocked';
- const EVENTS_SPAM = 'spam';
- const EVENTS_DELIVERED = 'delivered';
- const EVENTS_REQUEST = 'request';
- const EVENTS_CLICK = 'click';
- const EVENTS_INVALID = 'invalid';
- const EVENTS_DEFERRED = 'deferred';
- const EVENTS_OPENED = 'opened';
- const EVENTS_UNIQUE_OPENED = 'uniqueOpened';
- const EVENTS_UNSUBSCRIBED = 'unsubscribed';
- const EVENTS_LIST_ADDITION = 'listAddition';
- const EVENTS_CONTACT_UPDATED = 'contactUpdated';
- const EVENTS_CONTACT_DELETED = 'contactDeleted';
- const EVENTS_INBOUND_EMAIL_PROCESSED = 'inboundEmailProcessed';
- const TYPE_TRANSACTIONAL = 'transactional';
- const TYPE_MARKETING = 'marketing';
- const TYPE_INBOUND = 'inbound';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getEventsAllowableValues()
- {
- return [
- self::EVENTS_SENT,
- self::EVENTS_HARD_BOUNCE,
- self::EVENTS_SOFT_BOUNCE,
- self::EVENTS_BLOCKED,
- self::EVENTS_SPAM,
- self::EVENTS_DELIVERED,
- self::EVENTS_REQUEST,
- self::EVENTS_CLICK,
- self::EVENTS_INVALID,
- self::EVENTS_DEFERRED,
- self::EVENTS_OPENED,
- self::EVENTS_UNIQUE_OPENED,
- self::EVENTS_UNSUBSCRIBED,
- self::EVENTS_LIST_ADDITION,
- self::EVENTS_CONTACT_UPDATED,
- self::EVENTS_CONTACT_DELETED,
- self::EVENTS_INBOUND_EMAIL_PROCESSED,
- ];
- }
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getTypeAllowableValues()
- {
- return [
- self::TYPE_TRANSACTIONAL,
- self::TYPE_MARKETING,
- self::TYPE_INBOUND,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['url'] = isset($data['url']) ? $data['url'] : null;
- $this->container['description'] = isset($data['description']) ? $data['description'] : null;
- $this->container['events'] = isset($data['events']) ? $data['events'] : null;
- $this->container['type'] = isset($data['type']) ? $data['type'] : 'transactional';
- $this->container['domain'] = isset($data['domain']) ? $data['domain'] : null;
- $this->container['batched'] = isset($data['batched']) ? $data['batched'] : null;
- $this->container['auth'] = isset($data['auth']) ? $data['auth'] : null;
- $this->container['headers'] = isset($data['headers']) ? $data['headers'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['url'] === null) {
- $invalidProperties[] = "'url' can't be null";
- }
- if ($this->container['events'] === null) {
- $invalidProperties[] = "'events' can't be null";
- }
- $allowedValues = $this->getTypeAllowableValues();
- if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'type', must be one of '%s'",
- 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 url
- *
- * @return string
- */
- public function getUrl()
- {
- return $this->container['url'];
- }
-
- /**
- * Sets url
- *
- * @param string $url URL of the webhook
- *
- * @return $this
- */
- public function setUrl($url)
- {
- $this->container['url'] = $url;
-
- return $this;
- }
-
- /**
- * Gets description
- *
- * @return string
- */
- public function getDescription()
- {
- return $this->container['description'];
- }
-
- /**
- * Sets description
- *
- * @param string $description Description of the webhook
- *
- * @return $this
- */
- public function setDescription($description)
- {
- $this->container['description'] = $description;
-
- return $this;
- }
-
- /**
- * Gets events
- *
- * @return string[]
- */
- public function getEvents()
- {
- return $this->container['events'];
- }
-
- /**
- * Sets events
- *
- * @param string[] $events - Events triggering the webhook. Possible values for **Transactional** type webhook: #### `sent` OR `request`, `delivered`, `hardBounce`, `softBounce`, `blocked`, `spam`, `invalid`, `deferred`, `click`, `opened`, `uniqueOpened` and `unsubscribed` - Possible values for **Marketing** type webhook: #### `spam`, `opened`, `click`, `hardBounce`, `softBounce`, `unsubscribed`, `listAddition` & `delivered` - Possible values for **Inbound** type webhook: #### `inboundEmailProcessed`
- *
- * @return $this
- */
- public function setEvents($events)
- {
- $allowedValues = $this->getEventsAllowableValues();
- if (array_diff($events, $allowedValues)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'events', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['events'] = $events;
-
- return $this;
- }
-
- /**
- * Gets type
- *
- * @return string
- */
- public function getType()
- {
- return $this->container['type'];
- }
-
- /**
- * Sets type
- *
- * @param string $type Type of the webhook
- *
- * @return $this
- */
- public function setType($type)
- {
- $allowedValues = $this->getTypeAllowableValues();
- if (!is_null($type) && !in_array($type, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'type', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['type'] = $type;
-
- return $this;
- }
-
- /**
- * Gets domain
- *
- * @return string
- */
- public function getDomain()
- {
- return $this->container['domain'];
- }
-
- /**
- * Sets domain
- *
- * @param string $domain Inbound domain of webhook, required in case of event type `inbound`
- *
- * @return $this
- */
- public function setDomain($domain)
- {
- $this->container['domain'] = $domain;
-
- return $this;
- }
-
- /**
- * Gets batched
- *
- * @return bool
- */
- public function getBatched()
- {
- return $this->container['batched'];
- }
-
- /**
- * Sets batched
- *
- * @param bool $batched To send batched webhooks
- *
- * @return $this
- */
- public function setBatched($batched)
- {
- $this->container['batched'] = $batched;
-
- return $this;
- }
-
- /**
- * Gets auth
- *
- * @return \Brevo\Client\Model\GetWebhookAuth
- */
- public function getAuth()
- {
- return $this->container['auth'];
- }
-
- /**
- * Sets auth
- *
- * @param \Brevo\Client\Model\GetWebhookAuth $auth auth
- *
- * @return $this
- */
- public function setAuth($auth)
- {
- $this->container['auth'] = $auth;
-
- return $this;
- }
-
- /**
- * Gets headers
- *
- * @return \Brevo\Client\Model\GetWebhookHeaders[]
- */
- public function getHeaders()
- {
- return $this->container['headers'];
- }
-
- /**
- * Sets headers
- *
- * @param \Brevo\Client\Model\GetWebhookHeaders[] $headers Custom headers to be send with webhooks
- *
- * @return $this
- */
- public function setHeaders($headers)
- {
- $this->container['headers'] = $headers;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateWhatsAppCampaign.php b/lib/Model/CreateWhatsAppCampaign.php
deleted file mode 100644
index d6faa21..0000000
--- a/lib/Model/CreateWhatsAppCampaign.php
+++ /dev/null
@@ -1,407 +0,0 @@
- 'string',
- 'templateId' => 'int',
- 'scheduledAt' => 'string',
- 'recipients' => '\Brevo\Client\Model\CreateWhatsAppCampaignRecipients'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'templateId' => null,
- 'scheduledAt' => null,
- 'recipients' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'templateId' => 'templateId',
- 'scheduledAt' => 'scheduledAt',
- 'recipients' => 'recipients'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'templateId' => 'setTemplateId',
- 'scheduledAt' => 'setScheduledAt',
- 'recipients' => 'setRecipients'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'templateId' => 'getTemplateId',
- 'scheduledAt' => 'getScheduledAt',
- 'recipients' => 'getRecipients'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['templateId'] = isset($data['templateId']) ? $data['templateId'] : null;
- $this->container['scheduledAt'] = isset($data['scheduledAt']) ? $data['scheduledAt'] : null;
- $this->container['recipients'] = isset($data['recipients']) ? $data['recipients'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['name'] === null) {
- $invalidProperties[] = "'name' can't be null";
- }
- if ($this->container['templateId'] === null) {
- $invalidProperties[] = "'templateId' can't be null";
- }
- if ($this->container['scheduledAt'] === null) {
- $invalidProperties[] = "'scheduledAt' can't be null";
- }
- if ($this->container['recipients'] === null) {
- $invalidProperties[] = "'recipients' 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the WhatsApp campaign creation
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets templateId
- *
- * @return int
- */
- public function getTemplateId()
- {
- return $this->container['templateId'];
- }
-
- /**
- * Sets templateId
- *
- * @param int $templateId Id of the WhatsApp template in **approved** state
- *
- * @return $this
- */
- public function setTemplateId($templateId)
- {
- $this->container['templateId'] = $templateId;
-
- return $this;
- }
-
- /**
- * Gets scheduledAt
- *
- * @return string
- */
- public function getScheduledAt()
- {
- return $this->container['scheduledAt'];
- }
-
- /**
- * Sets scheduledAt
- *
- * @param string $scheduledAt Sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.For example: **2017-06-01T12:30:00+02:00**
- *
- * @return $this
- */
- public function setScheduledAt($scheduledAt)
- {
- $this->container['scheduledAt'] = $scheduledAt;
-
- return $this;
- }
-
- /**
- * Gets recipients
- *
- * @return \Brevo\Client\Model\CreateWhatsAppCampaignRecipients
- */
- public function getRecipients()
- {
- return $this->container['recipients'];
- }
-
- /**
- * Sets recipients
- *
- * @param \Brevo\Client\Model\CreateWhatsAppCampaignRecipients $recipients recipients
- *
- * @return $this
- */
- public function setRecipients($recipients)
- {
- $this->container['recipients'] = $recipients;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateWhatsAppCampaignRecipients.php b/lib/Model/CreateWhatsAppCampaignRecipients.php
deleted file mode 100644
index 78311df..0000000
--- a/lib/Model/CreateWhatsAppCampaignRecipients.php
+++ /dev/null
@@ -1,366 +0,0 @@
- 'int[]',
- 'listIds' => 'int[]',
- 'segments' => 'int[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'excludedListIds' => 'int64',
- 'listIds' => 'int64',
- 'segments' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'excludedListIds' => 'excludedListIds',
- 'listIds' => 'listIds',
- 'segments' => 'segments'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'excludedListIds' => 'setExcludedListIds',
- 'listIds' => 'setListIds',
- 'segments' => 'setSegments'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'excludedListIds' => 'getExcludedListIds',
- 'listIds' => 'getListIds',
- 'segments' => 'getSegments'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['excludedListIds'] = isset($data['excludedListIds']) ? $data['excludedListIds'] : null;
- $this->container['listIds'] = isset($data['listIds']) ? $data['listIds'] : null;
- $this->container['segments'] = isset($data['segments']) ? $data['segments'] : null;
- }
-
- /**
- * 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 excludedListIds
- *
- * @return int[]
- */
- public function getExcludedListIds()
- {
- return $this->container['excludedListIds'];
- }
-
- /**
- * Sets excludedListIds
- *
- * @param int[] $excludedListIds List ids to exclude from the campaign
- *
- * @return $this
- */
- public function setExcludedListIds($excludedListIds)
- {
- $this->container['excludedListIds'] = $excludedListIds;
-
- return $this;
- }
-
- /**
- * Gets listIds
- *
- * @return int[]
- */
- public function getListIds()
- {
- return $this->container['listIds'];
- }
-
- /**
- * Sets listIds
- *
- * @param int[] $listIds **Mandatory if scheduledAt is not empty**. List Ids to send the campaign to
- *
- * @return $this
- */
- public function setListIds($listIds)
- {
- $this->container['listIds'] = $listIds;
-
- return $this;
- }
-
- /**
- * Gets segments
- *
- * @return int[]
- */
- public function getSegments()
- {
- return $this->container['segments'];
- }
-
- /**
- * Sets segments
- *
- * @param int[] $segments **Mandatory if listIds are not used**. Segment ids to send the campaign to.
- *
- * @return $this
- */
- public function setSegments($segments)
- {
- $this->container['segments'] = $segments;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreateWhatsAppTemplate.php b/lib/Model/CreateWhatsAppTemplate.php
deleted file mode 100644
index 73d7f8a..0000000
--- a/lib/Model/CreateWhatsAppTemplate.php
+++ /dev/null
@@ -1,561 +0,0 @@
- 'string',
- 'language' => 'string',
- 'category' => 'string',
- 'mediaUrl' => 'string',
- 'bodyText' => 'string',
- 'headerText' => 'string',
- 'source' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'language' => null,
- 'category' => null,
- 'mediaUrl' => null,
- 'bodyText' => null,
- 'headerText' => null,
- 'source' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'language' => 'language',
- 'category' => 'category',
- 'mediaUrl' => 'mediaUrl',
- 'bodyText' => 'bodyText',
- 'headerText' => 'headerText',
- 'source' => 'source'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'language' => 'setLanguage',
- 'category' => 'setCategory',
- 'mediaUrl' => 'setMediaUrl',
- 'bodyText' => 'setBodyText',
- 'headerText' => 'setHeaderText',
- 'source' => 'setSource'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'language' => 'getLanguage',
- 'category' => 'getCategory',
- 'mediaUrl' => 'getMediaUrl',
- 'bodyText' => 'getBodyText',
- 'headerText' => 'getHeaderText',
- 'source' => 'getSource'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const CATEGORY_MARKETING = 'MARKETING';
- const CATEGORY_UTILITY = 'UTILITY';
- const SOURCE_AUTOMATION = 'Automation';
- const SOURCE_CONVERSATIONS = 'Conversations';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getCategoryAllowableValues()
- {
- return [
- self::CATEGORY_MARKETING,
- self::CATEGORY_UTILITY,
- ];
- }
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getSourceAllowableValues()
- {
- return [
- self::SOURCE_AUTOMATION,
- self::SOURCE_CONVERSATIONS,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['language'] = isset($data['language']) ? $data['language'] : null;
- $this->container['category'] = isset($data['category']) ? $data['category'] : null;
- $this->container['mediaUrl'] = isset($data['mediaUrl']) ? $data['mediaUrl'] : null;
- $this->container['bodyText'] = isset($data['bodyText']) ? $data['bodyText'] : null;
- $this->container['headerText'] = isset($data['headerText']) ? $data['headerText'] : null;
- $this->container['source'] = isset($data['source']) ? $data['source'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['name'] === null) {
- $invalidProperties[] = "'name' can't be null";
- }
- if ($this->container['language'] === null) {
- $invalidProperties[] = "'language' can't be null";
- }
- if ($this->container['category'] === null) {
- $invalidProperties[] = "'category' can't be null";
- }
- $allowedValues = $this->getCategoryAllowableValues();
- if (!is_null($this->container['category']) && !in_array($this->container['category'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'category', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- if ($this->container['bodyText'] === null) {
- $invalidProperties[] = "'bodyText' can't be null";
- }
- $allowedValues = $this->getSourceAllowableValues();
- if (!is_null($this->container['source']) && !in_array($this->container['source'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'source', must be one of '%s'",
- 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the template
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets language
- *
- * @return string
- */
- public function getLanguage()
- {
- return $this->container['language'];
- }
-
- /**
- * Sets language
- *
- * @param string $language Language of the template. For Example : **en** for English
- *
- * @return $this
- */
- public function setLanguage($language)
- {
- $this->container['language'] = $language;
-
- return $this;
- }
-
- /**
- * Gets category
- *
- * @return string
- */
- public function getCategory()
- {
- return $this->container['category'];
- }
-
- /**
- * Sets category
- *
- * @param string $category Category of the template
- *
- * @return $this
- */
- public function setCategory($category)
- {
- $allowedValues = $this->getCategoryAllowableValues();
- if (!in_array($category, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'category', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['category'] = $category;
-
- return $this;
- }
-
- /**
- * Gets mediaUrl
- *
- * @return string
- */
- public function getMediaUrl()
- {
- return $this->container['mediaUrl'];
- }
-
- /**
- * Sets mediaUrl
- *
- * @param string $mediaUrl Absolute url of the media file **(no local file)** for the header. **Use this field in you want to add media in Template header and headerText is empty.** Allowed extensions for media files are: #### jpeg | png | mp4 | pdf
- *
- * @return $this
- */
- public function setMediaUrl($mediaUrl)
- {
- $this->container['mediaUrl'] = $mediaUrl;
-
- return $this;
- }
-
- /**
- * Gets bodyText
- *
- * @return string
- */
- public function getBodyText()
- {
- return $this->container['bodyText'];
- }
-
- /**
- * Sets bodyText
- *
- * @param string $bodyText Body of the template. **Maximum allowed characters are 1024**
- *
- * @return $this
- */
- public function setBodyText($bodyText)
- {
- $this->container['bodyText'] = $bodyText;
-
- return $this;
- }
-
- /**
- * Gets headerText
- *
- * @return string
- */
- public function getHeaderText()
- {
- return $this->container['headerText'];
- }
-
- /**
- * Sets headerText
- *
- * @param string $headerText Text content of the header in the template. **Maximum allowed characters are 45** **Use this field to add text content in template header and if mediaUrl is empty**
- *
- * @return $this
- */
- public function setHeaderText($headerText)
- {
- $this->container['headerText'] = $headerText;
-
- return $this;
- }
-
- /**
- * Gets source
- *
- * @return string
- */
- public function getSource()
- {
- return $this->container['source'];
- }
-
- /**
- * Sets source
- *
- * @param string $source source of the template
- *
- * @return $this
- */
- public function setSource($source)
- {
- $allowedValues = $this->getSourceAllowableValues();
- if (!is_null($source) && !in_array($source, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'source', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['source'] = $source;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreatedBatchId.php b/lib/Model/CreatedBatchId.php
deleted file mode 100644
index 28812b8..0000000
--- a/lib/Model/CreatedBatchId.php
+++ /dev/null
@@ -1,308 +0,0 @@
- 'float'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'batchId' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'batchId' => 'batchId'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'batchId' => 'setBatchId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'batchId' => 'getBatchId'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['batchId'] = isset($data['batchId']) ? $data['batchId'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['batchId'] === null) {
- $invalidProperties[] = "'batchId' 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 batchId
- *
- * @return float
- */
- public function getBatchId()
- {
- return $this->container['batchId'];
- }
-
- /**
- * Sets batchId
- *
- * @param float $batchId Batch ID of the request
- *
- * @return $this
- */
- public function setBatchId($batchId)
- {
- $this->container['batchId'] = $batchId;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/CreatedProcessId.php b/lib/Model/CreatedProcessId.php
deleted file mode 100644
index 96341df..0000000
--- a/lib/Model/CreatedProcessId.php
+++ /dev/null
@@ -1,308 +0,0 @@
- 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'processId' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'processId' => 'processId'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'processId' => 'setProcessId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'processId' => 'getProcessId'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['processId'] = isset($data['processId']) ? $data['processId'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['processId'] === null) {
- $invalidProperties[] = "'processId' 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 processId
- *
- * @return int
- */
- public function getProcessId()
- {
- return $this->container['processId'];
- }
-
- /**
- * Sets processId
- *
- * @param int $processId Id of the process created
- *
- * @return $this
- */
- public function setProcessId($processId)
- {
- $this->container['processId'] = $processId;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/Deal.php b/lib/Model/Deal.php
deleted file mode 100644
index a315359..0000000
--- a/lib/Model/Deal.php
+++ /dev/null
@@ -1,396 +0,0 @@
- 'string',
- 'attributes' => 'object',
- 'linkedContactsIds' => 'int[]',
- 'linkedCompaniesIds' => 'string[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => null,
- 'attributes' => null,
- 'linkedContactsIds' => null,
- 'linkedCompaniesIds' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'attributes' => 'attributes',
- 'linkedContactsIds' => 'linkedContactsIds',
- 'linkedCompaniesIds' => 'linkedCompaniesIds'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'attributes' => 'setAttributes',
- 'linkedContactsIds' => 'setLinkedContactsIds',
- 'linkedCompaniesIds' => 'setLinkedCompaniesIds'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'attributes' => 'getAttributes',
- 'linkedContactsIds' => 'getLinkedContactsIds',
- 'linkedCompaniesIds' => 'getLinkedCompaniesIds'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null;
- $this->container['linkedContactsIds'] = isset($data['linkedContactsIds']) ? $data['linkedContactsIds'] : null;
- $this->container['linkedCompaniesIds'] = isset($data['linkedCompaniesIds']) ? $data['linkedCompaniesIds'] : null;
- }
-
- /**
- * 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 id
- *
- * @return string
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param string $id Unique deal id
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets attributes
- *
- * @return object
- */
- public function getAttributes()
- {
- return $this->container['attributes'];
- }
-
- /**
- * Sets attributes
- *
- * @param object $attributes Deal attributes with values
- *
- * @return $this
- */
- public function setAttributes($attributes)
- {
- $this->container['attributes'] = $attributes;
-
- return $this;
- }
-
- /**
- * Gets linkedContactsIds
- *
- * @return int[]
- */
- public function getLinkedContactsIds()
- {
- return $this->container['linkedContactsIds'];
- }
-
- /**
- * Sets linkedContactsIds
- *
- * @param int[] $linkedContactsIds Contact ids for contacts linked to this deal
- *
- * @return $this
- */
- public function setLinkedContactsIds($linkedContactsIds)
- {
- $this->container['linkedContactsIds'] = $linkedContactsIds;
-
- return $this;
- }
-
- /**
- * Gets linkedCompaniesIds
- *
- * @return string[]
- */
- public function getLinkedCompaniesIds()
- {
- return $this->container['linkedCompaniesIds'];
- }
-
- /**
- * Sets linkedCompaniesIds
- *
- * @param string[] $linkedCompaniesIds Companies ids for companies linked to this deal
- *
- * @return $this
- */
- public function setLinkedCompaniesIds($linkedCompaniesIds)
- {
- $this->container['linkedCompaniesIds'] = $linkedCompaniesIds;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/DealAttributes.php b/lib/Model/DealAttributes.php
deleted file mode 100644
index 1ff6bf9..0000000
--- a/lib/Model/DealAttributes.php
+++ /dev/null
@@ -1,281 +0,0 @@
-listInvalidProperties()) === 0;
- }
-
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/DealAttributesInner.php b/lib/Model/DealAttributesInner.php
deleted file mode 100644
index 23144be..0000000
--- a/lib/Model/DealAttributesInner.php
+++ /dev/null
@@ -1,426 +0,0 @@
- 'string',
- 'label' => 'string',
- 'attributeTypeName' => 'string',
- 'attributeOptions' => 'object[]',
- 'isRequired' => 'bool'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'internalName' => null,
- 'label' => null,
- 'attributeTypeName' => null,
- 'attributeOptions' => null,
- 'isRequired' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'internalName' => 'internalName',
- 'label' => 'label',
- 'attributeTypeName' => 'attributeTypeName',
- 'attributeOptions' => 'attributeOptions',
- 'isRequired' => 'isRequired'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'internalName' => 'setInternalName',
- 'label' => 'setLabel',
- 'attributeTypeName' => 'setAttributeTypeName',
- 'attributeOptions' => 'setAttributeOptions',
- 'isRequired' => 'setIsRequired'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'internalName' => 'getInternalName',
- 'label' => 'getLabel',
- 'attributeTypeName' => 'getAttributeTypeName',
- 'attributeOptions' => 'getAttributeOptions',
- 'isRequired' => 'getIsRequired'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['internalName'] = isset($data['internalName']) ? $data['internalName'] : null;
- $this->container['label'] = isset($data['label']) ? $data['label'] : null;
- $this->container['attributeTypeName'] = isset($data['attributeTypeName']) ? $data['attributeTypeName'] : null;
- $this->container['attributeOptions'] = isset($data['attributeOptions']) ? $data['attributeOptions'] : null;
- $this->container['isRequired'] = isset($data['isRequired']) ? $data['isRequired'] : null;
- }
-
- /**
- * 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 internalName
- *
- * @return string
- */
- public function getInternalName()
- {
- return $this->container['internalName'];
- }
-
- /**
- * Sets internalName
- *
- * @param string $internalName internalName
- *
- * @return $this
- */
- public function setInternalName($internalName)
- {
- $this->container['internalName'] = $internalName;
-
- return $this;
- }
-
- /**
- * Gets label
- *
- * @return string
- */
- public function getLabel()
- {
- return $this->container['label'];
- }
-
- /**
- * Sets label
- *
- * @param string $label label
- *
- * @return $this
- */
- public function setLabel($label)
- {
- $this->container['label'] = $label;
-
- return $this;
- }
-
- /**
- * Gets attributeTypeName
- *
- * @return string
- */
- public function getAttributeTypeName()
- {
- return $this->container['attributeTypeName'];
- }
-
- /**
- * Sets attributeTypeName
- *
- * @param string $attributeTypeName attributeTypeName
- *
- * @return $this
- */
- public function setAttributeTypeName($attributeTypeName)
- {
- $this->container['attributeTypeName'] = $attributeTypeName;
-
- return $this;
- }
-
- /**
- * Gets attributeOptions
- *
- * @return object[]
- */
- public function getAttributeOptions()
- {
- return $this->container['attributeOptions'];
- }
-
- /**
- * Sets attributeOptions
- *
- * @param object[] $attributeOptions attributeOptions
- *
- * @return $this
- */
- public function setAttributeOptions($attributeOptions)
- {
- $this->container['attributeOptions'] = $attributeOptions;
-
- return $this;
- }
-
- /**
- * Gets isRequired
- *
- * @return bool
- */
- public function getIsRequired()
- {
- return $this->container['isRequired'];
- }
-
- /**
- * Sets isRequired
- *
- * @param bool $isRequired isRequired
- *
- * @return $this
- */
- public function setIsRequired($isRequired)
- {
- $this->container['isRequired'] = $isRequired;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/DealsList.php b/lib/Model/DealsList.php
deleted file mode 100644
index f517903..0000000
--- a/lib/Model/DealsList.php
+++ /dev/null
@@ -1,306 +0,0 @@
- '\Brevo\Client\Model\Deal[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'items' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'items' => 'items'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'items' => 'setItems'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'items' => 'getItems'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['items'] = isset($data['items']) ? $data['items'] : null;
- }
-
- /**
- * 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 items
- *
- * @return \Brevo\Client\Model\Deal[]
- */
- public function getItems()
- {
- return $this->container['items'];
- }
-
- /**
- * Sets items
- *
- * @param \Brevo\Client\Model\Deal[] $items List of deals
- *
- * @return $this
- */
- public function setItems($items)
- {
- $this->container['items'] = $items;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/DeleteHardbounces.php b/lib/Model/DeleteHardbounces.php
deleted file mode 100644
index fd256f5..0000000
--- a/lib/Model/DeleteHardbounces.php
+++ /dev/null
@@ -1,365 +0,0 @@
- 'string',
- 'endDate' => 'string',
- 'contactEmail' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'startDate' => null,
- 'endDate' => null,
- 'contactEmail' => 'email'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'startDate' => 'startDate',
- 'endDate' => 'endDate',
- 'contactEmail' => 'contactEmail'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'startDate' => 'setStartDate',
- 'endDate' => 'setEndDate',
- 'contactEmail' => 'setContactEmail'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'startDate' => 'getStartDate',
- 'endDate' => 'getEndDate',
- 'contactEmail' => 'getContactEmail'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['startDate'] = isset($data['startDate']) ? $data['startDate'] : null;
- $this->container['endDate'] = isset($data['endDate']) ? $data['endDate'] : null;
- $this->container['contactEmail'] = isset($data['contactEmail']) ? $data['contactEmail'] : null;
- }
-
- /**
- * 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 startDate
- *
- * @return string
- */
- public function getStartDate()
- {
- return $this->container['startDate'];
- }
-
- /**
- * Sets startDate
- *
- * @param string $startDate Starting date (YYYY-MM-DD) of the time period for deletion. The hardbounces occurred after this date will be deleted. Must be less than or equal to the endDate
- *
- * @return $this
- */
- public function setStartDate($startDate)
- {
- $this->container['startDate'] = $startDate;
-
- return $this;
- }
-
- /**
- * Gets endDate
- *
- * @return string
- */
- public function getEndDate()
- {
- return $this->container['endDate'];
- }
-
- /**
- * Sets endDate
- *
- * @param string $endDate Ending date (YYYY-MM-DD) of the time period for deletion. The hardbounces until this date will be deleted. Must be greater than or equal to the startDate
- *
- * @return $this
- */
- public function setEndDate($endDate)
- {
- $this->container['endDate'] = $endDate;
-
- return $this;
- }
-
- /**
- * Gets contactEmail
- *
- * @return string
- */
- public function getContactEmail()
- {
- return $this->container['contactEmail'];
- }
-
- /**
- * Sets contactEmail
- *
- * @param string $contactEmail Target a specific email address
- *
- * @return $this
- */
- public function setContactEmail($contactEmail)
- {
- $this->container['contactEmail'] = $contactEmail;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/EmailExportRecipients.php b/lib/Model/EmailExportRecipients.php
deleted file mode 100644
index 4489fd9..0000000
--- a/lib/Model/EmailExportRecipients.php
+++ /dev/null
@@ -1,382 +0,0 @@
- 'string',
- 'recipientsType' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'notifyURL' => 'url',
- 'recipientsType' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'notifyURL' => 'notifyURL',
- 'recipientsType' => 'recipientsType'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'notifyURL' => 'setNotifyURL',
- 'recipientsType' => 'setRecipientsType'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'notifyURL' => 'getNotifyURL',
- 'recipientsType' => 'getRecipientsType'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const RECIPIENTS_TYPE_ALL = 'all';
- const RECIPIENTS_TYPE_NON_CLICKERS = 'nonClickers';
- const RECIPIENTS_TYPE_NON_OPENERS = 'nonOpeners';
- const RECIPIENTS_TYPE_CLICKERS = 'clickers';
- const RECIPIENTS_TYPE_OPENERS = 'openers';
- const RECIPIENTS_TYPE_SOFT_BOUNCES = 'softBounces';
- const RECIPIENTS_TYPE_HARD_BOUNCES = 'hardBounces';
- const RECIPIENTS_TYPE_UNSUBSCRIBED = 'unsubscribed';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getRecipientsTypeAllowableValues()
- {
- return [
- self::RECIPIENTS_TYPE_ALL,
- self::RECIPIENTS_TYPE_NON_CLICKERS,
- self::RECIPIENTS_TYPE_NON_OPENERS,
- self::RECIPIENTS_TYPE_CLICKERS,
- self::RECIPIENTS_TYPE_OPENERS,
- self::RECIPIENTS_TYPE_SOFT_BOUNCES,
- self::RECIPIENTS_TYPE_HARD_BOUNCES,
- self::RECIPIENTS_TYPE_UNSUBSCRIBED,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['notifyURL'] = isset($data['notifyURL']) ? $data['notifyURL'] : null;
- $this->container['recipientsType'] = isset($data['recipientsType']) ? $data['recipientsType'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['recipientsType'] === null) {
- $invalidProperties[] = "'recipientsType' can't be null";
- }
- $allowedValues = $this->getRecipientsTypeAllowableValues();
- if (!is_null($this->container['recipientsType']) && !in_array($this->container['recipientsType'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'recipientsType', must be one of '%s'",
- 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 notifyURL
- *
- * @return string
- */
- public function getNotifyURL()
- {
- return $this->container['notifyURL'];
- }
-
- /**
- * Sets notifyURL
- *
- * @param string $notifyURL Webhook called once the export process is finished. For reference, https://help.brevo.com/hc/en-us/articles/360007666479
- *
- * @return $this
- */
- public function setNotifyURL($notifyURL)
- {
- $this->container['notifyURL'] = $notifyURL;
-
- return $this;
- }
-
- /**
- * Gets recipientsType
- *
- * @return string
- */
- public function getRecipientsType()
- {
- return $this->container['recipientsType'];
- }
-
- /**
- * Sets recipientsType
- *
- * @param string $recipientsType Type of recipients to export for a campaign
- *
- * @return $this
- */
- public function setRecipientsType($recipientsType)
- {
- $allowedValues = $this->getRecipientsTypeAllowableValues();
- if (!in_array($recipientsType, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'recipientsType', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['recipientsType'] = $recipientsType;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/ErrorModel.php b/lib/Model/ErrorModel.php
deleted file mode 100644
index 7d4591b..0000000
--- a/lib/Model/ErrorModel.php
+++ /dev/null
@@ -1,401 +0,0 @@
- 'string',
- 'message' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'code' => null,
- 'message' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'code' => 'code',
- 'message' => 'message'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'code' => 'setCode',
- 'message' => 'setMessage'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'code' => 'getCode',
- 'message' => 'getMessage'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const CODE_INVALID_PARAMETER = 'invalid_parameter';
- const CODE_MISSING_PARAMETER = 'missing_parameter';
- const CODE_OUT_OF_RANGE = 'out_of_range';
- const CODE_CAMPAIGN_PROCESSING = 'campaign_processing';
- const CODE_CAMPAIGN_SENT = 'campaign_sent';
- const CODE_DOCUMENT_NOT_FOUND = 'document_not_found';
- const CODE_RESELLER_PERMISSION_DENIED = 'reseller_permission_denied';
- const CODE_NOT_ENOUGH_CREDITS = 'not_enough_credits';
- const CODE_PERMISSION_DENIED = 'permission_denied';
- const CODE_DUPLICATE_PARAMETER = 'duplicate_parameter';
- const CODE_DUPLICATE_REQUEST = 'duplicate_request';
- const CODE_METHOD_NOT_ALLOWED = 'method_not_allowed';
- const CODE_UNAUTHORIZED = 'unauthorized';
- const CODE_ACCOUNT_UNDER_VALIDATION = 'account_under_validation';
- const CODE_NOT_ACCEPTABLE = 'not_acceptable';
- const CODE_BAD_REQUEST = 'bad_request';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getCodeAllowableValues()
- {
- return [
- self::CODE_INVALID_PARAMETER,
- self::CODE_MISSING_PARAMETER,
- self::CODE_OUT_OF_RANGE,
- self::CODE_CAMPAIGN_PROCESSING,
- self::CODE_CAMPAIGN_SENT,
- self::CODE_DOCUMENT_NOT_FOUND,
- self::CODE_RESELLER_PERMISSION_DENIED,
- self::CODE_NOT_ENOUGH_CREDITS,
- self::CODE_PERMISSION_DENIED,
- self::CODE_DUPLICATE_PARAMETER,
- self::CODE_DUPLICATE_REQUEST,
- self::CODE_METHOD_NOT_ALLOWED,
- self::CODE_UNAUTHORIZED,
- self::CODE_ACCOUNT_UNDER_VALIDATION,
- self::CODE_NOT_ACCEPTABLE,
- self::CODE_BAD_REQUEST,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['code'] = isset($data['code']) ? $data['code'] : null;
- $this->container['message'] = isset($data['message']) ? $data['message'] : null;
- }
-
- /**
- * 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";
- }
- $allowedValues = $this->getCodeAllowableValues();
- if (!is_null($this->container['code']) && !in_array($this->container['code'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'code', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- if ($this->container['message'] === null) {
- $invalidProperties[] = "'message' 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 Error code displayed in case of a failure
- *
- * @return $this
- */
- public function setCode($code)
- {
- $allowedValues = $this->getCodeAllowableValues();
- if (!in_array($code, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'code', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['code'] = $code;
-
- return $this;
- }
-
- /**
- * Gets message
- *
- * @return string
- */
- public function getMessage()
- {
- return $this->container['message'];
- }
-
- /**
- * Sets message
- *
- * @param string $message Readable message associated to the failure
- *
- * @return $this
- */
- public function setMessage($message)
- {
- $this->container['message'] = $message;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/Event.php b/lib/Model/Event.php
deleted file mode 100644
index 8335cfe..0000000
--- a/lib/Model/Event.php
+++ /dev/null
@@ -1,431 +0,0 @@
- 'string',
- 'eventDate' => 'string',
- 'identifiers' => '\Brevo\Client\Model\EventIdentifiers',
- 'contactProperties' => 'object',
- 'eventProperties' => 'object'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'eventName' => null,
- 'eventDate' => null,
- 'identifiers' => null,
- 'contactProperties' => null,
- 'eventProperties' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'eventName' => 'event_name',
- 'eventDate' => 'event_date',
- 'identifiers' => 'identifiers',
- 'contactProperties' => 'contact_properties',
- 'eventProperties' => 'event_properties'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'eventName' => 'setEventName',
- 'eventDate' => 'setEventDate',
- 'identifiers' => 'setIdentifiers',
- 'contactProperties' => 'setContactProperties',
- 'eventProperties' => 'setEventProperties'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'eventName' => 'getEventName',
- 'eventDate' => 'getEventDate',
- 'identifiers' => 'getIdentifiers',
- 'contactProperties' => 'getContactProperties',
- 'eventProperties' => 'getEventProperties'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['eventName'] = isset($data['eventName']) ? $data['eventName'] : null;
- $this->container['eventDate'] = isset($data['eventDate']) ? $data['eventDate'] : null;
- $this->container['identifiers'] = isset($data['identifiers']) ? $data['identifiers'] : null;
- $this->container['contactProperties'] = isset($data['contactProperties']) ? $data['contactProperties'] : null;
- $this->container['eventProperties'] = isset($data['eventProperties']) ? $data['eventProperties'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['eventName'] === null) {
- $invalidProperties[] = "'eventName' can't be null";
- }
- if ($this->container['identifiers'] === null) {
- $invalidProperties[] = "'identifiers' 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 eventName
- *
- * @return string
- */
- public function getEventName()
- {
- return $this->container['eventName'];
- }
-
- /**
- * Sets eventName
- *
- * @param string $eventName The name of the event that occurred. This is how you will find your event in Brevo. Limited to 255 characters, alphanumerical characters and - _ only.
- *
- * @return $this
- */
- public function setEventName($eventName)
- {
- $this->container['eventName'] = $eventName;
-
- return $this;
- }
-
- /**
- * Gets eventDate
- *
- * @return string
- */
- public function getEventDate()
- {
- return $this->container['eventDate'];
- }
-
- /**
- * Sets eventDate
- *
- * @param string $eventDate Timestamp of when the event occurred (e.g. \"2024-01-24T17:39:57+01:00\"). If no value is passed, the timestamp of the event creation is used.
- *
- * @return $this
- */
- public function setEventDate($eventDate)
- {
- $this->container['eventDate'] = $eventDate;
-
- return $this;
- }
-
- /**
- * Gets identifiers
- *
- * @return \Brevo\Client\Model\EventIdentifiers
- */
- public function getIdentifiers()
- {
- return $this->container['identifiers'];
- }
-
- /**
- * Sets identifiers
- *
- * @param \Brevo\Client\Model\EventIdentifiers $identifiers identifiers
- *
- * @return $this
- */
- public function setIdentifiers($identifiers)
- {
- $this->container['identifiers'] = $identifiers;
-
- return $this;
- }
-
- /**
- * Gets contactProperties
- *
- * @return object
- */
- public function getContactProperties()
- {
- return $this->container['contactProperties'];
- }
-
- /**
- * Sets contactProperties
- *
- * @param object $contactProperties Properties defining the state of the contact associated to this event. Useful to update contact attributes defined in your contacts database while passing the event. For example: **\"FIRSTNAME\": \"Jane\" , \"AGE\": 37**
- *
- * @return $this
- */
- public function setContactProperties($contactProperties)
- {
- $this->container['contactProperties'] = $contactProperties;
-
- return $this;
- }
-
- /**
- * Gets eventProperties
- *
- * @return object
- */
- public function getEventProperties()
- {
- return $this->container['eventProperties'];
- }
-
- /**
- * Sets eventProperties
- *
- * @param object $eventProperties Properties of the event. Top level properties and nested properties can be used to better segment contacts and personalise workflow conditions. The following field type are supported: string, number, boolean (true/false), date (Timestamp e.g. \"2024-01-24T17:39:57+01:00\"). Keys are limited to 255 characters, alphanumerical characters and - _ only. Size is limited to 50Kb.
- *
- * @return $this
- */
- public function setEventProperties($eventProperties)
- {
- $this->container['eventProperties'] = $eventProperties;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/EventIdentifiers.php b/lib/Model/EventIdentifiers.php
deleted file mode 100644
index a71997e..0000000
--- a/lib/Model/EventIdentifiers.php
+++ /dev/null
@@ -1,426 +0,0 @@
- 'string',
- 'phoneId' => 'string',
- 'whatsappId' => 'string',
- 'landlineNumberId' => 'string',
- 'extId' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'emailId' => null,
- 'phoneId' => null,
- 'whatsappId' => null,
- 'landlineNumberId' => null,
- 'extId' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'emailId' => 'email_id',
- 'phoneId' => 'phone_id',
- 'whatsappId' => 'whatsapp_id',
- 'landlineNumberId' => 'landline_number_id',
- 'extId' => 'ext_id'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'emailId' => 'setEmailId',
- 'phoneId' => 'setPhoneId',
- 'whatsappId' => 'setWhatsappId',
- 'landlineNumberId' => 'setLandlineNumberId',
- 'extId' => 'setExtId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'emailId' => 'getEmailId',
- 'phoneId' => 'getPhoneId',
- 'whatsappId' => 'getWhatsappId',
- 'landlineNumberId' => 'getLandlineNumberId',
- 'extId' => 'getExtId'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['emailId'] = isset($data['emailId']) ? $data['emailId'] : null;
- $this->container['phoneId'] = isset($data['phoneId']) ? $data['phoneId'] : null;
- $this->container['whatsappId'] = isset($data['whatsappId']) ? $data['whatsappId'] : null;
- $this->container['landlineNumberId'] = isset($data['landlineNumberId']) ? $data['landlineNumberId'] : null;
- $this->container['extId'] = isset($data['extId']) ? $data['extId'] : null;
- }
-
- /**
- * 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 emailId
- *
- * @return string
- */
- public function getEmailId()
- {
- return $this->container['emailId'];
- }
-
- /**
- * Sets emailId
- *
- * @param string $emailId Email Id associated with the event
- *
- * @return $this
- */
- public function setEmailId($emailId)
- {
- $this->container['emailId'] = $emailId;
-
- return $this;
- }
-
- /**
- * Gets phoneId
- *
- * @return string
- */
- public function getPhoneId()
- {
- return $this->container['phoneId'];
- }
-
- /**
- * Sets phoneId
- *
- * @param string $phoneId SMS associated with the event
- *
- * @return $this
- */
- public function setPhoneId($phoneId)
- {
- $this->container['phoneId'] = $phoneId;
-
- return $this;
- }
-
- /**
- * Gets whatsappId
- *
- * @return string
- */
- public function getWhatsappId()
- {
- return $this->container['whatsappId'];
- }
-
- /**
- * Sets whatsappId
- *
- * @param string $whatsappId whatsapp associated with the event
- *
- * @return $this
- */
- public function setWhatsappId($whatsappId)
- {
- $this->container['whatsappId'] = $whatsappId;
-
- return $this;
- }
-
- /**
- * Gets landlineNumberId
- *
- * @return string
- */
- public function getLandlineNumberId()
- {
- return $this->container['landlineNumberId'];
- }
-
- /**
- * Sets landlineNumberId
- *
- * @param string $landlineNumberId landline_number associated with the event
- *
- * @return $this
- */
- public function setLandlineNumberId($landlineNumberId)
- {
- $this->container['landlineNumberId'] = $landlineNumberId;
-
- return $this;
- }
-
- /**
- * Gets extId
- *
- * @return string
- */
- public function getExtId()
- {
- return $this->container['extId'];
- }
-
- /**
- * Sets extId
- *
- * @param string $extId ext_id associated with the event
- *
- * @return $this
- */
- public function setExtId($extId)
- {
- $this->container['extId'] = $extId;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/ExportWebhooksHistory.php b/lib/Model/ExportWebhooksHistory.php
deleted file mode 100644
index 4d36844..0000000
--- a/lib/Model/ExportWebhooksHistory.php
+++ /dev/null
@@ -1,678 +0,0 @@
- 'int',
- 'startDate' => 'string',
- 'endDate' => 'string',
- 'sort' => 'string',
- 'type' => 'string',
- 'event' => 'string',
- 'notifyURL' => 'string',
- 'webhookId' => 'int',
- 'email' => 'string',
- 'messageId' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'days' => null,
- 'startDate' => null,
- 'endDate' => null,
- 'sort' => null,
- 'type' => null,
- 'event' => null,
- 'notifyURL' => null,
- 'webhookId' => null,
- 'email' => null,
- 'messageId' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'days' => 'days',
- 'startDate' => 'startDate',
- 'endDate' => 'endDate',
- 'sort' => 'sort',
- 'type' => 'type',
- 'event' => 'event',
- 'notifyURL' => 'notifyURL',
- 'webhookId' => 'webhookId',
- 'email' => 'email',
- 'messageId' => 'messageId'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'days' => 'setDays',
- 'startDate' => 'setStartDate',
- 'endDate' => 'setEndDate',
- 'sort' => 'setSort',
- 'type' => 'setType',
- 'event' => 'setEvent',
- 'notifyURL' => 'setNotifyURL',
- 'webhookId' => 'setWebhookId',
- 'email' => 'setEmail',
- 'messageId' => 'setMessageId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'days' => 'getDays',
- 'startDate' => 'getStartDate',
- 'endDate' => 'getEndDate',
- 'sort' => 'getSort',
- 'type' => 'getType',
- 'event' => 'getEvent',
- 'notifyURL' => 'getNotifyURL',
- 'webhookId' => 'getWebhookId',
- 'email' => 'getEmail',
- 'messageId' => 'getMessageId'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const TYPE_TRANSACTIONAL = 'transactional';
- const TYPE_MARKETING = 'marketing';
- const EVENT_INVALID_PARAMETER = 'invalid_parameter';
- const EVENT_MISSING_PARAMETER = 'missing_parameter';
- const EVENT_HARD_BOUNCE = 'hardBounce';
- const EVENT_SOFT_BOUNCE = 'softBounce';
- const EVENT_DELIVERED = 'delivered\"';
- const EVENT_SPAM = 'spam';
- const EVENT_REQUEST = 'request';
- const EVENT_OPENED = 'opened';
- const EVENT_CLICK = 'click';
- const EVENT_INVALID = 'invalid';
- const EVENT_DEFERRED = 'deferred';
- const EVENT_BLOCKED = 'blocked';
- const EVENT_UNSUBSCRIBED = 'unsubscribed';
- const EVENT_ERROR = 'error';
- const EVENT_UNIQUE_OPENED = 'uniqueOpened';
- const EVENT_LOADED_BY_PROXY = 'loadedByProxy';
- const EVENT_ALL_EVENTS = 'allEvents';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getTypeAllowableValues()
- {
- return [
- self::TYPE_TRANSACTIONAL,
- self::TYPE_MARKETING,
- ];
- }
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getEventAllowableValues()
- {
- return [
- self::EVENT_INVALID_PARAMETER,
- self::EVENT_MISSING_PARAMETER,
- self::EVENT_HARD_BOUNCE,
- self::EVENT_SOFT_BOUNCE,
- self::EVENT_DELIVERED,
- self::EVENT_SPAM,
- self::EVENT_REQUEST,
- self::EVENT_OPENED,
- self::EVENT_CLICK,
- self::EVENT_INVALID,
- self::EVENT_DEFERRED,
- self::EVENT_BLOCKED,
- self::EVENT_UNSUBSCRIBED,
- self::EVENT_ERROR,
- self::EVENT_UNIQUE_OPENED,
- self::EVENT_LOADED_BY_PROXY,
- self::EVENT_ALL_EVENTS,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['days'] = isset($data['days']) ? $data['days'] : null;
- $this->container['startDate'] = isset($data['startDate']) ? $data['startDate'] : null;
- $this->container['endDate'] = isset($data['endDate']) ? $data['endDate'] : null;
- $this->container['sort'] = isset($data['sort']) ? $data['sort'] : null;
- $this->container['type'] = isset($data['type']) ? $data['type'] : null;
- $this->container['event'] = isset($data['event']) ? $data['event'] : null;
- $this->container['notifyURL'] = isset($data['notifyURL']) ? $data['notifyURL'] : null;
- $this->container['webhookId'] = isset($data['webhookId']) ? $data['webhookId'] : null;
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['messageId'] = isset($data['messageId']) ? $data['messageId'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['type'] === null) {
- $invalidProperties[] = "'type' can't be null";
- }
- $allowedValues = $this->getTypeAllowableValues();
- if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'type', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- if ($this->container['event'] === null) {
- $invalidProperties[] = "'event' can't be null";
- }
- $allowedValues = $this->getEventAllowableValues();
- if (!is_null($this->container['event']) && !in_array($this->container['event'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'event', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- if ($this->container['notifyURL'] === null) {
- $invalidProperties[] = "'notifyURL' 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 days
- *
- * @return int
- */
- public function getDays()
- {
- return $this->container['days'];
- }
-
- /**
- * Sets days
- *
- * @param int $days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_
- *
- * @return $this
- */
- public function setDays($days)
- {
- $this->container['days'] = $days;
-
- return $this;
- }
-
- /**
- * Gets startDate
- *
- * @return string
- */
- public function getStartDate()
- {
- return $this->container['startDate'];
- }
-
- /**
- * Sets startDate
- *
- * @param string $startDate Mandatory if endDate is used. Starting date of the history (YYYY-MM-DD). Must be lower than equal to endDate
- *
- * @return $this
- */
- public function setStartDate($startDate)
- {
- $this->container['startDate'] = $startDate;
-
- return $this;
- }
-
- /**
- * Gets endDate
- *
- * @return string
- */
- public function getEndDate()
- {
- return $this->container['endDate'];
- }
-
- /**
- * Sets endDate
- *
- * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate
- *
- * @return $this
- */
- public function setEndDate($endDate)
- {
- $this->container['endDate'] = $endDate;
-
- return $this;
- }
-
- /**
- * Gets sort
- *
- * @return string
- */
- public function getSort()
- {
- return $this->container['sort'];
- }
-
- /**
- * Sets sort
- *
- * @param string $sort Sorting order of records (asc or desc)
- *
- * @return $this
- */
- public function setSort($sort)
- {
- $this->container['sort'] = $sort;
-
- return $this;
- }
-
- /**
- * Gets type
- *
- * @return string
- */
- public function getType()
- {
- return $this->container['type'];
- }
-
- /**
- * Sets type
- *
- * @param string $type Filter the history based on webhook type
- *
- * @return $this
- */
- public function setType($type)
- {
- $allowedValues = $this->getTypeAllowableValues();
- if (!in_array($type, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'type', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['type'] = $type;
-
- return $this;
- }
-
- /**
- * Gets event
- *
- * @return string
- */
- public function getEvent()
- {
- return $this->container['event'];
- }
-
- /**
- * Sets event
- *
- * @param string $event Filter the history for a specific event type
- *
- * @return $this
- */
- public function setEvent($event)
- {
- $allowedValues = $this->getEventAllowableValues();
- if (!in_array($event, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'event', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['event'] = $event;
-
- return $this;
- }
-
- /**
- * Gets notifyURL
- *
- * @return string
- */
- public function getNotifyURL()
- {
- return $this->container['notifyURL'];
- }
-
- /**
- * Sets notifyURL
- *
- * @param string $notifyURL Webhook URL to receive CSV file link
- *
- * @return $this
- */
- public function setNotifyURL($notifyURL)
- {
- $this->container['notifyURL'] = $notifyURL;
-
- return $this;
- }
-
- /**
- * Gets webhookId
- *
- * @return int
- */
- public function getWebhookId()
- {
- return $this->container['webhookId'];
- }
-
- /**
- * Sets webhookId
- *
- * @param int $webhookId Filter the history for a specific webhook id
- *
- * @return $this
- */
- public function setWebhookId($webhookId)
- {
- $this->container['webhookId'] = $webhookId;
-
- return $this;
- }
-
- /**
- * Gets email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Filter the history for a specific email
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets messageId
- *
- * @return int
- */
- public function getMessageId()
- {
- return $this->container['messageId'];
- }
-
- /**
- * Sets messageId
- *
- * @param int $messageId Filter the history for a specific message id. Applicable only for transactional webhooks.
- *
- * @return $this
- */
- public function setMessageId($messageId)
- {
- $this->container['messageId'] = $messageId;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/FileData.php b/lib/Model/FileData.php
deleted file mode 100644
index 7b7ef4f..0000000
--- a/lib/Model/FileData.php
+++ /dev/null
@@ -1,582 +0,0 @@
- 'string',
- 'id' => 'string',
- 'name' => 'string',
- 'authorId' => 'string',
- 'author' => 'object',
- 'contactId' => 'int',
- 'dealId' => 'string',
- 'companyId' => 'string',
- 'size' => 'int',
- 'createdAt' => '\DateTime',
- 'updatedAt' => '\DateTime'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'url' => null,
- 'id' => null,
- 'name' => null,
- 'authorId' => null,
- 'author' => null,
- 'contactId' => 'int64',
- 'dealId' => null,
- 'companyId' => null,
- 'size' => 'int64',
- 'createdAt' => 'date-time',
- 'updatedAt' => 'date-time'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'url' => 'url',
- 'id' => 'id',
- 'name' => 'name',
- 'authorId' => 'authorId',
- 'author' => 'author',
- 'contactId' => 'contactId',
- 'dealId' => 'dealId',
- 'companyId' => 'companyId',
- 'size' => 'size',
- 'createdAt' => 'createdAt',
- 'updatedAt' => 'updatedAt'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'url' => 'setUrl',
- 'id' => 'setId',
- 'name' => 'setName',
- 'authorId' => 'setAuthorId',
- 'author' => 'setAuthor',
- 'contactId' => 'setContactId',
- 'dealId' => 'setDealId',
- 'companyId' => 'setCompanyId',
- 'size' => 'setSize',
- 'createdAt' => 'setCreatedAt',
- 'updatedAt' => 'setUpdatedAt'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'url' => 'getUrl',
- 'id' => 'getId',
- 'name' => 'getName',
- 'authorId' => 'getAuthorId',
- 'author' => 'getAuthor',
- 'contactId' => 'getContactId',
- 'dealId' => 'getDealId',
- 'companyId' => 'getCompanyId',
- 'size' => 'getSize',
- 'createdAt' => 'getCreatedAt',
- 'updatedAt' => 'getUpdatedAt'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['url'] = isset($data['url']) ? $data['url'] : null;
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['authorId'] = isset($data['authorId']) ? $data['authorId'] : null;
- $this->container['author'] = isset($data['author']) ? $data['author'] : null;
- $this->container['contactId'] = isset($data['contactId']) ? $data['contactId'] : null;
- $this->container['dealId'] = isset($data['dealId']) ? $data['dealId'] : null;
- $this->container['companyId'] = isset($data['companyId']) ? $data['companyId'] : null;
- $this->container['size'] = isset($data['size']) ? $data['size'] : null;
- $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null;
- $this->container['updatedAt'] = isset($data['updatedAt']) ? $data['updatedAt'] : null;
- }
-
- /**
- * 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 url
- *
- * @return string
- */
- public function getUrl()
- {
- return $this->container['url'];
- }
-
- /**
- * Sets url
- *
- * @param string $url Url of uploaded file
- *
- * @return $this
- */
- public function setUrl($url)
- {
- $this->container['url'] = $url;
-
- return $this;
- }
-
- /**
- * Gets id
- *
- * @return string
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param string $id Id of uploaded file
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of uploaded file
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets authorId
- *
- * @return string
- */
- public function getAuthorId()
- {
- return $this->container['authorId'];
- }
-
- /**
- * Sets authorId
- *
- * @param string $authorId Account id of user which created the file
- *
- * @return $this
- */
- public function setAuthorId($authorId)
- {
- $this->container['authorId'] = $authorId;
-
- return $this;
- }
-
- /**
- * Gets contactId
- *
- * @return int
- */
- public function getContactId()
- {
- return $this->container['contactId'];
- }
-
- /**
- * Sets contactId
- *
- * @param int $contactId Contact id of contact on which file is uploaded
- *
- * @return $this
- */
- public function setContactId($contactId)
- {
- $this->container['contactId'] = $contactId;
-
- return $this;
- }
-
- /**
- * Gets dealId
- *
- * @return string
- */
- public function getDealId()
- {
- return $this->container['dealId'];
- }
-
- /**
- * Sets dealId
- *
- * @param string $dealId Deal id linked to a file
- *
- * @return $this
- */
- public function setDealId($dealId)
- {
- $this->container['dealId'] = $dealId;
-
- return $this;
- }
-
- /**
- * Gets companyId
- *
- * @return string
- */
- public function getCompanyId()
- {
- return $this->container['companyId'];
- }
-
- /**
- * Sets companyId
- *
- * @param string $companyId Company id linked to a file
- *
- * @return $this
- */
- public function setCompanyId($companyId)
- {
- $this->container['companyId'] = $companyId;
-
- return $this;
- }
-
- /**
- * Gets size
- *
- * @return int
- */
- public function getSize()
- {
- return $this->container['size'];
- }
-
- /**
- * Sets size
- *
- * @param int $size Size of file in bytes
- *
- * @return $this
- */
- public function setSize($size)
- {
- $this->container['size'] = $size;
-
- return $this;
- }
-
- /**
- * Gets createdAt
- *
- * @return \DateTime
- */
- public function getCreatedAt()
- {
- return $this->container['createdAt'];
- }
-
- /**
- * Sets createdAt
- *
- * @param \DateTime $createdAt File created date/time
- *
- * @return $this
- */
- public function setCreatedAt($createdAt)
- {
- $this->container['createdAt'] = $createdAt;
-
- return $this;
- }
-
- /**
- * Gets updatedAt
- *
- * @return \DateTime
- */
- public function getUpdatedAt()
- {
- return $this->container['updatedAt'];
- }
-
- /**
- * Sets updatedAt
- *
- * @param \DateTime $updatedAt File updated date/time
- *
- * @return $this
- */
- public function setUpdatedAt($updatedAt)
- {
- $this->container['updatedAt'] = $updatedAt;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/FileDownloadableLink.php b/lib/Model/FileDownloadableLink.php
deleted file mode 100644
index 003c6c6..0000000
--- a/lib/Model/FileDownloadableLink.php
+++ /dev/null
@@ -1,308 +0,0 @@
- 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'fileUrl' => 'url'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'fileUrl' => 'fileUrl'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'fileUrl' => 'setFileUrl'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'fileUrl' => 'getFileUrl'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['fileUrl'] = isset($data['fileUrl']) ? $data['fileUrl'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['fileUrl'] === null) {
- $invalidProperties[] = "'fileUrl' 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 fileUrl
- *
- * @return string
- */
- public function getFileUrl()
- {
- return $this->container['fileUrl'];
- }
-
- /**
- * Sets fileUrl
- *
- * @param string $fileUrl A unique link to download the requested file.
- *
- * @return $this
- */
- public function setFileUrl($fileUrl)
- {
- $this->container['fileUrl'] = $fileUrl;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/FileList.php b/lib/Model/FileList.php
deleted file mode 100644
index 9fe810f..0000000
--- a/lib/Model/FileList.php
+++ /dev/null
@@ -1,281 +0,0 @@
-listInvalidProperties()) === 0;
- }
-
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetAccount.php b/lib/Model/GetAccount.php
deleted file mode 100644
index fe969b4..0000000
--- a/lib/Model/GetAccount.php
+++ /dev/null
@@ -1,365 +0,0 @@
- '\Brevo\Client\Model\GetAccountPlan[]',
- 'relay' => '\Brevo\Client\Model\GetAccountRelay',
- 'marketingAutomation' => '\Brevo\Client\Model\GetAccountMarketingAutomation'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'plan' => null,
- 'relay' => null,
- 'marketingAutomation' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes + parent::swaggerTypes();
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats + parent::swaggerFormats();
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'plan' => 'plan',
- 'relay' => 'relay',
- 'marketingAutomation' => 'marketingAutomation'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'plan' => 'setPlan',
- 'relay' => 'setRelay',
- 'marketingAutomation' => 'setMarketingAutomation'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'plan' => 'getPlan',
- 'relay' => 'getRelay',
- 'marketingAutomation' => 'getMarketingAutomation'
- ];
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @return array
- */
- public static function attributeMap()
- {
- return parent::attributeMap() + self::$attributeMap;
- }
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @return array
- */
- public static function setters()
- {
- return parent::setters() + self::$setters;
- }
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @return array
- */
- public static function getters()
- {
- return parent::getters() + self::$getters;
- }
-
- /**
- * The original name of the model.
- *
- * @return string
- */
- public function getModelName()
- {
- return self::$swaggerModelName;
- }
-
-
-
-
-
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- parent::__construct($data);
-
- $this->container['plan'] = isset($data['plan']) ? $data['plan'] : null;
- $this->container['relay'] = isset($data['relay']) ? $data['relay'] : null;
- $this->container['marketingAutomation'] = isset($data['marketingAutomation']) ? $data['marketingAutomation'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = parent::listInvalidProperties();
-
- if ($this->container['plan'] === null) {
- $invalidProperties[] = "'plan' can't be null";
- }
- if ($this->container['relay'] === null) {
- $invalidProperties[] = "'relay' 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 plan
- *
- * @return \Brevo\Client\Model\GetAccountPlan[]
- */
- public function getPlan()
- {
- return $this->container['plan'];
- }
-
- /**
- * Sets plan
- *
- * @param \Brevo\Client\Model\GetAccountPlan[] $plan Information about your plans and credits
- *
- * @return $this
- */
- public function setPlan($plan)
- {
- $this->container['plan'] = $plan;
-
- return $this;
- }
-
- /**
- * Gets relay
- *
- * @return \Brevo\Client\Model\GetAccountRelay
- */
- public function getRelay()
- {
- return $this->container['relay'];
- }
-
- /**
- * Sets relay
- *
- * @param \Brevo\Client\Model\GetAccountRelay $relay relay
- *
- * @return $this
- */
- public function setRelay($relay)
- {
- $this->container['relay'] = $relay;
-
- return $this;
- }
-
- /**
- * Gets marketingAutomation
- *
- * @return \Brevo\Client\Model\GetAccountMarketingAutomation
- */
- public function getMarketingAutomation()
- {
- return $this->container['marketingAutomation'];
- }
-
- /**
- * Sets marketingAutomation
- *
- * @param \Brevo\Client\Model\GetAccountMarketingAutomation $marketingAutomation marketingAutomation
- *
- * @return $this
- */
- public function setMarketingAutomation($marketingAutomation)
- {
- $this->container['marketingAutomation'] = $marketingAutomation;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetAccountActivity.php b/lib/Model/GetAccountActivity.php
deleted file mode 100644
index 6d48d87..0000000
--- a/lib/Model/GetAccountActivity.php
+++ /dev/null
@@ -1,305 +0,0 @@
- '\Brevo\Client\Model\GetAccountActivityLogs[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'logs' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'logs' => 'logs'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'logs' => 'setLogs'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'logs' => 'getLogs'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['logs'] = isset($data['logs']) ? $data['logs'] : null;
- }
-
- /**
- * 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 logs
- *
- * @return \Brevo\Client\Model\GetAccountActivityLogs[]
- */
- public function getLogs()
- {
- return $this->container['logs'];
- }
-
- /**
- * Sets logs
- *
- * @param \Brevo\Client\Model\GetAccountActivityLogs[] $logs Get user activity logs
- *
- * @return $this
- */
- public function setLogs($logs)
- {
- $this->container['logs'] = $logs;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetAccountActivityLogs.php b/lib/Model/GetAccountActivityLogs.php
deleted file mode 100644
index 4e4baa1..0000000
--- a/lib/Model/GetAccountActivityLogs.php
+++ /dev/null
@@ -1,440 +0,0 @@
- 'string',
- 'date' => 'string',
- 'userEmail' => 'string',
- 'userIp' => 'string',
- 'userAgent' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'action' => null,
- 'date' => null,
- 'userEmail' => null,
- 'userIp' => null,
- 'userAgent' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'action' => 'action',
- 'date' => 'date',
- 'userEmail' => 'user_email',
- 'userIp' => 'user_ip',
- 'userAgent' => 'user_agent'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'action' => 'setAction',
- 'date' => 'setDate',
- 'userEmail' => 'setUserEmail',
- 'userIp' => 'setUserIp',
- 'userAgent' => 'setUserAgent'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'action' => 'getAction',
- 'date' => 'getDate',
- 'userEmail' => 'getUserEmail',
- 'userIp' => 'getUserIp',
- 'userAgent' => 'getUserAgent'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['action'] = isset($data['action']) ? $data['action'] : null;
- $this->container['date'] = isset($data['date']) ? $data['date'] : null;
- $this->container['userEmail'] = isset($data['userEmail']) ? $data['userEmail'] : null;
- $this->container['userIp'] = isset($data['userIp']) ? $data['userIp'] : null;
- $this->container['userAgent'] = isset($data['userAgent']) ? $data['userAgent'] : null;
- }
-
- /**
- * 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['date'] === null) {
- $invalidProperties[] = "'date' can't be null";
- }
- if ($this->container['userEmail'] === null) {
- $invalidProperties[] = "'userEmail' can't be null";
- }
- if ($this->container['userIp'] === null) {
- $invalidProperties[] = "'userIp' can't be null";
- }
- if ($this->container['userAgent'] === null) {
- $invalidProperties[] = "'userAgent' 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 Type of activity in the account.
- *
- * @return $this
- */
- public function setAction($action)
- {
- $this->container['action'] = $action;
-
- return $this;
- }
-
- /**
- * Gets date
- *
- * @return string
- */
- public function getDate()
- {
- return $this->container['date'];
- }
-
- /**
- * Sets date
- *
- * @param string $date Time of the activity.
- *
- * @return $this
- */
- public function setDate($date)
- {
- $this->container['date'] = $date;
-
- return $this;
- }
-
- /**
- * Gets userEmail
- *
- * @return string
- */
- public function getUserEmail()
- {
- return $this->container['userEmail'];
- }
-
- /**
- * Sets userEmail
- *
- * @param string $userEmail Email address of the user who performed activity in the account.
- *
- * @return $this
- */
- public function setUserEmail($userEmail)
- {
- $this->container['userEmail'] = $userEmail;
-
- return $this;
- }
-
- /**
- * Gets userIp
- *
- * @return string
- */
- public function getUserIp()
- {
- return $this->container['userIp'];
- }
-
- /**
- * Sets userIp
- *
- * @param string $userIp IP address of the user who performed activity in the account.
- *
- * @return $this
- */
- public function setUserIp($userIp)
- {
- $this->container['userIp'] = $userIp;
-
- return $this;
- }
-
- /**
- * Gets userAgent
- *
- * @return string
- */
- public function getUserAgent()
- {
- return $this->container['userAgent'];
- }
-
- /**
- * Sets userAgent
- *
- * @param string $userAgent Browser details of the user who performed the activity.
- *
- * @return $this
- */
- public function setUserAgent($userAgent)
- {
- $this->container['userAgent'] = $userAgent;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetAccountMarketingAutomation.php b/lib/Model/GetAccountMarketingAutomation.php
deleted file mode 100644
index fa2ee05..0000000
--- a/lib/Model/GetAccountMarketingAutomation.php
+++ /dev/null
@@ -1,338 +0,0 @@
- 'string',
- 'enabled' => 'bool'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'key' => null,
- 'enabled' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'key' => 'key',
- 'enabled' => 'enabled'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'key' => 'setKey',
- 'enabled' => 'setEnabled'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'key' => 'getKey',
- 'enabled' => 'getEnabled'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['key'] = isset($data['key']) ? $data['key'] : null;
- $this->container['enabled'] = isset($data['enabled']) ? $data['enabled'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['enabled'] === null) {
- $invalidProperties[] = "'enabled' 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 key
- *
- * @return string
- */
- public function getKey()
- {
- return $this->container['key'];
- }
-
- /**
- * Sets key
- *
- * @param string $key Marketing Automation Tracker ID
- *
- * @return $this
- */
- public function setKey($key)
- {
- $this->container['key'] = $key;
-
- return $this;
- }
-
- /**
- * Gets enabled
- *
- * @return bool
- */
- public function getEnabled()
- {
- return $this->container['enabled'];
- }
-
- /**
- * Sets enabled
- *
- * @param bool $enabled Status of Marketing Automation Plateform activation for your account (true=enabled, false=disabled)
- *
- * @return $this
- */
- public function setEnabled($enabled)
- {
- $this->container['enabled'] = $enabled;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetAccountPlan.php b/lib/Model/GetAccountPlan.php
deleted file mode 100644
index caadcb8..0000000
--- a/lib/Model/GetAccountPlan.php
+++ /dev/null
@@ -1,532 +0,0 @@
- 'string',
- 'creditsType' => 'string',
- 'credits' => 'float',
- 'startDate' => '\DateTime',
- 'endDate' => '\DateTime',
- 'userLimit' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'type' => null,
- 'creditsType' => null,
- 'credits' => 'float',
- 'startDate' => 'date',
- 'endDate' => 'date',
- 'userLimit' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'type' => 'type',
- 'creditsType' => 'creditsType',
- 'credits' => 'credits',
- 'startDate' => 'startDate',
- 'endDate' => 'endDate',
- 'userLimit' => 'userLimit'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'type' => 'setType',
- 'creditsType' => 'setCreditsType',
- 'credits' => 'setCredits',
- 'startDate' => 'setStartDate',
- 'endDate' => 'setEndDate',
- 'userLimit' => 'setUserLimit'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'type' => 'getType',
- 'creditsType' => 'getCreditsType',
- 'credits' => 'getCredits',
- 'startDate' => 'getStartDate',
- 'endDate' => 'getEndDate',
- 'userLimit' => 'getUserLimit'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const TYPE_PAY_AS_YOU_GO = 'payAsYouGo';
- const TYPE_FREE = 'free';
- const TYPE_SUBSCRIPTION = 'subscription';
- const TYPE_SMS = 'sms';
- const TYPE_RESELLER = 'reseller';
- const CREDITS_TYPE_SEND_LIMIT = 'sendLimit';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getTypeAllowableValues()
- {
- return [
- self::TYPE_PAY_AS_YOU_GO,
- self::TYPE_FREE,
- self::TYPE_SUBSCRIPTION,
- self::TYPE_SMS,
- self::TYPE_RESELLER,
- ];
- }
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getCreditsTypeAllowableValues()
- {
- return [
- self::CREDITS_TYPE_SEND_LIMIT,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['type'] = isset($data['type']) ? $data['type'] : null;
- $this->container['creditsType'] = isset($data['creditsType']) ? $data['creditsType'] : null;
- $this->container['credits'] = isset($data['credits']) ? $data['credits'] : null;
- $this->container['startDate'] = isset($data['startDate']) ? $data['startDate'] : null;
- $this->container['endDate'] = isset($data['endDate']) ? $data['endDate'] : null;
- $this->container['userLimit'] = isset($data['userLimit']) ? $data['userLimit'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['type'] === null) {
- $invalidProperties[] = "'type' can't be null";
- }
- $allowedValues = $this->getTypeAllowableValues();
- if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'type', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- if ($this->container['creditsType'] === null) {
- $invalidProperties[] = "'creditsType' can't be null";
- }
- $allowedValues = $this->getCreditsTypeAllowableValues();
- if (!is_null($this->container['creditsType']) && !in_array($this->container['creditsType'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'creditsType', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- if ($this->container['credits'] === null) {
- $invalidProperties[] = "'credits' 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 type
- *
- * @return string
- */
- public function getType()
- {
- return $this->container['type'];
- }
-
- /**
- * Sets type
- *
- * @param string $type Displays the plan type of the user
- *
- * @return $this
- */
- public function setType($type)
- {
- $allowedValues = $this->getTypeAllowableValues();
- if (!in_array($type, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'type', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['type'] = $type;
-
- return $this;
- }
-
- /**
- * Gets creditsType
- *
- * @return string
- */
- public function getCreditsType()
- {
- return $this->container['creditsType'];
- }
-
- /**
- * Sets creditsType
- *
- * @param string $creditsType This is the type of the credit, \"Send Limit\" is one of the possible types of credit of a user. \"Send Limit\" implies the total number of emails you can send to the subscribers in your account.
- *
- * @return $this
- */
- public function setCreditsType($creditsType)
- {
- $allowedValues = $this->getCreditsTypeAllowableValues();
- if (!in_array($creditsType, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'creditsType', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['creditsType'] = $creditsType;
-
- return $this;
- }
-
- /**
- * Gets credits
- *
- * @return float
- */
- public function getCredits()
- {
- return $this->container['credits'];
- }
-
- /**
- * Sets credits
- *
- * @param float $credits Remaining credits of the user
- *
- * @return $this
- */
- public function setCredits($credits)
- {
- $this->container['credits'] = $credits;
-
- return $this;
- }
-
- /**
- * Gets startDate
- *
- * @return \DateTime
- */
- public function getStartDate()
- {
- return $this->container['startDate'];
- }
-
- /**
- * Sets startDate
- *
- * @param \DateTime $startDate Date of the period from which the plan will start (only available for \"subscription\" and \"reseller\" plan type)
- *
- * @return $this
- */
- public function setStartDate($startDate)
- {
- $this->container['startDate'] = $startDate;
-
- return $this;
- }
-
- /**
- * Gets endDate
- *
- * @return \DateTime
- */
- public function getEndDate()
- {
- return $this->container['endDate'];
- }
-
- /**
- * Sets endDate
- *
- * @param \DateTime $endDate Date of the period from which the plan will end (only available for \"subscription\" and \"reseller\" plan type)
- *
- * @return $this
- */
- public function setEndDate($endDate)
- {
- $this->container['endDate'] = $endDate;
-
- return $this;
- }
-
- /**
- * Gets userLimit
- *
- * @return int
- */
- public function getUserLimit()
- {
- return $this->container['userLimit'];
- }
-
- /**
- * Sets userLimit
- *
- * @param int $userLimit Only in case of reseller account. It implies the total number of child accounts you can add to your account.
- *
- * @return $this
- */
- public function setUserLimit($userLimit)
- {
- $this->container['userLimit'] = $userLimit;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetAccountRelay.php b/lib/Model/GetAccountRelay.php
deleted file mode 100644
index 7af1aa4..0000000
--- a/lib/Model/GetAccountRelay.php
+++ /dev/null
@@ -1,342 +0,0 @@
- 'bool',
- 'data' => '\Brevo\Client\Model\GetAccountRelayData'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'enabled' => null,
- 'data' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'enabled' => 'enabled',
- 'data' => 'data'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'enabled' => 'setEnabled',
- 'data' => 'setData'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'enabled' => 'getEnabled',
- 'data' => 'getData'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['enabled'] = isset($data['enabled']) ? $data['enabled'] : null;
- $this->container['data'] = isset($data['data']) ? $data['data'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['enabled'] === null) {
- $invalidProperties[] = "'enabled' can't be null";
- }
- if ($this->container['data'] === null) {
- $invalidProperties[] = "'data' 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 enabled
- *
- * @return bool
- */
- public function getEnabled()
- {
- return $this->container['enabled'];
- }
-
- /**
- * Sets enabled
- *
- * @param bool $enabled Status of your transactional email Account (true=Enabled, false=Disabled)
- *
- * @return $this
- */
- public function setEnabled($enabled)
- {
- $this->container['enabled'] = $enabled;
-
- return $this;
- }
-
- /**
- * Gets data
- *
- * @return \Brevo\Client\Model\GetAccountRelayData
- */
- public function getData()
- {
- return $this->container['data'];
- }
-
- /**
- * Sets data
- *
- * @param \Brevo\Client\Model\GetAccountRelayData $data data
- *
- * @return $this
- */
- public function setData($data)
- {
- $this->container['data'] = $data;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetAccountRelayData.php b/lib/Model/GetAccountRelayData.php
deleted file mode 100644
index c9ef3b9..0000000
--- a/lib/Model/GetAccountRelayData.php
+++ /dev/null
@@ -1,375 +0,0 @@
- 'string',
- 'relay' => 'string',
- 'port' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'userName' => 'email',
- 'relay' => null,
- 'port' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'userName' => 'userName',
- 'relay' => 'relay',
- 'port' => 'port'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'userName' => 'setUserName',
- 'relay' => 'setRelay',
- 'port' => 'setPort'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'userName' => 'getUserName',
- 'relay' => 'getRelay',
- 'port' => 'getPort'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['userName'] = isset($data['userName']) ? $data['userName'] : null;
- $this->container['relay'] = isset($data['relay']) ? $data['relay'] : null;
- $this->container['port'] = isset($data['port']) ? $data['port'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['userName'] === null) {
- $invalidProperties[] = "'userName' can't be null";
- }
- if ($this->container['relay'] === null) {
- $invalidProperties[] = "'relay' can't be null";
- }
- if ($this->container['port'] === null) {
- $invalidProperties[] = "'port' 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 userName
- *
- * @return string
- */
- public function getUserName()
- {
- return $this->container['userName'];
- }
-
- /**
- * Sets userName
- *
- * @param string $userName Email to use as login on transactional platform
- *
- * @return $this
- */
- public function setUserName($userName)
- {
- $this->container['userName'] = $userName;
-
- return $this;
- }
-
- /**
- * Gets relay
- *
- * @return string
- */
- public function getRelay()
- {
- return $this->container['relay'];
- }
-
- /**
- * Sets relay
- *
- * @param string $relay URL of the SMTP Relay
- *
- * @return $this
- */
- public function setRelay($relay)
- {
- $this->container['relay'] = $relay;
-
- return $this;
- }
-
- /**
- * Gets port
- *
- * @return int
- */
- public function getPort()
- {
- return $this->container['port'];
- }
-
- /**
- * Sets port
- *
- * @param int $port Port used for SMTP Relay
- *
- * @return $this
- */
- public function setPort($port)
- {
- $this->container['port'] = $port;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetAggregatedReport.php b/lib/Model/GetAggregatedReport.php
deleted file mode 100644
index 3ab89d2..0000000
--- a/lib/Model/GetAggregatedReport.php
+++ /dev/null
@@ -1,665 +0,0 @@
- 'string',
- 'requests' => 'int',
- 'delivered' => 'int',
- 'hardBounces' => 'int',
- 'softBounces' => 'int',
- 'clicks' => 'int',
- 'uniqueClicks' => 'int',
- 'opens' => 'int',
- 'uniqueOpens' => 'int',
- 'spamReports' => 'int',
- 'blocked' => 'int',
- 'invalid' => 'int',
- 'unsubscribed' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'range' => null,
- 'requests' => 'int64',
- 'delivered' => 'int64',
- 'hardBounces' => 'int64',
- 'softBounces' => 'int64',
- 'clicks' => 'int64',
- 'uniqueClicks' => 'int64',
- 'opens' => 'int64',
- 'uniqueOpens' => 'int64',
- 'spamReports' => 'int64',
- 'blocked' => 'int64',
- 'invalid' => 'int64',
- 'unsubscribed' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'range' => 'range',
- 'requests' => 'requests',
- 'delivered' => 'delivered',
- 'hardBounces' => 'hardBounces',
- 'softBounces' => 'softBounces',
- 'clicks' => 'clicks',
- 'uniqueClicks' => 'uniqueClicks',
- 'opens' => 'opens',
- 'uniqueOpens' => 'uniqueOpens',
- 'spamReports' => 'spamReports',
- 'blocked' => 'blocked',
- 'invalid' => 'invalid',
- 'unsubscribed' => 'unsubscribed'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'range' => 'setRange',
- 'requests' => 'setRequests',
- 'delivered' => 'setDelivered',
- 'hardBounces' => 'setHardBounces',
- 'softBounces' => 'setSoftBounces',
- 'clicks' => 'setClicks',
- 'uniqueClicks' => 'setUniqueClicks',
- 'opens' => 'setOpens',
- 'uniqueOpens' => 'setUniqueOpens',
- 'spamReports' => 'setSpamReports',
- 'blocked' => 'setBlocked',
- 'invalid' => 'setInvalid',
- 'unsubscribed' => 'setUnsubscribed'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'range' => 'getRange',
- 'requests' => 'getRequests',
- 'delivered' => 'getDelivered',
- 'hardBounces' => 'getHardBounces',
- 'softBounces' => 'getSoftBounces',
- 'clicks' => 'getClicks',
- 'uniqueClicks' => 'getUniqueClicks',
- 'opens' => 'getOpens',
- 'uniqueOpens' => 'getUniqueOpens',
- 'spamReports' => 'getSpamReports',
- 'blocked' => 'getBlocked',
- 'invalid' => 'getInvalid',
- 'unsubscribed' => 'getUnsubscribed'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['range'] = isset($data['range']) ? $data['range'] : null;
- $this->container['requests'] = isset($data['requests']) ? $data['requests'] : null;
- $this->container['delivered'] = isset($data['delivered']) ? $data['delivered'] : null;
- $this->container['hardBounces'] = isset($data['hardBounces']) ? $data['hardBounces'] : null;
- $this->container['softBounces'] = isset($data['softBounces']) ? $data['softBounces'] : null;
- $this->container['clicks'] = isset($data['clicks']) ? $data['clicks'] : null;
- $this->container['uniqueClicks'] = isset($data['uniqueClicks']) ? $data['uniqueClicks'] : null;
- $this->container['opens'] = isset($data['opens']) ? $data['opens'] : null;
- $this->container['uniqueOpens'] = isset($data['uniqueOpens']) ? $data['uniqueOpens'] : null;
- $this->container['spamReports'] = isset($data['spamReports']) ? $data['spamReports'] : null;
- $this->container['blocked'] = isset($data['blocked']) ? $data['blocked'] : null;
- $this->container['invalid'] = isset($data['invalid']) ? $data['invalid'] : null;
- $this->container['unsubscribed'] = isset($data['unsubscribed']) ? $data['unsubscribed'] : null;
- }
-
- /**
- * 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 range
- *
- * @return string
- */
- public function getRange()
- {
- return $this->container['range'];
- }
-
- /**
- * Sets range
- *
- * @param string $range Time frame of the report
- *
- * @return $this
- */
- public function setRange($range)
- {
- $this->container['range'] = $range;
-
- return $this;
- }
-
- /**
- * Gets requests
- *
- * @return int
- */
- public function getRequests()
- {
- return $this->container['requests'];
- }
-
- /**
- * Sets requests
- *
- * @param int $requests Number of requests for the timeframe
- *
- * @return $this
- */
- public function setRequests($requests)
- {
- $this->container['requests'] = $requests;
-
- return $this;
- }
-
- /**
- * Gets delivered
- *
- * @return int
- */
- public function getDelivered()
- {
- return $this->container['delivered'];
- }
-
- /**
- * Sets delivered
- *
- * @param int $delivered Number of delivered emails for the timeframe
- *
- * @return $this
- */
- public function setDelivered($delivered)
- {
- $this->container['delivered'] = $delivered;
-
- return $this;
- }
-
- /**
- * Gets hardBounces
- *
- * @return int
- */
- public function getHardBounces()
- {
- return $this->container['hardBounces'];
- }
-
- /**
- * Sets hardBounces
- *
- * @param int $hardBounces Number of hardbounces for the timeframe
- *
- * @return $this
- */
- public function setHardBounces($hardBounces)
- {
- $this->container['hardBounces'] = $hardBounces;
-
- return $this;
- }
-
- /**
- * Gets softBounces
- *
- * @return int
- */
- public function getSoftBounces()
- {
- return $this->container['softBounces'];
- }
-
- /**
- * Sets softBounces
- *
- * @param int $softBounces Number of softbounces for the timeframe
- *
- * @return $this
- */
- public function setSoftBounces($softBounces)
- {
- $this->container['softBounces'] = $softBounces;
-
- return $this;
- }
-
- /**
- * Gets clicks
- *
- * @return int
- */
- public function getClicks()
- {
- return $this->container['clicks'];
- }
-
- /**
- * Sets clicks
- *
- * @param int $clicks Number of clicks for the timeframe
- *
- * @return $this
- */
- public function setClicks($clicks)
- {
- $this->container['clicks'] = $clicks;
-
- return $this;
- }
-
- /**
- * Gets uniqueClicks
- *
- * @return int
- */
- public function getUniqueClicks()
- {
- return $this->container['uniqueClicks'];
- }
-
- /**
- * Sets uniqueClicks
- *
- * @param int $uniqueClicks Number of unique clicks for the timeframe
- *
- * @return $this
- */
- public function setUniqueClicks($uniqueClicks)
- {
- $this->container['uniqueClicks'] = $uniqueClicks;
-
- return $this;
- }
-
- /**
- * Gets opens
- *
- * @return int
- */
- public function getOpens()
- {
- return $this->container['opens'];
- }
-
- /**
- * Sets opens
- *
- * @param int $opens Number of openings for the timeframe
- *
- * @return $this
- */
- public function setOpens($opens)
- {
- $this->container['opens'] = $opens;
-
- return $this;
- }
-
- /**
- * Gets uniqueOpens
- *
- * @return int
- */
- public function getUniqueOpens()
- {
- return $this->container['uniqueOpens'];
- }
-
- /**
- * Sets uniqueOpens
- *
- * @param int $uniqueOpens Number of unique openings for the timeframe
- *
- * @return $this
- */
- public function setUniqueOpens($uniqueOpens)
- {
- $this->container['uniqueOpens'] = $uniqueOpens;
-
- return $this;
- }
-
- /**
- * Gets spamReports
- *
- * @return int
- */
- public function getSpamReports()
- {
- return $this->container['spamReports'];
- }
-
- /**
- * Sets spamReports
- *
- * @param int $spamReports Number of complaint (spam report) for the timeframe
- *
- * @return $this
- */
- public function setSpamReports($spamReports)
- {
- $this->container['spamReports'] = $spamReports;
-
- return $this;
- }
-
- /**
- * Gets blocked
- *
- * @return int
- */
- public function getBlocked()
- {
- return $this->container['blocked'];
- }
-
- /**
- * Sets blocked
- *
- * @param int $blocked Number of blocked contact emails for the timeframe
- *
- * @return $this
- */
- public function setBlocked($blocked)
- {
- $this->container['blocked'] = $blocked;
-
- return $this;
- }
-
- /**
- * Gets invalid
- *
- * @return int
- */
- public function getInvalid()
- {
- return $this->container['invalid'];
- }
-
- /**
- * Sets invalid
- *
- * @param int $invalid Number of invalid emails for the timeframe
- *
- * @return $this
- */
- public function setInvalid($invalid)
- {
- $this->container['invalid'] = $invalid;
-
- return $this;
- }
-
- /**
- * Gets unsubscribed
- *
- * @return int
- */
- public function getUnsubscribed()
- {
- return $this->container['unsubscribed'];
- }
-
- /**
- * Sets unsubscribed
- *
- * @param int $unsubscribed Number of unsubscribed emails for the timeframe
- *
- * @return $this
- */
- public function setUnsubscribed($unsubscribed)
- {
- $this->container['unsubscribed'] = $unsubscribed;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetAllExternalFeeds.php b/lib/Model/GetAllExternalFeeds.php
deleted file mode 100644
index 5d2a4d9..0000000
--- a/lib/Model/GetAllExternalFeeds.php
+++ /dev/null
@@ -1,335 +0,0 @@
- 'int',
- 'feeds' => '\Brevo\Client\Model\GetAllExternalFeedsFeeds[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'count' => null,
- 'feeds' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'count' => 'count',
- 'feeds' => 'feeds'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'count' => 'setCount',
- 'feeds' => 'setFeeds'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'count' => 'getCount',
- 'feeds' => 'getFeeds'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['count'] = isset($data['count']) ? $data['count'] : null;
- $this->container['feeds'] = isset($data['feeds']) ? $data['feeds'] : null;
- }
-
- /**
- * 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 count
- *
- * @return int
- */
- public function getCount()
- {
- return $this->container['count'];
- }
-
- /**
- * Sets count
- *
- * @param int $count Total number of batches
- *
- * @return $this
- */
- public function setCount($count)
- {
- $this->container['count'] = $count;
-
- return $this;
- }
-
- /**
- * Gets feeds
- *
- * @return \Brevo\Client\Model\GetAllExternalFeedsFeeds[]
- */
- public function getFeeds()
- {
- return $this->container['feeds'];
- }
-
- /**
- * Sets feeds
- *
- * @param \Brevo\Client\Model\GetAllExternalFeedsFeeds[] $feeds feeds
- *
- * @return $this
- */
- public function setFeeds($feeds)
- {
- $this->container['feeds'] = $feeds;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetAllExternalFeedsFeeds.php b/lib/Model/GetAllExternalFeedsFeeds.php
deleted file mode 100644
index fa998bd..0000000
--- a/lib/Model/GetAllExternalFeedsFeeds.php
+++ /dev/null
@@ -1,712 +0,0 @@
- 'string',
- 'name' => 'string',
- 'url' => 'string',
- 'authType' => 'string',
- 'username' => 'string',
- 'password' => 'string',
- 'token' => 'string',
- 'headers' => '\Brevo\Client\Model\GetExternalFeedByUUIDHeaders[]',
- 'maxRetries' => 'int',
- 'cache' => 'bool',
- 'createdAt' => '\DateTime',
- 'modifiedAt' => '\DateTime'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'uuidv4',
- 'name' => null,
- 'url' => 'url',
- 'authType' => null,
- 'username' => null,
- 'password' => null,
- 'token' => null,
- 'headers' => null,
- 'maxRetries' => null,
- 'cache' => null,
- 'createdAt' => 'date-time',
- 'modifiedAt' => 'date-time'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'name' => 'name',
- 'url' => 'url',
- 'authType' => 'authType',
- 'username' => 'username',
- 'password' => 'password',
- 'token' => 'token',
- 'headers' => 'headers',
- 'maxRetries' => 'maxRetries',
- 'cache' => 'cache',
- 'createdAt' => 'createdAt',
- 'modifiedAt' => 'modifiedAt'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'name' => 'setName',
- 'url' => 'setUrl',
- 'authType' => 'setAuthType',
- 'username' => 'setUsername',
- 'password' => 'setPassword',
- 'token' => 'setToken',
- 'headers' => 'setHeaders',
- 'maxRetries' => 'setMaxRetries',
- 'cache' => 'setCache',
- 'createdAt' => 'setCreatedAt',
- 'modifiedAt' => 'setModifiedAt'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'name' => 'getName',
- 'url' => 'getUrl',
- 'authType' => 'getAuthType',
- 'username' => 'getUsername',
- 'password' => 'getPassword',
- 'token' => 'getToken',
- 'headers' => 'getHeaders',
- 'maxRetries' => 'getMaxRetries',
- 'cache' => 'getCache',
- 'createdAt' => 'getCreatedAt',
- 'modifiedAt' => 'getModifiedAt'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const AUTH_TYPE_BASIC = 'basic';
- const AUTH_TYPE_TOKEN = 'token';
- const AUTH_TYPE_NO_AUTH = 'noAuth';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getAuthTypeAllowableValues()
- {
- return [
- self::AUTH_TYPE_BASIC,
- self::AUTH_TYPE_TOKEN,
- self::AUTH_TYPE_NO_AUTH,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['url'] = isset($data['url']) ? $data['url'] : null;
- $this->container['authType'] = isset($data['authType']) ? $data['authType'] : null;
- $this->container['username'] = isset($data['username']) ? $data['username'] : null;
- $this->container['password'] = isset($data['password']) ? $data['password'] : null;
- $this->container['token'] = isset($data['token']) ? $data['token'] : null;
- $this->container['headers'] = isset($data['headers']) ? $data['headers'] : null;
- $this->container['maxRetries'] = isset($data['maxRetries']) ? $data['maxRetries'] : null;
- $this->container['cache'] = isset($data['cache']) ? $data['cache'] : null;
- $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null;
- $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null;
- }
-
- /**
- * 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['name'] === null) {
- $invalidProperties[] = "'name' can't be null";
- }
- if ($this->container['url'] === null) {
- $invalidProperties[] = "'url' can't be null";
- }
- if ($this->container['authType'] === null) {
- $invalidProperties[] = "'authType' can't be null";
- }
- $allowedValues = $this->getAuthTypeAllowableValues();
- if (!is_null($this->container['authType']) && !in_array($this->container['authType'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'authType', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- if ($this->container['headers'] === null) {
- $invalidProperties[] = "'headers' can't be null";
- }
- if ($this->container['maxRetries'] === null) {
- $invalidProperties[] = "'maxRetries' can't be null";
- }
- if (($this->container['maxRetries'] > 5)) {
- $invalidProperties[] = "invalid value for 'maxRetries', must be smaller than or equal to 5.";
- }
-
- if (($this->container['maxRetries'] < 0)) {
- $invalidProperties[] = "invalid value for 'maxRetries', must be bigger than or equal to 0.";
- }
-
- if ($this->container['cache'] === null) {
- $invalidProperties[] = "'cache' can't be null";
- }
- if ($this->container['createdAt'] === null) {
- $invalidProperties[] = "'createdAt' can't be null";
- }
- if ($this->container['modifiedAt'] === null) {
- $invalidProperties[] = "'modifiedAt' 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 of the feed
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the feed
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets url
- *
- * @return string
- */
- public function getUrl()
- {
- return $this->container['url'];
- }
-
- /**
- * Sets url
- *
- * @param string $url URL of the feed
- *
- * @return $this
- */
- public function setUrl($url)
- {
- $this->container['url'] = $url;
-
- return $this;
- }
-
- /**
- * Gets authType
- *
- * @return string
- */
- public function getAuthType()
- {
- return $this->container['authType'];
- }
-
- /**
- * Sets authType
- *
- * @param string $authType Auth type of the feed: * `basic` * `token` * `noAuth`
- *
- * @return $this
- */
- public function setAuthType($authType)
- {
- $allowedValues = $this->getAuthTypeAllowableValues();
- if (!in_array($authType, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'authType', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['authType'] = $authType;
-
- return $this;
- }
-
- /**
- * Gets username
- *
- * @return string
- */
- public function getUsername()
- {
- return $this->container['username'];
- }
-
- /**
- * Sets username
- *
- * @param string $username Username for authType `basic`
- *
- * @return $this
- */
- public function setUsername($username)
- {
- $this->container['username'] = $username;
-
- return $this;
- }
-
- /**
- * Gets password
- *
- * @return string
- */
- public function getPassword()
- {
- return $this->container['password'];
- }
-
- /**
- * Sets password
- *
- * @param string $password Password for authType `basic`
- *
- * @return $this
- */
- public function setPassword($password)
- {
- $this->container['password'] = $password;
-
- return $this;
- }
-
- /**
- * Gets token
- *
- * @return string
- */
- public function getToken()
- {
- return $this->container['token'];
- }
-
- /**
- * Sets token
- *
- * @param string $token Token for authType `token`
- *
- * @return $this
- */
- public function setToken($token)
- {
- $this->container['token'] = $token;
-
- return $this;
- }
-
- /**
- * Gets headers
- *
- * @return \Brevo\Client\Model\GetExternalFeedByUUIDHeaders[]
- */
- public function getHeaders()
- {
- return $this->container['headers'];
- }
-
- /**
- * Sets headers
- *
- * @param \Brevo\Client\Model\GetExternalFeedByUUIDHeaders[] $headers Custom headers for the feed
- *
- * @return $this
- */
- public function setHeaders($headers)
- {
- $this->container['headers'] = $headers;
-
- return $this;
- }
-
- /**
- * Gets maxRetries
- *
- * @return int
- */
- public function getMaxRetries()
- {
- return $this->container['maxRetries'];
- }
-
- /**
- * Sets maxRetries
- *
- * @param int $maxRetries Maximum number of retries on the feed url
- *
- * @return $this
- */
- public function setMaxRetries($maxRetries)
- {
-
- if (($maxRetries > 5)) {
- throw new \InvalidArgumentException('invalid value for $maxRetries when calling GetAllExternalFeedsFeeds., must be smaller than or equal to 5.');
- }
- if (($maxRetries < 0)) {
- throw new \InvalidArgumentException('invalid value for $maxRetries when calling GetAllExternalFeedsFeeds., must be bigger than or equal to 0.');
- }
-
- $this->container['maxRetries'] = $maxRetries;
-
- return $this;
- }
-
- /**
- * Gets cache
- *
- * @return bool
- */
- public function getCache()
- {
- return $this->container['cache'];
- }
-
- /**
- * Sets cache
- *
- * @param bool $cache Toggle caching of feed url response
- *
- * @return $this
- */
- public function setCache($cache)
- {
- $this->container['cache'] = $cache;
-
- return $this;
- }
-
- /**
- * Gets createdAt
- *
- * @return \DateTime
- */
- public function getCreatedAt()
- {
- return $this->container['createdAt'];
- }
-
- /**
- * Sets createdAt
- *
- * @param \DateTime $createdAt Datetime on which the feed was created
- *
- * @return $this
- */
- public function setCreatedAt($createdAt)
- {
- $this->container['createdAt'] = $createdAt;
-
- return $this;
- }
-
- /**
- * Gets modifiedAt
- *
- * @return \DateTime
- */
- public function getModifiedAt()
- {
- return $this->container['modifiedAt'];
- }
-
- /**
- * Sets modifiedAt
- *
- * @param \DateTime $modifiedAt Datetime on which the feed was modified
- *
- * @return $this
- */
- public function setModifiedAt($modifiedAt)
- {
- $this->container['modifiedAt'] = $modifiedAt;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetAttributes.php b/lib/Model/GetAttributes.php
deleted file mode 100644
index 76861a9..0000000
--- a/lib/Model/GetAttributes.php
+++ /dev/null
@@ -1,308 +0,0 @@
- '\Brevo\Client\Model\GetAttributesAttributes[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'attributes' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'attributes' => 'attributes'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'attributes' => 'setAttributes'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'attributes' => 'getAttributes'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['attributes'] === null) {
- $invalidProperties[] = "'attributes' 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 attributes
- *
- * @return \Brevo\Client\Model\GetAttributesAttributes[]
- */
- public function getAttributes()
- {
- return $this->container['attributes'];
- }
-
- /**
- * Sets attributes
- *
- * @param \Brevo\Client\Model\GetAttributesAttributes[] $attributes Listing of available contact attributes in your account
- *
- * @return $this
- */
- public function setAttributes($attributes)
- {
- $this->container['attributes'] = $attributes;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetAttributesAttributes.php b/lib/Model/GetAttributesAttributes.php
deleted file mode 100644
index 7588373..0000000
--- a/lib/Model/GetAttributesAttributes.php
+++ /dev/null
@@ -1,507 +0,0 @@
- 'string',
- 'category' => 'string',
- 'type' => 'string',
- 'enumeration' => '\Brevo\Client\Model\GetAttributesEnumeration[]',
- 'calculatedValue' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'category' => null,
- 'type' => null,
- 'enumeration' => null,
- 'calculatedValue' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'category' => 'category',
- 'type' => 'type',
- 'enumeration' => 'enumeration',
- 'calculatedValue' => 'calculatedValue'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'category' => 'setCategory',
- 'type' => 'setType',
- 'enumeration' => 'setEnumeration',
- 'calculatedValue' => 'setCalculatedValue'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'category' => 'getCategory',
- 'type' => 'getType',
- 'enumeration' => 'getEnumeration',
- 'calculatedValue' => 'getCalculatedValue'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const CATEGORY_NORMAL = 'normal';
- const CATEGORY_TRANSACTIONAL = 'transactional';
- const CATEGORY_CATEGORY = 'category';
- const CATEGORY_CALCULATED = 'calculated';
- const CATEGORY__GLOBAL = 'global';
- const TYPE_TEXT = 'text';
- const TYPE_DATE = 'date';
- const TYPE_FLOAT = 'float';
- const TYPE_ID = 'id';
- const TYPE_BOOLEAN = 'boolean';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getCategoryAllowableValues()
- {
- return [
- self::CATEGORY_NORMAL,
- self::CATEGORY_TRANSACTIONAL,
- self::CATEGORY_CATEGORY,
- self::CATEGORY_CALCULATED,
- self::CATEGORY__GLOBAL,
- ];
- }
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getTypeAllowableValues()
- {
- return [
- self::TYPE_TEXT,
- self::TYPE_DATE,
- self::TYPE_FLOAT,
- self::TYPE_ID,
- self::TYPE_BOOLEAN,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['category'] = isset($data['category']) ? $data['category'] : null;
- $this->container['type'] = isset($data['type']) ? $data['type'] : null;
- $this->container['enumeration'] = isset($data['enumeration']) ? $data['enumeration'] : null;
- $this->container['calculatedValue'] = isset($data['calculatedValue']) ? $data['calculatedValue'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['name'] === null) {
- $invalidProperties[] = "'name' can't be null";
- }
- if ($this->container['category'] === null) {
- $invalidProperties[] = "'category' can't be null";
- }
- $allowedValues = $this->getCategoryAllowableValues();
- if (!is_null($this->container['category']) && !in_array($this->container['category'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'category', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- $allowedValues = $this->getTypeAllowableValues();
- if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'type', must be one of '%s'",
- 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the attribute
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets category
- *
- * @return string
- */
- public function getCategory()
- {
- return $this->container['category'];
- }
-
- /**
- * Sets category
- *
- * @param string $category Category of the attribute
- *
- * @return $this
- */
- public function setCategory($category)
- {
- $allowedValues = $this->getCategoryAllowableValues();
- if (!in_array($category, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'category', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['category'] = $category;
-
- return $this;
- }
-
- /**
- * Gets type
- *
- * @return string
- */
- public function getType()
- {
- return $this->container['type'];
- }
-
- /**
- * Sets type
- *
- * @param string $type Type of the attribute
- *
- * @return $this
- */
- public function setType($type)
- {
- $allowedValues = $this->getTypeAllowableValues();
- if (!is_null($type) && !in_array($type, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'type', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['type'] = $type;
-
- return $this;
- }
-
- /**
- * Gets enumeration
- *
- * @return \Brevo\Client\Model\GetAttributesEnumeration[]
- */
- public function getEnumeration()
- {
- return $this->container['enumeration'];
- }
-
- /**
- * Sets enumeration
- *
- * @param \Brevo\Client\Model\GetAttributesEnumeration[] $enumeration Parameter only available for \"category\" type attributes.
- *
- * @return $this
- */
- public function setEnumeration($enumeration)
- {
- $this->container['enumeration'] = $enumeration;
-
- return $this;
- }
-
- /**
- * Gets calculatedValue
- *
- * @return string
- */
- public function getCalculatedValue()
- {
- return $this->container['calculatedValue'];
- }
-
- /**
- * Sets calculatedValue
- *
- * @param string $calculatedValue Calculated value formula
- *
- * @return $this
- */
- public function setCalculatedValue($calculatedValue)
- {
- $this->container['calculatedValue'] = $calculatedValue;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetAttributesEnumeration.php b/lib/Model/GetAttributesEnumeration.php
deleted file mode 100644
index 32e3179..0000000
--- a/lib/Model/GetAttributesEnumeration.php
+++ /dev/null
@@ -1,341 +0,0 @@
- 'int',
- 'label' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'value' => 'int64',
- 'label' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'value' => 'value',
- 'label' => 'label'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'value' => 'setValue',
- 'label' => 'setLabel'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'value' => 'getValue',
- 'label' => 'getLabel'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['value'] = isset($data['value']) ? $data['value'] : null;
- $this->container['label'] = isset($data['label']) ? $data['label'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['value'] === null) {
- $invalidProperties[] = "'value' can't be null";
- }
- if ($this->container['label'] === null) {
- $invalidProperties[] = "'label' 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 value
- *
- * @return int
- */
- public function getValue()
- {
- return $this->container['value'];
- }
-
- /**
- * Sets value
- *
- * @param int $value ID of Value of the \"category\" type attribute
- *
- * @return $this
- */
- public function setValue($value)
- {
- $this->container['value'] = $value;
-
- return $this;
- }
-
- /**
- * Gets label
- *
- * @return string
- */
- public function getLabel()
- {
- return $this->container['label'];
- }
-
- /**
- * Sets label
- *
- * @param string $label Label of the \"category\" type attribute
- *
- * @return $this
- */
- public function setLabel($label)
- {
- $this->container['label'] = $label;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetBlockedDomains.php b/lib/Model/GetBlockedDomains.php
deleted file mode 100644
index a2e5808..0000000
--- a/lib/Model/GetBlockedDomains.php
+++ /dev/null
@@ -1,309 +0,0 @@
- 'string[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'domains' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'domains' => 'domains'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'domains' => 'setDomains'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'domains' => 'getDomains'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['domains'] = isset($data['domains']) ? $data['domains'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['domains'] === null) {
- $invalidProperties[] = "'domains' 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 domains
- *
- * @return string[]
- */
- public function getDomains()
- {
- return $this->container['domains'];
- }
-
- /**
- * Sets domains
- *
- * @param string[] $domains List of all blocked domains
- *
- * @return $this
- */
- public function setDomains($domains)
- {
- $this->container['domains'] = $domains;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetCampaignOverview.php b/lib/Model/GetCampaignOverview.php
deleted file mode 100644
index 7c9bf6c..0000000
--- a/lib/Model/GetCampaignOverview.php
+++ /dev/null
@@ -1,779 +0,0 @@
- 'int',
- 'name' => 'string',
- 'subject' => 'string',
- 'previewText' => 'string',
- 'type' => 'string',
- 'status' => 'string',
- 'scheduledAt' => 'string',
- 'abTesting' => 'bool',
- 'subjectA' => 'string',
- 'subjectB' => 'string',
- 'splitRule' => 'int',
- 'winnerCriteria' => 'string',
- 'winnerDelay' => 'int',
- 'sendAtBestTime' => 'bool'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'int64',
- 'name' => null,
- 'subject' => null,
- 'previewText' => null,
- 'type' => null,
- 'status' => null,
- 'scheduledAt' => null,
- 'abTesting' => null,
- 'subjectA' => null,
- 'subjectB' => null,
- 'splitRule' => null,
- 'winnerCriteria' => null,
- 'winnerDelay' => null,
- 'sendAtBestTime' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'name' => 'name',
- 'subject' => 'subject',
- 'previewText' => 'previewText',
- 'type' => 'type',
- 'status' => 'status',
- 'scheduledAt' => 'scheduledAt',
- 'abTesting' => 'abTesting',
- 'subjectA' => 'subjectA',
- 'subjectB' => 'subjectB',
- 'splitRule' => 'splitRule',
- 'winnerCriteria' => 'winnerCriteria',
- 'winnerDelay' => 'winnerDelay',
- 'sendAtBestTime' => 'sendAtBestTime'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'name' => 'setName',
- 'subject' => 'setSubject',
- 'previewText' => 'setPreviewText',
- 'type' => 'setType',
- 'status' => 'setStatus',
- 'scheduledAt' => 'setScheduledAt',
- 'abTesting' => 'setAbTesting',
- 'subjectA' => 'setSubjectA',
- 'subjectB' => 'setSubjectB',
- 'splitRule' => 'setSplitRule',
- 'winnerCriteria' => 'setWinnerCriteria',
- 'winnerDelay' => 'setWinnerDelay',
- 'sendAtBestTime' => 'setSendAtBestTime'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'name' => 'getName',
- 'subject' => 'getSubject',
- 'previewText' => 'getPreviewText',
- 'type' => 'getType',
- 'status' => 'getStatus',
- 'scheduledAt' => 'getScheduledAt',
- 'abTesting' => 'getAbTesting',
- 'subjectA' => 'getSubjectA',
- 'subjectB' => 'getSubjectB',
- 'splitRule' => 'getSplitRule',
- 'winnerCriteria' => 'getWinnerCriteria',
- 'winnerDelay' => 'getWinnerDelay',
- 'sendAtBestTime' => 'getSendAtBestTime'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const TYPE_CLASSIC = 'classic';
- const TYPE_TRIGGER = 'trigger';
- const STATUS_DRAFT = 'draft';
- const STATUS_SENT = 'sent';
- const STATUS_ARCHIVE = 'archive';
- const STATUS_QUEUED = 'queued';
- const STATUS_SUSPENDED = 'suspended';
- const STATUS_IN_PROCESS = 'in_process';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getTypeAllowableValues()
- {
- return [
- self::TYPE_CLASSIC,
- self::TYPE_TRIGGER,
- ];
- }
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getStatusAllowableValues()
- {
- return [
- self::STATUS_DRAFT,
- self::STATUS_SENT,
- self::STATUS_ARCHIVE,
- self::STATUS_QUEUED,
- self::STATUS_SUSPENDED,
- self::STATUS_IN_PROCESS,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null;
- $this->container['previewText'] = isset($data['previewText']) ? $data['previewText'] : null;
- $this->container['type'] = isset($data['type']) ? $data['type'] : null;
- $this->container['status'] = isset($data['status']) ? $data['status'] : null;
- $this->container['scheduledAt'] = isset($data['scheduledAt']) ? $data['scheduledAt'] : null;
- $this->container['abTesting'] = isset($data['abTesting']) ? $data['abTesting'] : null;
- $this->container['subjectA'] = isset($data['subjectA']) ? $data['subjectA'] : null;
- $this->container['subjectB'] = isset($data['subjectB']) ? $data['subjectB'] : null;
- $this->container['splitRule'] = isset($data['splitRule']) ? $data['splitRule'] : null;
- $this->container['winnerCriteria'] = isset($data['winnerCriteria']) ? $data['winnerCriteria'] : null;
- $this->container['winnerDelay'] = isset($data['winnerDelay']) ? $data['winnerDelay'] : null;
- $this->container['sendAtBestTime'] = isset($data['sendAtBestTime']) ? $data['sendAtBestTime'] : null;
- }
-
- /**
- * 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['name'] === null) {
- $invalidProperties[] = "'name' can't be null";
- }
- if ($this->container['type'] === null) {
- $invalidProperties[] = "'type' can't be null";
- }
- $allowedValues = $this->getTypeAllowableValues();
- if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'type', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- if ($this->container['status'] === null) {
- $invalidProperties[] = "'status' can't be null";
- }
- $allowedValues = $this->getStatusAllowableValues();
- if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'status', must be one of '%s'",
- 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 id
- *
- * @return int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id ID of the campaign
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the campaign
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets subject
- *
- * @return string
- */
- public function getSubject()
- {
- return $this->container['subject'];
- }
-
- /**
- * Sets subject
- *
- * @param string $subject Subject of the campaign. Only available if `abTesting` flag of the campaign is `false`
- *
- * @return $this
- */
- public function setSubject($subject)
- {
- $this->container['subject'] = $subject;
-
- return $this;
- }
-
- /**
- * Gets previewText
- *
- * @return string
- */
- public function getPreviewText()
- {
- return $this->container['previewText'];
- }
-
- /**
- * Sets previewText
- *
- * @param string $previewText Preview text or preheader of the email campaign
- *
- * @return $this
- */
- public function setPreviewText($previewText)
- {
- $this->container['previewText'] = $previewText;
-
- return $this;
- }
-
- /**
- * Gets type
- *
- * @return string
- */
- public function getType()
- {
- return $this->container['type'];
- }
-
- /**
- * Sets type
- *
- * @param string $type Type of campaign
- *
- * @return $this
- */
- public function setType($type)
- {
- $allowedValues = $this->getTypeAllowableValues();
- if (!in_array($type, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'type', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['type'] = $type;
-
- return $this;
- }
-
- /**
- * Gets status
- *
- * @return string
- */
- public function getStatus()
- {
- return $this->container['status'];
- }
-
- /**
- * Sets status
- *
- * @param string $status Status of the campaign
- *
- * @return $this
- */
- public function setStatus($status)
- {
- $allowedValues = $this->getStatusAllowableValues();
- if (!in_array($status, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'status', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['status'] = $status;
-
- return $this;
- }
-
- /**
- * Gets scheduledAt
- *
- * @return string
- */
- public function getScheduledAt()
- {
- return $this->container['scheduledAt'];
- }
-
- /**
- * Sets scheduledAt
- *
- * @param string $scheduledAt UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ)
- *
- * @return $this
- */
- public function setScheduledAt($scheduledAt)
- {
- $this->container['scheduledAt'] = $scheduledAt;
-
- return $this;
- }
-
- /**
- * Gets abTesting
- *
- * @return bool
- */
- public function getAbTesting()
- {
- return $this->container['abTesting'];
- }
-
- /**
- * Sets abTesting
- *
- * @param bool $abTesting Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled.
- *
- * @return $this
- */
- public function setAbTesting($abTesting)
- {
- $this->container['abTesting'] = $abTesting;
-
- return $this;
- }
-
- /**
- * Gets subjectA
- *
- * @return string
- */
- public function getSubjectA()
- {
- return $this->container['subjectA'];
- }
-
- /**
- * Sets subjectA
- *
- * @param string $subjectA Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true`
- *
- * @return $this
- */
- public function setSubjectA($subjectA)
- {
- $this->container['subjectA'] = $subjectA;
-
- return $this;
- }
-
- /**
- * Gets subjectB
- *
- * @return string
- */
- public function getSubjectB()
- {
- return $this->container['subjectB'];
- }
-
- /**
- * Sets subjectB
- *
- * @param string $subjectB Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true`
- *
- * @return $this
- */
- public function setSubjectB($subjectB)
- {
- $this->container['subjectB'] = $subjectB;
-
- return $this;
- }
-
- /**
- * Gets splitRule
- *
- * @return int
- */
- public function getSplitRule()
- {
- return $this->container['splitRule'];
- }
-
- /**
- * Sets splitRule
- *
- * @param int $splitRule The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true`
- *
- * @return $this
- */
- public function setSplitRule($splitRule)
- {
- $this->container['splitRule'] = $splitRule;
-
- return $this;
- }
-
- /**
- * Gets winnerCriteria
- *
- * @return string
- */
- public function getWinnerCriteria()
- {
- return $this->container['winnerCriteria'];
- }
-
- /**
- * Sets winnerCriteria
- *
- * @param string $winnerCriteria Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true`
- *
- * @return $this
- */
- public function setWinnerCriteria($winnerCriteria)
- {
- $this->container['winnerCriteria'] = $winnerCriteria;
-
- return $this;
- }
-
- /**
- * Gets winnerDelay
- *
- * @return int
- */
- public function getWinnerDelay()
- {
- return $this->container['winnerDelay'];
- }
-
- /**
- * Sets winnerDelay
- *
- * @param int $winnerDelay The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true`
- *
- * @return $this
- */
- public function setWinnerDelay($winnerDelay)
- {
- $this->container['winnerDelay'] = $winnerDelay;
-
- return $this;
- }
-
- /**
- * Gets sendAtBestTime
- *
- * @return bool
- */
- public function getSendAtBestTime()
- {
- return $this->container['sendAtBestTime'];
- }
-
- /**
- * Sets sendAtBestTime
- *
- * @param bool $sendAtBestTime It is true if you have chosen to send your campaign at best time, otherwise it is false
- *
- * @return $this
- */
- public function setSendAtBestTime($sendAtBestTime)
- {
- $this->container['sendAtBestTime'] = $sendAtBestTime;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetCampaignRecipients.php b/lib/Model/GetCampaignRecipients.php
deleted file mode 100644
index 70bc51a..0000000
--- a/lib/Model/GetCampaignRecipients.php
+++ /dev/null
@@ -1,341 +0,0 @@
- 'int[]',
- 'exclusionLists' => 'int[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'lists' => 'int64',
- 'exclusionLists' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'lists' => 'lists',
- 'exclusionLists' => 'exclusionLists'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'lists' => 'setLists',
- 'exclusionLists' => 'setExclusionLists'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'lists' => 'getLists',
- 'exclusionLists' => 'getExclusionLists'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['lists'] = isset($data['lists']) ? $data['lists'] : null;
- $this->container['exclusionLists'] = isset($data['exclusionLists']) ? $data['exclusionLists'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['lists'] === null) {
- $invalidProperties[] = "'lists' can't be null";
- }
- if ($this->container['exclusionLists'] === null) {
- $invalidProperties[] = "'exclusionLists' 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 lists
- *
- * @return int[]
- */
- public function getLists()
- {
- return $this->container['lists'];
- }
-
- /**
- * Sets lists
- *
- * @param int[] $lists lists
- *
- * @return $this
- */
- public function setLists($lists)
- {
- $this->container['lists'] = $lists;
-
- return $this;
- }
-
- /**
- * Gets exclusionLists
- *
- * @return int[]
- */
- public function getExclusionLists()
- {
- return $this->container['exclusionLists'];
- }
-
- /**
- * Sets exclusionLists
- *
- * @param int[] $exclusionLists exclusionLists
- *
- * @return $this
- */
- public function setExclusionLists($exclusionLists)
- {
- $this->container['exclusionLists'] = $exclusionLists;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetCampaignStats.php b/lib/Model/GetCampaignStats.php
deleted file mode 100644
index fb2a6a7..0000000
--- a/lib/Model/GetCampaignStats.php
+++ /dev/null
@@ -1,788 +0,0 @@
- 'int',
- 'uniqueClicks' => 'int',
- 'clickers' => 'int',
- 'complaints' => 'int',
- 'delivered' => 'int',
- 'sent' => 'int',
- 'softBounces' => 'int',
- 'hardBounces' => 'int',
- 'uniqueViews' => 'int',
- 'trackableViews' => 'int',
- 'trackableViewsRate' => 'float',
- 'estimatedViews' => 'int',
- 'unsubscriptions' => 'int',
- 'viewed' => 'int',
- 'deferred' => 'int',
- 'returnBounce' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'listId' => 'int64',
- 'uniqueClicks' => 'int64',
- 'clickers' => 'int64',
- 'complaints' => 'int64',
- 'delivered' => 'int64',
- 'sent' => 'int64',
- 'softBounces' => 'int64',
- 'hardBounces' => 'int64',
- 'uniqueViews' => 'int64',
- 'trackableViews' => 'int64',
- 'trackableViewsRate' => 'float',
- 'estimatedViews' => 'int64',
- 'unsubscriptions' => 'int64',
- 'viewed' => 'int64',
- 'deferred' => 'int64',
- 'returnBounce' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'listId' => 'listId',
- 'uniqueClicks' => 'uniqueClicks',
- 'clickers' => 'clickers',
- 'complaints' => 'complaints',
- 'delivered' => 'delivered',
- 'sent' => 'sent',
- 'softBounces' => 'softBounces',
- 'hardBounces' => 'hardBounces',
- 'uniqueViews' => 'uniqueViews',
- 'trackableViews' => 'trackableViews',
- 'trackableViewsRate' => 'trackableViewsRate',
- 'estimatedViews' => 'estimatedViews',
- 'unsubscriptions' => 'unsubscriptions',
- 'viewed' => 'viewed',
- 'deferred' => 'deferred',
- 'returnBounce' => 'returnBounce'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'listId' => 'setListId',
- 'uniqueClicks' => 'setUniqueClicks',
- 'clickers' => 'setClickers',
- 'complaints' => 'setComplaints',
- 'delivered' => 'setDelivered',
- 'sent' => 'setSent',
- 'softBounces' => 'setSoftBounces',
- 'hardBounces' => 'setHardBounces',
- 'uniqueViews' => 'setUniqueViews',
- 'trackableViews' => 'setTrackableViews',
- 'trackableViewsRate' => 'setTrackableViewsRate',
- 'estimatedViews' => 'setEstimatedViews',
- 'unsubscriptions' => 'setUnsubscriptions',
- 'viewed' => 'setViewed',
- 'deferred' => 'setDeferred',
- 'returnBounce' => 'setReturnBounce'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'listId' => 'getListId',
- 'uniqueClicks' => 'getUniqueClicks',
- 'clickers' => 'getClickers',
- 'complaints' => 'getComplaints',
- 'delivered' => 'getDelivered',
- 'sent' => 'getSent',
- 'softBounces' => 'getSoftBounces',
- 'hardBounces' => 'getHardBounces',
- 'uniqueViews' => 'getUniqueViews',
- 'trackableViews' => 'getTrackableViews',
- 'trackableViewsRate' => 'getTrackableViewsRate',
- 'estimatedViews' => 'getEstimatedViews',
- 'unsubscriptions' => 'getUnsubscriptions',
- 'viewed' => 'getViewed',
- 'deferred' => 'getDeferred',
- 'returnBounce' => 'getReturnBounce'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['listId'] = isset($data['listId']) ? $data['listId'] : null;
- $this->container['uniqueClicks'] = isset($data['uniqueClicks']) ? $data['uniqueClicks'] : null;
- $this->container['clickers'] = isset($data['clickers']) ? $data['clickers'] : null;
- $this->container['complaints'] = isset($data['complaints']) ? $data['complaints'] : null;
- $this->container['delivered'] = isset($data['delivered']) ? $data['delivered'] : null;
- $this->container['sent'] = isset($data['sent']) ? $data['sent'] : null;
- $this->container['softBounces'] = isset($data['softBounces']) ? $data['softBounces'] : null;
- $this->container['hardBounces'] = isset($data['hardBounces']) ? $data['hardBounces'] : null;
- $this->container['uniqueViews'] = isset($data['uniqueViews']) ? $data['uniqueViews'] : null;
- $this->container['trackableViews'] = isset($data['trackableViews']) ? $data['trackableViews'] : null;
- $this->container['trackableViewsRate'] = isset($data['trackableViewsRate']) ? $data['trackableViewsRate'] : null;
- $this->container['estimatedViews'] = isset($data['estimatedViews']) ? $data['estimatedViews'] : null;
- $this->container['unsubscriptions'] = isset($data['unsubscriptions']) ? $data['unsubscriptions'] : null;
- $this->container['viewed'] = isset($data['viewed']) ? $data['viewed'] : null;
- $this->container['deferred'] = isset($data['deferred']) ? $data['deferred'] : null;
- $this->container['returnBounce'] = isset($data['returnBounce']) ? $data['returnBounce'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['uniqueClicks'] === null) {
- $invalidProperties[] = "'uniqueClicks' can't be null";
- }
- if ($this->container['clickers'] === null) {
- $invalidProperties[] = "'clickers' can't be null";
- }
- if ($this->container['complaints'] === null) {
- $invalidProperties[] = "'complaints' can't be null";
- }
- if ($this->container['delivered'] === null) {
- $invalidProperties[] = "'delivered' can't be null";
- }
- if ($this->container['sent'] === null) {
- $invalidProperties[] = "'sent' can't be null";
- }
- if ($this->container['softBounces'] === null) {
- $invalidProperties[] = "'softBounces' can't be null";
- }
- if ($this->container['hardBounces'] === null) {
- $invalidProperties[] = "'hardBounces' can't be null";
- }
- if ($this->container['uniqueViews'] === null) {
- $invalidProperties[] = "'uniqueViews' can't be null";
- }
- if ($this->container['trackableViews'] === null) {
- $invalidProperties[] = "'trackableViews' can't be null";
- }
- if ($this->container['unsubscriptions'] === null) {
- $invalidProperties[] = "'unsubscriptions' can't be null";
- }
- if ($this->container['viewed'] === null) {
- $invalidProperties[] = "'viewed' 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 listId
- *
- * @return int
- */
- public function getListId()
- {
- return $this->container['listId'];
- }
-
- /**
- * Sets listId
- *
- * @param int $listId List Id of email campaign (only in case of get email campaign(s)(not for global stats))
- *
- * @return $this
- */
- public function setListId($listId)
- {
- $this->container['listId'] = $listId;
-
- return $this;
- }
-
- /**
- * Gets uniqueClicks
- *
- * @return int
- */
- public function getUniqueClicks()
- {
- return $this->container['uniqueClicks'];
- }
-
- /**
- * Sets uniqueClicks
- *
- * @param int $uniqueClicks Number of unique clicks for the campaign
- *
- * @return $this
- */
- public function setUniqueClicks($uniqueClicks)
- {
- $this->container['uniqueClicks'] = $uniqueClicks;
-
- return $this;
- }
-
- /**
- * Gets clickers
- *
- * @return int
- */
- public function getClickers()
- {
- return $this->container['clickers'];
- }
-
- /**
- * Sets clickers
- *
- * @param int $clickers Number of total clicks for the campaign
- *
- * @return $this
- */
- public function setClickers($clickers)
- {
- $this->container['clickers'] = $clickers;
-
- return $this;
- }
-
- /**
- * Gets complaints
- *
- * @return int
- */
- public function getComplaints()
- {
- return $this->container['complaints'];
- }
-
- /**
- * Sets complaints
- *
- * @param int $complaints Number of complaints (Spam reports) for the campaign
- *
- * @return $this
- */
- public function setComplaints($complaints)
- {
- $this->container['complaints'] = $complaints;
-
- return $this;
- }
-
- /**
- * Gets delivered
- *
- * @return int
- */
- public function getDelivered()
- {
- return $this->container['delivered'];
- }
-
- /**
- * Sets delivered
- *
- * @param int $delivered Number of delivered emails for the campaign
- *
- * @return $this
- */
- public function setDelivered($delivered)
- {
- $this->container['delivered'] = $delivered;
-
- return $this;
- }
-
- /**
- * Gets sent
- *
- * @return int
- */
- public function getSent()
- {
- return $this->container['sent'];
- }
-
- /**
- * Sets sent
- *
- * @param int $sent Number of sent emails for the campaign
- *
- * @return $this
- */
- public function setSent($sent)
- {
- $this->container['sent'] = $sent;
-
- return $this;
- }
-
- /**
- * Gets softBounces
- *
- * @return int
- */
- public function getSoftBounces()
- {
- return $this->container['softBounces'];
- }
-
- /**
- * Sets softBounces
- *
- * @param int $softBounces Number of softbounce for the campaign
- *
- * @return $this
- */
- public function setSoftBounces($softBounces)
- {
- $this->container['softBounces'] = $softBounces;
-
- return $this;
- }
-
- /**
- * Gets hardBounces
- *
- * @return int
- */
- public function getHardBounces()
- {
- return $this->container['hardBounces'];
- }
-
- /**
- * Sets hardBounces
- *
- * @param int $hardBounces Number of harbounce for the campaign
- *
- * @return $this
- */
- public function setHardBounces($hardBounces)
- {
- $this->container['hardBounces'] = $hardBounces;
-
- return $this;
- }
-
- /**
- * Gets uniqueViews
- *
- * @return int
- */
- public function getUniqueViews()
- {
- return $this->container['uniqueViews'];
- }
-
- /**
- * Sets uniqueViews
- *
- * @param int $uniqueViews Number of unique openings for the campaign
- *
- * @return $this
- */
- public function setUniqueViews($uniqueViews)
- {
- $this->container['uniqueViews'] = $uniqueViews;
-
- return $this;
- }
-
- /**
- * Gets trackableViews
- *
- * @return int
- */
- public function getTrackableViews()
- {
- return $this->container['trackableViews'];
- }
-
- /**
- * Sets trackableViews
- *
- * @param int $trackableViews Recipients without any privacy protection option enabled in their email client
- *
- * @return $this
- */
- public function setTrackableViews($trackableViews)
- {
- $this->container['trackableViews'] = $trackableViews;
-
- return $this;
- }
-
- /**
- * Gets trackableViewsRate
- *
- * @return float
- */
- public function getTrackableViewsRate()
- {
- return $this->container['trackableViewsRate'];
- }
-
- /**
- * Sets trackableViewsRate
- *
- * @param float $trackableViewsRate Rate of recipients without any privacy protection option enabled in their email client
- *
- * @return $this
- */
- public function setTrackableViewsRate($trackableViewsRate)
- {
- $this->container['trackableViewsRate'] = $trackableViewsRate;
-
- return $this;
- }
-
- /**
- * Gets estimatedViews
- *
- * @return int
- */
- public function getEstimatedViews()
- {
- return $this->container['estimatedViews'];
- }
-
- /**
- * Sets estimatedViews
- *
- * @param int $estimatedViews Rate of recipients without any privacy protection option enabled in their email client, applied to all delivered emails
- *
- * @return $this
- */
- public function setEstimatedViews($estimatedViews)
- {
- $this->container['estimatedViews'] = $estimatedViews;
-
- return $this;
- }
-
- /**
- * Gets unsubscriptions
- *
- * @return int
- */
- public function getUnsubscriptions()
- {
- return $this->container['unsubscriptions'];
- }
-
- /**
- * Sets unsubscriptions
- *
- * @param int $unsubscriptions Number of unsubscription for the campaign
- *
- * @return $this
- */
- public function setUnsubscriptions($unsubscriptions)
- {
- $this->container['unsubscriptions'] = $unsubscriptions;
-
- return $this;
- }
-
- /**
- * Gets viewed
- *
- * @return int
- */
- public function getViewed()
- {
- return $this->container['viewed'];
- }
-
- /**
- * Sets viewed
- *
- * @param int $viewed Number of openings for the campaign
- *
- * @return $this
- */
- public function setViewed($viewed)
- {
- $this->container['viewed'] = $viewed;
-
- return $this;
- }
-
- /**
- * Gets deferred
- *
- * @return int
- */
- public function getDeferred()
- {
- return $this->container['deferred'];
- }
-
- /**
- * Sets deferred
- *
- * @param int $deferred Number of deferred emails for the campaign
- *
- * @return $this
- */
- public function setDeferred($deferred)
- {
- $this->container['deferred'] = $deferred;
-
- return $this;
- }
-
- /**
- * Gets returnBounce
- *
- * @return int
- */
- public function getReturnBounce()
- {
- return $this->container['returnBounce'];
- }
-
- /**
- * Sets returnBounce
- *
- * @param int $returnBounce Total number of non-delivered campaigns for a particular campaign id.
- *
- * @return $this
- */
- public function setReturnBounce($returnBounce)
- {
- $this->container['returnBounce'] = $returnBounce;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetCategories.php b/lib/Model/GetCategories.php
deleted file mode 100644
index 596ab12..0000000
--- a/lib/Model/GetCategories.php
+++ /dev/null
@@ -1,341 +0,0 @@
- 'object[]',
- 'count' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'categories' => null,
- 'count' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'categories' => 'categories',
- 'count' => 'count'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'categories' => 'setCategories',
- 'count' => 'setCount'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'categories' => 'getCategories',
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['categories'] = isset($data['categories']) ? $data['categories'] : null;
- $this->container['count'] = isset($data['count']) ? $data['count'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['categories'] === null) {
- $invalidProperties[] = "'categories' 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 categories
- *
- * @return object[]
- */
- public function getCategories()
- {
- return $this->container['categories'];
- }
-
- /**
- * Sets categories
- *
- * @param object[] $categories categories
- *
- * @return $this
- */
- public function setCategories($categories)
- {
- $this->container['categories'] = $categories;
-
- return $this;
- }
-
- /**
- * Gets count
- *
- * @return int
- */
- public function getCount()
- {
- return $this->container['count'];
- }
-
- /**
- * Sets count
- *
- * @param int $count Number of categories
- *
- * @return $this
- */
- public function setCount($count)
- {
- $this->container['count'] = $count;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetCategoryDetails.php b/lib/Model/GetCategoryDetails.php
deleted file mode 100644
index 0b4d072..0000000
--- a/lib/Model/GetCategoryDetails.php
+++ /dev/null
@@ -1,467 +0,0 @@
- 'string',
- 'name' => 'string',
- 'createdAt' => 'string',
- 'modifiedAt' => 'string',
- 'url' => 'string',
- 'isDeleted' => 'bool'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'string',
- 'name' => 'string',
- 'createdAt' => null,
- 'modifiedAt' => null,
- 'url' => 'string',
- 'isDeleted' => 'string'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'name' => 'name',
- 'createdAt' => 'createdAt',
- 'modifiedAt' => 'modifiedAt',
- 'url' => 'url',
- 'isDeleted' => 'isDeleted'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'name' => 'setName',
- 'createdAt' => 'setCreatedAt',
- 'modifiedAt' => 'setModifiedAt',
- 'url' => 'setUrl',
- 'isDeleted' => 'setIsDeleted'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'name' => 'getName',
- 'createdAt' => 'getCreatedAt',
- 'modifiedAt' => 'getModifiedAt',
- 'url' => 'getUrl',
- 'isDeleted' => '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null;
- $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null;
- $this->container['url'] = isset($data['url']) ? $data['url'] : null;
- $this->container['isDeleted'] = isset($data['isDeleted']) ? $data['isDeleted'] : null;
- }
-
- /**
- * 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['name'] === null) {
- $invalidProperties[] = "'name' can't be null";
- }
- if ($this->container['createdAt'] === null) {
- $invalidProperties[] = "'createdAt' can't be null";
- }
- if ($this->container['modifiedAt'] === null) {
- $invalidProperties[] = "'modifiedAt' 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 Category ID for which you requested the details
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the category for which you requested the details
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets createdAt
- *
- * @return string
- */
- public function getCreatedAt()
- {
- return $this->container['createdAt'];
- }
-
- /**
- * Sets createdAt
- *
- * @param string $createdAt Creation UTC date-time of the category (YYYY-MM-DDTHH:mm:ss.SSSZ)
- *
- * @return $this
- */
- public function setCreatedAt($createdAt)
- {
- $this->container['createdAt'] = $createdAt;
-
- return $this;
- }
-
- /**
- * Gets modifiedAt
- *
- * @return string
- */
- public function getModifiedAt()
- {
- return $this->container['modifiedAt'];
- }
-
- /**
- * Sets modifiedAt
- *
- * @param string $modifiedAt Last modification UTC date-time of the category (YYYY-MM-DDTHH:mm:ss.SSSZ)
- *
- * @return $this
- */
- public function setModifiedAt($modifiedAt)
- {
- $this->container['modifiedAt'] = $modifiedAt;
-
- return $this;
- }
-
- /**
- * Gets url
- *
- * @return string
- */
- public function getUrl()
- {
- return $this->container['url'];
- }
-
- /**
- * Sets url
- *
- * @param string $url URL to the category
- *
- * @return $this
- */
- public function setUrl($url)
- {
- $this->container['url'] = $url;
-
- return $this;
- }
-
- /**
- * Gets isDeleted
- *
- * @return bool
- */
- public function getIsDeleted()
- {
- return $this->container['isDeleted'];
- }
-
- /**
- * Sets isDeleted
- *
- * @param bool $isDeleted category deleted from the shop's database
- *
- * @return $this
- */
- public function setIsDeleted($isDeleted)
- {
- $this->container['isDeleted'] = $isDeleted;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetChildAccountCreationStatus.php b/lib/Model/GetChildAccountCreationStatus.php
deleted file mode 100644
index 33d8821..0000000
--- a/lib/Model/GetChildAccountCreationStatus.php
+++ /dev/null
@@ -1,308 +0,0 @@
- 'bool'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'childAccountCreated' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'childAccountCreated' => 'childAccountCreated'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'childAccountCreated' => 'setChildAccountCreated'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'childAccountCreated' => 'getChildAccountCreated'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['childAccountCreated'] = isset($data['childAccountCreated']) ? $data['childAccountCreated'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['childAccountCreated'] === null) {
- $invalidProperties[] = "'childAccountCreated' 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 childAccountCreated
- *
- * @return bool
- */
- public function getChildAccountCreated()
- {
- return $this->container['childAccountCreated'];
- }
-
- /**
- * Sets childAccountCreated
- *
- * @param bool $childAccountCreated Status of child account creation whether it is successfully created (exists) or not.
- *
- * @return $this
- */
- public function setChildAccountCreated($childAccountCreated)
- {
- $this->container['childAccountCreated'] = $childAccountCreated;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetChildDomain.php b/lib/Model/GetChildDomain.php
deleted file mode 100644
index 0fe663a..0000000
--- a/lib/Model/GetChildDomain.php
+++ /dev/null
@@ -1,335 +0,0 @@
- 'string',
- 'active' => 'bool'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'domain' => null,
- 'active' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'domain' => 'domain',
- 'active' => 'active'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'domain' => 'setDomain',
- 'active' => 'setActive'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'domain' => 'getDomain',
- 'active' => 'getActive'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['domain'] = isset($data['domain']) ? $data['domain'] : null;
- $this->container['active'] = isset($data['active']) ? $data['active'] : null;
- }
-
- /**
- * 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 domain
- *
- * @return string
- */
- public function getDomain()
- {
- return $this->container['domain'];
- }
-
- /**
- * Sets domain
- *
- * @param string $domain Sender domain
- *
- * @return $this
- */
- public function setDomain($domain)
- {
- $this->container['domain'] = $domain;
-
- return $this;
- }
-
- /**
- * Gets active
- *
- * @return bool
- */
- public function getActive()
- {
- return $this->container['active'];
- }
-
- /**
- * Sets active
- *
- * @param bool $active indicates whether a domain is verified or not
- *
- * @return $this
- */
- public function setActive($active)
- {
- $this->container['active'] = $active;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetChildDomains.php b/lib/Model/GetChildDomains.php
deleted file mode 100644
index b54947f..0000000
--- a/lib/Model/GetChildDomains.php
+++ /dev/null
@@ -1,280 +0,0 @@
-listInvalidProperties()) === 0;
- }
-
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetChildInfo.php b/lib/Model/GetChildInfo.php
deleted file mode 100644
index 0b909b7..0000000
--- a/lib/Model/GetChildInfo.php
+++ /dev/null
@@ -1,422 +0,0 @@
- '\Brevo\Client\Model\GetChildInfoCredits',
- 'statistics' => '\Brevo\Client\Model\GetChildInfoStatistics',
- 'password' => 'string',
- 'ips' => 'string[]',
- 'apiKeys' => '\Brevo\Client\Model\GetChildInfoApiKeys'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'credits' => null,
- 'statistics' => null,
- 'password' => 'password',
- 'ips' => null,
- 'apiKeys' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes + parent::swaggerTypes();
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats + parent::swaggerFormats();
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'credits' => 'credits',
- 'statistics' => 'statistics',
- 'password' => 'password',
- 'ips' => 'ips',
- 'apiKeys' => 'apiKeys'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'credits' => 'setCredits',
- 'statistics' => 'setStatistics',
- 'password' => 'setPassword',
- 'ips' => 'setIps',
- 'apiKeys' => 'setApiKeys'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'credits' => 'getCredits',
- 'statistics' => 'getStatistics',
- 'password' => 'getPassword',
- 'ips' => 'getIps',
- 'apiKeys' => 'getApiKeys'
- ];
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @return array
- */
- public static function attributeMap()
- {
- return parent::attributeMap() + self::$attributeMap;
- }
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @return array
- */
- public static function setters()
- {
- return parent::setters() + self::$setters;
- }
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @return array
- */
- public static function getters()
- {
- return parent::getters() + self::$getters;
- }
-
- /**
- * The original name of the model.
- *
- * @return string
- */
- public function getModelName()
- {
- return self::$swaggerModelName;
- }
-
-
-
-
-
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- parent::__construct($data);
-
- $this->container['credits'] = isset($data['credits']) ? $data['credits'] : null;
- $this->container['statistics'] = isset($data['statistics']) ? $data['statistics'] : null;
- $this->container['password'] = isset($data['password']) ? $data['password'] : null;
- $this->container['ips'] = isset($data['ips']) ? $data['ips'] : null;
- $this->container['apiKeys'] = isset($data['apiKeys']) ? $data['apiKeys'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = parent::listInvalidProperties();
-
- if ($this->container['password'] === null) {
- $invalidProperties[] = "'password' 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 credits
- *
- * @return \Brevo\Client\Model\GetChildInfoCredits
- */
- public function getCredits()
- {
- return $this->container['credits'];
- }
-
- /**
- * Sets credits
- *
- * @param \Brevo\Client\Model\GetChildInfoCredits $credits credits
- *
- * @return $this
- */
- public function setCredits($credits)
- {
- $this->container['credits'] = $credits;
-
- return $this;
- }
-
- /**
- * Gets statistics
- *
- * @return \Brevo\Client\Model\GetChildInfoStatistics
- */
- public function getStatistics()
- {
- return $this->container['statistics'];
- }
-
- /**
- * Sets statistics
- *
- * @param \Brevo\Client\Model\GetChildInfoStatistics $statistics statistics
- *
- * @return $this
- */
- public function setStatistics($statistics)
- {
- $this->container['statistics'] = $statistics;
-
- return $this;
- }
-
- /**
- * Gets password
- *
- * @return string
- */
- public function getPassword()
- {
- return $this->container['password'];
- }
-
- /**
- * Sets password
- *
- * @param string $password The encrypted password of child account
- *
- * @return $this
- */
- public function setPassword($password)
- {
- $this->container['password'] = $password;
-
- return $this;
- }
-
- /**
- * Gets ips
- *
- * @return string[]
- */
- public function getIps()
- {
- return $this->container['ips'];
- }
-
- /**
- * Sets ips
- *
- * @param string[] $ips IP(s) associated to a child account user
- *
- * @return $this
- */
- public function setIps($ips)
- {
- $this->container['ips'] = $ips;
-
- return $this;
- }
-
- /**
- * Gets apiKeys
- *
- * @return \Brevo\Client\Model\GetChildInfoApiKeys
- */
- public function getApiKeys()
- {
- return $this->container['apiKeys'];
- }
-
- /**
- * Sets apiKeys
- *
- * @param \Brevo\Client\Model\GetChildInfoApiKeys $apiKeys apiKeys
- *
- * @return $this
- */
- public function setApiKeys($apiKeys)
- {
- $this->container['apiKeys'] = $apiKeys;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetChildInfoApiKeys.php b/lib/Model/GetChildInfoApiKeys.php
deleted file mode 100644
index 63fd407..0000000
--- a/lib/Model/GetChildInfoApiKeys.php
+++ /dev/null
@@ -1,339 +0,0 @@
- '\Brevo\Client\Model\GetChildInfoApiKeysV2[]',
- 'v3' => '\Brevo\Client\Model\GetChildInfoApiKeysV3[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'v2' => null,
- 'v3' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'v2' => 'v2',
- 'v3' => 'v3'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'v2' => 'setV2',
- 'v3' => 'setV3'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'v2' => 'getV2',
- 'v3' => 'getV3'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['v2'] = isset($data['v2']) ? $data['v2'] : null;
- $this->container['v3'] = isset($data['v3']) ? $data['v3'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['v2'] === null) {
- $invalidProperties[] = "'v2' 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 v2
- *
- * @return \Brevo\Client\Model\GetChildInfoApiKeysV2[]
- */
- public function getV2()
- {
- return $this->container['v2'];
- }
-
- /**
- * Sets v2
- *
- * @param \Brevo\Client\Model\GetChildInfoApiKeysV2[] $v2 v2
- *
- * @return $this
- */
- public function setV2($v2)
- {
- $this->container['v2'] = $v2;
-
- return $this;
- }
-
- /**
- * Gets v3
- *
- * @return \Brevo\Client\Model\GetChildInfoApiKeysV3[]
- */
- public function getV3()
- {
- return $this->container['v3'];
- }
-
- /**
- * Sets v3
- *
- * @param \Brevo\Client\Model\GetChildInfoApiKeysV3[] $v3 v3
- *
- * @return $this
- */
- public function setV3($v3)
- {
- $this->container['v3'] = $v3;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetChildInfoApiKeysV2.php b/lib/Model/GetChildInfoApiKeysV2.php
deleted file mode 100644
index 4215b8a..0000000
--- a/lib/Model/GetChildInfoApiKeysV2.php
+++ /dev/null
@@ -1,341 +0,0 @@
- 'string',
- 'key' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'key' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'key' => 'key'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'key' => 'setKey'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'key' => 'getKey'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['key'] = isset($data['key']) ? $data['key'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['name'] === null) {
- $invalidProperties[] = "'name' can't be null";
- }
- if ($this->container['key'] === null) {
- $invalidProperties[] = "'key' 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the key for version 2
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets key
- *
- * @return string
- */
- public function getKey()
- {
- return $this->container['key'];
- }
-
- /**
- * Sets key
- *
- * @param string $key API Key for version 2
- *
- * @return $this
- */
- public function setKey($key)
- {
- $this->container['key'] = $key;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetChildInfoApiKeysV3.php b/lib/Model/GetChildInfoApiKeysV3.php
deleted file mode 100644
index 8b58a1f..0000000
--- a/lib/Model/GetChildInfoApiKeysV3.php
+++ /dev/null
@@ -1,341 +0,0 @@
- 'string',
- 'key' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'key' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'key' => 'key'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'key' => 'setKey'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'key' => 'getKey'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['key'] = isset($data['key']) ? $data['key'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['name'] === null) {
- $invalidProperties[] = "'name' can't be null";
- }
- if ($this->container['key'] === null) {
- $invalidProperties[] = "'key' 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the key for version 3
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets key
- *
- * @return string
- */
- public function getKey()
- {
- return $this->container['key'];
- }
-
- /**
- * Sets key
- *
- * @param string $key API Key for version 3
- *
- * @return $this
- */
- public function setKey($key)
- {
- $this->container['key'] = $key;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetChildInfoCredits.php b/lib/Model/GetChildInfoCredits.php
deleted file mode 100644
index b79dd86..0000000
--- a/lib/Model/GetChildInfoCredits.php
+++ /dev/null
@@ -1,336 +0,0 @@
- 'int',
- 'smsCredits' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'emailCredits' => 'int64',
- 'smsCredits' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'emailCredits' => 'emailCredits',
- 'smsCredits' => 'smsCredits'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'emailCredits' => 'setEmailCredits',
- 'smsCredits' => 'setSmsCredits'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'emailCredits' => 'getEmailCredits',
- 'smsCredits' => 'getSmsCredits'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['emailCredits'] = isset($data['emailCredits']) ? $data['emailCredits'] : null;
- $this->container['smsCredits'] = isset($data['smsCredits']) ? $data['smsCredits'] : null;
- }
-
- /**
- * 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 emailCredits
- *
- * @return int
- */
- public function getEmailCredits()
- {
- return $this->container['emailCredits'];
- }
-
- /**
- * Sets emailCredits
- *
- * @param int $emailCredits Email credits available for your child
- *
- * @return $this
- */
- public function setEmailCredits($emailCredits)
- {
- $this->container['emailCredits'] = $emailCredits;
-
- return $this;
- }
-
- /**
- * Gets smsCredits
- *
- * @return int
- */
- public function getSmsCredits()
- {
- return $this->container['smsCredits'];
- }
-
- /**
- * Sets smsCredits
- *
- * @param int $smsCredits SMS credits available for your child
- *
- * @return $this
- */
- public function setSmsCredits($smsCredits)
- {
- $this->container['smsCredits'] = $smsCredits;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetChildInfoStatistics.php b/lib/Model/GetChildInfoStatistics.php
deleted file mode 100644
index 730f10d..0000000
--- a/lib/Model/GetChildInfoStatistics.php
+++ /dev/null
@@ -1,366 +0,0 @@
- 'int',
- 'currentMonthTotalSent' => 'int',
- 'totalSent' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'previousMonthTotalSent' => 'int64',
- 'currentMonthTotalSent' => 'int64',
- 'totalSent' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'previousMonthTotalSent' => 'previousMonthTotalSent',
- 'currentMonthTotalSent' => 'currentMonthTotalSent',
- 'totalSent' => 'totalSent'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'previousMonthTotalSent' => 'setPreviousMonthTotalSent',
- 'currentMonthTotalSent' => 'setCurrentMonthTotalSent',
- 'totalSent' => 'setTotalSent'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'previousMonthTotalSent' => 'getPreviousMonthTotalSent',
- 'currentMonthTotalSent' => 'getCurrentMonthTotalSent',
- 'totalSent' => 'getTotalSent'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['previousMonthTotalSent'] = isset($data['previousMonthTotalSent']) ? $data['previousMonthTotalSent'] : null;
- $this->container['currentMonthTotalSent'] = isset($data['currentMonthTotalSent']) ? $data['currentMonthTotalSent'] : null;
- $this->container['totalSent'] = isset($data['totalSent']) ? $data['totalSent'] : null;
- }
-
- /**
- * 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 previousMonthTotalSent
- *
- * @return int
- */
- public function getPreviousMonthTotalSent()
- {
- return $this->container['previousMonthTotalSent'];
- }
-
- /**
- * Sets previousMonthTotalSent
- *
- * @param int $previousMonthTotalSent Overall emails sent for the previous month
- *
- * @return $this
- */
- public function setPreviousMonthTotalSent($previousMonthTotalSent)
- {
- $this->container['previousMonthTotalSent'] = $previousMonthTotalSent;
-
- return $this;
- }
-
- /**
- * Gets currentMonthTotalSent
- *
- * @return int
- */
- public function getCurrentMonthTotalSent()
- {
- return $this->container['currentMonthTotalSent'];
- }
-
- /**
- * Sets currentMonthTotalSent
- *
- * @param int $currentMonthTotalSent Overall emails sent for current month
- *
- * @return $this
- */
- public function setCurrentMonthTotalSent($currentMonthTotalSent)
- {
- $this->container['currentMonthTotalSent'] = $currentMonthTotalSent;
-
- return $this;
- }
-
- /**
- * Gets totalSent
- *
- * @return int
- */
- public function getTotalSent()
- {
- return $this->container['totalSent'];
- }
-
- /**
- * Sets totalSent
- *
- * @param int $totalSent Overall emails sent for since the account exists
- *
- * @return $this
- */
- public function setTotalSent($totalSent)
- {
- $this->container['totalSent'] = $totalSent;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetChildrenList.php b/lib/Model/GetChildrenList.php
deleted file mode 100644
index 0d48062..0000000
--- a/lib/Model/GetChildrenList.php
+++ /dev/null
@@ -1,335 +0,0 @@
- 'object[]',
- 'count' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'children' => null,
- 'count' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'children' => 'children',
- 'count' => 'count'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'children' => 'setChildren',
- 'count' => 'setCount'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'children' => 'getChildren',
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['children'] = isset($data['children']) ? $data['children'] : null;
- $this->container['count'] = isset($data['count']) ? $data['count'] : null;
- }
-
- /**
- * 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 children
- *
- * @return object[]
- */
- public function getChildren()
- {
- return $this->container['children'];
- }
-
- /**
- * Sets children
- *
- * @param object[] $children Your children's account information
- *
- * @return $this
- */
- public function setChildren($children)
- {
- $this->container['children'] = $children;
-
- return $this;
- }
-
- /**
- * Gets count
- *
- * @return int
- */
- public function getCount()
- {
- return $this->container['count'];
- }
-
- /**
- * Sets count
- *
- * @param int $count Number of child accounts
- *
- * @return $this
- */
- public function setCount($count)
- {
- $this->container['count'] = $count;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetClient.php b/lib/Model/GetClient.php
deleted file mode 100644
index 53d7b2f..0000000
--- a/lib/Model/GetClient.php
+++ /dev/null
@@ -1,407 +0,0 @@
- 'string',
- 'firstName' => 'string',
- 'lastName' => 'string',
- 'companyName' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'email' => 'email',
- 'firstName' => null,
- 'lastName' => null,
- 'companyName' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'email' => 'email',
- 'firstName' => 'firstName',
- 'lastName' => 'lastName',
- 'companyName' => 'companyName'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'email' => 'setEmail',
- 'firstName' => 'setFirstName',
- 'lastName' => 'setLastName',
- 'companyName' => 'setCompanyName'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'email' => 'getEmail',
- 'firstName' => 'getFirstName',
- 'lastName' => 'getLastName',
- 'companyName' => 'getCompanyName'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['firstName'] = isset($data['firstName']) ? $data['firstName'] : null;
- $this->container['lastName'] = isset($data['lastName']) ? $data['lastName'] : null;
- $this->container['companyName'] = isset($data['companyName']) ? $data['companyName'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['email'] === null) {
- $invalidProperties[] = "'email' can't be null";
- }
- if ($this->container['firstName'] === null) {
- $invalidProperties[] = "'firstName' can't be null";
- }
- if ($this->container['lastName'] === null) {
- $invalidProperties[] = "'lastName' can't be null";
- }
- if ($this->container['companyName'] === null) {
- $invalidProperties[] = "'companyName' 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 email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Login Email
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets firstName
- *
- * @return string
- */
- public function getFirstName()
- {
- return $this->container['firstName'];
- }
-
- /**
- * Sets firstName
- *
- * @param string $firstName First Name
- *
- * @return $this
- */
- public function setFirstName($firstName)
- {
- $this->container['firstName'] = $firstName;
-
- return $this;
- }
-
- /**
- * Gets lastName
- *
- * @return string
- */
- public function getLastName()
- {
- return $this->container['lastName'];
- }
-
- /**
- * Sets lastName
- *
- * @param string $lastName Last Name
- *
- * @return $this
- */
- public function setLastName($lastName)
- {
- $this->container['lastName'] = $lastName;
-
- return $this;
- }
-
- /**
- * Gets companyName
- *
- * @return string
- */
- public function getCompanyName()
- {
- return $this->container['companyName'];
- }
-
- /**
- * Sets companyName
- *
- * @param string $companyName Name of the company
- *
- * @return $this
- */
- public function setCompanyName($companyName)
- {
- $this->container['companyName'] = $companyName;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetContactCampaignStats.php b/lib/Model/GetContactCampaignStats.php
deleted file mode 100644
index 963af44..0000000
--- a/lib/Model/GetContactCampaignStats.php
+++ /dev/null
@@ -1,546 +0,0 @@
- '\Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]',
- 'hardBounces' => '\Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]',
- 'softBounces' => '\Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]',
- 'complaints' => '\Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]',
- 'unsubscriptions' => '\Brevo\Client\Model\GetContactCampaignStatsUnsubscriptions',
- 'opened' => '\Brevo\Client\Model\GetContactCampaignStatsOpened[]',
- 'clicked' => '\Brevo\Client\Model\GetContactCampaignStatsClicked[]',
- 'transacAttributes' => '\Brevo\Client\Model\GetContactCampaignStatsTransacAttributes[]',
- 'delivered' => '\Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'messagesSent' => null,
- 'hardBounces' => null,
- 'softBounces' => null,
- 'complaints' => null,
- 'unsubscriptions' => null,
- 'opened' => null,
- 'clicked' => null,
- 'transacAttributes' => null,
- 'delivered' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'messagesSent' => 'messagesSent',
- 'hardBounces' => 'hardBounces',
- 'softBounces' => 'softBounces',
- 'complaints' => 'complaints',
- 'unsubscriptions' => 'unsubscriptions',
- 'opened' => 'opened',
- 'clicked' => 'clicked',
- 'transacAttributes' => 'transacAttributes',
- 'delivered' => 'delivered'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'messagesSent' => 'setMessagesSent',
- 'hardBounces' => 'setHardBounces',
- 'softBounces' => 'setSoftBounces',
- 'complaints' => 'setComplaints',
- 'unsubscriptions' => 'setUnsubscriptions',
- 'opened' => 'setOpened',
- 'clicked' => 'setClicked',
- 'transacAttributes' => 'setTransacAttributes',
- 'delivered' => 'setDelivered'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'messagesSent' => 'getMessagesSent',
- 'hardBounces' => 'getHardBounces',
- 'softBounces' => 'getSoftBounces',
- 'complaints' => 'getComplaints',
- 'unsubscriptions' => 'getUnsubscriptions',
- 'opened' => 'getOpened',
- 'clicked' => 'getClicked',
- 'transacAttributes' => 'getTransacAttributes',
- 'delivered' => 'getDelivered'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['messagesSent'] = isset($data['messagesSent']) ? $data['messagesSent'] : null;
- $this->container['hardBounces'] = isset($data['hardBounces']) ? $data['hardBounces'] : null;
- $this->container['softBounces'] = isset($data['softBounces']) ? $data['softBounces'] : null;
- $this->container['complaints'] = isset($data['complaints']) ? $data['complaints'] : null;
- $this->container['unsubscriptions'] = isset($data['unsubscriptions']) ? $data['unsubscriptions'] : null;
- $this->container['opened'] = isset($data['opened']) ? $data['opened'] : null;
- $this->container['clicked'] = isset($data['clicked']) ? $data['clicked'] : null;
- $this->container['transacAttributes'] = isset($data['transacAttributes']) ? $data['transacAttributes'] : null;
- $this->container['delivered'] = isset($data['delivered']) ? $data['delivered'] : null;
- }
-
- /**
- * 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 messagesSent
- *
- * @return \Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]
- */
- public function getMessagesSent()
- {
- return $this->container['messagesSent'];
- }
-
- /**
- * Sets messagesSent
- *
- * @param \Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[] $messagesSent messagesSent
- *
- * @return $this
- */
- public function setMessagesSent($messagesSent)
- {
- $this->container['messagesSent'] = $messagesSent;
-
- return $this;
- }
-
- /**
- * Gets hardBounces
- *
- * @return \Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]
- */
- public function getHardBounces()
- {
- return $this->container['hardBounces'];
- }
-
- /**
- * Sets hardBounces
- *
- * @param \Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[] $hardBounces hardBounces
- *
- * @return $this
- */
- public function setHardBounces($hardBounces)
- {
- $this->container['hardBounces'] = $hardBounces;
-
- return $this;
- }
-
- /**
- * Gets softBounces
- *
- * @return \Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]
- */
- public function getSoftBounces()
- {
- return $this->container['softBounces'];
- }
-
- /**
- * Sets softBounces
- *
- * @param \Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[] $softBounces softBounces
- *
- * @return $this
- */
- public function setSoftBounces($softBounces)
- {
- $this->container['softBounces'] = $softBounces;
-
- return $this;
- }
-
- /**
- * Gets complaints
- *
- * @return \Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]
- */
- public function getComplaints()
- {
- return $this->container['complaints'];
- }
-
- /**
- * Sets complaints
- *
- * @param \Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[] $complaints complaints
- *
- * @return $this
- */
- public function setComplaints($complaints)
- {
- $this->container['complaints'] = $complaints;
-
- return $this;
- }
-
- /**
- * Gets unsubscriptions
- *
- * @return \Brevo\Client\Model\GetContactCampaignStatsUnsubscriptions
- */
- public function getUnsubscriptions()
- {
- return $this->container['unsubscriptions'];
- }
-
- /**
- * Sets unsubscriptions
- *
- * @param \Brevo\Client\Model\GetContactCampaignStatsUnsubscriptions $unsubscriptions unsubscriptions
- *
- * @return $this
- */
- public function setUnsubscriptions($unsubscriptions)
- {
- $this->container['unsubscriptions'] = $unsubscriptions;
-
- return $this;
- }
-
- /**
- * Gets opened
- *
- * @return \Brevo\Client\Model\GetContactCampaignStatsOpened[]
- */
- public function getOpened()
- {
- return $this->container['opened'];
- }
-
- /**
- * Sets opened
- *
- * @param \Brevo\Client\Model\GetContactCampaignStatsOpened[] $opened opened
- *
- * @return $this
- */
- public function setOpened($opened)
- {
- $this->container['opened'] = $opened;
-
- return $this;
- }
-
- /**
- * Gets clicked
- *
- * @return \Brevo\Client\Model\GetContactCampaignStatsClicked[]
- */
- public function getClicked()
- {
- return $this->container['clicked'];
- }
-
- /**
- * Sets clicked
- *
- * @param \Brevo\Client\Model\GetContactCampaignStatsClicked[] $clicked clicked
- *
- * @return $this
- */
- public function setClicked($clicked)
- {
- $this->container['clicked'] = $clicked;
-
- return $this;
- }
-
- /**
- * Gets transacAttributes
- *
- * @return \Brevo\Client\Model\GetContactCampaignStatsTransacAttributes[]
- */
- public function getTransacAttributes()
- {
- return $this->container['transacAttributes'];
- }
-
- /**
- * Sets transacAttributes
- *
- * @param \Brevo\Client\Model\GetContactCampaignStatsTransacAttributes[] $transacAttributes transacAttributes
- *
- * @return $this
- */
- public function setTransacAttributes($transacAttributes)
- {
- $this->container['transacAttributes'] = $transacAttributes;
-
- return $this;
- }
-
- /**
- * Gets delivered
- *
- * @return \Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]
- */
- public function getDelivered()
- {
- return $this->container['delivered'];
- }
-
- /**
- * Sets delivered
- *
- * @param \Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[] $delivered delivered
- *
- * @return $this
- */
- public function setDelivered($delivered)
- {
- $this->container['delivered'] = $delivered;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetContactCampaignStatsClicked.php b/lib/Model/GetContactCampaignStatsClicked.php
deleted file mode 100644
index 8dc1d58..0000000
--- a/lib/Model/GetContactCampaignStatsClicked.php
+++ /dev/null
@@ -1,341 +0,0 @@
- 'int',
- 'links' => '\Brevo\Client\Model\GetExtendedContactDetailsStatisticsLinks[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'campaignId' => 'int64',
- 'links' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'campaignId' => 'campaignId',
- 'links' => 'links'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'campaignId' => 'setCampaignId',
- 'links' => 'setLinks'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'campaignId' => 'getCampaignId',
- 'links' => 'getLinks'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['campaignId'] = isset($data['campaignId']) ? $data['campaignId'] : null;
- $this->container['links'] = isset($data['links']) ? $data['links'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['campaignId'] === null) {
- $invalidProperties[] = "'campaignId' can't be null";
- }
- if ($this->container['links'] === null) {
- $invalidProperties[] = "'links' 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 campaignId
- *
- * @return int
- */
- public function getCampaignId()
- {
- return $this->container['campaignId'];
- }
-
- /**
- * Sets campaignId
- *
- * @param int $campaignId ID of the campaign which generated the event
- *
- * @return $this
- */
- public function setCampaignId($campaignId)
- {
- $this->container['campaignId'] = $campaignId;
-
- return $this;
- }
-
- /**
- * Gets links
- *
- * @return \Brevo\Client\Model\GetExtendedContactDetailsStatisticsLinks[]
- */
- public function getLinks()
- {
- return $this->container['links'];
- }
-
- /**
- * Sets links
- *
- * @param \Brevo\Client\Model\GetExtendedContactDetailsStatisticsLinks[] $links links
- *
- * @return $this
- */
- public function setLinks($links)
- {
- $this->container['links'] = $links;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetContactCampaignStatsOpened.php b/lib/Model/GetContactCampaignStatsOpened.php
deleted file mode 100644
index fd17f29..0000000
--- a/lib/Model/GetContactCampaignStatsOpened.php
+++ /dev/null
@@ -1,407 +0,0 @@
- 'int',
- 'count' => 'int',
- 'eventTime' => 'string',
- 'ip' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'campaignId' => 'int64',
- 'count' => 'int64',
- 'eventTime' => null,
- 'ip' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'campaignId' => 'campaignId',
- 'count' => 'count',
- 'eventTime' => 'eventTime',
- 'ip' => 'ip'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'campaignId' => 'setCampaignId',
- 'count' => 'setCount',
- 'eventTime' => 'setEventTime',
- 'ip' => 'setIp'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'campaignId' => 'getCampaignId',
- 'count' => 'getCount',
- 'eventTime' => 'getEventTime',
- 'ip' => 'getIp'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['campaignId'] = isset($data['campaignId']) ? $data['campaignId'] : null;
- $this->container['count'] = isset($data['count']) ? $data['count'] : null;
- $this->container['eventTime'] = isset($data['eventTime']) ? $data['eventTime'] : null;
- $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['campaignId'] === null) {
- $invalidProperties[] = "'campaignId' can't be null";
- }
- if ($this->container['count'] === null) {
- $invalidProperties[] = "'count' can't be null";
- }
- if ($this->container['eventTime'] === null) {
- $invalidProperties[] = "'eventTime' can't be null";
- }
- if ($this->container['ip'] === null) {
- $invalidProperties[] = "'ip' 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 campaignId
- *
- * @return int
- */
- public function getCampaignId()
- {
- return $this->container['campaignId'];
- }
-
- /**
- * Sets campaignId
- *
- * @param int $campaignId ID of the campaign which generated the event
- *
- * @return $this
- */
- public function setCampaignId($campaignId)
- {
- $this->container['campaignId'] = $campaignId;
-
- return $this;
- }
-
- /**
- * Gets count
- *
- * @return int
- */
- public function getCount()
- {
- return $this->container['count'];
- }
-
- /**
- * Sets count
- *
- * @param int $count Number of openings of the campaign
- *
- * @return $this
- */
- public function setCount($count)
- {
- $this->container['count'] = $count;
-
- return $this;
- }
-
- /**
- * Gets eventTime
- *
- * @return string
- */
- public function getEventTime()
- {
- return $this->container['eventTime'];
- }
-
- /**
- * Sets eventTime
- *
- * @param string $eventTime UTC date-time of the event
- *
- * @return $this
- */
- public function setEventTime($eventTime)
- {
- $this->container['eventTime'] = $eventTime;
-
- return $this;
- }
-
- /**
- * Gets ip
- *
- * @return string
- */
- public function getIp()
- {
- return $this->container['ip'];
- }
-
- /**
- * Sets ip
- *
- * @param string $ip IP from which the user has opened the campaign
- *
- * @return $this
- */
- public function setIp($ip)
- {
- $this->container['ip'] = $ip;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetContactCampaignStatsTransacAttributes.php b/lib/Model/GetContactCampaignStatsTransacAttributes.php
deleted file mode 100644
index e070a8f..0000000
--- a/lib/Model/GetContactCampaignStatsTransacAttributes.php
+++ /dev/null
@@ -1,374 +0,0 @@
- '\DateTime',
- 'orderPrice' => 'float',
- 'orderId' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'orderDate' => 'date',
- 'orderPrice' => 'float',
- 'orderId' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'orderDate' => 'orderDate',
- 'orderPrice' => 'orderPrice',
- 'orderId' => 'orderId'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'orderDate' => 'setOrderDate',
- 'orderPrice' => 'setOrderPrice',
- 'orderId' => 'setOrderId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'orderDate' => 'getOrderDate',
- 'orderPrice' => 'getOrderPrice',
- 'orderId' => 'getOrderId'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['orderDate'] = isset($data['orderDate']) ? $data['orderDate'] : null;
- $this->container['orderPrice'] = isset($data['orderPrice']) ? $data['orderPrice'] : null;
- $this->container['orderId'] = isset($data['orderId']) ? $data['orderId'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['orderDate'] === null) {
- $invalidProperties[] = "'orderDate' can't be null";
- }
- if ($this->container['orderPrice'] === null) {
- $invalidProperties[] = "'orderPrice' can't be null";
- }
- if ($this->container['orderId'] === null) {
- $invalidProperties[] = "'orderId' 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 orderDate
- *
- * @return \DateTime
- */
- public function getOrderDate()
- {
- return $this->container['orderDate'];
- }
-
- /**
- * Sets orderDate
- *
- * @param \DateTime $orderDate Date of the order
- *
- * @return $this
- */
- public function setOrderDate($orderDate)
- {
- $this->container['orderDate'] = $orderDate;
-
- return $this;
- }
-
- /**
- * Gets orderPrice
- *
- * @return float
- */
- public function getOrderPrice()
- {
- return $this->container['orderPrice'];
- }
-
- /**
- * Sets orderPrice
- *
- * @param float $orderPrice Price of the order
- *
- * @return $this
- */
- public function setOrderPrice($orderPrice)
- {
- $this->container['orderPrice'] = $orderPrice;
-
- return $this;
- }
-
- /**
- * Gets orderId
- *
- * @return int
- */
- public function getOrderId()
- {
- return $this->container['orderId'];
- }
-
- /**
- * Sets orderId
- *
- * @param int $orderId ID of the order
- *
- * @return $this
- */
- public function setOrderId($orderId)
- {
- $this->container['orderId'] = $orderId;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetContactCampaignStatsUnsubscriptions.php b/lib/Model/GetContactCampaignStatsUnsubscriptions.php
deleted file mode 100644
index 801f31d..0000000
--- a/lib/Model/GetContactCampaignStatsUnsubscriptions.php
+++ /dev/null
@@ -1,341 +0,0 @@
- '\Brevo\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription[]',
- 'adminUnsubscription' => '\Brevo\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'userUnsubscription' => null,
- 'adminUnsubscription' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'userUnsubscription' => 'userUnsubscription',
- 'adminUnsubscription' => 'adminUnsubscription'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'userUnsubscription' => 'setUserUnsubscription',
- 'adminUnsubscription' => 'setAdminUnsubscription'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'userUnsubscription' => 'getUserUnsubscription',
- 'adminUnsubscription' => 'getAdminUnsubscription'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['userUnsubscription'] = isset($data['userUnsubscription']) ? $data['userUnsubscription'] : null;
- $this->container['adminUnsubscription'] = isset($data['adminUnsubscription']) ? $data['adminUnsubscription'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['userUnsubscription'] === null) {
- $invalidProperties[] = "'userUnsubscription' can't be null";
- }
- if ($this->container['adminUnsubscription'] === null) {
- $invalidProperties[] = "'adminUnsubscription' 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 userUnsubscription
- *
- * @return \Brevo\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription[]
- */
- public function getUserUnsubscription()
- {
- return $this->container['userUnsubscription'];
- }
-
- /**
- * Sets userUnsubscription
- *
- * @param \Brevo\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription[] $userUnsubscription Contact has unsubscribed via the unsubscription link in the email
- *
- * @return $this
- */
- public function setUserUnsubscription($userUnsubscription)
- {
- $this->container['userUnsubscription'] = $userUnsubscription;
-
- return $this;
- }
-
- /**
- * Gets adminUnsubscription
- *
- * @return \Brevo\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription[]
- */
- public function getAdminUnsubscription()
- {
- return $this->container['adminUnsubscription'];
- }
-
- /**
- * Sets adminUnsubscription
- *
- * @param \Brevo\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription[] $adminUnsubscription Contact has been unsubscribed from the administrator
- *
- * @return $this
- */
- public function setAdminUnsubscription($adminUnsubscription)
- {
- $this->container['adminUnsubscription'] = $adminUnsubscription;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetContactDetails.php b/lib/Model/GetContactDetails.php
deleted file mode 100644
index da37f94..0000000
--- a/lib/Model/GetContactDetails.php
+++ /dev/null
@@ -1,569 +0,0 @@
- 'string',
- 'id' => 'int',
- 'emailBlacklisted' => 'bool',
- 'smsBlacklisted' => 'bool',
- 'createdAt' => 'string',
- 'modifiedAt' => 'string',
- 'listIds' => 'int[]',
- 'listUnsubscribed' => 'int[]',
- 'attributes' => 'object'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'email' => 'email',
- 'id' => 'int64',
- 'emailBlacklisted' => null,
- 'smsBlacklisted' => null,
- 'createdAt' => null,
- 'modifiedAt' => null,
- 'listIds' => 'int64',
- 'listUnsubscribed' => 'int64',
- 'attributes' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'email' => 'email',
- 'id' => 'id',
- 'emailBlacklisted' => 'emailBlacklisted',
- 'smsBlacklisted' => 'smsBlacklisted',
- 'createdAt' => 'createdAt',
- 'modifiedAt' => 'modifiedAt',
- 'listIds' => 'listIds',
- 'listUnsubscribed' => 'listUnsubscribed',
- 'attributes' => 'attributes'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'email' => 'setEmail',
- 'id' => 'setId',
- 'emailBlacklisted' => 'setEmailBlacklisted',
- 'smsBlacklisted' => 'setSmsBlacklisted',
- 'createdAt' => 'setCreatedAt',
- 'modifiedAt' => 'setModifiedAt',
- 'listIds' => 'setListIds',
- 'listUnsubscribed' => 'setListUnsubscribed',
- 'attributes' => 'setAttributes'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'email' => 'getEmail',
- 'id' => 'getId',
- 'emailBlacklisted' => 'getEmailBlacklisted',
- 'smsBlacklisted' => 'getSmsBlacklisted',
- 'createdAt' => 'getCreatedAt',
- 'modifiedAt' => 'getModifiedAt',
- 'listIds' => 'getListIds',
- 'listUnsubscribed' => 'getListUnsubscribed',
- 'attributes' => 'getAttributes'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['emailBlacklisted'] = isset($data['emailBlacklisted']) ? $data['emailBlacklisted'] : null;
- $this->container['smsBlacklisted'] = isset($data['smsBlacklisted']) ? $data['smsBlacklisted'] : null;
- $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null;
- $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null;
- $this->container['listIds'] = isset($data['listIds']) ? $data['listIds'] : null;
- $this->container['listUnsubscribed'] = isset($data['listUnsubscribed']) ? $data['listUnsubscribed'] : null;
- $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['email'] === null) {
- $invalidProperties[] = "'email' can't be null";
- }
- if ($this->container['id'] === null) {
- $invalidProperties[] = "'id' can't be null";
- }
- if ($this->container['emailBlacklisted'] === null) {
- $invalidProperties[] = "'emailBlacklisted' can't be null";
- }
- if ($this->container['smsBlacklisted'] === null) {
- $invalidProperties[] = "'smsBlacklisted' can't be null";
- }
- if ($this->container['createdAt'] === null) {
- $invalidProperties[] = "'createdAt' can't be null";
- }
- if ($this->container['modifiedAt'] === null) {
- $invalidProperties[] = "'modifiedAt' can't be null";
- }
- if ($this->container['listIds'] === null) {
- $invalidProperties[] = "'listIds' can't be null";
- }
- if ($this->container['attributes'] === null) {
- $invalidProperties[] = "'attributes' 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 email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Email address of the contact for which you requested the details
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets id
- *
- * @return int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id ID of the contact for which you requested the details
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets emailBlacklisted
- *
- * @return bool
- */
- public function getEmailBlacklisted()
- {
- return $this->container['emailBlacklisted'];
- }
-
- /**
- * Sets emailBlacklisted
- *
- * @param bool $emailBlacklisted Blacklist status for email campaigns (true=blacklisted, false=not blacklisted)
- *
- * @return $this
- */
- public function setEmailBlacklisted($emailBlacklisted)
- {
- $this->container['emailBlacklisted'] = $emailBlacklisted;
-
- return $this;
- }
-
- /**
- * Gets smsBlacklisted
- *
- * @return bool
- */
- public function getSmsBlacklisted()
- {
- return $this->container['smsBlacklisted'];
- }
-
- /**
- * Sets smsBlacklisted
- *
- * @param bool $smsBlacklisted Blacklist status for SMS campaigns (true=blacklisted, false=not blacklisted)
- *
- * @return $this
- */
- public function setSmsBlacklisted($smsBlacklisted)
- {
- $this->container['smsBlacklisted'] = $smsBlacklisted;
-
- return $this;
- }
-
- /**
- * Gets createdAt
- *
- * @return string
- */
- public function getCreatedAt()
- {
- return $this->container['createdAt'];
- }
-
- /**
- * Sets createdAt
- *
- * @param string $createdAt Creation UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ)
- *
- * @return $this
- */
- public function setCreatedAt($createdAt)
- {
- $this->container['createdAt'] = $createdAt;
-
- return $this;
- }
-
- /**
- * Gets modifiedAt
- *
- * @return string
- */
- public function getModifiedAt()
- {
- return $this->container['modifiedAt'];
- }
-
- /**
- * Sets modifiedAt
- *
- * @param string $modifiedAt Last modification UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ)
- *
- * @return $this
- */
- public function setModifiedAt($modifiedAt)
- {
- $this->container['modifiedAt'] = $modifiedAt;
-
- return $this;
- }
-
- /**
- * Gets listIds
- *
- * @return int[]
- */
- public function getListIds()
- {
- return $this->container['listIds'];
- }
-
- /**
- * Sets listIds
- *
- * @param int[] $listIds listIds
- *
- * @return $this
- */
- public function setListIds($listIds)
- {
- $this->container['listIds'] = $listIds;
-
- return $this;
- }
-
- /**
- * Gets listUnsubscribed
- *
- * @return int[]
- */
- public function getListUnsubscribed()
- {
- return $this->container['listUnsubscribed'];
- }
-
- /**
- * Sets listUnsubscribed
- *
- * @param int[] $listUnsubscribed listUnsubscribed
- *
- * @return $this
- */
- public function setListUnsubscribed($listUnsubscribed)
- {
- $this->container['listUnsubscribed'] = $listUnsubscribed;
-
- return $this;
- }
-
- /**
- * Gets attributes
- *
- * @return object
- */
- public function getAttributes()
- {
- return $this->container['attributes'];
- }
-
- /**
- * Sets attributes
- *
- * @param object $attributes Set of attributes of the contact
- *
- * @return $this
- */
- public function setAttributes($attributes)
- {
- $this->container['attributes'] = $attributes;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetContacts.php b/lib/Model/GetContacts.php
deleted file mode 100644
index 0be86d9..0000000
--- a/lib/Model/GetContacts.php
+++ /dev/null
@@ -1,341 +0,0 @@
- 'object[]',
- 'count' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'contacts' => null,
- 'count' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'contacts' => 'contacts',
- 'count' => 'count'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'contacts' => 'setContacts',
- 'count' => 'setCount'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'contacts' => 'getContacts',
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['contacts'] = isset($data['contacts']) ? $data['contacts'] : null;
- $this->container['count'] = isset($data['count']) ? $data['count'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['contacts'] === null) {
- $invalidProperties[] = "'contacts' 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 contacts
- *
- * @return object[]
- */
- public function getContacts()
- {
- return $this->container['contacts'];
- }
-
- /**
- * Sets contacts
- *
- * @param object[] $contacts contacts
- *
- * @return $this
- */
- public function setContacts($contacts)
- {
- $this->container['contacts'] = $contacts;
-
- return $this;
- }
-
- /**
- * Gets count
- *
- * @return int
- */
- public function getCount()
- {
- return $this->container['count'];
- }
-
- /**
- * Sets count
- *
- * @param int $count Number of contacts
- *
- * @return $this
- */
- public function setCount($count)
- {
- $this->container['count'] = $count;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetCorporateInvitedUsersList.php b/lib/Model/GetCorporateInvitedUsersList.php
deleted file mode 100644
index 989c089..0000000
--- a/lib/Model/GetCorporateInvitedUsersList.php
+++ /dev/null
@@ -1,305 +0,0 @@
- '\Brevo\Client\Model\GetCorporateInvitedUsersListUsers[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'users' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'users' => 'users'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'users' => 'setUsers'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['users'] = isset($data['users']) ? $data['users'] : null;
- }
-
- /**
- * 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 users
- *
- * @return \Brevo\Client\Model\GetCorporateInvitedUsersListUsers[]
- */
- public function getUsers()
- {
- return $this->container['users'];
- }
-
- /**
- * Sets users
- *
- * @param \Brevo\Client\Model\GetCorporateInvitedUsersListUsers[] $users Get invited users list
- *
- * @return $this
- */
- public function setUsers($users)
- {
- $this->container['users'] = $users;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetCorporateInvitedUsersListFeatureAccess.php b/lib/Model/GetCorporateInvitedUsersListFeatureAccess.php
deleted file mode 100644
index 38544b2..0000000
--- a/lib/Model/GetCorporateInvitedUsersListFeatureAccess.php
+++ /dev/null
@@ -1,396 +0,0 @@
- 'string[]',
- 'apiKeys' => 'string[]',
- 'myPlan' => 'string[]',
- 'appsManagement' => 'string[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'userManagement' => null,
- 'apiKeys' => null,
- 'myPlan' => null,
- 'appsManagement' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'userManagement' => 'user_management',
- 'apiKeys' => 'api_keys',
- 'myPlan' => 'my_plan',
- 'appsManagement' => 'apps_management'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'userManagement' => 'setUserManagement',
- 'apiKeys' => 'setApiKeys',
- 'myPlan' => 'setMyPlan',
- 'appsManagement' => 'setAppsManagement'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'userManagement' => 'getUserManagement',
- 'apiKeys' => 'getApiKeys',
- 'myPlan' => 'getMyPlan',
- 'appsManagement' => 'getAppsManagement'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['userManagement'] = isset($data['userManagement']) ? $data['userManagement'] : null;
- $this->container['apiKeys'] = isset($data['apiKeys']) ? $data['apiKeys'] : null;
- $this->container['myPlan'] = isset($data['myPlan']) ? $data['myPlan'] : null;
- $this->container['appsManagement'] = isset($data['appsManagement']) ? $data['appsManagement'] : null;
- }
-
- /**
- * 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 userManagement
- *
- * @return string[]
- */
- public function getUserManagement()
- {
- return $this->container['userManagement'];
- }
-
- /**
- * Sets userManagement
- *
- * @param string[] $userManagement User management accessiblity.
- *
- * @return $this
- */
- public function setUserManagement($userManagement)
- {
- $this->container['userManagement'] = $userManagement;
-
- return $this;
- }
-
- /**
- * Gets apiKeys
- *
- * @return string[]
- */
- public function getApiKeys()
- {
- return $this->container['apiKeys'];
- }
-
- /**
- * Sets apiKeys
- *
- * @param string[] $apiKeys Api keys accessiblity.
- *
- * @return $this
- */
- public function setApiKeys($apiKeys)
- {
- $this->container['apiKeys'] = $apiKeys;
-
- return $this;
- }
-
- /**
- * Gets myPlan
- *
- * @return string[]
- */
- public function getMyPlan()
- {
- return $this->container['myPlan'];
- }
-
- /**
- * Sets myPlan
- *
- * @param string[] $myPlan My plan accessiblity.
- *
- * @return $this
- */
- public function setMyPlan($myPlan)
- {
- $this->container['myPlan'] = $myPlan;
-
- return $this;
- }
-
- /**
- * Gets appsManagement
- *
- * @return string[]
- */
- public function getAppsManagement()
- {
- return $this->container['appsManagement'];
- }
-
- /**
- * Sets appsManagement
- *
- * @param string[] $appsManagement Apps management accessiblity | Not available in ENTv2
- *
- * @return $this
- */
- public function setAppsManagement($appsManagement)
- {
- $this->container['appsManagement'] = $appsManagement;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetCorporateInvitedUsersListGroups.php b/lib/Model/GetCorporateInvitedUsersListGroups.php
deleted file mode 100644
index c6c882b..0000000
--- a/lib/Model/GetCorporateInvitedUsersListGroups.php
+++ /dev/null
@@ -1,336 +0,0 @@
- 'string',
- 'name' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => null,
- 'name' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'name' => 'name'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'name' => 'setName'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'name' => 'getName'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- }
-
- /**
- * 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 id
- *
- * @return string
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param string $id group id
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name group name
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetCorporateInvitedUsersListUsers.php b/lib/Model/GetCorporateInvitedUsersListUsers.php
deleted file mode 100644
index 1bb9cae..0000000
--- a/lib/Model/GetCorporateInvitedUsersListUsers.php
+++ /dev/null
@@ -1,440 +0,0 @@
- '\Brevo\Client\Model\GetCorporateInvitedUsersListGroups',
- 'email' => 'string',
- 'isOwner' => 'string',
- 'status' => 'string',
- 'featureAccess' => '\Brevo\Client\Model\GetCorporateInvitedUsersListFeatureAccess'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'groups' => null,
- 'email' => null,
- 'isOwner' => null,
- 'status' => null,
- 'featureAccess' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'groups' => 'groups',
- 'email' => 'email',
- 'isOwner' => 'is_owner',
- 'status' => 'status',
- 'featureAccess' => 'feature_access'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'groups' => 'setGroups',
- 'email' => 'setEmail',
- 'isOwner' => 'setIsOwner',
- 'status' => 'setStatus',
- 'featureAccess' => 'setFeatureAccess'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'groups' => 'getGroups',
- 'email' => 'getEmail',
- 'isOwner' => 'getIsOwner',
- 'status' => 'getStatus',
- 'featureAccess' => 'getFeatureAccess'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['groups'] = isset($data['groups']) ? $data['groups'] : null;
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['isOwner'] = isset($data['isOwner']) ? $data['isOwner'] : null;
- $this->container['status'] = isset($data['status']) ? $data['status'] : null;
- $this->container['featureAccess'] = isset($data['featureAccess']) ? $data['featureAccess'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['groups'] === null) {
- $invalidProperties[] = "'groups' can't be null";
- }
- if ($this->container['email'] === null) {
- $invalidProperties[] = "'email' can't be null";
- }
- if ($this->container['isOwner'] === null) {
- $invalidProperties[] = "'isOwner' can't be null";
- }
- if ($this->container['status'] === null) {
- $invalidProperties[] = "'status' can't be null";
- }
- if ($this->container['featureAccess'] === null) {
- $invalidProperties[] = "'featureAccess' 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 groups
- *
- * @return \Brevo\Client\Model\GetCorporateInvitedUsersListGroups
- */
- public function getGroups()
- {
- return $this->container['groups'];
- }
-
- /**
- * Sets groups
- *
- * @param \Brevo\Client\Model\GetCorporateInvitedUsersListGroups $groups groups
- *
- * @return $this
- */
- public function setGroups($groups)
- {
- $this->container['groups'] = $groups;
-
- return $this;
- }
-
- /**
- * Gets email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Email address of the user.
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets isOwner
- *
- * @return string
- */
- public function getIsOwner()
- {
- return $this->container['isOwner'];
- }
-
- /**
- * Sets isOwner
- *
- * @param string $isOwner Flag for indicating is user owner of the organization.
- *
- * @return $this
- */
- public function setIsOwner($isOwner)
- {
- $this->container['isOwner'] = $isOwner;
-
- return $this;
- }
-
- /**
- * Gets status
- *
- * @return string
- */
- public function getStatus()
- {
- return $this->container['status'];
- }
-
- /**
- * Sets status
- *
- * @param string $status Status of the invited user.
- *
- * @return $this
- */
- public function setStatus($status)
- {
- $this->container['status'] = $status;
-
- return $this;
- }
-
- /**
- * Gets featureAccess
- *
- * @return \Brevo\Client\Model\GetCorporateInvitedUsersListFeatureAccess
- */
- public function getFeatureAccess()
- {
- return $this->container['featureAccess'];
- }
-
- /**
- * Sets featureAccess
- *
- * @param \Brevo\Client\Model\GetCorporateInvitedUsersListFeatureAccess $featureAccess featureAccess
- *
- * @return $this
- */
- public function setFeatureAccess($featureAccess)
- {
- $this->container['featureAccess'] = $featureAccess;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetCouponCollection.php b/lib/Model/GetCouponCollection.php
deleted file mode 100644
index 69d4b47..0000000
--- a/lib/Model/GetCouponCollection.php
+++ /dev/null
@@ -1,473 +0,0 @@
- 'string',
- 'name' => 'string',
- 'defaultCoupon' => 'string',
- 'createdAt' => '\DateTime',
- 'totalCoupons' => 'int',
- 'remainingCoupons' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'uuidv4',
- 'name' => 'uuidv4',
- 'defaultCoupon' => null,
- 'createdAt' => 'date-time',
- 'totalCoupons' => 'int64',
- 'remainingCoupons' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'name' => 'name',
- 'defaultCoupon' => 'defaultCoupon',
- 'createdAt' => 'createdAt',
- 'totalCoupons' => 'totalCoupons',
- 'remainingCoupons' => 'remainingCoupons'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'name' => 'setName',
- 'defaultCoupon' => 'setDefaultCoupon',
- 'createdAt' => 'setCreatedAt',
- 'totalCoupons' => 'setTotalCoupons',
- 'remainingCoupons' => 'setRemainingCoupons'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'name' => 'getName',
- 'defaultCoupon' => 'getDefaultCoupon',
- 'createdAt' => 'getCreatedAt',
- 'totalCoupons' => 'getTotalCoupons',
- 'remainingCoupons' => 'getRemainingCoupons'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['defaultCoupon'] = isset($data['defaultCoupon']) ? $data['defaultCoupon'] : null;
- $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null;
- $this->container['totalCoupons'] = isset($data['totalCoupons']) ? $data['totalCoupons'] : null;
- $this->container['remainingCoupons'] = isset($data['remainingCoupons']) ? $data['remainingCoupons'] : null;
- }
-
- /**
- * 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['name'] === null) {
- $invalidProperties[] = "'name' can't be null";
- }
- if ($this->container['defaultCoupon'] === null) {
- $invalidProperties[] = "'defaultCoupon' can't be null";
- }
- if ($this->container['createdAt'] === null) {
- $invalidProperties[] = "'createdAt' can't be null";
- }
- if ($this->container['totalCoupons'] === null) {
- $invalidProperties[] = "'totalCoupons' can't be null";
- }
- if ($this->container['remainingCoupons'] === null) {
- $invalidProperties[] = "'remainingCoupons' 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 The id of the collection
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name The name of the collection
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets defaultCoupon
- *
- * @return string
- */
- public function getDefaultCoupon()
- {
- return $this->container['defaultCoupon'];
- }
-
- /**
- * Sets defaultCoupon
- *
- * @param string $defaultCoupon The default coupon of the collection
- *
- * @return $this
- */
- public function setDefaultCoupon($defaultCoupon)
- {
- $this->container['defaultCoupon'] = $defaultCoupon;
-
- return $this;
- }
-
- /**
- * Gets createdAt
- *
- * @return \DateTime
- */
- public function getCreatedAt()
- {
- return $this->container['createdAt'];
- }
-
- /**
- * Sets createdAt
- *
- * @param \DateTime $createdAt Datetime on which the collection was created
- *
- * @return $this
- */
- public function setCreatedAt($createdAt)
- {
- $this->container['createdAt'] = $createdAt;
-
- return $this;
- }
-
- /**
- * Gets totalCoupons
- *
- * @return int
- */
- public function getTotalCoupons()
- {
- return $this->container['totalCoupons'];
- }
-
- /**
- * Sets totalCoupons
- *
- * @param int $totalCoupons Total coupons in the collection
- *
- * @return $this
- */
- public function setTotalCoupons($totalCoupons)
- {
- $this->container['totalCoupons'] = $totalCoupons;
-
- return $this;
- }
-
- /**
- * Gets remainingCoupons
- *
- * @return int
- */
- public function getRemainingCoupons()
- {
- return $this->container['remainingCoupons'];
- }
-
- /**
- * Sets remainingCoupons
- *
- * @param int $remainingCoupons Not sent coupons in the collection
- *
- * @return $this
- */
- public function setRemainingCoupons($remainingCoupons)
- {
- $this->container['remainingCoupons'] = $remainingCoupons;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetDeviceBrowserStats.php b/lib/Model/GetDeviceBrowserStats.php
deleted file mode 100644
index 81a3e75..0000000
--- a/lib/Model/GetDeviceBrowserStats.php
+++ /dev/null
@@ -1,407 +0,0 @@
- 'int',
- 'uniqueClicks' => 'int',
- 'viewed' => 'int',
- 'uniqueViews' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'clickers' => 'int64',
- 'uniqueClicks' => 'int64',
- 'viewed' => 'int64',
- 'uniqueViews' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'clickers' => 'clickers',
- 'uniqueClicks' => 'uniqueClicks',
- 'viewed' => 'viewed',
- 'uniqueViews' => 'uniqueViews'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'clickers' => 'setClickers',
- 'uniqueClicks' => 'setUniqueClicks',
- 'viewed' => 'setViewed',
- 'uniqueViews' => 'setUniqueViews'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'clickers' => 'getClickers',
- 'uniqueClicks' => 'getUniqueClicks',
- 'viewed' => 'getViewed',
- 'uniqueViews' => 'getUniqueViews'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['clickers'] = isset($data['clickers']) ? $data['clickers'] : null;
- $this->container['uniqueClicks'] = isset($data['uniqueClicks']) ? $data['uniqueClicks'] : null;
- $this->container['viewed'] = isset($data['viewed']) ? $data['viewed'] : null;
- $this->container['uniqueViews'] = isset($data['uniqueViews']) ? $data['uniqueViews'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['clickers'] === null) {
- $invalidProperties[] = "'clickers' can't be null";
- }
- if ($this->container['uniqueClicks'] === null) {
- $invalidProperties[] = "'uniqueClicks' can't be null";
- }
- if ($this->container['viewed'] === null) {
- $invalidProperties[] = "'viewed' can't be null";
- }
- if ($this->container['uniqueViews'] === null) {
- $invalidProperties[] = "'uniqueViews' 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 clickers
- *
- * @return int
- */
- public function getClickers()
- {
- return $this->container['clickers'];
- }
-
- /**
- * Sets clickers
- *
- * @param int $clickers Number of total clicks for the campaign using the particular browser
- *
- * @return $this
- */
- public function setClickers($clickers)
- {
- $this->container['clickers'] = $clickers;
-
- return $this;
- }
-
- /**
- * Gets uniqueClicks
- *
- * @return int
- */
- public function getUniqueClicks()
- {
- return $this->container['uniqueClicks'];
- }
-
- /**
- * Sets uniqueClicks
- *
- * @param int $uniqueClicks Number of unique clicks for the campaign using the particular browser
- *
- * @return $this
- */
- public function setUniqueClicks($uniqueClicks)
- {
- $this->container['uniqueClicks'] = $uniqueClicks;
-
- return $this;
- }
-
- /**
- * Gets viewed
- *
- * @return int
- */
- public function getViewed()
- {
- return $this->container['viewed'];
- }
-
- /**
- * Sets viewed
- *
- * @param int $viewed Number of openings for the campaign using the particular browser
- *
- * @return $this
- */
- public function setViewed($viewed)
- {
- $this->container['viewed'] = $viewed;
-
- return $this;
- }
-
- /**
- * Gets uniqueViews
- *
- * @return int
- */
- public function getUniqueViews()
- {
- return $this->container['uniqueViews'];
- }
-
- /**
- * Sets uniqueViews
- *
- * @param int $uniqueViews Number of unique openings for the campaign using the particular browser
- *
- * @return $this
- */
- public function setUniqueViews($uniqueViews)
- {
- $this->container['uniqueViews'] = $uniqueViews;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetDomainConfigurationModel.php b/lib/Model/GetDomainConfigurationModel.php
deleted file mode 100644
index 52ee44b..0000000
--- a/lib/Model/GetDomainConfigurationModel.php
+++ /dev/null
@@ -1,407 +0,0 @@
- 'string',
- 'verified' => 'bool',
- 'authenticated' => 'bool',
- 'dnsRecords' => '\Brevo\Client\Model\CreateDomainModelDnsRecords'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'domain' => null,
- 'verified' => null,
- 'authenticated' => null,
- 'dnsRecords' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'domain' => 'domain',
- 'verified' => 'verified',
- 'authenticated' => 'authenticated',
- 'dnsRecords' => 'dns_records'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'domain' => 'setDomain',
- 'verified' => 'setVerified',
- 'authenticated' => 'setAuthenticated',
- 'dnsRecords' => 'setDnsRecords'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'domain' => 'getDomain',
- 'verified' => 'getVerified',
- 'authenticated' => 'getAuthenticated',
- 'dnsRecords' => 'getDnsRecords'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['domain'] = isset($data['domain']) ? $data['domain'] : null;
- $this->container['verified'] = isset($data['verified']) ? $data['verified'] : null;
- $this->container['authenticated'] = isset($data['authenticated']) ? $data['authenticated'] : null;
- $this->container['dnsRecords'] = isset($data['dnsRecords']) ? $data['dnsRecords'] : null;
- }
-
- /**
- * 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";
- }
- if ($this->container['verified'] === null) {
- $invalidProperties[] = "'verified' can't be null";
- }
- if ($this->container['authenticated'] === null) {
- $invalidProperties[] = "'authenticated' can't be null";
- }
- if ($this->container['dnsRecords'] === null) {
- $invalidProperties[] = "'dnsRecords' 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 $this
- */
- public function setDomain($domain)
- {
- $this->container['domain'] = $domain;
-
- return $this;
- }
-
- /**
- * Gets verified
- *
- * @return bool
- */
- public function getVerified()
- {
- return $this->container['verified'];
- }
-
- /**
- * Sets verified
- *
- * @param bool $verified Status of domain verification (true=verified, false=non verified)
- *
- * @return $this
- */
- public function setVerified($verified)
- {
- $this->container['verified'] = $verified;
-
- return $this;
- }
-
- /**
- * Gets authenticated
- *
- * @return bool
- */
- public function getAuthenticated()
- {
- return $this->container['authenticated'];
- }
-
- /**
- * Sets authenticated
- *
- * @param bool $authenticated Status of domain authentication (true=authenticated, false=non authenticated)
- *
- * @return $this
- */
- public function setAuthenticated($authenticated)
- {
- $this->container['authenticated'] = $authenticated;
-
- return $this;
- }
-
- /**
- * Gets dnsRecords
- *
- * @return \Brevo\Client\Model\CreateDomainModelDnsRecords
- */
- public function getDnsRecords()
- {
- return $this->container['dnsRecords'];
- }
-
- /**
- * Sets dnsRecords
- *
- * @param \Brevo\Client\Model\CreateDomainModelDnsRecords $dnsRecords dnsRecords
- *
- * @return $this
- */
- public function setDnsRecords($dnsRecords)
- {
- $this->container['dnsRecords'] = $dnsRecords;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetDomainsList.php b/lib/Model/GetDomainsList.php
deleted file mode 100644
index 1ed1db7..0000000
--- a/lib/Model/GetDomainsList.php
+++ /dev/null
@@ -1,305 +0,0 @@
- '\Brevo\Client\Model\GetDomainsListDomains[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'domains' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'domains' => 'domains'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'domains' => 'setDomains'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'domains' => 'getDomains'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['domains'] = isset($data['domains']) ? $data['domains'] : null;
- }
-
- /**
- * 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 domains
- *
- * @return \Brevo\Client\Model\GetDomainsListDomains[]
- */
- public function getDomains()
- {
- return $this->container['domains'];
- }
-
- /**
- * Sets domains
- *
- * @param \Brevo\Client\Model\GetDomainsListDomains[] $domains List of the domains available in your account
- *
- * @return $this
- */
- public function setDomains($domains)
- {
- $this->container['domains'] = $domains;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetDomainsListDomains.php b/lib/Model/GetDomainsListDomains.php
deleted file mode 100644
index 27d25bf..0000000
--- a/lib/Model/GetDomainsListDomains.php
+++ /dev/null
@@ -1,437 +0,0 @@
- 'int',
- 'domainName' => 'string',
- 'authenticated' => 'bool',
- 'verified' => 'bool',
- 'ip' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'int64',
- 'domainName' => null,
- 'authenticated' => null,
- 'verified' => null,
- 'ip' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'domainName' => 'domain_name',
- 'authenticated' => 'authenticated',
- 'verified' => 'verified',
- 'ip' => 'ip'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'domainName' => 'setDomainName',
- 'authenticated' => 'setAuthenticated',
- 'verified' => 'setVerified',
- 'ip' => 'setIp'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'domainName' => 'getDomainName',
- 'authenticated' => 'getAuthenticated',
- 'verified' => 'getVerified',
- 'ip' => 'getIp'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['domainName'] = isset($data['domainName']) ? $data['domainName'] : null;
- $this->container['authenticated'] = isset($data['authenticated']) ? $data['authenticated'] : null;
- $this->container['verified'] = isset($data['verified']) ? $data['verified'] : null;
- $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null;
- }
-
- /**
- * 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['domainName'] === null) {
- $invalidProperties[] = "'domainName' can't be null";
- }
- if ($this->container['authenticated'] === null) {
- $invalidProperties[] = "'authenticated' 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 id
- *
- * @return int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id Id of the domain
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets domainName
- *
- * @return string
- */
- public function getDomainName()
- {
- return $this->container['domainName'];
- }
-
- /**
- * Sets domainName
- *
- * @param string $domainName Domain name
- *
- * @return $this
- */
- public function setDomainName($domainName)
- {
- $this->container['domainName'] = $domainName;
-
- return $this;
- }
-
- /**
- * Gets authenticated
- *
- * @return bool
- */
- public function getAuthenticated()
- {
- return $this->container['authenticated'];
- }
-
- /**
- * Sets authenticated
- *
- * @param bool $authenticated Status of domain authentication (true=authenticated, false=non authenticated)
- *
- * @return $this
- */
- public function setAuthenticated($authenticated)
- {
- $this->container['authenticated'] = $authenticated;
-
- return $this;
- }
-
- /**
- * Gets verified
- *
- * @return bool
- */
- public function getVerified()
- {
- return $this->container['verified'];
- }
-
- /**
- * Sets verified
- *
- * @param bool $verified Status of domain verification (true=verified, false=non verified)
- *
- * @return $this
- */
- public function setVerified($verified)
- {
- $this->container['verified'] = $verified;
-
- return $this;
- }
-
- /**
- * Gets ip
- *
- * @return string
- */
- public function getIp()
- {
- return $this->container['ip'];
- }
-
- /**
- * Sets ip
- *
- * @param string $ip Dedicated IP associated with domain
- *
- * @return $this
- */
- public function setIp($ip)
- {
- $this->container['ip'] = $ip;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetEmailCampaign.php b/lib/Model/GetEmailCampaign.php
deleted file mode 100644
index c27c352..0000000
--- a/lib/Model/GetEmailCampaign.php
+++ /dev/null
@@ -1,1320 +0,0 @@
- 'int',
- 'name' => 'string',
- 'subject' => 'string',
- 'type' => 'string',
- 'status' => 'string',
- 'scheduledAt' => 'string',
- 'abTesting' => 'bool',
- 'subjectA' => 'string',
- 'subjectB' => 'string',
- 'splitRule' => 'int',
- 'winnerCriteria' => 'string',
- 'winnerDelay' => 'int',
- 'sendAtBestTime' => 'bool',
- 'testSent' => 'bool',
- 'header' => 'string',
- 'footer' => 'string',
- 'sender' => '\Brevo\Client\Model\GetExtendedCampaignOverviewSender',
- 'replyTo' => 'string',
- 'toField' => 'string',
- 'htmlContent' => 'string',
- 'shareLink' => 'string',
- 'tag' => 'string',
- 'createdAt' => 'string',
- 'modifiedAt' => 'string',
- 'inlineImageActivation' => 'bool',
- 'mirrorActive' => 'bool',
- 'recurring' => 'bool',
- 'sentDate' => 'string',
- 'returnBounce' => 'int',
- 'recipients' => 'object',
- 'statistics' => 'object'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'int64',
- 'name' => null,
- 'subject' => null,
- 'type' => null,
- 'status' => null,
- 'scheduledAt' => null,
- 'abTesting' => null,
- 'subjectA' => null,
- 'subjectB' => null,
- 'splitRule' => null,
- 'winnerCriteria' => null,
- 'winnerDelay' => null,
- 'sendAtBestTime' => null,
- 'testSent' => null,
- 'header' => null,
- 'footer' => null,
- 'sender' => null,
- 'replyTo' => 'email',
- 'toField' => null,
- 'htmlContent' => null,
- 'shareLink' => 'url',
- 'tag' => null,
- 'createdAt' => null,
- 'modifiedAt' => null,
- 'inlineImageActivation' => null,
- 'mirrorActive' => null,
- 'recurring' => null,
- 'sentDate' => null,
- 'returnBounce' => 'int64',
- 'recipients' => null,
- 'statistics' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'name' => 'name',
- 'subject' => 'subject',
- 'type' => 'type',
- 'status' => 'status',
- 'scheduledAt' => 'scheduledAt',
- 'abTesting' => 'abTesting',
- 'subjectA' => 'subjectA',
- 'subjectB' => 'subjectB',
- 'splitRule' => 'splitRule',
- 'winnerCriteria' => 'winnerCriteria',
- 'winnerDelay' => 'winnerDelay',
- 'sendAtBestTime' => 'sendAtBestTime',
- 'testSent' => 'testSent',
- 'header' => 'header',
- 'footer' => 'footer',
- 'sender' => 'sender',
- 'replyTo' => 'replyTo',
- 'toField' => 'toField',
- 'htmlContent' => 'htmlContent',
- 'shareLink' => 'shareLink',
- 'tag' => 'tag',
- 'createdAt' => 'createdAt',
- 'modifiedAt' => 'modifiedAt',
- 'inlineImageActivation' => 'inlineImageActivation',
- 'mirrorActive' => 'mirrorActive',
- 'recurring' => 'recurring',
- 'sentDate' => 'sentDate',
- 'returnBounce' => 'returnBounce',
- 'recipients' => 'recipients',
- 'statistics' => 'statistics'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'name' => 'setName',
- 'subject' => 'setSubject',
- 'type' => 'setType',
- 'status' => 'setStatus',
- 'scheduledAt' => 'setScheduledAt',
- 'abTesting' => 'setAbTesting',
- 'subjectA' => 'setSubjectA',
- 'subjectB' => 'setSubjectB',
- 'splitRule' => 'setSplitRule',
- 'winnerCriteria' => 'setWinnerCriteria',
- 'winnerDelay' => 'setWinnerDelay',
- 'sendAtBestTime' => 'setSendAtBestTime',
- 'testSent' => 'setTestSent',
- 'header' => 'setHeader',
- 'footer' => 'setFooter',
- 'sender' => 'setSender',
- 'replyTo' => 'setReplyTo',
- 'toField' => 'setToField',
- 'htmlContent' => 'setHtmlContent',
- 'shareLink' => 'setShareLink',
- 'tag' => 'setTag',
- 'createdAt' => 'setCreatedAt',
- 'modifiedAt' => 'setModifiedAt',
- 'inlineImageActivation' => 'setInlineImageActivation',
- 'mirrorActive' => 'setMirrorActive',
- 'recurring' => 'setRecurring',
- 'sentDate' => 'setSentDate',
- 'returnBounce' => 'setReturnBounce',
- 'recipients' => 'setRecipients',
- 'statistics' => 'setStatistics'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'name' => 'getName',
- 'subject' => 'getSubject',
- 'type' => 'getType',
- 'status' => 'getStatus',
- 'scheduledAt' => 'getScheduledAt',
- 'abTesting' => 'getAbTesting',
- 'subjectA' => 'getSubjectA',
- 'subjectB' => 'getSubjectB',
- 'splitRule' => 'getSplitRule',
- 'winnerCriteria' => 'getWinnerCriteria',
- 'winnerDelay' => 'getWinnerDelay',
- 'sendAtBestTime' => 'getSendAtBestTime',
- 'testSent' => 'getTestSent',
- 'header' => 'getHeader',
- 'footer' => 'getFooter',
- 'sender' => 'getSender',
- 'replyTo' => 'getReplyTo',
- 'toField' => 'getToField',
- 'htmlContent' => 'getHtmlContent',
- 'shareLink' => 'getShareLink',
- 'tag' => 'getTag',
- 'createdAt' => 'getCreatedAt',
- 'modifiedAt' => 'getModifiedAt',
- 'inlineImageActivation' => 'getInlineImageActivation',
- 'mirrorActive' => 'getMirrorActive',
- 'recurring' => 'getRecurring',
- 'sentDate' => 'getSentDate',
- 'returnBounce' => 'getReturnBounce',
- 'recipients' => 'getRecipients',
- 'statistics' => 'getStatistics'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const TYPE_CLASSIC = 'classic';
- const TYPE_TRIGGER = 'trigger';
- const STATUS_DRAFT = 'draft';
- const STATUS_SENT = 'sent';
- const STATUS_ARCHIVE = 'archive';
- const STATUS_QUEUED = 'queued';
- const STATUS_SUSPENDED = 'suspended';
- const STATUS_IN_PROCESS = 'in_process';
-
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getTypeAllowableValues()
- {
- return [
- self::TYPE_CLASSIC,
- self::TYPE_TRIGGER,
- ];
- }
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getStatusAllowableValues()
- {
- return [
- self::STATUS_DRAFT,
- self::STATUS_SENT,
- self::STATUS_ARCHIVE,
- self::STATUS_QUEUED,
- self::STATUS_SUSPENDED,
- self::STATUS_IN_PROCESS,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null;
- $this->container['type'] = isset($data['type']) ? $data['type'] : null;
- $this->container['status'] = isset($data['status']) ? $data['status'] : null;
- $this->container['scheduledAt'] = isset($data['scheduledAt']) ? $data['scheduledAt'] : null;
- $this->container['abTesting'] = isset($data['abTesting']) ? $data['abTesting'] : null;
- $this->container['subjectA'] = isset($data['subjectA']) ? $data['subjectA'] : null;
- $this->container['subjectB'] = isset($data['subjectB']) ? $data['subjectB'] : null;
- $this->container['splitRule'] = isset($data['splitRule']) ? $data['splitRule'] : null;
- $this->container['winnerCriteria'] = isset($data['winnerCriteria']) ? $data['winnerCriteria'] : null;
- $this->container['winnerDelay'] = isset($data['winnerDelay']) ? $data['winnerDelay'] : null;
- $this->container['sendAtBestTime'] = isset($data['sendAtBestTime']) ? $data['sendAtBestTime'] : null;
- $this->container['testSent'] = isset($data['testSent']) ? $data['testSent'] : null;
- $this->container['header'] = isset($data['header']) ? $data['header'] : null;
- $this->container['footer'] = isset($data['footer']) ? $data['footer'] : null;
- $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null;
- $this->container['replyTo'] = isset($data['replyTo']) ? $data['replyTo'] : null;
- $this->container['toField'] = isset($data['toField']) ? $data['toField'] : null;
- $this->container['htmlContent'] = isset($data['htmlContent']) ? $data['htmlContent'] : null;
- $this->container['shareLink'] = isset($data['shareLink']) ? $data['shareLink'] : null;
- $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null;
- $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null;
- $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null;
- $this->container['inlineImageActivation'] = isset($data['inlineImageActivation']) ? $data['inlineImageActivation'] : null;
- $this->container['mirrorActive'] = isset($data['mirrorActive']) ? $data['mirrorActive'] : null;
- $this->container['recurring'] = isset($data['recurring']) ? $data['recurring'] : null;
- $this->container['sentDate'] = isset($data['sentDate']) ? $data['sentDate'] : null;
- $this->container['returnBounce'] = isset($data['returnBounce']) ? $data['returnBounce'] : null;
- $this->container['recipients'] = isset($data['recipients']) ? $data['recipients'] : null;
- $this->container['statistics'] = isset($data['statistics']) ? $data['statistics'] : null;
- }
-
- /**
- * 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['name'] === null) {
- $invalidProperties[] = "'name' can't be null";
- }
- if ($this->container['type'] === null) {
- $invalidProperties[] = "'type' can't be null";
- }
- $allowedValues = $this->getTypeAllowableValues();
- if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'type', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- if ($this->container['status'] === null) {
- $invalidProperties[] = "'status' can't be null";
- }
- $allowedValues = $this->getStatusAllowableValues();
- if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'status', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- if ($this->container['testSent'] === null) {
- $invalidProperties[] = "'testSent' can't be null";
- }
- if ($this->container['header'] === null) {
- $invalidProperties[] = "'header' can't be null";
- }
- if ($this->container['footer'] === null) {
- $invalidProperties[] = "'footer' can't be null";
- }
- if ($this->container['sender'] === null) {
- $invalidProperties[] = "'sender' can't be null";
- }
- if ($this->container['replyTo'] === null) {
- $invalidProperties[] = "'replyTo' can't be null";
- }
- if ($this->container['htmlContent'] === null) {
- $invalidProperties[] = "'htmlContent' can't be null";
- }
- if ($this->container['createdAt'] === null) {
- $invalidProperties[] = "'createdAt' can't be null";
- }
- if ($this->container['modifiedAt'] === null) {
- $invalidProperties[] = "'modifiedAt' can't be null";
- }
- if ($this->container['recipients'] === null) {
- $invalidProperties[] = "'recipients' can't be null";
- }
- if ($this->container['statistics'] === null) {
- $invalidProperties[] = "'statistics' 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 int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id ID of the campaign
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the campaign
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets subject
- *
- * @return string
- */
- public function getSubject()
- {
- return $this->container['subject'];
- }
-
- /**
- * Sets subject
- *
- * @param string $subject Subject of the campaign. Only available if `abTesting` flag of the campaign is `false`
- *
- * @return $this
- */
- public function setSubject($subject)
- {
- $this->container['subject'] = $subject;
-
- return $this;
- }
-
- /**
- * Gets type
- *
- * @return string
- */
- public function getType()
- {
- return $this->container['type'];
- }
-
- /**
- * Sets type
- *
- * @param string $type Type of campaign
- *
- * @return $this
- */
- public function setType($type)
- {
- $allowedValues = $this->getTypeAllowableValues();
- if (!in_array($type, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'type', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['type'] = $type;
-
- return $this;
- }
-
- /**
- * Gets status
- *
- * @return string
- */
- public function getStatus()
- {
- return $this->container['status'];
- }
-
- /**
- * Sets status
- *
- * @param string $status Status of the campaign
- *
- * @return $this
- */
- public function setStatus($status)
- {
- $allowedValues = $this->getStatusAllowableValues();
- if (!in_array($status, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'status', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['status'] = $status;
-
- return $this;
- }
-
- /**
- * Gets scheduledAt
- *
- * @return string
- */
- public function getScheduledAt()
- {
- return $this->container['scheduledAt'];
- }
-
- /**
- * Sets scheduledAt
- *
- * @param string $scheduledAt UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ)
- *
- * @return $this
- */
- public function setScheduledAt($scheduledAt)
- {
- $this->container['scheduledAt'] = $scheduledAt;
-
- return $this;
- }
-
- /**
- * Gets abTesting
- *
- * @return bool
- */
- public function getAbTesting()
- {
- return $this->container['abTesting'];
- }
-
- /**
- * Sets abTesting
- *
- * @param bool $abTesting Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled.
- *
- * @return $this
- */
- public function setAbTesting($abTesting)
- {
- $this->container['abTesting'] = $abTesting;
-
- return $this;
- }
-
- /**
- * Gets subjectA
- *
- * @return string
- */
- public function getSubjectA()
- {
- return $this->container['subjectA'];
- }
-
- /**
- * Sets subjectA
- *
- * @param string $subjectA Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true`
- *
- * @return $this
- */
- public function setSubjectA($subjectA)
- {
- $this->container['subjectA'] = $subjectA;
-
- return $this;
- }
-
- /**
- * Gets subjectB
- *
- * @return string
- */
- public function getSubjectB()
- {
- return $this->container['subjectB'];
- }
-
- /**
- * Sets subjectB
- *
- * @param string $subjectB Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true`
- *
- * @return $this
- */
- public function setSubjectB($subjectB)
- {
- $this->container['subjectB'] = $subjectB;
-
- return $this;
- }
-
- /**
- * Gets splitRule
- *
- * @return int
- */
- public function getSplitRule()
- {
- return $this->container['splitRule'];
- }
-
- /**
- * Sets splitRule
- *
- * @param int $splitRule The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true`
- *
- * @return $this
- */
- public function setSplitRule($splitRule)
- {
- $this->container['splitRule'] = $splitRule;
-
- return $this;
- }
-
- /**
- * Gets winnerCriteria
- *
- * @return string
- */
- public function getWinnerCriteria()
- {
- return $this->container['winnerCriteria'];
- }
-
- /**
- * Sets winnerCriteria
- *
- * @param string $winnerCriteria Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true`
- *
- * @return $this
- */
- public function setWinnerCriteria($winnerCriteria)
- {
- $this->container['winnerCriteria'] = $winnerCriteria;
-
- return $this;
- }
-
- /**
- * Gets winnerDelay
- *
- * @return int
- */
- public function getWinnerDelay()
- {
- return $this->container['winnerDelay'];
- }
-
- /**
- * Sets winnerDelay
- *
- * @param int $winnerDelay The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true`
- *
- * @return $this
- */
- public function setWinnerDelay($winnerDelay)
- {
- $this->container['winnerDelay'] = $winnerDelay;
-
- return $this;
- }
-
- /**
- * Gets sendAtBestTime
- *
- * @return bool
- */
- public function getSendAtBestTime()
- {
- return $this->container['sendAtBestTime'];
- }
-
- /**
- * Sets sendAtBestTime
- *
- * @param bool $sendAtBestTime It is true if you have chosen to send your campaign at best time, otherwise it is false
- *
- * @return $this
- */
- public function setSendAtBestTime($sendAtBestTime)
- {
- $this->container['sendAtBestTime'] = $sendAtBestTime;
-
- return $this;
- }
-
- /**
- * Gets testSent
- *
- * @return bool
- */
- public function getTestSent()
- {
- return $this->container['testSent'];
- }
-
- /**
- * Sets testSent
- *
- * @param bool $testSent Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent)
- *
- * @return $this
- */
- public function setTestSent($testSent)
- {
- $this->container['testSent'] = $testSent;
-
- return $this;
- }
-
- /**
- * Gets header
- *
- * @return string
- */
- public function getHeader()
- {
- return $this->container['header'];
- }
-
- /**
- * Sets header
- *
- * @param string $header Header of the campaign
- *
- * @return $this
- */
- public function setHeader($header)
- {
- $this->container['header'] = $header;
-
- return $this;
- }
-
- /**
- * Gets footer
- *
- * @return string
- */
- public function getFooter()
- {
- return $this->container['footer'];
- }
-
- /**
- * Sets footer
- *
- * @param string $footer Footer of the campaign
- *
- * @return $this
- */
- public function setFooter($footer)
- {
- $this->container['footer'] = $footer;
-
- return $this;
- }
-
- /**
- * Gets sender
- *
- * @return \Brevo\Client\Model\GetExtendedCampaignOverviewSender
- */
- public function getSender()
- {
- return $this->container['sender'];
- }
-
- /**
- * Sets sender
- *
- * @param \Brevo\Client\Model\GetExtendedCampaignOverviewSender $sender sender
- *
- * @return $this
- */
- public function setSender($sender)
- {
- $this->container['sender'] = $sender;
-
- return $this;
- }
-
- /**
- * Gets replyTo
- *
- * @return string
- */
- public function getReplyTo()
- {
- return $this->container['replyTo'];
- }
-
- /**
- * Sets replyTo
- *
- * @param string $replyTo Email defined as the \"Reply to\" of the campaign
- *
- * @return $this
- */
- public function setReplyTo($replyTo)
- {
- $this->container['replyTo'] = $replyTo;
-
- return $this;
- }
-
- /**
- * Gets toField
- *
- * @return string
- */
- public function getToField()
- {
- return $this->container['toField'];
- }
-
- /**
- * Sets toField
- *
- * @param string $toField Customisation of the \"to\" field of the campaign
- *
- * @return $this
- */
- public function setToField($toField)
- {
- $this->container['toField'] = $toField;
-
- return $this;
- }
-
- /**
- * Gets htmlContent
- *
- * @return string
- */
- public function getHtmlContent()
- {
- return $this->container['htmlContent'];
- }
-
- /**
- * Sets htmlContent
- *
- * @param string $htmlContent HTML content of the campaign
- *
- * @return $this
- */
- public function setHtmlContent($htmlContent)
- {
- $this->container['htmlContent'] = $htmlContent;
-
- return $this;
- }
-
- /**
- * Gets shareLink
- *
- * @return string
- */
- public function getShareLink()
- {
- return $this->container['shareLink'];
- }
-
- /**
- * Sets shareLink
- *
- * @param string $shareLink Link to share the campaign on social medias
- *
- * @return $this
- */
- public function setShareLink($shareLink)
- {
- $this->container['shareLink'] = $shareLink;
-
- return $this;
- }
-
- /**
- * Gets tag
- *
- * @return string
- */
- public function getTag()
- {
- return $this->container['tag'];
- }
-
- /**
- * Sets tag
- *
- * @param string $tag Tag of the campaign
- *
- * @return $this
- */
- public function setTag($tag)
- {
- $this->container['tag'] = $tag;
-
- return $this;
- }
-
- /**
- * Gets createdAt
- *
- * @return string
- */
- public function getCreatedAt()
- {
- return $this->container['createdAt'];
- }
-
- /**
- * Sets createdAt
- *
- * @param string $createdAt Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ)
- *
- * @return $this
- */
- public function setCreatedAt($createdAt)
- {
- $this->container['createdAt'] = $createdAt;
-
- return $this;
- }
-
- /**
- * Gets modifiedAt
- *
- * @return string
- */
- public function getModifiedAt()
- {
- return $this->container['modifiedAt'];
- }
-
- /**
- * Sets modifiedAt
- *
- * @param string $modifiedAt UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ)
- *
- * @return $this
- */
- public function setModifiedAt($modifiedAt)
- {
- $this->container['modifiedAt'] = $modifiedAt;
-
- return $this;
- }
-
- /**
- * Gets inlineImageActivation
- *
- * @return bool
- */
- public function getInlineImageActivation()
- {
- return $this->container['inlineImageActivation'];
- }
-
- /**
- * Sets inlineImageActivation
- *
- * @param bool $inlineImageActivation Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email.
- *
- * @return $this
- */
- public function setInlineImageActivation($inlineImageActivation)
- {
- $this->container['inlineImageActivation'] = $inlineImageActivation;
-
- return $this;
- }
-
- /**
- * Gets mirrorActive
- *
- * @return bool
- */
- public function getMirrorActive()
- {
- return $this->container['mirrorActive'];
- }
-
- /**
- * Sets mirrorActive
- *
- * @param bool $mirrorActive Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign
- *
- * @return $this
- */
- public function setMirrorActive($mirrorActive)
- {
- $this->container['mirrorActive'] = $mirrorActive;
-
- return $this;
- }
-
- /**
- * Gets recurring
- *
- * @return bool
- */
- public function getRecurring()
- {
- return $this->container['recurring'];
- }
-
- /**
- * Sets recurring
- *
- * @param bool $recurring FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times
- *
- * @return $this
- */
- public function setRecurring($recurring)
- {
- $this->container['recurring'] = $recurring;
-
- return $this;
- }
-
- /**
- * Gets sentDate
- *
- * @return string
- */
- public function getSentDate()
- {
- return $this->container['sentDate'];
- }
-
- /**
- * Sets sentDate
- *
- * @param string $sentDate Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent'
- *
- * @return $this
- */
- public function setSentDate($sentDate)
- {
- $this->container['sentDate'] = $sentDate;
-
- return $this;
- }
-
- /**
- * Gets returnBounce
- *
- * @return int
- */
- public function getReturnBounce()
- {
- return $this->container['returnBounce'];
- }
-
- /**
- * Sets returnBounce
- *
- * @param int $returnBounce Total number of non-delivered campaigns for a particular campaign id.
- *
- * @return $this
- */
- public function setReturnBounce($returnBounce)
- {
- $this->container['returnBounce'] = $returnBounce;
-
- return $this;
- }
-
- /**
- * Gets recipients
- *
- * @return object
- */
- public function getRecipients()
- {
- return $this->container['recipients'];
- }
-
- /**
- * Sets recipients
- *
- * @param object $recipients recipients
- *
- * @return $this
- */
- public function setRecipients($recipients)
- {
- $this->container['recipients'] = $recipients;
-
- return $this;
- }
-
- /**
- * Gets statistics
- *
- * @return object
- */
- public function getStatistics()
- {
- return $this->container['statistics'];
- }
-
- /**
- * Sets statistics
- *
- * @param object $statistics statistics
- *
- * @return $this
- */
- public function setStatistics($statistics)
- {
- $this->container['statistics'] = $statistics;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetEmailCampaigns.php b/lib/Model/GetEmailCampaigns.php
deleted file mode 100644
index 9f624c5..0000000
--- a/lib/Model/GetEmailCampaigns.php
+++ /dev/null
@@ -1,335 +0,0 @@
- 'object[]',
- 'count' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'campaigns' => null,
- 'count' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'campaigns' => 'campaigns',
- 'count' => 'count'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'campaigns' => 'setCampaigns',
- 'count' => 'setCount'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'campaigns' => 'getCampaigns',
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['campaigns'] = isset($data['campaigns']) ? $data['campaigns'] : null;
- $this->container['count'] = isset($data['count']) ? $data['count'] : null;
- }
-
- /**
- * 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 campaigns
- *
- * @return object[]
- */
- public function getCampaigns()
- {
- return $this->container['campaigns'];
- }
-
- /**
- * Sets campaigns
- *
- * @param object[] $campaigns campaigns
- *
- * @return $this
- */
- public function setCampaigns($campaigns)
- {
- $this->container['campaigns'] = $campaigns;
-
- return $this;
- }
-
- /**
- * Gets count
- *
- * @return int
- */
- public function getCount()
- {
- return $this->container['count'];
- }
-
- /**
- * Sets count
- *
- * @param int $count Number of Email campaigns retrieved
- *
- * @return $this
- */
- public function setCount($count)
- {
- $this->container['count'] = $count;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetEmailEventReport.php b/lib/Model/GetEmailEventReport.php
deleted file mode 100644
index 47d443e..0000000
--- a/lib/Model/GetEmailEventReport.php
+++ /dev/null
@@ -1,305 +0,0 @@
- '\Brevo\Client\Model\GetEmailEventReportEvents[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'events' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'events' => 'events'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'events' => 'setEvents'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'events' => 'getEvents'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['events'] = isset($data['events']) ? $data['events'] : null;
- }
-
- /**
- * 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 events
- *
- * @return \Brevo\Client\Model\GetEmailEventReportEvents[]
- */
- public function getEvents()
- {
- return $this->container['events'];
- }
-
- /**
- * Sets events
- *
- * @param \Brevo\Client\Model\GetEmailEventReportEvents[] $events events
- *
- * @return $this
- */
- public function setEvents($events)
- {
- $this->container['events'] = $events;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetEmailEventReportEvents.php b/lib/Model/GetEmailEventReportEvents.php
deleted file mode 100644
index ccaef2f..0000000
--- a/lib/Model/GetEmailEventReportEvents.php
+++ /dev/null
@@ -1,673 +0,0 @@
- 'string',
- 'date' => 'string',
- 'subject' => 'string',
- 'messageId' => 'string',
- 'event' => 'string',
- 'reason' => 'string',
- 'tag' => 'string',
- 'ip' => 'string',
- 'link' => 'string',
- 'from' => 'string',
- 'templateId' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'email' => 'email',
- 'date' => null,
- 'subject' => null,
- 'messageId' => null,
- 'event' => null,
- 'reason' => null,
- 'tag' => null,
- 'ip' => null,
- 'link' => null,
- 'from' => 'email',
- 'templateId' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'email' => 'email',
- 'date' => 'date',
- 'subject' => 'subject',
- 'messageId' => 'messageId',
- 'event' => 'event',
- 'reason' => 'reason',
- 'tag' => 'tag',
- 'ip' => 'ip',
- 'link' => 'link',
- 'from' => 'from',
- 'templateId' => 'templateId'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'email' => 'setEmail',
- 'date' => 'setDate',
- 'subject' => 'setSubject',
- 'messageId' => 'setMessageId',
- 'event' => 'setEvent',
- 'reason' => 'setReason',
- 'tag' => 'setTag',
- 'ip' => 'setIp',
- 'link' => 'setLink',
- 'from' => 'setFrom',
- 'templateId' => 'setTemplateId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'email' => 'getEmail',
- 'date' => 'getDate',
- 'subject' => 'getSubject',
- 'messageId' => 'getMessageId',
- 'event' => 'getEvent',
- 'reason' => 'getReason',
- 'tag' => 'getTag',
- 'ip' => 'getIp',
- 'link' => 'getLink',
- 'from' => 'getFrom',
- 'templateId' => 'getTemplateId'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const EVENT_BOUNCES = 'bounces';
- const EVENT_HARD_BOUNCES = 'hardBounces';
- const EVENT_SOFT_BOUNCES = 'softBounces';
- const EVENT_DELIVERED = 'delivered';
- const EVENT_SPAM = 'spam';
- const EVENT_REQUESTS = 'requests';
- const EVENT_OPENED = 'opened';
- const EVENT_CLICKS = 'clicks';
- const EVENT_INVALID = 'invalid';
- const EVENT_DEFERRED = 'deferred';
- const EVENT_BLOCKED = 'blocked';
- const EVENT_UNSUBSCRIBED = 'unsubscribed';
- const EVENT_ERROR = 'error';
- const EVENT_LOADED_BY_PROXY = 'loadedByProxy';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getEventAllowableValues()
- {
- return [
- self::EVENT_BOUNCES,
- self::EVENT_HARD_BOUNCES,
- self::EVENT_SOFT_BOUNCES,
- self::EVENT_DELIVERED,
- self::EVENT_SPAM,
- self::EVENT_REQUESTS,
- self::EVENT_OPENED,
- self::EVENT_CLICKS,
- self::EVENT_INVALID,
- self::EVENT_DEFERRED,
- self::EVENT_BLOCKED,
- self::EVENT_UNSUBSCRIBED,
- self::EVENT_ERROR,
- self::EVENT_LOADED_BY_PROXY,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['date'] = isset($data['date']) ? $data['date'] : null;
- $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null;
- $this->container['messageId'] = isset($data['messageId']) ? $data['messageId'] : null;
- $this->container['event'] = isset($data['event']) ? $data['event'] : null;
- $this->container['reason'] = isset($data['reason']) ? $data['reason'] : null;
- $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null;
- $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null;
- $this->container['link'] = isset($data['link']) ? $data['link'] : null;
- $this->container['from'] = isset($data['from']) ? $data['from'] : null;
- $this->container['templateId'] = isset($data['templateId']) ? $data['templateId'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['email'] === null) {
- $invalidProperties[] = "'email' can't be null";
- }
- if ($this->container['date'] === null) {
- $invalidProperties[] = "'date' can't be null";
- }
- if ($this->container['messageId'] === null) {
- $invalidProperties[] = "'messageId' can't be null";
- }
- if ($this->container['event'] === null) {
- $invalidProperties[] = "'event' can't be null";
- }
- $allowedValues = $this->getEventAllowableValues();
- if (!is_null($this->container['event']) && !in_array($this->container['event'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'event', must be one of '%s'",
- 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 email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Email address which generates the event
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets date
- *
- * @return string
- */
- public function getDate()
- {
- return $this->container['date'];
- }
-
- /**
- * Sets date
- *
- * @param string $date UTC date-time on which the event has been generated
- *
- * @return $this
- */
- public function setDate($date)
- {
- $this->container['date'] = $date;
-
- return $this;
- }
-
- /**
- * Gets subject
- *
- * @return string
- */
- public function getSubject()
- {
- return $this->container['subject'];
- }
-
- /**
- * Sets subject
- *
- * @param string $subject Subject of the event
- *
- * @return $this
- */
- public function setSubject($subject)
- {
- $this->container['subject'] = $subject;
-
- return $this;
- }
-
- /**
- * Gets messageId
- *
- * @return string
- */
- public function getMessageId()
- {
- return $this->container['messageId'];
- }
-
- /**
- * Sets messageId
- *
- * @param string $messageId Message ID which generated the event
- *
- * @return $this
- */
- public function setMessageId($messageId)
- {
- $this->container['messageId'] = $messageId;
-
- return $this;
- }
-
- /**
- * Gets event
- *
- * @return string
- */
- public function getEvent()
- {
- return $this->container['event'];
- }
-
- /**
- * Sets event
- *
- * @param string $event Event which occurred
- *
- * @return $this
- */
- public function setEvent($event)
- {
- $allowedValues = $this->getEventAllowableValues();
- if (!in_array($event, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'event', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['event'] = $event;
-
- return $this;
- }
-
- /**
- * Gets reason
- *
- * @return string
- */
- public function getReason()
- {
- return $this->container['reason'];
- }
-
- /**
- * Sets reason
- *
- * @param string $reason Reason of bounce (only available if the event is hardbounce or softbounce)
- *
- * @return $this
- */
- public function setReason($reason)
- {
- $this->container['reason'] = $reason;
-
- return $this;
- }
-
- /**
- * Gets tag
- *
- * @return string
- */
- public function getTag()
- {
- return $this->container['tag'];
- }
-
- /**
- * Sets tag
- *
- * @param string $tag Tag of the email which generated the event
- *
- * @return $this
- */
- public function setTag($tag)
- {
- $this->container['tag'] = $tag;
-
- return $this;
- }
-
- /**
- * Gets ip
- *
- * @return string
- */
- public function getIp()
- {
- return $this->container['ip'];
- }
-
- /**
- * Sets ip
- *
- * @param string $ip IP from which the user has opened the email or clicked on the link (only available if the event is opened or clicks)
- *
- * @return $this
- */
- public function setIp($ip)
- {
- $this->container['ip'] = $ip;
-
- return $this;
- }
-
- /**
- * Gets link
- *
- * @return string
- */
- public function getLink()
- {
- return $this->container['link'];
- }
-
- /**
- * Sets link
- *
- * @param string $link The link which is sent to the user (only available if the event is requests or opened or clicks)
- *
- * @return $this
- */
- public function setLink($link)
- {
- $this->container['link'] = $link;
-
- return $this;
- }
-
- /**
- * Gets from
- *
- * @return string
- */
- public function getFrom()
- {
- return $this->container['from'];
- }
-
- /**
- * Sets from
- *
- * @param string $from Sender email from which the emails are sent
- *
- * @return $this
- */
- public function setFrom($from)
- {
- $this->container['from'] = $from;
-
- return $this;
- }
-
- /**
- * Gets templateId
- *
- * @return int
- */
- public function getTemplateId()
- {
- return $this->container['templateId'];
- }
-
- /**
- * Sets templateId
- *
- * @param int $templateId ID of the template (only available if the email is template based)
- *
- * @return $this
- */
- public function setTemplateId($templateId)
- {
- $this->container['templateId'] = $templateId;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetExtendedCampaignOverview.php b/lib/Model/GetExtendedCampaignOverview.php
deleted file mode 100644
index cd7b110..0000000
--- a/lib/Model/GetExtendedCampaignOverview.php
+++ /dev/null
@@ -1,1254 +0,0 @@
- 'int',
- 'name' => 'string',
- 'subject' => 'string',
- 'type' => 'string',
- 'status' => 'string',
- 'scheduledAt' => 'string',
- 'abTesting' => 'bool',
- 'subjectA' => 'string',
- 'subjectB' => 'string',
- 'splitRule' => 'int',
- 'winnerCriteria' => 'string',
- 'winnerDelay' => 'int',
- 'sendAtBestTime' => 'bool',
- 'testSent' => 'bool',
- 'header' => 'string',
- 'footer' => 'string',
- 'sender' => '\Brevo\Client\Model\GetExtendedCampaignOverviewSender',
- 'replyTo' => 'string',
- 'toField' => 'string',
- 'htmlContent' => 'string',
- 'shareLink' => 'string',
- 'tag' => 'string',
- 'createdAt' => 'string',
- 'modifiedAt' => 'string',
- 'inlineImageActivation' => 'bool',
- 'mirrorActive' => 'bool',
- 'recurring' => 'bool',
- 'sentDate' => 'string',
- 'returnBounce' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'int64',
- 'name' => null,
- 'subject' => null,
- 'type' => null,
- 'status' => null,
- 'scheduledAt' => null,
- 'abTesting' => null,
- 'subjectA' => null,
- 'subjectB' => null,
- 'splitRule' => null,
- 'winnerCriteria' => null,
- 'winnerDelay' => null,
- 'sendAtBestTime' => null,
- 'testSent' => null,
- 'header' => null,
- 'footer' => null,
- 'sender' => null,
- 'replyTo' => 'email',
- 'toField' => null,
- 'htmlContent' => null,
- 'shareLink' => 'url',
- 'tag' => null,
- 'createdAt' => null,
- 'modifiedAt' => null,
- 'inlineImageActivation' => null,
- 'mirrorActive' => null,
- 'recurring' => null,
- 'sentDate' => null,
- 'returnBounce' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'name' => 'name',
- 'subject' => 'subject',
- 'type' => 'type',
- 'status' => 'status',
- 'scheduledAt' => 'scheduledAt',
- 'abTesting' => 'abTesting',
- 'subjectA' => 'subjectA',
- 'subjectB' => 'subjectB',
- 'splitRule' => 'splitRule',
- 'winnerCriteria' => 'winnerCriteria',
- 'winnerDelay' => 'winnerDelay',
- 'sendAtBestTime' => 'sendAtBestTime',
- 'testSent' => 'testSent',
- 'header' => 'header',
- 'footer' => 'footer',
- 'sender' => 'sender',
- 'replyTo' => 'replyTo',
- 'toField' => 'toField',
- 'htmlContent' => 'htmlContent',
- 'shareLink' => 'shareLink',
- 'tag' => 'tag',
- 'createdAt' => 'createdAt',
- 'modifiedAt' => 'modifiedAt',
- 'inlineImageActivation' => 'inlineImageActivation',
- 'mirrorActive' => 'mirrorActive',
- 'recurring' => 'recurring',
- 'sentDate' => 'sentDate',
- 'returnBounce' => 'returnBounce'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'name' => 'setName',
- 'subject' => 'setSubject',
- 'type' => 'setType',
- 'status' => 'setStatus',
- 'scheduledAt' => 'setScheduledAt',
- 'abTesting' => 'setAbTesting',
- 'subjectA' => 'setSubjectA',
- 'subjectB' => 'setSubjectB',
- 'splitRule' => 'setSplitRule',
- 'winnerCriteria' => 'setWinnerCriteria',
- 'winnerDelay' => 'setWinnerDelay',
- 'sendAtBestTime' => 'setSendAtBestTime',
- 'testSent' => 'setTestSent',
- 'header' => 'setHeader',
- 'footer' => 'setFooter',
- 'sender' => 'setSender',
- 'replyTo' => 'setReplyTo',
- 'toField' => 'setToField',
- 'htmlContent' => 'setHtmlContent',
- 'shareLink' => 'setShareLink',
- 'tag' => 'setTag',
- 'createdAt' => 'setCreatedAt',
- 'modifiedAt' => 'setModifiedAt',
- 'inlineImageActivation' => 'setInlineImageActivation',
- 'mirrorActive' => 'setMirrorActive',
- 'recurring' => 'setRecurring',
- 'sentDate' => 'setSentDate',
- 'returnBounce' => 'setReturnBounce'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'name' => 'getName',
- 'subject' => 'getSubject',
- 'type' => 'getType',
- 'status' => 'getStatus',
- 'scheduledAt' => 'getScheduledAt',
- 'abTesting' => 'getAbTesting',
- 'subjectA' => 'getSubjectA',
- 'subjectB' => 'getSubjectB',
- 'splitRule' => 'getSplitRule',
- 'winnerCriteria' => 'getWinnerCriteria',
- 'winnerDelay' => 'getWinnerDelay',
- 'sendAtBestTime' => 'getSendAtBestTime',
- 'testSent' => 'getTestSent',
- 'header' => 'getHeader',
- 'footer' => 'getFooter',
- 'sender' => 'getSender',
- 'replyTo' => 'getReplyTo',
- 'toField' => 'getToField',
- 'htmlContent' => 'getHtmlContent',
- 'shareLink' => 'getShareLink',
- 'tag' => 'getTag',
- 'createdAt' => 'getCreatedAt',
- 'modifiedAt' => 'getModifiedAt',
- 'inlineImageActivation' => 'getInlineImageActivation',
- 'mirrorActive' => 'getMirrorActive',
- 'recurring' => 'getRecurring',
- 'sentDate' => 'getSentDate',
- 'returnBounce' => 'getReturnBounce'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const TYPE_CLASSIC = 'classic';
- const TYPE_TRIGGER = 'trigger';
- const STATUS_DRAFT = 'draft';
- const STATUS_SENT = 'sent';
- const STATUS_ARCHIVE = 'archive';
- const STATUS_QUEUED = 'queued';
- const STATUS_SUSPENDED = 'suspended';
- const STATUS_IN_PROCESS = 'in_process';
-
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getTypeAllowableValues()
- {
- return [
- self::TYPE_CLASSIC,
- self::TYPE_TRIGGER,
- ];
- }
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getStatusAllowableValues()
- {
- return [
- self::STATUS_DRAFT,
- self::STATUS_SENT,
- self::STATUS_ARCHIVE,
- self::STATUS_QUEUED,
- self::STATUS_SUSPENDED,
- self::STATUS_IN_PROCESS,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null;
- $this->container['type'] = isset($data['type']) ? $data['type'] : null;
- $this->container['status'] = isset($data['status']) ? $data['status'] : null;
- $this->container['scheduledAt'] = isset($data['scheduledAt']) ? $data['scheduledAt'] : null;
- $this->container['abTesting'] = isset($data['abTesting']) ? $data['abTesting'] : null;
- $this->container['subjectA'] = isset($data['subjectA']) ? $data['subjectA'] : null;
- $this->container['subjectB'] = isset($data['subjectB']) ? $data['subjectB'] : null;
- $this->container['splitRule'] = isset($data['splitRule']) ? $data['splitRule'] : null;
- $this->container['winnerCriteria'] = isset($data['winnerCriteria']) ? $data['winnerCriteria'] : null;
- $this->container['winnerDelay'] = isset($data['winnerDelay']) ? $data['winnerDelay'] : null;
- $this->container['sendAtBestTime'] = isset($data['sendAtBestTime']) ? $data['sendAtBestTime'] : null;
- $this->container['testSent'] = isset($data['testSent']) ? $data['testSent'] : null;
- $this->container['header'] = isset($data['header']) ? $data['header'] : null;
- $this->container['footer'] = isset($data['footer']) ? $data['footer'] : null;
- $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null;
- $this->container['replyTo'] = isset($data['replyTo']) ? $data['replyTo'] : null;
- $this->container['toField'] = isset($data['toField']) ? $data['toField'] : null;
- $this->container['htmlContent'] = isset($data['htmlContent']) ? $data['htmlContent'] : null;
- $this->container['shareLink'] = isset($data['shareLink']) ? $data['shareLink'] : null;
- $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null;
- $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null;
- $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null;
- $this->container['inlineImageActivation'] = isset($data['inlineImageActivation']) ? $data['inlineImageActivation'] : null;
- $this->container['mirrorActive'] = isset($data['mirrorActive']) ? $data['mirrorActive'] : null;
- $this->container['recurring'] = isset($data['recurring']) ? $data['recurring'] : null;
- $this->container['sentDate'] = isset($data['sentDate']) ? $data['sentDate'] : null;
- $this->container['returnBounce'] = isset($data['returnBounce']) ? $data['returnBounce'] : null;
- }
-
- /**
- * 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['name'] === null) {
- $invalidProperties[] = "'name' can't be null";
- }
- if ($this->container['type'] === null) {
- $invalidProperties[] = "'type' can't be null";
- }
- $allowedValues = $this->getTypeAllowableValues();
- if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'type', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- if ($this->container['status'] === null) {
- $invalidProperties[] = "'status' can't be null";
- }
- $allowedValues = $this->getStatusAllowableValues();
- if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'status', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- if ($this->container['testSent'] === null) {
- $invalidProperties[] = "'testSent' can't be null";
- }
- if ($this->container['header'] === null) {
- $invalidProperties[] = "'header' can't be null";
- }
- if ($this->container['footer'] === null) {
- $invalidProperties[] = "'footer' can't be null";
- }
- if ($this->container['sender'] === null) {
- $invalidProperties[] = "'sender' can't be null";
- }
- if ($this->container['replyTo'] === null) {
- $invalidProperties[] = "'replyTo' can't be null";
- }
- if ($this->container['htmlContent'] === null) {
- $invalidProperties[] = "'htmlContent' can't be null";
- }
- if ($this->container['createdAt'] === null) {
- $invalidProperties[] = "'createdAt' can't be null";
- }
- if ($this->container['modifiedAt'] === null) {
- $invalidProperties[] = "'modifiedAt' 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 int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id ID of the campaign
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the campaign
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets subject
- *
- * @return string
- */
- public function getSubject()
- {
- return $this->container['subject'];
- }
-
- /**
- * Sets subject
- *
- * @param string $subject Subject of the campaign. Only available if `abTesting` flag of the campaign is `false`
- *
- * @return $this
- */
- public function setSubject($subject)
- {
- $this->container['subject'] = $subject;
-
- return $this;
- }
-
- /**
- * Gets type
- *
- * @return string
- */
- public function getType()
- {
- return $this->container['type'];
- }
-
- /**
- * Sets type
- *
- * @param string $type Type of campaign
- *
- * @return $this
- */
- public function setType($type)
- {
- $allowedValues = $this->getTypeAllowableValues();
- if (!in_array($type, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'type', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['type'] = $type;
-
- return $this;
- }
-
- /**
- * Gets status
- *
- * @return string
- */
- public function getStatus()
- {
- return $this->container['status'];
- }
-
- /**
- * Sets status
- *
- * @param string $status Status of the campaign
- *
- * @return $this
- */
- public function setStatus($status)
- {
- $allowedValues = $this->getStatusAllowableValues();
- if (!in_array($status, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'status', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['status'] = $status;
-
- return $this;
- }
-
- /**
- * Gets scheduledAt
- *
- * @return string
- */
- public function getScheduledAt()
- {
- return $this->container['scheduledAt'];
- }
-
- /**
- * Sets scheduledAt
- *
- * @param string $scheduledAt UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ)
- *
- * @return $this
- */
- public function setScheduledAt($scheduledAt)
- {
- $this->container['scheduledAt'] = $scheduledAt;
-
- return $this;
- }
-
- /**
- * Gets abTesting
- *
- * @return bool
- */
- public function getAbTesting()
- {
- return $this->container['abTesting'];
- }
-
- /**
- * Sets abTesting
- *
- * @param bool $abTesting Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled.
- *
- * @return $this
- */
- public function setAbTesting($abTesting)
- {
- $this->container['abTesting'] = $abTesting;
-
- return $this;
- }
-
- /**
- * Gets subjectA
- *
- * @return string
- */
- public function getSubjectA()
- {
- return $this->container['subjectA'];
- }
-
- /**
- * Sets subjectA
- *
- * @param string $subjectA Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true`
- *
- * @return $this
- */
- public function setSubjectA($subjectA)
- {
- $this->container['subjectA'] = $subjectA;
-
- return $this;
- }
-
- /**
- * Gets subjectB
- *
- * @return string
- */
- public function getSubjectB()
- {
- return $this->container['subjectB'];
- }
-
- /**
- * Sets subjectB
- *
- * @param string $subjectB Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true`
- *
- * @return $this
- */
- public function setSubjectB($subjectB)
- {
- $this->container['subjectB'] = $subjectB;
-
- return $this;
- }
-
- /**
- * Gets splitRule
- *
- * @return int
- */
- public function getSplitRule()
- {
- return $this->container['splitRule'];
- }
-
- /**
- * Sets splitRule
- *
- * @param int $splitRule The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true`
- *
- * @return $this
- */
- public function setSplitRule($splitRule)
- {
- $this->container['splitRule'] = $splitRule;
-
- return $this;
- }
-
- /**
- * Gets winnerCriteria
- *
- * @return string
- */
- public function getWinnerCriteria()
- {
- return $this->container['winnerCriteria'];
- }
-
- /**
- * Sets winnerCriteria
- *
- * @param string $winnerCriteria Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true`
- *
- * @return $this
- */
- public function setWinnerCriteria($winnerCriteria)
- {
- $this->container['winnerCriteria'] = $winnerCriteria;
-
- return $this;
- }
-
- /**
- * Gets winnerDelay
- *
- * @return int
- */
- public function getWinnerDelay()
- {
- return $this->container['winnerDelay'];
- }
-
- /**
- * Sets winnerDelay
- *
- * @param int $winnerDelay The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true`
- *
- * @return $this
- */
- public function setWinnerDelay($winnerDelay)
- {
- $this->container['winnerDelay'] = $winnerDelay;
-
- return $this;
- }
-
- /**
- * Gets sendAtBestTime
- *
- * @return bool
- */
- public function getSendAtBestTime()
- {
- return $this->container['sendAtBestTime'];
- }
-
- /**
- * Sets sendAtBestTime
- *
- * @param bool $sendAtBestTime It is true if you have chosen to send your campaign at best time, otherwise it is false
- *
- * @return $this
- */
- public function setSendAtBestTime($sendAtBestTime)
- {
- $this->container['sendAtBestTime'] = $sendAtBestTime;
-
- return $this;
- }
-
- /**
- * Gets testSent
- *
- * @return bool
- */
- public function getTestSent()
- {
- return $this->container['testSent'];
- }
-
- /**
- * Sets testSent
- *
- * @param bool $testSent Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent)
- *
- * @return $this
- */
- public function setTestSent($testSent)
- {
- $this->container['testSent'] = $testSent;
-
- return $this;
- }
-
- /**
- * Gets header
- *
- * @return string
- */
- public function getHeader()
- {
- return $this->container['header'];
- }
-
- /**
- * Sets header
- *
- * @param string $header Header of the campaign
- *
- * @return $this
- */
- public function setHeader($header)
- {
- $this->container['header'] = $header;
-
- return $this;
- }
-
- /**
- * Gets footer
- *
- * @return string
- */
- public function getFooter()
- {
- return $this->container['footer'];
- }
-
- /**
- * Sets footer
- *
- * @param string $footer Footer of the campaign
- *
- * @return $this
- */
- public function setFooter($footer)
- {
- $this->container['footer'] = $footer;
-
- return $this;
- }
-
- /**
- * Gets sender
- *
- * @return \Brevo\Client\Model\GetExtendedCampaignOverviewSender
- */
- public function getSender()
- {
- return $this->container['sender'];
- }
-
- /**
- * Sets sender
- *
- * @param \Brevo\Client\Model\GetExtendedCampaignOverviewSender $sender sender
- *
- * @return $this
- */
- public function setSender($sender)
- {
- $this->container['sender'] = $sender;
-
- return $this;
- }
-
- /**
- * Gets replyTo
- *
- * @return string
- */
- public function getReplyTo()
- {
- return $this->container['replyTo'];
- }
-
- /**
- * Sets replyTo
- *
- * @param string $replyTo Email defined as the \"Reply to\" of the campaign
- *
- * @return $this
- */
- public function setReplyTo($replyTo)
- {
- $this->container['replyTo'] = $replyTo;
-
- return $this;
- }
-
- /**
- * Gets toField
- *
- * @return string
- */
- public function getToField()
- {
- return $this->container['toField'];
- }
-
- /**
- * Sets toField
- *
- * @param string $toField Customisation of the \"to\" field of the campaign
- *
- * @return $this
- */
- public function setToField($toField)
- {
- $this->container['toField'] = $toField;
-
- return $this;
- }
-
- /**
- * Gets htmlContent
- *
- * @return string
- */
- public function getHtmlContent()
- {
- return $this->container['htmlContent'];
- }
-
- /**
- * Sets htmlContent
- *
- * @param string $htmlContent HTML content of the campaign
- *
- * @return $this
- */
- public function setHtmlContent($htmlContent)
- {
- $this->container['htmlContent'] = $htmlContent;
-
- return $this;
- }
-
- /**
- * Gets shareLink
- *
- * @return string
- */
- public function getShareLink()
- {
- return $this->container['shareLink'];
- }
-
- /**
- * Sets shareLink
- *
- * @param string $shareLink Link to share the campaign on social medias
- *
- * @return $this
- */
- public function setShareLink($shareLink)
- {
- $this->container['shareLink'] = $shareLink;
-
- return $this;
- }
-
- /**
- * Gets tag
- *
- * @return string
- */
- public function getTag()
- {
- return $this->container['tag'];
- }
-
- /**
- * Sets tag
- *
- * @param string $tag Tag of the campaign
- *
- * @return $this
- */
- public function setTag($tag)
- {
- $this->container['tag'] = $tag;
-
- return $this;
- }
-
- /**
- * Gets createdAt
- *
- * @return string
- */
- public function getCreatedAt()
- {
- return $this->container['createdAt'];
- }
-
- /**
- * Sets createdAt
- *
- * @param string $createdAt Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ)
- *
- * @return $this
- */
- public function setCreatedAt($createdAt)
- {
- $this->container['createdAt'] = $createdAt;
-
- return $this;
- }
-
- /**
- * Gets modifiedAt
- *
- * @return string
- */
- public function getModifiedAt()
- {
- return $this->container['modifiedAt'];
- }
-
- /**
- * Sets modifiedAt
- *
- * @param string $modifiedAt UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ)
- *
- * @return $this
- */
- public function setModifiedAt($modifiedAt)
- {
- $this->container['modifiedAt'] = $modifiedAt;
-
- return $this;
- }
-
- /**
- * Gets inlineImageActivation
- *
- * @return bool
- */
- public function getInlineImageActivation()
- {
- return $this->container['inlineImageActivation'];
- }
-
- /**
- * Sets inlineImageActivation
- *
- * @param bool $inlineImageActivation Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email.
- *
- * @return $this
- */
- public function setInlineImageActivation($inlineImageActivation)
- {
- $this->container['inlineImageActivation'] = $inlineImageActivation;
-
- return $this;
- }
-
- /**
- * Gets mirrorActive
- *
- * @return bool
- */
- public function getMirrorActive()
- {
- return $this->container['mirrorActive'];
- }
-
- /**
- * Sets mirrorActive
- *
- * @param bool $mirrorActive Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign
- *
- * @return $this
- */
- public function setMirrorActive($mirrorActive)
- {
- $this->container['mirrorActive'] = $mirrorActive;
-
- return $this;
- }
-
- /**
- * Gets recurring
- *
- * @return bool
- */
- public function getRecurring()
- {
- return $this->container['recurring'];
- }
-
- /**
- * Sets recurring
- *
- * @param bool $recurring FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times
- *
- * @return $this
- */
- public function setRecurring($recurring)
- {
- $this->container['recurring'] = $recurring;
-
- return $this;
- }
-
- /**
- * Gets sentDate
- *
- * @return string
- */
- public function getSentDate()
- {
- return $this->container['sentDate'];
- }
-
- /**
- * Sets sentDate
- *
- * @param string $sentDate Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent'
- *
- * @return $this
- */
- public function setSentDate($sentDate)
- {
- $this->container['sentDate'] = $sentDate;
-
- return $this;
- }
-
- /**
- * Gets returnBounce
- *
- * @return int
- */
- public function getReturnBounce()
- {
- return $this->container['returnBounce'];
- }
-
- /**
- * Sets returnBounce
- *
- * @param int $returnBounce Total number of non-delivered campaigns for a particular campaign id.
- *
- * @return $this
- */
- public function setReturnBounce($returnBounce)
- {
- $this->container['returnBounce'] = $returnBounce;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetExtendedCampaignOverviewSender.php b/lib/Model/GetExtendedCampaignOverviewSender.php
deleted file mode 100644
index eb289f5..0000000
--- a/lib/Model/GetExtendedCampaignOverviewSender.php
+++ /dev/null
@@ -1,365 +0,0 @@
- 'string',
- 'email' => 'string',
- 'id' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'email' => 'email',
- 'id' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'email' => 'email',
- 'id' => 'id'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'email' => 'setEmail',
- 'id' => 'setId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'email' => 'getEmail',
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- }
-
- /**
- * 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Sender name of the campaign
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Sender email of the campaign
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets id
- *
- * @return int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id Sender id of the campaign
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetExtendedCampaignStats.php b/lib/Model/GetExtendedCampaignStats.php
deleted file mode 100644
index efe202a..0000000
--- a/lib/Model/GetExtendedCampaignStats.php
+++ /dev/null
@@ -1,539 +0,0 @@
- '\Brevo\Client\Model\GetExtendedCampaignStatsGlobalStats',
- 'campaignStats' => 'object[]',
- 'mirrorClick' => 'int',
- 'remaining' => 'int',
- 'linksStats' => 'object',
- 'statsByDomain' => '\Brevo\Client\Model\GetStatsByDomain',
- 'statsByDevice' => '\Brevo\Client\Model\GetStatsByDevice',
- 'statsByBrowser' => '\Brevo\Client\Model\GetStatsByBrowser'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'globalStats' => null,
- 'campaignStats' => null,
- 'mirrorClick' => 'int64',
- 'remaining' => 'int64',
- 'linksStats' => null,
- 'statsByDomain' => null,
- 'statsByDevice' => null,
- 'statsByBrowser' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'globalStats' => 'globalStats',
- 'campaignStats' => 'campaignStats',
- 'mirrorClick' => 'mirrorClick',
- 'remaining' => 'remaining',
- 'linksStats' => 'linksStats',
- 'statsByDomain' => 'statsByDomain',
- 'statsByDevice' => 'statsByDevice',
- 'statsByBrowser' => 'statsByBrowser'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'globalStats' => 'setGlobalStats',
- 'campaignStats' => 'setCampaignStats',
- 'mirrorClick' => 'setMirrorClick',
- 'remaining' => 'setRemaining',
- 'linksStats' => 'setLinksStats',
- 'statsByDomain' => 'setStatsByDomain',
- 'statsByDevice' => 'setStatsByDevice',
- 'statsByBrowser' => 'setStatsByBrowser'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'globalStats' => 'getGlobalStats',
- 'campaignStats' => 'getCampaignStats',
- 'mirrorClick' => 'getMirrorClick',
- 'remaining' => 'getRemaining',
- 'linksStats' => 'getLinksStats',
- 'statsByDomain' => 'getStatsByDomain',
- 'statsByDevice' => 'getStatsByDevice',
- 'statsByBrowser' => 'getStatsByBrowser'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['globalStats'] = isset($data['globalStats']) ? $data['globalStats'] : null;
- $this->container['campaignStats'] = isset($data['campaignStats']) ? $data['campaignStats'] : null;
- $this->container['mirrorClick'] = isset($data['mirrorClick']) ? $data['mirrorClick'] : null;
- $this->container['remaining'] = isset($data['remaining']) ? $data['remaining'] : null;
- $this->container['linksStats'] = isset($data['linksStats']) ? $data['linksStats'] : null;
- $this->container['statsByDomain'] = isset($data['statsByDomain']) ? $data['statsByDomain'] : null;
- $this->container['statsByDevice'] = isset($data['statsByDevice']) ? $data['statsByDevice'] : null;
- $this->container['statsByBrowser'] = isset($data['statsByBrowser']) ? $data['statsByBrowser'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['globalStats'] === null) {
- $invalidProperties[] = "'globalStats' can't be null";
- }
- if ($this->container['campaignStats'] === null) {
- $invalidProperties[] = "'campaignStats' can't be null";
- }
- if ($this->container['mirrorClick'] === null) {
- $invalidProperties[] = "'mirrorClick' can't be null";
- }
- if ($this->container['remaining'] === null) {
- $invalidProperties[] = "'remaining' can't be null";
- }
- if ($this->container['linksStats'] === null) {
- $invalidProperties[] = "'linksStats' can't be null";
- }
- if ($this->container['statsByDomain'] === null) {
- $invalidProperties[] = "'statsByDomain' can't be null";
- }
- if ($this->container['statsByDevice'] === null) {
- $invalidProperties[] = "'statsByDevice' can't be null";
- }
- if ($this->container['statsByBrowser'] === null) {
- $invalidProperties[] = "'statsByBrowser' 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 globalStats
- *
- * @return \Brevo\Client\Model\GetExtendedCampaignStatsGlobalStats
- */
- public function getGlobalStats()
- {
- return $this->container['globalStats'];
- }
-
- /**
- * Sets globalStats
- *
- * @param \Brevo\Client\Model\GetExtendedCampaignStatsGlobalStats $globalStats globalStats
- *
- * @return $this
- */
- public function setGlobalStats($globalStats)
- {
- $this->container['globalStats'] = $globalStats;
-
- return $this;
- }
-
- /**
- * Gets campaignStats
- *
- * @return object[]
- */
- public function getCampaignStats()
- {
- return $this->container['campaignStats'];
- }
-
- /**
- * Sets campaignStats
- *
- * @param object[] $campaignStats List-wise statistics of the campaign.
- *
- * @return $this
- */
- public function setCampaignStats($campaignStats)
- {
- $this->container['campaignStats'] = $campaignStats;
-
- return $this;
- }
-
- /**
- * Gets mirrorClick
- *
- * @return int
- */
- public function getMirrorClick()
- {
- return $this->container['mirrorClick'];
- }
-
- /**
- * Sets mirrorClick
- *
- * @param int $mirrorClick Number of clicks on mirror link
- *
- * @return $this
- */
- public function setMirrorClick($mirrorClick)
- {
- $this->container['mirrorClick'] = $mirrorClick;
-
- return $this;
- }
-
- /**
- * Gets remaining
- *
- * @return int
- */
- public function getRemaining()
- {
- return $this->container['remaining'];
- }
-
- /**
- * Sets remaining
- *
- * @param int $remaining Number of remaning emails to send
- *
- * @return $this
- */
- public function setRemaining($remaining)
- {
- $this->container['remaining'] = $remaining;
-
- return $this;
- }
-
- /**
- * Gets linksStats
- *
- * @return object
- */
- public function getLinksStats()
- {
- return $this->container['linksStats'];
- }
-
- /**
- * Sets linksStats
- *
- * @param object $linksStats Statistics about the number of clicks for the links
- *
- * @return $this
- */
- public function setLinksStats($linksStats)
- {
- $this->container['linksStats'] = $linksStats;
-
- return $this;
- }
-
- /**
- * Gets statsByDomain
- *
- * @return \Brevo\Client\Model\GetStatsByDomain
- */
- public function getStatsByDomain()
- {
- return $this->container['statsByDomain'];
- }
-
- /**
- * Sets statsByDomain
- *
- * @param \Brevo\Client\Model\GetStatsByDomain $statsByDomain statsByDomain
- *
- * @return $this
- */
- public function setStatsByDomain($statsByDomain)
- {
- $this->container['statsByDomain'] = $statsByDomain;
-
- return $this;
- }
-
- /**
- * Gets statsByDevice
- *
- * @return \Brevo\Client\Model\GetStatsByDevice
- */
- public function getStatsByDevice()
- {
- return $this->container['statsByDevice'];
- }
-
- /**
- * Sets statsByDevice
- *
- * @param \Brevo\Client\Model\GetStatsByDevice $statsByDevice Statistics about the campaign on the basis of various devices
- *
- * @return $this
- */
- public function setStatsByDevice($statsByDevice)
- {
- $this->container['statsByDevice'] = $statsByDevice;
-
- return $this;
- }
-
- /**
- * Gets statsByBrowser
- *
- * @return \Brevo\Client\Model\GetStatsByBrowser
- */
- public function getStatsByBrowser()
- {
- return $this->container['statsByBrowser'];
- }
-
- /**
- * Sets statsByBrowser
- *
- * @param \Brevo\Client\Model\GetStatsByBrowser $statsByBrowser Statistics about the campaign on the basis of various browsers
- *
- * @return $this
- */
- public function setStatsByBrowser($statsByBrowser)
- {
- $this->container['statsByBrowser'] = $statsByBrowser;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetExtendedCampaignStatsGlobalStats.php b/lib/Model/GetExtendedCampaignStatsGlobalStats.php
deleted file mode 100644
index 03d1ced..0000000
--- a/lib/Model/GetExtendedCampaignStatsGlobalStats.php
+++ /dev/null
@@ -1,281 +0,0 @@
-listInvalidProperties()) === 0;
- }
-
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetExtendedClient.php b/lib/Model/GetExtendedClient.php
deleted file mode 100644
index a4eb983..0000000
--- a/lib/Model/GetExtendedClient.php
+++ /dev/null
@@ -1,302 +0,0 @@
- '\Brevo\Client\Model\GetExtendedClientAddress'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'address' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes + parent::swaggerTypes();
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats + parent::swaggerFormats();
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'address' => 'address'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'address' => 'setAddress'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'address' => 'getAddress'
- ];
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @return array
- */
- public static function attributeMap()
- {
- return parent::attributeMap() + self::$attributeMap;
- }
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @return array
- */
- public static function setters()
- {
- return parent::setters() + self::$setters;
- }
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @return array
- */
- public static function getters()
- {
- return parent::getters() + self::$getters;
- }
-
- /**
- * The original name of the model.
- *
- * @return string
- */
- public function getModelName()
- {
- return self::$swaggerModelName;
- }
-
-
-
-
-
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- parent::__construct($data);
-
- $this->container['address'] = isset($data['address']) ? $data['address'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = parent::listInvalidProperties();
-
- if ($this->container['address'] === null) {
- $invalidProperties[] = "'address' 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 address
- *
- * @return \Brevo\Client\Model\GetExtendedClientAddress
- */
- public function getAddress()
- {
- return $this->container['address'];
- }
-
- /**
- * Sets address
- *
- * @param \Brevo\Client\Model\GetExtendedClientAddress $address address
- *
- * @return $this
- */
- public function setAddress($address)
- {
- $this->container['address'] = $address;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetExtendedClientAddress.php b/lib/Model/GetExtendedClientAddress.php
deleted file mode 100644
index 7b4691f..0000000
--- a/lib/Model/GetExtendedClientAddress.php
+++ /dev/null
@@ -1,408 +0,0 @@
- 'string',
- 'city' => 'string',
- 'zipCode' => 'string',
- 'country' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'street' => null,
- 'city' => null,
- 'zipCode' => null,
- 'country' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'street' => 'street',
- 'city' => 'city',
- 'zipCode' => 'zipCode',
- 'country' => 'country'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'street' => 'setStreet',
- 'city' => 'setCity',
- 'zipCode' => 'setZipCode',
- 'country' => 'setCountry'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'street' => 'getStreet',
- 'city' => 'getCity',
- 'zipCode' => 'getZipCode',
- 'country' => 'getCountry'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['street'] = isset($data['street']) ? $data['street'] : null;
- $this->container['city'] = isset($data['city']) ? $data['city'] : null;
- $this->container['zipCode'] = isset($data['zipCode']) ? $data['zipCode'] : null;
- $this->container['country'] = isset($data['country']) ? $data['country'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['street'] === null) {
- $invalidProperties[] = "'street' can't be null";
- }
- if ($this->container['city'] === null) {
- $invalidProperties[] = "'city' can't be null";
- }
- if ($this->container['zipCode'] === null) {
- $invalidProperties[] = "'zipCode' can't be null";
- }
- if ($this->container['country'] === null) {
- $invalidProperties[] = "'country' 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 street
- *
- * @return string
- */
- public function getStreet()
- {
- return $this->container['street'];
- }
-
- /**
- * Sets street
- *
- * @param string $street Street information
- *
- * @return $this
- */
- public function setStreet($street)
- {
- $this->container['street'] = $street;
-
- return $this;
- }
-
- /**
- * Gets city
- *
- * @return string
- */
- public function getCity()
- {
- return $this->container['city'];
- }
-
- /**
- * Sets city
- *
- * @param string $city City information
- *
- * @return $this
- */
- public function setCity($city)
- {
- $this->container['city'] = $city;
-
- return $this;
- }
-
- /**
- * Gets zipCode
- *
- * @return string
- */
- public function getZipCode()
- {
- return $this->container['zipCode'];
- }
-
- /**
- * Sets zipCode
- *
- * @param string $zipCode Zip Code information
- *
- * @return $this
- */
- public function setZipCode($zipCode)
- {
- $this->container['zipCode'] = $zipCode;
-
- return $this;
- }
-
- /**
- * Gets country
- *
- * @return string
- */
- public function getCountry()
- {
- return $this->container['country'];
- }
-
- /**
- * Sets country
- *
- * @param string $country Country information
- *
- * @return $this
- */
- public function setCountry($country)
- {
- $this->container['country'] = $country;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetExtendedContactDetails.php b/lib/Model/GetExtendedContactDetails.php
deleted file mode 100644
index 6651b44..0000000
--- a/lib/Model/GetExtendedContactDetails.php
+++ /dev/null
@@ -1,603 +0,0 @@
- 'string',
- 'id' => 'int',
- 'emailBlacklisted' => 'bool',
- 'smsBlacklisted' => 'bool',
- 'createdAt' => 'string',
- 'modifiedAt' => 'string',
- 'listIds' => 'int[]',
- 'listUnsubscribed' => 'int[]',
- 'attributes' => 'object',
- 'statistics' => '\Brevo\Client\Model\GetExtendedContactDetailsStatistics'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'email' => 'email',
- 'id' => 'int64',
- 'emailBlacklisted' => null,
- 'smsBlacklisted' => null,
- 'createdAt' => null,
- 'modifiedAt' => null,
- 'listIds' => 'int64',
- 'listUnsubscribed' => 'int64',
- 'attributes' => null,
- 'statistics' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'email' => 'email',
- 'id' => 'id',
- 'emailBlacklisted' => 'emailBlacklisted',
- 'smsBlacklisted' => 'smsBlacklisted',
- 'createdAt' => 'createdAt',
- 'modifiedAt' => 'modifiedAt',
- 'listIds' => 'listIds',
- 'listUnsubscribed' => 'listUnsubscribed',
- 'attributes' => 'attributes',
- 'statistics' => 'statistics'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'email' => 'setEmail',
- 'id' => 'setId',
- 'emailBlacklisted' => 'setEmailBlacklisted',
- 'smsBlacklisted' => 'setSmsBlacklisted',
- 'createdAt' => 'setCreatedAt',
- 'modifiedAt' => 'setModifiedAt',
- 'listIds' => 'setListIds',
- 'listUnsubscribed' => 'setListUnsubscribed',
- 'attributes' => 'setAttributes',
- 'statistics' => 'setStatistics'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'email' => 'getEmail',
- 'id' => 'getId',
- 'emailBlacklisted' => 'getEmailBlacklisted',
- 'smsBlacklisted' => 'getSmsBlacklisted',
- 'createdAt' => 'getCreatedAt',
- 'modifiedAt' => 'getModifiedAt',
- 'listIds' => 'getListIds',
- 'listUnsubscribed' => 'getListUnsubscribed',
- 'attributes' => 'getAttributes',
- 'statistics' => 'getStatistics'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['emailBlacklisted'] = isset($data['emailBlacklisted']) ? $data['emailBlacklisted'] : null;
- $this->container['smsBlacklisted'] = isset($data['smsBlacklisted']) ? $data['smsBlacklisted'] : null;
- $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null;
- $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null;
- $this->container['listIds'] = isset($data['listIds']) ? $data['listIds'] : null;
- $this->container['listUnsubscribed'] = isset($data['listUnsubscribed']) ? $data['listUnsubscribed'] : null;
- $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null;
- $this->container['statistics'] = isset($data['statistics']) ? $data['statistics'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['email'] === null) {
- $invalidProperties[] = "'email' can't be null";
- }
- if ($this->container['id'] === null) {
- $invalidProperties[] = "'id' can't be null";
- }
- if ($this->container['emailBlacklisted'] === null) {
- $invalidProperties[] = "'emailBlacklisted' can't be null";
- }
- if ($this->container['smsBlacklisted'] === null) {
- $invalidProperties[] = "'smsBlacklisted' can't be null";
- }
- if ($this->container['createdAt'] === null) {
- $invalidProperties[] = "'createdAt' can't be null";
- }
- if ($this->container['modifiedAt'] === null) {
- $invalidProperties[] = "'modifiedAt' can't be null";
- }
- if ($this->container['listIds'] === null) {
- $invalidProperties[] = "'listIds' can't be null";
- }
- if ($this->container['attributes'] === null) {
- $invalidProperties[] = "'attributes' can't be null";
- }
- if ($this->container['statistics'] === null) {
- $invalidProperties[] = "'statistics' 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 email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Email address of the contact for which you requested the details
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets id
- *
- * @return int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id ID of the contact for which you requested the details
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets emailBlacklisted
- *
- * @return bool
- */
- public function getEmailBlacklisted()
- {
- return $this->container['emailBlacklisted'];
- }
-
- /**
- * Sets emailBlacklisted
- *
- * @param bool $emailBlacklisted Blacklist status for email campaigns (true=blacklisted, false=not blacklisted)
- *
- * @return $this
- */
- public function setEmailBlacklisted($emailBlacklisted)
- {
- $this->container['emailBlacklisted'] = $emailBlacklisted;
-
- return $this;
- }
-
- /**
- * Gets smsBlacklisted
- *
- * @return bool
- */
- public function getSmsBlacklisted()
- {
- return $this->container['smsBlacklisted'];
- }
-
- /**
- * Sets smsBlacklisted
- *
- * @param bool $smsBlacklisted Blacklist status for SMS campaigns (true=blacklisted, false=not blacklisted)
- *
- * @return $this
- */
- public function setSmsBlacklisted($smsBlacklisted)
- {
- $this->container['smsBlacklisted'] = $smsBlacklisted;
-
- return $this;
- }
-
- /**
- * Gets createdAt
- *
- * @return string
- */
- public function getCreatedAt()
- {
- return $this->container['createdAt'];
- }
-
- /**
- * Sets createdAt
- *
- * @param string $createdAt Creation UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ)
- *
- * @return $this
- */
- public function setCreatedAt($createdAt)
- {
- $this->container['createdAt'] = $createdAt;
-
- return $this;
- }
-
- /**
- * Gets modifiedAt
- *
- * @return string
- */
- public function getModifiedAt()
- {
- return $this->container['modifiedAt'];
- }
-
- /**
- * Sets modifiedAt
- *
- * @param string $modifiedAt Last modification UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ)
- *
- * @return $this
- */
- public function setModifiedAt($modifiedAt)
- {
- $this->container['modifiedAt'] = $modifiedAt;
-
- return $this;
- }
-
- /**
- * Gets listIds
- *
- * @return int[]
- */
- public function getListIds()
- {
- return $this->container['listIds'];
- }
-
- /**
- * Sets listIds
- *
- * @param int[] $listIds listIds
- *
- * @return $this
- */
- public function setListIds($listIds)
- {
- $this->container['listIds'] = $listIds;
-
- return $this;
- }
-
- /**
- * Gets listUnsubscribed
- *
- * @return int[]
- */
- public function getListUnsubscribed()
- {
- return $this->container['listUnsubscribed'];
- }
-
- /**
- * Sets listUnsubscribed
- *
- * @param int[] $listUnsubscribed listUnsubscribed
- *
- * @return $this
- */
- public function setListUnsubscribed($listUnsubscribed)
- {
- $this->container['listUnsubscribed'] = $listUnsubscribed;
-
- return $this;
- }
-
- /**
- * Gets attributes
- *
- * @return object
- */
- public function getAttributes()
- {
- return $this->container['attributes'];
- }
-
- /**
- * Sets attributes
- *
- * @param object $attributes Set of attributes of the contact
- *
- * @return $this
- */
- public function setAttributes($attributes)
- {
- $this->container['attributes'] = $attributes;
-
- return $this;
- }
-
- /**
- * Gets statistics
- *
- * @return \Brevo\Client\Model\GetExtendedContactDetailsStatistics
- */
- public function getStatistics()
- {
- return $this->container['statistics'];
- }
-
- /**
- * Sets statistics
- *
- * @param \Brevo\Client\Model\GetExtendedContactDetailsStatistics $statistics statistics
- *
- * @return $this
- */
- public function setStatistics($statistics)
- {
- $this->container['statistics'] = $statistics;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetExtendedContactDetailsStatistics.php b/lib/Model/GetExtendedContactDetailsStatistics.php
deleted file mode 100644
index f5f05be..0000000
--- a/lib/Model/GetExtendedContactDetailsStatistics.php
+++ /dev/null
@@ -1,546 +0,0 @@
- '\Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]',
- 'hardBounces' => '\Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]',
- 'softBounces' => '\Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]',
- 'complaints' => '\Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]',
- 'unsubscriptions' => '\Brevo\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptions',
- 'opened' => '\Brevo\Client\Model\GetExtendedContactDetailsStatisticsOpened[]',
- 'clicked' => '\Brevo\Client\Model\GetExtendedContactDetailsStatisticsClicked[]',
- 'transacAttributes' => 'object[]',
- 'delivered' => '\Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'messagesSent' => null,
- 'hardBounces' => null,
- 'softBounces' => null,
- 'complaints' => null,
- 'unsubscriptions' => null,
- 'opened' => null,
- 'clicked' => null,
- 'transacAttributes' => null,
- 'delivered' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'messagesSent' => 'messagesSent',
- 'hardBounces' => 'hardBounces',
- 'softBounces' => 'softBounces',
- 'complaints' => 'complaints',
- 'unsubscriptions' => 'unsubscriptions',
- 'opened' => 'opened',
- 'clicked' => 'clicked',
- 'transacAttributes' => 'transacAttributes',
- 'delivered' => 'delivered'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'messagesSent' => 'setMessagesSent',
- 'hardBounces' => 'setHardBounces',
- 'softBounces' => 'setSoftBounces',
- 'complaints' => 'setComplaints',
- 'unsubscriptions' => 'setUnsubscriptions',
- 'opened' => 'setOpened',
- 'clicked' => 'setClicked',
- 'transacAttributes' => 'setTransacAttributes',
- 'delivered' => 'setDelivered'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'messagesSent' => 'getMessagesSent',
- 'hardBounces' => 'getHardBounces',
- 'softBounces' => 'getSoftBounces',
- 'complaints' => 'getComplaints',
- 'unsubscriptions' => 'getUnsubscriptions',
- 'opened' => 'getOpened',
- 'clicked' => 'getClicked',
- 'transacAttributes' => 'getTransacAttributes',
- 'delivered' => 'getDelivered'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['messagesSent'] = isset($data['messagesSent']) ? $data['messagesSent'] : null;
- $this->container['hardBounces'] = isset($data['hardBounces']) ? $data['hardBounces'] : null;
- $this->container['softBounces'] = isset($data['softBounces']) ? $data['softBounces'] : null;
- $this->container['complaints'] = isset($data['complaints']) ? $data['complaints'] : null;
- $this->container['unsubscriptions'] = isset($data['unsubscriptions']) ? $data['unsubscriptions'] : null;
- $this->container['opened'] = isset($data['opened']) ? $data['opened'] : null;
- $this->container['clicked'] = isset($data['clicked']) ? $data['clicked'] : null;
- $this->container['transacAttributes'] = isset($data['transacAttributes']) ? $data['transacAttributes'] : null;
- $this->container['delivered'] = isset($data['delivered']) ? $data['delivered'] : null;
- }
-
- /**
- * 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 messagesSent
- *
- * @return \Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]
- */
- public function getMessagesSent()
- {
- return $this->container['messagesSent'];
- }
-
- /**
- * Sets messagesSent
- *
- * @param \Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[] $messagesSent Listing of the sent campaign for the contact
- *
- * @return $this
- */
- public function setMessagesSent($messagesSent)
- {
- $this->container['messagesSent'] = $messagesSent;
-
- return $this;
- }
-
- /**
- * Gets hardBounces
- *
- * @return \Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]
- */
- public function getHardBounces()
- {
- return $this->container['hardBounces'];
- }
-
- /**
- * Sets hardBounces
- *
- * @param \Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[] $hardBounces Listing of the hardbounes generated by the contact
- *
- * @return $this
- */
- public function setHardBounces($hardBounces)
- {
- $this->container['hardBounces'] = $hardBounces;
-
- return $this;
- }
-
- /**
- * Gets softBounces
- *
- * @return \Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]
- */
- public function getSoftBounces()
- {
- return $this->container['softBounces'];
- }
-
- /**
- * Sets softBounces
- *
- * @param \Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[] $softBounces Listing of the softbounes generated by the contact
- *
- * @return $this
- */
- public function setSoftBounces($softBounces)
- {
- $this->container['softBounces'] = $softBounces;
-
- return $this;
- }
-
- /**
- * Gets complaints
- *
- * @return \Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]
- */
- public function getComplaints()
- {
- return $this->container['complaints'];
- }
-
- /**
- * Sets complaints
- *
- * @param \Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[] $complaints Listing of the complaints generated by the contact
- *
- * @return $this
- */
- public function setComplaints($complaints)
- {
- $this->container['complaints'] = $complaints;
-
- return $this;
- }
-
- /**
- * Gets unsubscriptions
- *
- * @return \Brevo\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptions
- */
- public function getUnsubscriptions()
- {
- return $this->container['unsubscriptions'];
- }
-
- /**
- * Sets unsubscriptions
- *
- * @param \Brevo\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptions $unsubscriptions unsubscriptions
- *
- * @return $this
- */
- public function setUnsubscriptions($unsubscriptions)
- {
- $this->container['unsubscriptions'] = $unsubscriptions;
-
- return $this;
- }
-
- /**
- * Gets opened
- *
- * @return \Brevo\Client\Model\GetExtendedContactDetailsStatisticsOpened[]
- */
- public function getOpened()
- {
- return $this->container['opened'];
- }
-
- /**
- * Sets opened
- *
- * @param \Brevo\Client\Model\GetExtendedContactDetailsStatisticsOpened[] $opened Listing of the openings generated by the contact
- *
- * @return $this
- */
- public function setOpened($opened)
- {
- $this->container['opened'] = $opened;
-
- return $this;
- }
-
- /**
- * Gets clicked
- *
- * @return \Brevo\Client\Model\GetExtendedContactDetailsStatisticsClicked[]
- */
- public function getClicked()
- {
- return $this->container['clicked'];
- }
-
- /**
- * Sets clicked
- *
- * @param \Brevo\Client\Model\GetExtendedContactDetailsStatisticsClicked[] $clicked Listing of the clicks generated by the contact
- *
- * @return $this
- */
- public function setClicked($clicked)
- {
- $this->container['clicked'] = $clicked;
-
- return $this;
- }
-
- /**
- * Gets transacAttributes
- *
- * @return object[]
- */
- public function getTransacAttributes()
- {
- return $this->container['transacAttributes'];
- }
-
- /**
- * Sets transacAttributes
- *
- * @param object[] $transacAttributes Listing of the transactional attributes for the contact
- *
- * @return $this
- */
- public function setTransacAttributes($transacAttributes)
- {
- $this->container['transacAttributes'] = $transacAttributes;
-
- return $this;
- }
-
- /**
- * Gets delivered
- *
- * @return \Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]
- */
- public function getDelivered()
- {
- return $this->container['delivered'];
- }
-
- /**
- * Sets delivered
- *
- * @param \Brevo\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[] $delivered Listing of the delivered campaign for the contact
- *
- * @return $this
- */
- public function setDelivered($delivered)
- {
- $this->container['delivered'] = $delivered;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetExtendedContactDetailsStatisticsClicked.php b/lib/Model/GetExtendedContactDetailsStatisticsClicked.php
deleted file mode 100644
index ad3fbe3..0000000
--- a/lib/Model/GetExtendedContactDetailsStatisticsClicked.php
+++ /dev/null
@@ -1,341 +0,0 @@
- 'int',
- 'links' => '\Brevo\Client\Model\GetExtendedContactDetailsStatisticsLinks[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'campaignId' => 'int64',
- 'links' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'campaignId' => 'campaignId',
- 'links' => 'links'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'campaignId' => 'setCampaignId',
- 'links' => 'setLinks'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'campaignId' => 'getCampaignId',
- 'links' => 'getLinks'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['campaignId'] = isset($data['campaignId']) ? $data['campaignId'] : null;
- $this->container['links'] = isset($data['links']) ? $data['links'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['campaignId'] === null) {
- $invalidProperties[] = "'campaignId' can't be null";
- }
- if ($this->container['links'] === null) {
- $invalidProperties[] = "'links' 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 campaignId
- *
- * @return int
- */
- public function getCampaignId()
- {
- return $this->container['campaignId'];
- }
-
- /**
- * Sets campaignId
- *
- * @param int $campaignId ID of the campaign which generated the event
- *
- * @return $this
- */
- public function setCampaignId($campaignId)
- {
- $this->container['campaignId'] = $campaignId;
-
- return $this;
- }
-
- /**
- * Gets links
- *
- * @return \Brevo\Client\Model\GetExtendedContactDetailsStatisticsLinks[]
- */
- public function getLinks()
- {
- return $this->container['links'];
- }
-
- /**
- * Sets links
- *
- * @param \Brevo\Client\Model\GetExtendedContactDetailsStatisticsLinks[] $links Listing of the clicked links for the campaign
- *
- * @return $this
- */
- public function setLinks($links)
- {
- $this->container['links'] = $links;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetExtendedContactDetailsStatisticsDelivered.php b/lib/Model/GetExtendedContactDetailsStatisticsDelivered.php
deleted file mode 100644
index 42aeeec..0000000
--- a/lib/Model/GetExtendedContactDetailsStatisticsDelivered.php
+++ /dev/null
@@ -1,337 +0,0 @@
- 'int',
- 'eventTime' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'campaignId' => 'int64',
- 'eventTime' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'campaignId' => 'campaignId',
- 'eventTime' => 'eventTime'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'campaignId' => 'setCampaignId',
- 'eventTime' => 'setEventTime'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'campaignId' => 'getCampaignId',
- 'eventTime' => 'getEventTime'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['campaignId'] = isset($data['campaignId']) ? $data['campaignId'] : null;
- $this->container['eventTime'] = isset($data['eventTime']) ? $data['eventTime'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['campaignId'] === null) {
- $invalidProperties[] = "'campaignId' can't be null";
- }
- if ($this->container['eventTime'] === null) {
- $invalidProperties[] = "'eventTime' 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 campaignId
- *
- * @return int
- */
- public function getCampaignId()
- {
- return $this->container['campaignId'];
- }
-
- /**
- * Sets campaignId
- *
- * @param int $campaignId ID of the campaign which generated the event
- *
- * @return $this
- */
- public function setCampaignId($campaignId)
- {
- $this->container['campaignId'] = $campaignId;
-
- return $this;
- }
-
- /**
- * Gets eventTime
- *
- * @return string
- */
- public function getEventTime()
- {
- return $this->container['eventTime'];
- }
-
- /**
- * Sets eventTime
- *
- * @param string $eventTime UTC date-time of the event
- *
- * @return $this
- */
- public function setEventTime($eventTime)
- {
- $this->container['eventTime'] = $eventTime;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetExtendedContactDetailsStatisticsLinks.php b/lib/Model/GetExtendedContactDetailsStatisticsLinks.php
deleted file mode 100644
index 7365eb9..0000000
--- a/lib/Model/GetExtendedContactDetailsStatisticsLinks.php
+++ /dev/null
@@ -1,407 +0,0 @@
- 'int',
- 'eventTime' => 'string',
- 'ip' => 'string',
- 'url' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'count' => 'int64',
- 'eventTime' => null,
- 'ip' => null,
- 'url' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'count' => 'count',
- 'eventTime' => 'eventTime',
- 'ip' => 'ip',
- 'url' => 'url'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'count' => 'setCount',
- 'eventTime' => 'setEventTime',
- 'ip' => 'setIp',
- 'url' => 'setUrl'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'count' => 'getCount',
- 'eventTime' => 'getEventTime',
- 'ip' => 'getIp',
- 'url' => 'getUrl'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['count'] = isset($data['count']) ? $data['count'] : null;
- $this->container['eventTime'] = isset($data['eventTime']) ? $data['eventTime'] : null;
- $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null;
- $this->container['url'] = isset($data['url']) ? $data['url'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['count'] === null) {
- $invalidProperties[] = "'count' can't be null";
- }
- if ($this->container['eventTime'] === null) {
- $invalidProperties[] = "'eventTime' can't be null";
- }
- if ($this->container['ip'] === null) {
- $invalidProperties[] = "'ip' can't be null";
- }
- if ($this->container['url'] === null) {
- $invalidProperties[] = "'url' 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 count
- *
- * @return int
- */
- public function getCount()
- {
- return $this->container['count'];
- }
-
- /**
- * Sets count
- *
- * @param int $count Number of clicks on this link for the campaign
- *
- * @return $this
- */
- public function setCount($count)
- {
- $this->container['count'] = $count;
-
- return $this;
- }
-
- /**
- * Gets eventTime
- *
- * @return string
- */
- public function getEventTime()
- {
- return $this->container['eventTime'];
- }
-
- /**
- * Sets eventTime
- *
- * @param string $eventTime UTC date-time of the event
- *
- * @return $this
- */
- public function setEventTime($eventTime)
- {
- $this->container['eventTime'] = $eventTime;
-
- return $this;
- }
-
- /**
- * Gets ip
- *
- * @return string
- */
- public function getIp()
- {
- return $this->container['ip'];
- }
-
- /**
- * Sets ip
- *
- * @param string $ip IP from which the user has clicked on the link
- *
- * @return $this
- */
- public function setIp($ip)
- {
- $this->container['ip'] = $ip;
-
- return $this;
- }
-
- /**
- * Gets url
- *
- * @return string
- */
- public function getUrl()
- {
- return $this->container['url'];
- }
-
- /**
- * Sets url
- *
- * @param string $url URL of the clicked link
- *
- * @return $this
- */
- public function setUrl($url)
- {
- $this->container['url'] = $url;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetExtendedContactDetailsStatisticsMessagesSent.php b/lib/Model/GetExtendedContactDetailsStatisticsMessagesSent.php
deleted file mode 100644
index be2cdac..0000000
--- a/lib/Model/GetExtendedContactDetailsStatisticsMessagesSent.php
+++ /dev/null
@@ -1,341 +0,0 @@
- 'int',
- 'eventTime' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'campaignId' => 'int64',
- 'eventTime' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'campaignId' => 'campaignId',
- 'eventTime' => 'eventTime'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'campaignId' => 'setCampaignId',
- 'eventTime' => 'setEventTime'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'campaignId' => 'getCampaignId',
- 'eventTime' => 'getEventTime'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['campaignId'] = isset($data['campaignId']) ? $data['campaignId'] : null;
- $this->container['eventTime'] = isset($data['eventTime']) ? $data['eventTime'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['campaignId'] === null) {
- $invalidProperties[] = "'campaignId' can't be null";
- }
- if ($this->container['eventTime'] === null) {
- $invalidProperties[] = "'eventTime' 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 campaignId
- *
- * @return int
- */
- public function getCampaignId()
- {
- return $this->container['campaignId'];
- }
-
- /**
- * Sets campaignId
- *
- * @param int $campaignId ID of the campaign which generated the event
- *
- * @return $this
- */
- public function setCampaignId($campaignId)
- {
- $this->container['campaignId'] = $campaignId;
-
- return $this;
- }
-
- /**
- * Gets eventTime
- *
- * @return string
- */
- public function getEventTime()
- {
- return $this->container['eventTime'];
- }
-
- /**
- * Sets eventTime
- *
- * @param string $eventTime UTC date-time of the event
- *
- * @return $this
- */
- public function setEventTime($eventTime)
- {
- $this->container['eventTime'] = $eventTime;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetExtendedContactDetailsStatisticsOpened.php b/lib/Model/GetExtendedContactDetailsStatisticsOpened.php
deleted file mode 100644
index 00599ef..0000000
--- a/lib/Model/GetExtendedContactDetailsStatisticsOpened.php
+++ /dev/null
@@ -1,407 +0,0 @@
- 'int',
- 'count' => 'int',
- 'eventTime' => 'string',
- 'ip' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'campaignId' => 'int64',
- 'count' => 'int64',
- 'eventTime' => null,
- 'ip' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'campaignId' => 'campaignId',
- 'count' => 'count',
- 'eventTime' => 'eventTime',
- 'ip' => 'ip'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'campaignId' => 'setCampaignId',
- 'count' => 'setCount',
- 'eventTime' => 'setEventTime',
- 'ip' => 'setIp'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'campaignId' => 'getCampaignId',
- 'count' => 'getCount',
- 'eventTime' => 'getEventTime',
- 'ip' => 'getIp'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['campaignId'] = isset($data['campaignId']) ? $data['campaignId'] : null;
- $this->container['count'] = isset($data['count']) ? $data['count'] : null;
- $this->container['eventTime'] = isset($data['eventTime']) ? $data['eventTime'] : null;
- $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['campaignId'] === null) {
- $invalidProperties[] = "'campaignId' can't be null";
- }
- if ($this->container['count'] === null) {
- $invalidProperties[] = "'count' can't be null";
- }
- if ($this->container['eventTime'] === null) {
- $invalidProperties[] = "'eventTime' can't be null";
- }
- if ($this->container['ip'] === null) {
- $invalidProperties[] = "'ip' 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 campaignId
- *
- * @return int
- */
- public function getCampaignId()
- {
- return $this->container['campaignId'];
- }
-
- /**
- * Sets campaignId
- *
- * @param int $campaignId ID of the campaign which generated the event
- *
- * @return $this
- */
- public function setCampaignId($campaignId)
- {
- $this->container['campaignId'] = $campaignId;
-
- return $this;
- }
-
- /**
- * Gets count
- *
- * @return int
- */
- public function getCount()
- {
- return $this->container['count'];
- }
-
- /**
- * Sets count
- *
- * @param int $count Number of openings for the campaign
- *
- * @return $this
- */
- public function setCount($count)
- {
- $this->container['count'] = $count;
-
- return $this;
- }
-
- /**
- * Gets eventTime
- *
- * @return string
- */
- public function getEventTime()
- {
- return $this->container['eventTime'];
- }
-
- /**
- * Sets eventTime
- *
- * @param string $eventTime UTC date-time of the event
- *
- * @return $this
- */
- public function setEventTime($eventTime)
- {
- $this->container['eventTime'] = $eventTime;
-
- return $this;
- }
-
- /**
- * Gets ip
- *
- * @return string
- */
- public function getIp()
- {
- return $this->container['ip'];
- }
-
- /**
- * Sets ip
- *
- * @param string $ip IP from which the user has opened the email
- *
- * @return $this
- */
- public function setIp($ip)
- {
- $this->container['ip'] = $ip;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptions.php b/lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptions.php
deleted file mode 100644
index 0105dec..0000000
--- a/lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptions.php
+++ /dev/null
@@ -1,342 +0,0 @@
- '\Brevo\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription[]',
- 'adminUnsubscription' => '\Brevo\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'userUnsubscription' => null,
- 'adminUnsubscription' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'userUnsubscription' => 'userUnsubscription',
- 'adminUnsubscription' => 'adminUnsubscription'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'userUnsubscription' => 'setUserUnsubscription',
- 'adminUnsubscription' => 'setAdminUnsubscription'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'userUnsubscription' => 'getUserUnsubscription',
- 'adminUnsubscription' => 'getAdminUnsubscription'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['userUnsubscription'] = isset($data['userUnsubscription']) ? $data['userUnsubscription'] : null;
- $this->container['adminUnsubscription'] = isset($data['adminUnsubscription']) ? $data['adminUnsubscription'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['userUnsubscription'] === null) {
- $invalidProperties[] = "'userUnsubscription' can't be null";
- }
- if ($this->container['adminUnsubscription'] === null) {
- $invalidProperties[] = "'adminUnsubscription' 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 userUnsubscription
- *
- * @return \Brevo\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription[]
- */
- public function getUserUnsubscription()
- {
- return $this->container['userUnsubscription'];
- }
-
- /**
- * Sets userUnsubscription
- *
- * @param \Brevo\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription[] $userUnsubscription Contact unsubscribe via unsubscription link in a campaign
- *
- * @return $this
- */
- public function setUserUnsubscription($userUnsubscription)
- {
- $this->container['userUnsubscription'] = $userUnsubscription;
-
- return $this;
- }
-
- /**
- * Gets adminUnsubscription
- *
- * @return \Brevo\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription[]
- */
- public function getAdminUnsubscription()
- {
- return $this->container['adminUnsubscription'];
- }
-
- /**
- * Sets adminUnsubscription
- *
- * @param \Brevo\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription[] $adminUnsubscription Contact has been unsubscribed from the administrator
- *
- * @return $this
- */
- public function setAdminUnsubscription($adminUnsubscription)
- {
- $this->container['adminUnsubscription'] = $adminUnsubscription;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription.php b/lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription.php
deleted file mode 100644
index 99a7b85..0000000
--- a/lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription.php
+++ /dev/null
@@ -1,338 +0,0 @@
- 'string',
- 'ip' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'eventTime' => null,
- 'ip' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'eventTime' => 'eventTime',
- 'ip' => 'ip'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'eventTime' => 'setEventTime',
- 'ip' => 'setIp'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'eventTime' => 'getEventTime',
- 'ip' => 'getIp'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['eventTime'] = isset($data['eventTime']) ? $data['eventTime'] : null;
- $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['eventTime'] === null) {
- $invalidProperties[] = "'eventTime' 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 eventTime
- *
- * @return string
- */
- public function getEventTime()
- {
- return $this->container['eventTime'];
- }
-
- /**
- * Sets eventTime
- *
- * @param string $eventTime UTC date-time of the event
- *
- * @return $this
- */
- public function setEventTime($eventTime)
- {
- $this->container['eventTime'] = $eventTime;
-
- return $this;
- }
-
- /**
- * Gets ip
- *
- * @return string
- */
- public function getIp()
- {
- return $this->container['ip'];
- }
-
- /**
- * Sets ip
- *
- * @param string $ip IP from which the user has been unsubscribed
- *
- * @return $this
- */
- public function setIp($ip)
- {
- $this->container['ip'] = $ip;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription.php b/lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription.php
deleted file mode 100644
index 6a9aaf9..0000000
--- a/lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription.php
+++ /dev/null
@@ -1,371 +0,0 @@
- 'int',
- 'eventTime' => 'string',
- 'ip' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'campaignId' => 'int64',
- 'eventTime' => null,
- 'ip' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'campaignId' => 'campaignId',
- 'eventTime' => 'eventTime',
- 'ip' => 'ip'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'campaignId' => 'setCampaignId',
- 'eventTime' => 'setEventTime',
- 'ip' => 'setIp'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'campaignId' => 'getCampaignId',
- 'eventTime' => 'getEventTime',
- 'ip' => 'getIp'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['campaignId'] = isset($data['campaignId']) ? $data['campaignId'] : null;
- $this->container['eventTime'] = isset($data['eventTime']) ? $data['eventTime'] : null;
- $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['campaignId'] === null) {
- $invalidProperties[] = "'campaignId' can't be null";
- }
- if ($this->container['eventTime'] === null) {
- $invalidProperties[] = "'eventTime' 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 campaignId
- *
- * @return int
- */
- public function getCampaignId()
- {
- return $this->container['campaignId'];
- }
-
- /**
- * Sets campaignId
- *
- * @param int $campaignId ID of the campaign which generated the event
- *
- * @return $this
- */
- public function setCampaignId($campaignId)
- {
- $this->container['campaignId'] = $campaignId;
-
- return $this;
- }
-
- /**
- * Gets eventTime
- *
- * @return string
- */
- public function getEventTime()
- {
- return $this->container['eventTime'];
- }
-
- /**
- * Sets eventTime
- *
- * @param string $eventTime UTC date-time of the event
- *
- * @return $this
- */
- public function setEventTime($eventTime)
- {
- $this->container['eventTime'] = $eventTime;
-
- return $this;
- }
-
- /**
- * Gets ip
- *
- * @return string
- */
- public function getIp()
- {
- return $this->container['ip'];
- }
-
- /**
- * Sets ip
- *
- * @param string $ip IP from which the user has unsubscribed
- *
- * @return $this
- */
- public function setIp($ip)
- {
- $this->container['ip'] = $ip;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetExtendedList.php b/lib/Model/GetExtendedList.php
deleted file mode 100644
index 09f6804..0000000
--- a/lib/Model/GetExtendedList.php
+++ /dev/null
@@ -1,395 +0,0 @@
- 'int',
- 'createdAt' => 'string',
- 'campaignStats' => '\Brevo\Client\Model\GetExtendedListCampaignStats[]',
- 'dynamicList' => 'bool'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'folderId' => 'int64',
- 'createdAt' => null,
- 'campaignStats' => null,
- 'dynamicList' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes + parent::swaggerTypes();
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats + parent::swaggerFormats();
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'folderId' => 'folderId',
- 'createdAt' => 'createdAt',
- 'campaignStats' => 'campaignStats',
- 'dynamicList' => 'dynamicList'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'folderId' => 'setFolderId',
- 'createdAt' => 'setCreatedAt',
- 'campaignStats' => 'setCampaignStats',
- 'dynamicList' => 'setDynamicList'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'folderId' => 'getFolderId',
- 'createdAt' => 'getCreatedAt',
- 'campaignStats' => 'getCampaignStats',
- 'dynamicList' => 'getDynamicList'
- ];
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @return array
- */
- public static function attributeMap()
- {
- return parent::attributeMap() + self::$attributeMap;
- }
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @return array
- */
- public static function setters()
- {
- return parent::setters() + self::$setters;
- }
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @return array
- */
- public static function getters()
- {
- return parent::getters() + self::$getters;
- }
-
- /**
- * The original name of the model.
- *
- * @return string
- */
- public function getModelName()
- {
- return self::$swaggerModelName;
- }
-
-
-
-
-
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- parent::__construct($data);
-
- $this->container['folderId'] = isset($data['folderId']) ? $data['folderId'] : null;
- $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null;
- $this->container['campaignStats'] = isset($data['campaignStats']) ? $data['campaignStats'] : null;
- $this->container['dynamicList'] = isset($data['dynamicList']) ? $data['dynamicList'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = parent::listInvalidProperties();
-
- if ($this->container['folderId'] === null) {
- $invalidProperties[] = "'folderId' can't be null";
- }
- if ($this->container['createdAt'] === null) {
- $invalidProperties[] = "'createdAt' 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 folderId
- *
- * @return int
- */
- public function getFolderId()
- {
- return $this->container['folderId'];
- }
-
- /**
- * Sets folderId
- *
- * @param int $folderId ID of the folder
- *
- * @return $this
- */
- public function setFolderId($folderId)
- {
- $this->container['folderId'] = $folderId;
-
- return $this;
- }
-
- /**
- * Gets createdAt
- *
- * @return string
- */
- public function getCreatedAt()
- {
- return $this->container['createdAt'];
- }
-
- /**
- * Sets createdAt
- *
- * @param string $createdAt Creation UTC date-time of the list (YYYY-MM-DDTHH:mm:ss.SSSZ)
- *
- * @return $this
- */
- public function setCreatedAt($createdAt)
- {
- $this->container['createdAt'] = $createdAt;
-
- return $this;
- }
-
- /**
- * Gets campaignStats
- *
- * @return \Brevo\Client\Model\GetExtendedListCampaignStats[]
- */
- public function getCampaignStats()
- {
- return $this->container['campaignStats'];
- }
-
- /**
- * Sets campaignStats
- *
- * @param \Brevo\Client\Model\GetExtendedListCampaignStats[] $campaignStats campaignStats
- *
- * @return $this
- */
- public function setCampaignStats($campaignStats)
- {
- $this->container['campaignStats'] = $campaignStats;
-
- return $this;
- }
-
- /**
- * Gets dynamicList
- *
- * @return bool
- */
- public function getDynamicList()
- {
- return $this->container['dynamicList'];
- }
-
- /**
- * Sets dynamicList
- *
- * @param bool $dynamicList Status telling if the list is dynamic or not (true=dynamic, false=not dynamic)
- *
- * @return $this
- */
- public function setDynamicList($dynamicList)
- {
- $this->container['dynamicList'] = $dynamicList;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetExtendedListCampaignStats.php b/lib/Model/GetExtendedListCampaignStats.php
deleted file mode 100644
index 468b511..0000000
--- a/lib/Model/GetExtendedListCampaignStats.php
+++ /dev/null
@@ -1,341 +0,0 @@
- 'int',
- 'stats' => '\Brevo\Client\Model\GetCampaignStats'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'campaignId' => 'int64',
- 'stats' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'campaignId' => 'campaignId',
- 'stats' => 'stats'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'campaignId' => 'setCampaignId',
- 'stats' => 'setStats'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'campaignId' => 'getCampaignId',
- 'stats' => 'getStats'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['campaignId'] = isset($data['campaignId']) ? $data['campaignId'] : null;
- $this->container['stats'] = isset($data['stats']) ? $data['stats'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['campaignId'] === null) {
- $invalidProperties[] = "'campaignId' can't be null";
- }
- if ($this->container['stats'] === null) {
- $invalidProperties[] = "'stats' 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 campaignId
- *
- * @return int
- */
- public function getCampaignId()
- {
- return $this->container['campaignId'];
- }
-
- /**
- * Sets campaignId
- *
- * @param int $campaignId ID of the campaign
- *
- * @return $this
- */
- public function setCampaignId($campaignId)
- {
- $this->container['campaignId'] = $campaignId;
-
- return $this;
- }
-
- /**
- * Gets stats
- *
- * @return \Brevo\Client\Model\GetCampaignStats
- */
- public function getStats()
- {
- return $this->container['stats'];
- }
-
- /**
- * Sets stats
- *
- * @param \Brevo\Client\Model\GetCampaignStats $stats stats
- *
- * @return $this
- */
- public function setStats($stats)
- {
- $this->container['stats'] = $stats;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetExternalFeedByUUID.php b/lib/Model/GetExternalFeedByUUID.php
deleted file mode 100644
index 685bda8..0000000
--- a/lib/Model/GetExternalFeedByUUID.php
+++ /dev/null
@@ -1,712 +0,0 @@
- 'string',
- 'name' => 'string',
- 'url' => 'string',
- 'authType' => 'string',
- 'username' => 'string',
- 'password' => 'string',
- 'token' => 'string',
- 'headers' => '\Brevo\Client\Model\GetExternalFeedByUUIDHeaders[]',
- 'maxRetries' => 'int',
- 'cache' => 'bool',
- 'createdAt' => '\DateTime',
- 'modifiedAt' => '\DateTime'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'uuidv4',
- 'name' => null,
- 'url' => 'url',
- 'authType' => null,
- 'username' => null,
- 'password' => null,
- 'token' => null,
- 'headers' => null,
- 'maxRetries' => null,
- 'cache' => null,
- 'createdAt' => 'date-time',
- 'modifiedAt' => 'date-time'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'name' => 'name',
- 'url' => 'url',
- 'authType' => 'authType',
- 'username' => 'username',
- 'password' => 'password',
- 'token' => 'token',
- 'headers' => 'headers',
- 'maxRetries' => 'maxRetries',
- 'cache' => 'cache',
- 'createdAt' => 'createdAt',
- 'modifiedAt' => 'modifiedAt'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'name' => 'setName',
- 'url' => 'setUrl',
- 'authType' => 'setAuthType',
- 'username' => 'setUsername',
- 'password' => 'setPassword',
- 'token' => 'setToken',
- 'headers' => 'setHeaders',
- 'maxRetries' => 'setMaxRetries',
- 'cache' => 'setCache',
- 'createdAt' => 'setCreatedAt',
- 'modifiedAt' => 'setModifiedAt'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'name' => 'getName',
- 'url' => 'getUrl',
- 'authType' => 'getAuthType',
- 'username' => 'getUsername',
- 'password' => 'getPassword',
- 'token' => 'getToken',
- 'headers' => 'getHeaders',
- 'maxRetries' => 'getMaxRetries',
- 'cache' => 'getCache',
- 'createdAt' => 'getCreatedAt',
- 'modifiedAt' => 'getModifiedAt'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const AUTH_TYPE_BASIC = 'basic';
- const AUTH_TYPE_TOKEN = 'token';
- const AUTH_TYPE_NO_AUTH = 'noAuth';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getAuthTypeAllowableValues()
- {
- return [
- self::AUTH_TYPE_BASIC,
- self::AUTH_TYPE_TOKEN,
- self::AUTH_TYPE_NO_AUTH,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['url'] = isset($data['url']) ? $data['url'] : null;
- $this->container['authType'] = isset($data['authType']) ? $data['authType'] : null;
- $this->container['username'] = isset($data['username']) ? $data['username'] : null;
- $this->container['password'] = isset($data['password']) ? $data['password'] : null;
- $this->container['token'] = isset($data['token']) ? $data['token'] : null;
- $this->container['headers'] = isset($data['headers']) ? $data['headers'] : null;
- $this->container['maxRetries'] = isset($data['maxRetries']) ? $data['maxRetries'] : null;
- $this->container['cache'] = isset($data['cache']) ? $data['cache'] : null;
- $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null;
- $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null;
- }
-
- /**
- * 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['name'] === null) {
- $invalidProperties[] = "'name' can't be null";
- }
- if ($this->container['url'] === null) {
- $invalidProperties[] = "'url' can't be null";
- }
- if ($this->container['authType'] === null) {
- $invalidProperties[] = "'authType' can't be null";
- }
- $allowedValues = $this->getAuthTypeAllowableValues();
- if (!is_null($this->container['authType']) && !in_array($this->container['authType'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'authType', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- if ($this->container['headers'] === null) {
- $invalidProperties[] = "'headers' can't be null";
- }
- if ($this->container['maxRetries'] === null) {
- $invalidProperties[] = "'maxRetries' can't be null";
- }
- if (($this->container['maxRetries'] > 5)) {
- $invalidProperties[] = "invalid value for 'maxRetries', must be smaller than or equal to 5.";
- }
-
- if (($this->container['maxRetries'] < 0)) {
- $invalidProperties[] = "invalid value for 'maxRetries', must be bigger than or equal to 0.";
- }
-
- if ($this->container['cache'] === null) {
- $invalidProperties[] = "'cache' can't be null";
- }
- if ($this->container['createdAt'] === null) {
- $invalidProperties[] = "'createdAt' can't be null";
- }
- if ($this->container['modifiedAt'] === null) {
- $invalidProperties[] = "'modifiedAt' 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 of the feed
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the feed
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets url
- *
- * @return string
- */
- public function getUrl()
- {
- return $this->container['url'];
- }
-
- /**
- * Sets url
- *
- * @param string $url URL of the feed
- *
- * @return $this
- */
- public function setUrl($url)
- {
- $this->container['url'] = $url;
-
- return $this;
- }
-
- /**
- * Gets authType
- *
- * @return string
- */
- public function getAuthType()
- {
- return $this->container['authType'];
- }
-
- /**
- * Sets authType
- *
- * @param string $authType Auth type of the feed: * `basic` * `token` * `noAuth`
- *
- * @return $this
- */
- public function setAuthType($authType)
- {
- $allowedValues = $this->getAuthTypeAllowableValues();
- if (!in_array($authType, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'authType', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['authType'] = $authType;
-
- return $this;
- }
-
- /**
- * Gets username
- *
- * @return string
- */
- public function getUsername()
- {
- return $this->container['username'];
- }
-
- /**
- * Sets username
- *
- * @param string $username Username for authType `basic`
- *
- * @return $this
- */
- public function setUsername($username)
- {
- $this->container['username'] = $username;
-
- return $this;
- }
-
- /**
- * Gets password
- *
- * @return string
- */
- public function getPassword()
- {
- return $this->container['password'];
- }
-
- /**
- * Sets password
- *
- * @param string $password Password for authType `basic`
- *
- * @return $this
- */
- public function setPassword($password)
- {
- $this->container['password'] = $password;
-
- return $this;
- }
-
- /**
- * Gets token
- *
- * @return string
- */
- public function getToken()
- {
- return $this->container['token'];
- }
-
- /**
- * Sets token
- *
- * @param string $token Token for authType `token`
- *
- * @return $this
- */
- public function setToken($token)
- {
- $this->container['token'] = $token;
-
- return $this;
- }
-
- /**
- * Gets headers
- *
- * @return \Brevo\Client\Model\GetExternalFeedByUUIDHeaders[]
- */
- public function getHeaders()
- {
- return $this->container['headers'];
- }
-
- /**
- * Sets headers
- *
- * @param \Brevo\Client\Model\GetExternalFeedByUUIDHeaders[] $headers Custom headers for the feed
- *
- * @return $this
- */
- public function setHeaders($headers)
- {
- $this->container['headers'] = $headers;
-
- return $this;
- }
-
- /**
- * Gets maxRetries
- *
- * @return int
- */
- public function getMaxRetries()
- {
- return $this->container['maxRetries'];
- }
-
- /**
- * Sets maxRetries
- *
- * @param int $maxRetries Maximum number of retries on the feed url
- *
- * @return $this
- */
- public function setMaxRetries($maxRetries)
- {
-
- if (($maxRetries > 5)) {
- throw new \InvalidArgumentException('invalid value for $maxRetries when calling GetExternalFeedByUUID., must be smaller than or equal to 5.');
- }
- if (($maxRetries < 0)) {
- throw new \InvalidArgumentException('invalid value for $maxRetries when calling GetExternalFeedByUUID., must be bigger than or equal to 0.');
- }
-
- $this->container['maxRetries'] = $maxRetries;
-
- return $this;
- }
-
- /**
- * Gets cache
- *
- * @return bool
- */
- public function getCache()
- {
- return $this->container['cache'];
- }
-
- /**
- * Sets cache
- *
- * @param bool $cache Toggle caching of feed url response
- *
- * @return $this
- */
- public function setCache($cache)
- {
- $this->container['cache'] = $cache;
-
- return $this;
- }
-
- /**
- * Gets createdAt
- *
- * @return \DateTime
- */
- public function getCreatedAt()
- {
- return $this->container['createdAt'];
- }
-
- /**
- * Sets createdAt
- *
- * @param \DateTime $createdAt Datetime on which the feed was created
- *
- * @return $this
- */
- public function setCreatedAt($createdAt)
- {
- $this->container['createdAt'] = $createdAt;
-
- return $this;
- }
-
- /**
- * Gets modifiedAt
- *
- * @return \DateTime
- */
- public function getModifiedAt()
- {
- return $this->container['modifiedAt'];
- }
-
- /**
- * Sets modifiedAt
- *
- * @param \DateTime $modifiedAt Datetime on which the feed was modified
- *
- * @return $this
- */
- public function setModifiedAt($modifiedAt)
- {
- $this->container['modifiedAt'] = $modifiedAt;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetExternalFeedByUUIDHeaders.php b/lib/Model/GetExternalFeedByUUIDHeaders.php
deleted file mode 100644
index 29c89e1..0000000
--- a/lib/Model/GetExternalFeedByUUIDHeaders.php
+++ /dev/null
@@ -1,335 +0,0 @@
- 'string',
- 'value' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'value' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'value' => 'value'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'value' => 'setValue'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'value' => 'getValue'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['value'] = isset($data['value']) ? $data['value'] : null;
- }
-
- /**
- * 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the header
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets value
- *
- * @return string
- */
- public function getValue()
- {
- return $this->container['value'];
- }
-
- /**
- * Sets value
- *
- * @param string $value Value of the header
- *
- * @return $this
- */
- public function setValue($value)
- {
- $this->container['value'] = $value;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetFolder.php b/lib/Model/GetFolder.php
deleted file mode 100644
index 24b2fd1..0000000
--- a/lib/Model/GetFolder.php
+++ /dev/null
@@ -1,440 +0,0 @@
- 'int',
- 'name' => 'string',
- 'totalBlacklisted' => 'int',
- 'totalSubscribers' => 'int',
- 'uniqueSubscribers' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'int64',
- 'name' => null,
- 'totalBlacklisted' => 'int64',
- 'totalSubscribers' => 'int64',
- 'uniqueSubscribers' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'name' => 'name',
- 'totalBlacklisted' => 'totalBlacklisted',
- 'totalSubscribers' => 'totalSubscribers',
- 'uniqueSubscribers' => 'uniqueSubscribers'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'name' => 'setName',
- 'totalBlacklisted' => 'setTotalBlacklisted',
- 'totalSubscribers' => 'setTotalSubscribers',
- 'uniqueSubscribers' => 'setUniqueSubscribers'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'name' => 'getName',
- 'totalBlacklisted' => 'getTotalBlacklisted',
- 'totalSubscribers' => 'getTotalSubscribers',
- 'uniqueSubscribers' => 'getUniqueSubscribers'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['totalBlacklisted'] = isset($data['totalBlacklisted']) ? $data['totalBlacklisted'] : null;
- $this->container['totalSubscribers'] = isset($data['totalSubscribers']) ? $data['totalSubscribers'] : null;
- $this->container['uniqueSubscribers'] = isset($data['uniqueSubscribers']) ? $data['uniqueSubscribers'] : null;
- }
-
- /**
- * 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['name'] === null) {
- $invalidProperties[] = "'name' can't be null";
- }
- if ($this->container['totalBlacklisted'] === null) {
- $invalidProperties[] = "'totalBlacklisted' can't be null";
- }
- if ($this->container['totalSubscribers'] === null) {
- $invalidProperties[] = "'totalSubscribers' can't be null";
- }
- if ($this->container['uniqueSubscribers'] === null) {
- $invalidProperties[] = "'uniqueSubscribers' 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 int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id ID of the folder
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the folder
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets totalBlacklisted
- *
- * @return int
- */
- public function getTotalBlacklisted()
- {
- return $this->container['totalBlacklisted'];
- }
-
- /**
- * Sets totalBlacklisted
- *
- * @param int $totalBlacklisted Number of blacklisted contacts in the folder
- *
- * @return $this
- */
- public function setTotalBlacklisted($totalBlacklisted)
- {
- $this->container['totalBlacklisted'] = $totalBlacklisted;
-
- return $this;
- }
-
- /**
- * Gets totalSubscribers
- *
- * @return int
- */
- public function getTotalSubscribers()
- {
- return $this->container['totalSubscribers'];
- }
-
- /**
- * Sets totalSubscribers
- *
- * @param int $totalSubscribers Number of contacts in the folder
- *
- * @return $this
- */
- public function setTotalSubscribers($totalSubscribers)
- {
- $this->container['totalSubscribers'] = $totalSubscribers;
-
- return $this;
- }
-
- /**
- * Gets uniqueSubscribers
- *
- * @return int
- */
- public function getUniqueSubscribers()
- {
- return $this->container['uniqueSubscribers'];
- }
-
- /**
- * Sets uniqueSubscribers
- *
- * @param int $uniqueSubscribers Number of unique contacts in the folder
- *
- * @return $this
- */
- public function setUniqueSubscribers($uniqueSubscribers)
- {
- $this->container['uniqueSubscribers'] = $uniqueSubscribers;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetFolderLists.php b/lib/Model/GetFolderLists.php
deleted file mode 100644
index 60b3c25..0000000
--- a/lib/Model/GetFolderLists.php
+++ /dev/null
@@ -1,335 +0,0 @@
- 'object[]',
- 'count' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'lists' => null,
- 'count' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'lists' => 'lists',
- 'count' => 'count'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'lists' => 'setLists',
- 'count' => 'setCount'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'lists' => 'getLists',
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['lists'] = isset($data['lists']) ? $data['lists'] : null;
- $this->container['count'] = isset($data['count']) ? $data['count'] : null;
- }
-
- /**
- * 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 lists
- *
- * @return object[]
- */
- public function getLists()
- {
- return $this->container['lists'];
- }
-
- /**
- * Sets lists
- *
- * @param object[] $lists lists
- *
- * @return $this
- */
- public function setLists($lists)
- {
- $this->container['lists'] = $lists;
-
- return $this;
- }
-
- /**
- * Gets count
- *
- * @return int
- */
- public function getCount()
- {
- return $this->container['count'];
- }
-
- /**
- * Sets count
- *
- * @param int $count Number of lists in the folder
- *
- * @return $this
- */
- public function setCount($count)
- {
- $this->container['count'] = $count;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetFolders.php b/lib/Model/GetFolders.php
deleted file mode 100644
index 1935c41..0000000
--- a/lib/Model/GetFolders.php
+++ /dev/null
@@ -1,335 +0,0 @@
- 'object[]',
- 'count' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'folders' => null,
- 'count' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'folders' => 'folders',
- 'count' => 'count'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'folders' => 'setFolders',
- 'count' => 'setCount'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'folders' => 'getFolders',
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['folders'] = isset($data['folders']) ? $data['folders'] : null;
- $this->container['count'] = isset($data['count']) ? $data['count'] : null;
- }
-
- /**
- * 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 folders
- *
- * @return object[]
- */
- public function getFolders()
- {
- return $this->container['folders'];
- }
-
- /**
- * Sets folders
- *
- * @param object[] $folders folders
- *
- * @return $this
- */
- public function setFolders($folders)
- {
- $this->container['folders'] = $folders;
-
- return $this;
- }
-
- /**
- * Gets count
- *
- * @return int
- */
- public function getCount()
- {
- return $this->container['count'];
- }
-
- /**
- * Sets count
- *
- * @param int $count Number of folders available in your account
- *
- * @return $this
- */
- public function setCount($count)
- {
- $this->container['count'] = $count;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetInboundEmailEvents.php b/lib/Model/GetInboundEmailEvents.php
deleted file mode 100644
index c95405b..0000000
--- a/lib/Model/GetInboundEmailEvents.php
+++ /dev/null
@@ -1,305 +0,0 @@
- '\Brevo\Client\Model\GetInboundEmailEventsEvents[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'events' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'events' => 'events'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'events' => 'setEvents'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'events' => 'getEvents'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['events'] = isset($data['events']) ? $data['events'] : null;
- }
-
- /**
- * 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 events
- *
- * @return \Brevo\Client\Model\GetInboundEmailEventsEvents[]
- */
- public function getEvents()
- {
- return $this->container['events'];
- }
-
- /**
- * Sets events
- *
- * @param \Brevo\Client\Model\GetInboundEmailEventsEvents[] $events events
- *
- * @return $this
- */
- public function setEvents($events)
- {
- $this->container['events'] = $events;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetInboundEmailEventsByUuid.php b/lib/Model/GetInboundEmailEventsByUuid.php
deleted file mode 100644
index 5607781..0000000
--- a/lib/Model/GetInboundEmailEventsByUuid.php
+++ /dev/null
@@ -1,515 +0,0 @@
- '\DateTime',
- 'deliveredAt' => '\DateTime',
- 'recipient' => 'string',
- 'sender' => 'string',
- 'messageId' => 'string',
- 'subject' => 'string',
- 'attachments' => '\Brevo\Client\Model\GetInboundEmailEventsByUuidAttachments[]',
- 'logs' => '\Brevo\Client\Model\GetInboundEmailEventsByUuidLogs[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'receivedAt' => 'date-time',
- 'deliveredAt' => 'date-time',
- 'recipient' => 'email',
- 'sender' => 'email',
- 'messageId' => null,
- 'subject' => null,
- 'attachments' => null,
- 'logs' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'receivedAt' => 'receivedAt',
- 'deliveredAt' => 'deliveredAt',
- 'recipient' => 'recipient',
- 'sender' => 'sender',
- 'messageId' => 'messageId',
- 'subject' => 'subject',
- 'attachments' => 'attachments',
- 'logs' => 'logs'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'receivedAt' => 'setReceivedAt',
- 'deliveredAt' => 'setDeliveredAt',
- 'recipient' => 'setRecipient',
- 'sender' => 'setSender',
- 'messageId' => 'setMessageId',
- 'subject' => 'setSubject',
- 'attachments' => 'setAttachments',
- 'logs' => 'setLogs'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'receivedAt' => 'getReceivedAt',
- 'deliveredAt' => 'getDeliveredAt',
- 'recipient' => 'getRecipient',
- 'sender' => 'getSender',
- 'messageId' => 'getMessageId',
- 'subject' => 'getSubject',
- 'attachments' => 'getAttachments',
- 'logs' => 'getLogs'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['receivedAt'] = isset($data['receivedAt']) ? $data['receivedAt'] : null;
- $this->container['deliveredAt'] = isset($data['deliveredAt']) ? $data['deliveredAt'] : null;
- $this->container['recipient'] = isset($data['recipient']) ? $data['recipient'] : null;
- $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null;
- $this->container['messageId'] = isset($data['messageId']) ? $data['messageId'] : null;
- $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null;
- $this->container['attachments'] = isset($data['attachments']) ? $data['attachments'] : null;
- $this->container['logs'] = isset($data['logs']) ? $data['logs'] : null;
- }
-
- /**
- * 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 receivedAt
- *
- * @return \DateTime
- */
- public function getReceivedAt()
- {
- return $this->container['receivedAt'];
- }
-
- /**
- * Sets receivedAt
- *
- * @param \DateTime $receivedAt Date when email was received on SMTP relay
- *
- * @return $this
- */
- public function setReceivedAt($receivedAt)
- {
- $this->container['receivedAt'] = $receivedAt;
-
- return $this;
- }
-
- /**
- * Gets deliveredAt
- *
- * @return \DateTime
- */
- public function getDeliveredAt()
- {
- return $this->container['deliveredAt'];
- }
-
- /**
- * Sets deliveredAt
- *
- * @param \DateTime $deliveredAt Date when email was delivered successfully to client’s webhook
- *
- * @return $this
- */
- public function setDeliveredAt($deliveredAt)
- {
- $this->container['deliveredAt'] = $deliveredAt;
-
- return $this;
- }
-
- /**
- * Gets recipient
- *
- * @return string
- */
- public function getRecipient()
- {
- return $this->container['recipient'];
- }
-
- /**
- * Sets recipient
- *
- * @param string $recipient Recipient’s email address
- *
- * @return $this
- */
- public function setRecipient($recipient)
- {
- $this->container['recipient'] = $recipient;
-
- return $this;
- }
-
- /**
- * Gets sender
- *
- * @return string
- */
- public function getSender()
- {
- return $this->container['sender'];
- }
-
- /**
- * Sets sender
- *
- * @param string $sender Sender’s email address
- *
- * @return $this
- */
- public function setSender($sender)
- {
- $this->container['sender'] = $sender;
-
- return $this;
- }
-
- /**
- * Gets messageId
- *
- * @return string
- */
- public function getMessageId()
- {
- return $this->container['messageId'];
- }
-
- /**
- * Sets messageId
- *
- * @param string $messageId Value of the Message-ID header. This will be present only after the processing is done.
- *
- * @return $this
- */
- public function setMessageId($messageId)
- {
- $this->container['messageId'] = $messageId;
-
- return $this;
- }
-
- /**
- * Gets subject
- *
- * @return string
- */
- public function getSubject()
- {
- return $this->container['subject'];
- }
-
- /**
- * Sets subject
- *
- * @param string $subject Value of the Subject header. This will be present only after the processing is done.
- *
- * @return $this
- */
- public function setSubject($subject)
- {
- $this->container['subject'] = $subject;
-
- return $this;
- }
-
- /**
- * Gets attachments
- *
- * @return \Brevo\Client\Model\GetInboundEmailEventsByUuidAttachments[]
- */
- public function getAttachments()
- {
- return $this->container['attachments'];
- }
-
- /**
- * Sets attachments
- *
- * @param \Brevo\Client\Model\GetInboundEmailEventsByUuidAttachments[] $attachments List of attachments of the email. This will be present only after the processing is done.
- *
- * @return $this
- */
- public function setAttachments($attachments)
- {
- $this->container['attachments'] = $attachments;
-
- return $this;
- }
-
- /**
- * Gets logs
- *
- * @return \Brevo\Client\Model\GetInboundEmailEventsByUuidLogs[]
- */
- public function getLogs()
- {
- return $this->container['logs'];
- }
-
- /**
- * Sets logs
- *
- * @param \Brevo\Client\Model\GetInboundEmailEventsByUuidLogs[] $logs List of events/logs that describe the lifecycle of the email on SIB platform
- *
- * @return $this
- */
- public function setLogs($logs)
- {
- $this->container['logs'] = $logs;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetInboundEmailEventsByUuidAttachments.php b/lib/Model/GetInboundEmailEventsByUuidAttachments.php
deleted file mode 100644
index ce25827..0000000
--- a/lib/Model/GetInboundEmailEventsByUuidAttachments.php
+++ /dev/null
@@ -1,395 +0,0 @@
- 'string',
- 'contentType' => 'string',
- 'contentId' => 'string',
- 'contentLength' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'contentType' => null,
- 'contentId' => null,
- 'contentLength' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'contentType' => 'contentType',
- 'contentId' => 'contentId',
- 'contentLength' => 'contentLength'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'contentType' => 'setContentType',
- 'contentId' => 'setContentId',
- 'contentLength' => 'setContentLength'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'contentType' => 'getContentType',
- 'contentId' => 'getContentId',
- 'contentLength' => 'getContentLength'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['contentType'] = isset($data['contentType']) ? $data['contentType'] : null;
- $this->container['contentId'] = isset($data['contentId']) ? $data['contentId'] : null;
- $this->container['contentLength'] = isset($data['contentLength']) ? $data['contentLength'] : null;
- }
-
- /**
- * 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name filename specified in the Content-Disposition header of the attachment
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets contentType
- *
- * @return string
- */
- public function getContentType()
- {
- return $this->container['contentType'];
- }
-
- /**
- * Sets contentType
- *
- * @param string $contentType value of the Content-Type header of the attachment
- *
- * @return $this
- */
- public function setContentType($contentType)
- {
- $this->container['contentType'] = $contentType;
-
- return $this;
- }
-
- /**
- * Gets contentId
- *
- * @return string
- */
- public function getContentId()
- {
- return $this->container['contentId'];
- }
-
- /**
- * Sets contentId
- *
- * @param string $contentId value of the Content-ID header of the attachment.
- *
- * @return $this
- */
- public function setContentId($contentId)
- {
- $this->container['contentId'] = $contentId;
-
- return $this;
- }
-
- /**
- * Gets contentLength
- *
- * @return int
- */
- public function getContentLength()
- {
- return $this->container['contentLength'];
- }
-
- /**
- * Sets contentLength
- *
- * @param int $contentLength size of the attachment in bytes
- *
- * @return $this
- */
- public function setContentLength($contentLength)
- {
- $this->container['contentLength'] = $contentLength;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetInboundEmailEventsByUuidLogs.php b/lib/Model/GetInboundEmailEventsByUuidLogs.php
deleted file mode 100644
index 3addbe4..0000000
--- a/lib/Model/GetInboundEmailEventsByUuidLogs.php
+++ /dev/null
@@ -1,371 +0,0 @@
- '\DateTime',
- 'type' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'date' => 'date-time',
- 'type' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'date' => 'date',
- 'type' => 'type'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'date' => 'setDate',
- 'type' => 'setType'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'date' => 'getDate',
- 'type' => 'getType'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const TYPE_RECEIVED = 'received';
- const TYPE_PROCESSED = 'processed';
- const TYPE_WEBHOOK_FAILED = 'webhookFailed';
- const TYPE_WEBHOOK_DELIVERED = 'webhookDelivered';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getTypeAllowableValues()
- {
- return [
- self::TYPE_RECEIVED,
- self::TYPE_PROCESSED,
- self::TYPE_WEBHOOK_FAILED,
- self::TYPE_WEBHOOK_DELIVERED,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['date'] = isset($data['date']) ? $data['date'] : null;
- $this->container['type'] = isset($data['type']) ? $data['type'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- $allowedValues = $this->getTypeAllowableValues();
- if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'type', must be one of '%s'",
- 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 date
- *
- * @return \DateTime
- */
- public function getDate()
- {
- return $this->container['date'];
- }
-
- /**
- * Sets date
- *
- * @param \DateTime $date Date of the event
- *
- * @return $this
- */
- public function setDate($date)
- {
- $this->container['date'] = $date;
-
- return $this;
- }
-
- /**
- * Gets type
- *
- * @return string
- */
- public function getType()
- {
- return $this->container['type'];
- }
-
- /**
- * Sets type
- *
- * @param string $type Type of the event
- *
- * @return $this
- */
- public function setType($type)
- {
- $allowedValues = $this->getTypeAllowableValues();
- if (!is_null($type) && !in_array($type, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'type', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['type'] = $type;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetInboundEmailEventsEvents.php b/lib/Model/GetInboundEmailEventsEvents.php
deleted file mode 100644
index 966dc43..0000000
--- a/lib/Model/GetInboundEmailEventsEvents.php
+++ /dev/null
@@ -1,407 +0,0 @@
- 'string',
- 'date' => '\DateTime',
- 'sender' => 'string',
- 'recipient' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'uuid' => 'uuid',
- 'date' => 'date-time',
- 'sender' => 'email',
- 'recipient' => 'email'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'uuid' => 'uuid',
- 'date' => 'date',
- 'sender' => 'sender',
- 'recipient' => 'recipient'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'uuid' => 'setUuid',
- 'date' => 'setDate',
- 'sender' => 'setSender',
- 'recipient' => 'setRecipient'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'uuid' => 'getUuid',
- 'date' => 'getDate',
- 'sender' => 'getSender',
- 'recipient' => 'getRecipient'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['uuid'] = isset($data['uuid']) ? $data['uuid'] : null;
- $this->container['date'] = isset($data['date']) ? $data['date'] : null;
- $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null;
- $this->container['recipient'] = isset($data['recipient']) ? $data['recipient'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['uuid'] === null) {
- $invalidProperties[] = "'uuid' can't be null";
- }
- if ($this->container['date'] === null) {
- $invalidProperties[] = "'date' can't be null";
- }
- if ($this->container['sender'] === null) {
- $invalidProperties[] = "'sender' can't be null";
- }
- if ($this->container['recipient'] === null) {
- $invalidProperties[] = "'recipient' 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 uuid
- *
- * @return string
- */
- public function getUuid()
- {
- return $this->container['uuid'];
- }
-
- /**
- * Sets uuid
- *
- * @param string $uuid UUID that can be used to fetch additional data
- *
- * @return $this
- */
- public function setUuid($uuid)
- {
- $this->container['uuid'] = $uuid;
-
- return $this;
- }
-
- /**
- * Gets date
- *
- * @return \DateTime
- */
- public function getDate()
- {
- return $this->container['date'];
- }
-
- /**
- * Sets date
- *
- * @param \DateTime $date Date when email was received on SMTP relay
- *
- * @return $this
- */
- public function setDate($date)
- {
- $this->container['date'] = $date;
-
- return $this;
- }
-
- /**
- * Gets sender
- *
- * @return string
- */
- public function getSender()
- {
- return $this->container['sender'];
- }
-
- /**
- * Sets sender
- *
- * @param string $sender Sender’s email address
- *
- * @return $this
- */
- public function setSender($sender)
- {
- $this->container['sender'] = $sender;
-
- return $this;
- }
-
- /**
- * Gets recipient
- *
- * @return string
- */
- public function getRecipient()
- {
- return $this->container['recipient'];
- }
-
- /**
- * Sets recipient
- *
- * @param string $recipient Recipient’s email address
- *
- * @return $this
- */
- public function setRecipient($recipient)
- {
- $this->container['recipient'] = $recipient;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetInvitedUsersList.php b/lib/Model/GetInvitedUsersList.php
deleted file mode 100644
index 15e8982..0000000
--- a/lib/Model/GetInvitedUsersList.php
+++ /dev/null
@@ -1,305 +0,0 @@
- '\Brevo\Client\Model\GetInvitedUsersListUsers[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'users' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'users' => 'users'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'users' => 'setUsers'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['users'] = isset($data['users']) ? $data['users'] : null;
- }
-
- /**
- * 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 users
- *
- * @return \Brevo\Client\Model\GetInvitedUsersListUsers[]
- */
- public function getUsers()
- {
- return $this->container['users'];
- }
-
- /**
- * Sets users
- *
- * @param \Brevo\Client\Model\GetInvitedUsersListUsers[] $users Get invited users list
- *
- * @return $this
- */
- public function setUsers($users)
- {
- $this->container['users'] = $users;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetInvitedUsersListFeatureAccess.php b/lib/Model/GetInvitedUsersListFeatureAccess.php
deleted file mode 100644
index 07ad614..0000000
--- a/lib/Model/GetInvitedUsersListFeatureAccess.php
+++ /dev/null
@@ -1,366 +0,0 @@
- 'object',
- 'conversations' => 'object',
- 'crm' => 'object'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'marketing' => 'string',
- 'conversations' => 'string',
- 'crm' => 'string'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'marketing' => 'marketing',
- 'conversations' => 'conversations',
- 'crm' => 'crm'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'marketing' => 'setMarketing',
- 'conversations' => 'setConversations',
- 'crm' => 'setCrm'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'marketing' => 'getMarketing',
- 'conversations' => 'getConversations',
- 'crm' => 'getCrm'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['marketing'] = isset($data['marketing']) ? $data['marketing'] : null;
- $this->container['conversations'] = isset($data['conversations']) ? $data['conversations'] : null;
- $this->container['crm'] = isset($data['crm']) ? $data['crm'] : null;
- }
-
- /**
- * 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 marketing
- *
- * @return object
- */
- public function getMarketing()
- {
- return $this->container['marketing'];
- }
-
- /**
- * Sets marketing
- *
- * @param object $marketing Marketing features accessiblity.
- *
- * @return $this
- */
- public function setMarketing($marketing)
- {
- $this->container['marketing'] = $marketing;
-
- return $this;
- }
-
- /**
- * Gets conversations
- *
- * @return object
- */
- public function getConversations()
- {
- return $this->container['conversations'];
- }
-
- /**
- * Sets conversations
- *
- * @param object $conversations Conversations features accessiblity.
- *
- * @return $this
- */
- public function setConversations($conversations)
- {
- $this->container['conversations'] = $conversations;
-
- return $this;
- }
-
- /**
- * Gets crm
- *
- * @return object
- */
- public function getCrm()
- {
- return $this->container['crm'];
- }
-
- /**
- * Sets crm
- *
- * @param object $crm CRM features accessiblity.
- *
- * @return $this
- */
- public function setCrm($crm)
- {
- $this->container['crm'] = $crm;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetInvitedUsersListUsers.php b/lib/Model/GetInvitedUsersListUsers.php
deleted file mode 100644
index 4978dd4..0000000
--- a/lib/Model/GetInvitedUsersListUsers.php
+++ /dev/null
@@ -1,407 +0,0 @@
- 'string',
- 'isOwner' => 'string',
- 'status' => 'string',
- 'featureAccess' => '\Brevo\Client\Model\GetInvitedUsersListFeatureAccess'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'email' => null,
- 'isOwner' => null,
- 'status' => null,
- 'featureAccess' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'email' => 'email',
- 'isOwner' => 'is_owner',
- 'status' => 'status',
- 'featureAccess' => 'feature_access'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'email' => 'setEmail',
- 'isOwner' => 'setIsOwner',
- 'status' => 'setStatus',
- 'featureAccess' => 'setFeatureAccess'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'email' => 'getEmail',
- 'isOwner' => 'getIsOwner',
- 'status' => 'getStatus',
- 'featureAccess' => 'getFeatureAccess'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['isOwner'] = isset($data['isOwner']) ? $data['isOwner'] : null;
- $this->container['status'] = isset($data['status']) ? $data['status'] : null;
- $this->container['featureAccess'] = isset($data['featureAccess']) ? $data['featureAccess'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['email'] === null) {
- $invalidProperties[] = "'email' can't be null";
- }
- if ($this->container['isOwner'] === null) {
- $invalidProperties[] = "'isOwner' can't be null";
- }
- if ($this->container['status'] === null) {
- $invalidProperties[] = "'status' can't be null";
- }
- if ($this->container['featureAccess'] === null) {
- $invalidProperties[] = "'featureAccess' 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 email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Email address of the user.
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets isOwner
- *
- * @return string
- */
- public function getIsOwner()
- {
- return $this->container['isOwner'];
- }
-
- /**
- * Sets isOwner
- *
- * @param string $isOwner Flag for indicating is user owner of the organization.
- *
- * @return $this
- */
- public function setIsOwner($isOwner)
- {
- $this->container['isOwner'] = $isOwner;
-
- return $this;
- }
-
- /**
- * Gets status
- *
- * @return string
- */
- public function getStatus()
- {
- return $this->container['status'];
- }
-
- /**
- * Sets status
- *
- * @param string $status Status of the invited user.
- *
- * @return $this
- */
- public function setStatus($status)
- {
- $this->container['status'] = $status;
-
- return $this;
- }
-
- /**
- * Gets featureAccess
- *
- * @return \Brevo\Client\Model\GetInvitedUsersListFeatureAccess
- */
- public function getFeatureAccess()
- {
- return $this->container['featureAccess'];
- }
-
- /**
- * Sets featureAccess
- *
- * @param \Brevo\Client\Model\GetInvitedUsersListFeatureAccess $featureAccess featureAccess
- *
- * @return $this
- */
- public function setFeatureAccess($featureAccess)
- {
- $this->container['featureAccess'] = $featureAccess;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetIp.php b/lib/Model/GetIp.php
deleted file mode 100644
index 322d6fc..0000000
--- a/lib/Model/GetIp.php
+++ /dev/null
@@ -1,407 +0,0 @@
- 'int',
- 'ip' => 'string',
- 'active' => 'bool',
- 'domain' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'int64',
- 'ip' => null,
- 'active' => null,
- 'domain' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'ip' => 'ip',
- 'active' => 'active',
- 'domain' => 'domain'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'ip' => 'setIp',
- 'active' => 'setActive',
- 'domain' => 'setDomain'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'ip' => 'getIp',
- 'active' => 'getActive',
- 'domain' => 'getDomain'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null;
- $this->container['active'] = isset($data['active']) ? $data['active'] : null;
- $this->container['domain'] = isset($data['domain']) ? $data['domain'] : null;
- }
-
- /**
- * 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['ip'] === null) {
- $invalidProperties[] = "'ip' can't be null";
- }
- if ($this->container['active'] === null) {
- $invalidProperties[] = "'active' can't be null";
- }
- 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 id
- *
- * @return int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id ID of the dedicated IP
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets ip
- *
- * @return string
- */
- public function getIp()
- {
- return $this->container['ip'];
- }
-
- /**
- * Sets ip
- *
- * @param string $ip Dedicated IP
- *
- * @return $this
- */
- public function setIp($ip)
- {
- $this->container['ip'] = $ip;
-
- return $this;
- }
-
- /**
- * Gets active
- *
- * @return bool
- */
- public function getActive()
- {
- return $this->container['active'];
- }
-
- /**
- * Sets active
- *
- * @param bool $active Status of the IP (true=active, false=inactive)
- *
- * @return $this
- */
- public function setActive($active)
- {
- $this->container['active'] = $active;
-
- return $this;
- }
-
- /**
- * Gets domain
- *
- * @return string
- */
- public function getDomain()
- {
- return $this->container['domain'];
- }
-
- /**
- * Sets domain
- *
- * @param string $domain Domain associated to the IP
- *
- * @return $this
- */
- public function setDomain($domain)
- {
- $this->container['domain'] = $domain;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetIpFromSender.php b/lib/Model/GetIpFromSender.php
deleted file mode 100644
index 4802c9a..0000000
--- a/lib/Model/GetIpFromSender.php
+++ /dev/null
@@ -1,407 +0,0 @@
- 'int',
- 'ip' => 'string',
- 'domain' => 'string',
- 'weight' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'int64',
- 'ip' => null,
- 'domain' => null,
- 'weight' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'ip' => 'ip',
- 'domain' => 'domain',
- 'weight' => 'weight'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'ip' => 'setIp',
- 'domain' => 'setDomain',
- 'weight' => 'setWeight'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'ip' => 'getIp',
- 'domain' => 'getDomain',
- 'weight' => 'getWeight'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null;
- $this->container['domain'] = isset($data['domain']) ? $data['domain'] : null;
- $this->container['weight'] = isset($data['weight']) ? $data['weight'] : null;
- }
-
- /**
- * 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['ip'] === null) {
- $invalidProperties[] = "'ip' can't be null";
- }
- if ($this->container['domain'] === null) {
- $invalidProperties[] = "'domain' can't be null";
- }
- if ($this->container['weight'] === null) {
- $invalidProperties[] = "'weight' 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 int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id ID of the dedicated IP
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets ip
- *
- * @return string
- */
- public function getIp()
- {
- return $this->container['ip'];
- }
-
- /**
- * Sets ip
- *
- * @param string $ip Dedicated IP
- *
- * @return $this
- */
- public function setIp($ip)
- {
- $this->container['ip'] = $ip;
-
- return $this;
- }
-
- /**
- * Gets domain
- *
- * @return string
- */
- public function getDomain()
- {
- return $this->container['domain'];
- }
-
- /**
- * Sets domain
- *
- * @param string $domain Domain associated to the IP
- *
- * @return $this
- */
- public function setDomain($domain)
- {
- $this->container['domain'] = $domain;
-
- return $this;
- }
-
- /**
- * Gets weight
- *
- * @return int
- */
- public function getWeight()
- {
- return $this->container['weight'];
- }
-
- /**
- * Sets weight
- *
- * @param int $weight Weight of the IP
- *
- * @return $this
- */
- public function setWeight($weight)
- {
- $this->container['weight'] = $weight;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetIps.php b/lib/Model/GetIps.php
deleted file mode 100644
index fbd6cd4..0000000
--- a/lib/Model/GetIps.php
+++ /dev/null
@@ -1,308 +0,0 @@
- '\Brevo\Client\Model\GetIp[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'ips' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'ips' => 'ips'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'ips' => 'setIps'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'ips' => 'getIps'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['ips'] = isset($data['ips']) ? $data['ips'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['ips'] === null) {
- $invalidProperties[] = "'ips' 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 ips
- *
- * @return \Brevo\Client\Model\GetIp[]
- */
- public function getIps()
- {
- return $this->container['ips'];
- }
-
- /**
- * Sets ips
- *
- * @param \Brevo\Client\Model\GetIp[] $ips Dedicated IP(s) available on your account
- *
- * @return $this
- */
- public function setIps($ips)
- {
- $this->container['ips'] = $ips;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetIpsFromSender.php b/lib/Model/GetIpsFromSender.php
deleted file mode 100644
index de5b679..0000000
--- a/lib/Model/GetIpsFromSender.php
+++ /dev/null
@@ -1,308 +0,0 @@
- '\Brevo\Client\Model\GetIpFromSender[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'ips' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'ips' => 'ips'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'ips' => 'setIps'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'ips' => 'getIps'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['ips'] = isset($data['ips']) ? $data['ips'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['ips'] === null) {
- $invalidProperties[] = "'ips' 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 ips
- *
- * @return \Brevo\Client\Model\GetIpFromSender[]
- */
- public function getIps()
- {
- return $this->container['ips'];
- }
-
- /**
- * Sets ips
- *
- * @param \Brevo\Client\Model\GetIpFromSender[] $ips Dedicated IP(s) linked to a sender
- *
- * @return $this
- */
- public function setIps($ips)
- {
- $this->container['ips'] = $ips;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetList.php b/lib/Model/GetList.php
deleted file mode 100644
index e01ef48..0000000
--- a/lib/Model/GetList.php
+++ /dev/null
@@ -1,440 +0,0 @@
- 'int',
- 'name' => 'string',
- 'totalBlacklisted' => 'int',
- 'totalSubscribers' => 'int',
- 'uniqueSubscribers' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'int64',
- 'name' => null,
- 'totalBlacklisted' => 'int64',
- 'totalSubscribers' => 'int64',
- 'uniqueSubscribers' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'name' => 'name',
- 'totalBlacklisted' => 'totalBlacklisted',
- 'totalSubscribers' => 'totalSubscribers',
- 'uniqueSubscribers' => 'uniqueSubscribers'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'name' => 'setName',
- 'totalBlacklisted' => 'setTotalBlacklisted',
- 'totalSubscribers' => 'setTotalSubscribers',
- 'uniqueSubscribers' => 'setUniqueSubscribers'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'name' => 'getName',
- 'totalBlacklisted' => 'getTotalBlacklisted',
- 'totalSubscribers' => 'getTotalSubscribers',
- 'uniqueSubscribers' => 'getUniqueSubscribers'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['totalBlacklisted'] = isset($data['totalBlacklisted']) ? $data['totalBlacklisted'] : null;
- $this->container['totalSubscribers'] = isset($data['totalSubscribers']) ? $data['totalSubscribers'] : null;
- $this->container['uniqueSubscribers'] = isset($data['uniqueSubscribers']) ? $data['uniqueSubscribers'] : null;
- }
-
- /**
- * 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['name'] === null) {
- $invalidProperties[] = "'name' can't be null";
- }
- if ($this->container['totalBlacklisted'] === null) {
- $invalidProperties[] = "'totalBlacklisted' can't be null";
- }
- if ($this->container['totalSubscribers'] === null) {
- $invalidProperties[] = "'totalSubscribers' can't be null";
- }
- if ($this->container['uniqueSubscribers'] === null) {
- $invalidProperties[] = "'uniqueSubscribers' 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 int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id ID of the list
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the list
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets totalBlacklisted
- *
- * @return int
- */
- public function getTotalBlacklisted()
- {
- return $this->container['totalBlacklisted'];
- }
-
- /**
- * Sets totalBlacklisted
- *
- * @param int $totalBlacklisted Number of blacklisted contacts in the list
- *
- * @return $this
- */
- public function setTotalBlacklisted($totalBlacklisted)
- {
- $this->container['totalBlacklisted'] = $totalBlacklisted;
-
- return $this;
- }
-
- /**
- * Gets totalSubscribers
- *
- * @return int
- */
- public function getTotalSubscribers()
- {
- return $this->container['totalSubscribers'];
- }
-
- /**
- * Sets totalSubscribers
- *
- * @param int $totalSubscribers Number of contacts in the list
- *
- * @return $this
- */
- public function setTotalSubscribers($totalSubscribers)
- {
- $this->container['totalSubscribers'] = $totalSubscribers;
-
- return $this;
- }
-
- /**
- * Gets uniqueSubscribers
- *
- * @return int
- */
- public function getUniqueSubscribers()
- {
- return $this->container['uniqueSubscribers'];
- }
-
- /**
- * Sets uniqueSubscribers
- *
- * @param int $uniqueSubscribers Number of unique contacts in the list
- *
- * @return $this
- */
- public function setUniqueSubscribers($uniqueSubscribers)
- {
- $this->container['uniqueSubscribers'] = $uniqueSubscribers;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetLists.php b/lib/Model/GetLists.php
deleted file mode 100644
index 57c93ee..0000000
--- a/lib/Model/GetLists.php
+++ /dev/null
@@ -1,335 +0,0 @@
- 'object[]',
- 'count' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'lists' => null,
- 'count' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'lists' => 'lists',
- 'count' => 'count'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'lists' => 'setLists',
- 'count' => 'setCount'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'lists' => 'getLists',
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['lists'] = isset($data['lists']) ? $data['lists'] : null;
- $this->container['count'] = isset($data['count']) ? $data['count'] : null;
- }
-
- /**
- * 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 lists
- *
- * @return object[]
- */
- public function getLists()
- {
- return $this->container['lists'];
- }
-
- /**
- * Sets lists
- *
- * @param object[] $lists Listing of all the lists available in your account
- *
- * @return $this
- */
- public function setLists($lists)
- {
- $this->container['lists'] = $lists;
-
- return $this;
- }
-
- /**
- * Gets count
- *
- * @return int
- */
- public function getCount()
- {
- return $this->container['count'];
- }
-
- /**
- * Sets count
- *
- * @param int $count Number of lists in your account
- *
- * @return $this
- */
- public function setCount($count)
- {
- $this->container['count'] = $count;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetOrders.php b/lib/Model/GetOrders.php
deleted file mode 100644
index cca4fc1..0000000
--- a/lib/Model/GetOrders.php
+++ /dev/null
@@ -1,335 +0,0 @@
- 'object[]',
- 'count' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'orders' => null,
- 'count' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'orders' => 'orders',
- 'count' => 'count'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'orders' => 'setOrders',
- 'count' => 'setCount'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'orders' => 'getOrders',
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['orders'] = isset($data['orders']) ? $data['orders'] : null;
- $this->container['count'] = isset($data['count']) ? $data['count'] : null;
- }
-
- /**
- * 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 orders
- *
- * @return object[]
- */
- public function getOrders()
- {
- return $this->container['orders'];
- }
-
- /**
- * Sets orders
- *
- * @param object[] $orders orders
- *
- * @return $this
- */
- public function setOrders($orders)
- {
- $this->container['orders'] = $orders;
-
- return $this;
- }
-
- /**
- * Gets count
- *
- * @return int
- */
- public function getCount()
- {
- return $this->container['count'];
- }
-
- /**
- * Sets count
- *
- * @param int $count Number of orders
- *
- * @return $this
- */
- public function setCount($count)
- {
- $this->container['count'] = $count;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetProcess.php b/lib/Model/GetProcess.php
deleted file mode 100644
index 1bdea77..0000000
--- a/lib/Model/GetProcess.php
+++ /dev/null
@@ -1,438 +0,0 @@
- 'int',
- 'status' => 'string',
- 'name' => 'string',
- 'exportUrl' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'int64',
- 'status' => null,
- 'name' => null,
- 'exportUrl' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'status' => 'status',
- 'name' => 'name',
- 'exportUrl' => 'export_url'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'status' => 'setStatus',
- 'name' => 'setName',
- 'exportUrl' => 'setExportUrl'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'status' => 'getStatus',
- 'name' => 'getName',
- 'exportUrl' => 'getExportUrl'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const STATUS_QUEUED = 'queued';
- const STATUS_IN_PROCESS = 'in_process';
- const STATUS_COMPLETED = 'completed';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getStatusAllowableValues()
- {
- return [
- self::STATUS_QUEUED,
- self::STATUS_IN_PROCESS,
- self::STATUS_COMPLETED,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['status'] = isset($data['status']) ? $data['status'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['exportUrl'] = isset($data['exportUrl']) ? $data['exportUrl'] : null;
- }
-
- /**
- * 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['status'] === null) {
- $invalidProperties[] = "'status' can't be null";
- }
- $allowedValues = $this->getStatusAllowableValues();
- if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'status', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- if ($this->container['name'] === null) {
- $invalidProperties[] = "'name' 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 int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id Id of the process
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets status
- *
- * @return string
- */
- public function getStatus()
- {
- return $this->container['status'];
- }
-
- /**
- * Sets status
- *
- * @param string $status Status of the process
- *
- * @return $this
- */
- public function setStatus($status)
- {
- $allowedValues = $this->getStatusAllowableValues();
- if (!in_array($status, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'status', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['status'] = $status;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Process name
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets exportUrl
- *
- * @return string
- */
- public function getExportUrl()
- {
- return $this->container['exportUrl'];
- }
-
- /**
- * Sets exportUrl
- *
- * @param string $exportUrl URL on which send export the of contacts once the process is completed
- *
- * @return $this
- */
- public function setExportUrl($exportUrl)
- {
- $this->container['exportUrl'] = $exportUrl;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetProcesses.php b/lib/Model/GetProcesses.php
deleted file mode 100644
index c4ca6d5..0000000
--- a/lib/Model/GetProcesses.php
+++ /dev/null
@@ -1,335 +0,0 @@
- '\Brevo\Client\Model\GetProcess[]',
- 'count' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'processes' => null,
- 'count' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'processes' => 'processes',
- 'count' => 'count'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'processes' => 'setProcesses',
- 'count' => 'setCount'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'processes' => 'getProcesses',
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['processes'] = isset($data['processes']) ? $data['processes'] : null;
- $this->container['count'] = isset($data['count']) ? $data['count'] : null;
- }
-
- /**
- * 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 processes
- *
- * @return \Brevo\Client\Model\GetProcess[]
- */
- public function getProcesses()
- {
- return $this->container['processes'];
- }
-
- /**
- * Sets processes
- *
- * @param \Brevo\Client\Model\GetProcess[] $processes List of processes available on your account
- *
- * @return $this
- */
- public function setProcesses($processes)
- {
- $this->container['processes'] = $processes;
-
- return $this;
- }
-
- /**
- * Gets count
- *
- * @return int
- */
- public function getCount()
- {
- return $this->container['count'];
- }
-
- /**
- * Sets count
- *
- * @param int $count Number of processes available on your account
- *
- * @return $this
- */
- public function setCount($count)
- {
- $this->container['count'] = $count;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetProductDetails.php b/lib/Model/GetProductDetails.php
deleted file mode 100644
index 328ac97..0000000
--- a/lib/Model/GetProductDetails.php
+++ /dev/null
@@ -1,743 +0,0 @@
- 'string',
- 'name' => 'string',
- 'createdAt' => 'string',
- 'modifiedAt' => 'string',
- 'url' => 'string',
- 'imageUrl' => 'string',
- 'sku' => 'string',
- 'price' => 'float',
- 'categories' => 'string[]',
- 'parentId' => 'string',
- 's3Original' => 'string',
- 's3ThumbAnalytics' => 'string',
- 'metaInfo' => 'object',
- 's3ThumbEditor' => 'string',
- 'isDeleted' => 'bool'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'string',
- 'name' => 'string',
- 'createdAt' => null,
- 'modifiedAt' => null,
- 'url' => 'string',
- 'imageUrl' => 'string',
- 'sku' => 'string',
- 'price' => 'float',
- 'categories' => null,
- 'parentId' => 'string',
- 's3Original' => 'string',
- 's3ThumbAnalytics' => 'string',
- 'metaInfo' => null,
- 's3ThumbEditor' => 'string',
- 'isDeleted' => 'string'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'name' => 'name',
- 'createdAt' => 'createdAt',
- 'modifiedAt' => 'modifiedAt',
- 'url' => 'url',
- 'imageUrl' => 'imageUrl',
- 'sku' => 'sku',
- 'price' => 'price',
- 'categories' => 'categories',
- 'parentId' => 'parentId',
- 's3Original' => 's3Original',
- 's3ThumbAnalytics' => 's3ThumbAnalytics',
- 'metaInfo' => 'metaInfo',
- 's3ThumbEditor' => 's3ThumbEditor',
- 'isDeleted' => 'isDeleted'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'name' => 'setName',
- 'createdAt' => 'setCreatedAt',
- 'modifiedAt' => 'setModifiedAt',
- 'url' => 'setUrl',
- 'imageUrl' => 'setImageUrl',
- 'sku' => 'setSku',
- 'price' => 'setPrice',
- 'categories' => 'setCategories',
- 'parentId' => 'setParentId',
- 's3Original' => 'setS3Original',
- 's3ThumbAnalytics' => 'setS3ThumbAnalytics',
- 'metaInfo' => 'setMetaInfo',
- 's3ThumbEditor' => 'setS3ThumbEditor',
- 'isDeleted' => 'setIsDeleted'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'name' => 'getName',
- 'createdAt' => 'getCreatedAt',
- 'modifiedAt' => 'getModifiedAt',
- 'url' => 'getUrl',
- 'imageUrl' => 'getImageUrl',
- 'sku' => 'getSku',
- 'price' => 'getPrice',
- 'categories' => 'getCategories',
- 'parentId' => 'getParentId',
- 's3Original' => 'getS3Original',
- 's3ThumbAnalytics' => 'getS3ThumbAnalytics',
- 'metaInfo' => 'getMetaInfo',
- 's3ThumbEditor' => 'getS3ThumbEditor',
- 'isDeleted' => '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null;
- $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null;
- $this->container['url'] = isset($data['url']) ? $data['url'] : null;
- $this->container['imageUrl'] = isset($data['imageUrl']) ? $data['imageUrl'] : null;
- $this->container['sku'] = isset($data['sku']) ? $data['sku'] : null;
- $this->container['price'] = isset($data['price']) ? $data['price'] : null;
- $this->container['categories'] = isset($data['categories']) ? $data['categories'] : null;
- $this->container['parentId'] = isset($data['parentId']) ? $data['parentId'] : null;
- $this->container['s3Original'] = isset($data['s3Original']) ? $data['s3Original'] : null;
- $this->container['s3ThumbAnalytics'] = isset($data['s3ThumbAnalytics']) ? $data['s3ThumbAnalytics'] : null;
- $this->container['metaInfo'] = isset($data['metaInfo']) ? $data['metaInfo'] : null;
- $this->container['s3ThumbEditor'] = isset($data['s3ThumbEditor']) ? $data['s3ThumbEditor'] : null;
- $this->container['isDeleted'] = isset($data['isDeleted']) ? $data['isDeleted'] : null;
- }
-
- /**
- * 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['name'] === null) {
- $invalidProperties[] = "'name' can't be null";
- }
- if ($this->container['createdAt'] === null) {
- $invalidProperties[] = "'createdAt' can't be null";
- }
- if ($this->container['modifiedAt'] === null) {
- $invalidProperties[] = "'modifiedAt' can't be null";
- }
- if ($this->container['s3ThumbAnalytics'] === null) {
- $invalidProperties[] = "'s3ThumbAnalytics' can't be null";
- }
- if ($this->container['s3ThumbEditor'] === null) {
- $invalidProperties[] = "'s3ThumbEditor' 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 Product ID for which you requested the details
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the product for which you requested the details
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets createdAt
- *
- * @return string
- */
- public function getCreatedAt()
- {
- return $this->container['createdAt'];
- }
-
- /**
- * Sets createdAt
- *
- * @param string $createdAt Creation UTC date-time of the product (YYYY-MM-DDTHH:mm:ss.SSSZ)
- *
- * @return $this
- */
- public function setCreatedAt($createdAt)
- {
- $this->container['createdAt'] = $createdAt;
-
- return $this;
- }
-
- /**
- * Gets modifiedAt
- *
- * @return string
- */
- public function getModifiedAt()
- {
- return $this->container['modifiedAt'];
- }
-
- /**
- * Sets modifiedAt
- *
- * @param string $modifiedAt Last modification UTC date-time of the product (YYYY-MM-DDTHH:mm:ss.SSSZ)
- *
- * @return $this
- */
- public function setModifiedAt($modifiedAt)
- {
- $this->container['modifiedAt'] = $modifiedAt;
-
- return $this;
- }
-
- /**
- * Gets url
- *
- * @return string
- */
- public function getUrl()
- {
- return $this->container['url'];
- }
-
- /**
- * Sets url
- *
- * @param string $url URL to the product
- *
- * @return $this
- */
- public function setUrl($url)
- {
- $this->container['url'] = $url;
-
- return $this;
- }
-
- /**
- * Gets imageUrl
- *
- * @return string
- */
- public function getImageUrl()
- {
- return $this->container['imageUrl'];
- }
-
- /**
- * Sets imageUrl
- *
- * @param string $imageUrl Absolute URL to the cover image of the product
- *
- * @return $this
- */
- public function setImageUrl($imageUrl)
- {
- $this->container['imageUrl'] = $imageUrl;
-
- return $this;
- }
-
- /**
- * Gets sku
- *
- * @return string
- */
- public function getSku()
- {
- return $this->container['sku'];
- }
-
- /**
- * Sets sku
- *
- * @param string $sku Product identifier from the shop
- *
- * @return $this
- */
- public function setSku($sku)
- {
- $this->container['sku'] = $sku;
-
- return $this;
- }
-
- /**
- * Gets price
- *
- * @return float
- */
- public function getPrice()
- {
- return $this->container['price'];
- }
-
- /**
- * Sets price
- *
- * @param float $price Price of the product
- *
- * @return $this
- */
- public function setPrice($price)
- {
- $this->container['price'] = $price;
-
- return $this;
- }
-
- /**
- * Gets categories
- *
- * @return string[]
- */
- public function getCategories()
- {
- return $this->container['categories'];
- }
-
- /**
- * Sets categories
- *
- * @param string[] $categories Category ID-s of the product
- *
- * @return $this
- */
- public function setCategories($categories)
- {
- $this->container['categories'] = $categories;
-
- return $this;
- }
-
- /**
- * Gets parentId
- *
- * @return string
- */
- public function getParentId()
- {
- return $this->container['parentId'];
- }
-
- /**
- * Sets parentId
- *
- * @param string $parentId Parent product id of the product
- *
- * @return $this
- */
- public function setParentId($parentId)
- {
- $this->container['parentId'] = $parentId;
-
- return $this;
- }
-
- /**
- * Gets s3Original
- *
- * @return string
- */
- public function getS3Original()
- {
- return $this->container['s3Original'];
- }
-
- /**
- * Sets s3Original
- *
- * @param string $s3Original S3 url of original image
- *
- * @return $this
- */
- public function setS3Original($s3Original)
- {
- $this->container['s3Original'] = $s3Original;
-
- return $this;
- }
-
- /**
- * Gets s3ThumbAnalytics
- *
- * @return string
- */
- public function getS3ThumbAnalytics()
- {
- return $this->container['s3ThumbAnalytics'];
- }
-
- /**
- * Sets s3ThumbAnalytics
- *
- * @param string $s3ThumbAnalytics S3 thumbnail url of original image in 120x120 dimension for analytics section
- *
- * @return $this
- */
- public function setS3ThumbAnalytics($s3ThumbAnalytics)
- {
- $this->container['s3ThumbAnalytics'] = $s3ThumbAnalytics;
-
- return $this;
- }
-
- /**
- * Gets metaInfo
- *
- * @return object
- */
- public function getMetaInfo()
- {
- return $this->container['metaInfo'];
- }
-
- /**
- * Sets metaInfo
- *
- * @param object $metaInfo Meta data of product such as description, vendor, producer, stock level, etc.
- *
- * @return $this
- */
- public function setMetaInfo($metaInfo)
- {
- $this->container['metaInfo'] = $metaInfo;
-
- return $this;
- }
-
- /**
- * Gets s3ThumbEditor
- *
- * @return string
- */
- public function getS3ThumbEditor()
- {
- return $this->container['s3ThumbEditor'];
- }
-
- /**
- * Sets s3ThumbEditor
- *
- * @param string $s3ThumbEditor S3 thumbnail url of original image in 600x400 dimension for editor section
- *
- * @return $this
- */
- public function setS3ThumbEditor($s3ThumbEditor)
- {
- $this->container['s3ThumbEditor'] = $s3ThumbEditor;
-
- return $this;
- }
-
- /**
- * Gets isDeleted
- *
- * @return bool
- */
- public function getIsDeleted()
- {
- return $this->container['isDeleted'];
- }
-
- /**
- * Sets isDeleted
- *
- * @param bool $isDeleted product deleted from the shop's database
- *
- * @return $this
- */
- public function setIsDeleted($isDeleted)
- {
- $this->container['isDeleted'] = $isDeleted;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetProducts.php b/lib/Model/GetProducts.php
deleted file mode 100644
index 3e432a0..0000000
--- a/lib/Model/GetProducts.php
+++ /dev/null
@@ -1,341 +0,0 @@
- 'object[]',
- 'count' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'products' => null,
- 'count' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'products' => 'products',
- 'count' => 'count'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'products' => 'setProducts',
- 'count' => 'setCount'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'products' => 'getProducts',
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['products'] = isset($data['products']) ? $data['products'] : null;
- $this->container['count'] = isset($data['count']) ? $data['count'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['products'] === null) {
- $invalidProperties[] = "'products' 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 products
- *
- * @return object[]
- */
- public function getProducts()
- {
- return $this->container['products'];
- }
-
- /**
- * Sets products
- *
- * @param object[] $products products
- *
- * @return $this
- */
- public function setProducts($products)
- {
- $this->container['products'] = $products;
-
- return $this;
- }
-
- /**
- * Gets count
- *
- * @return int
- */
- public function getCount()
- {
- return $this->container['count'];
- }
-
- /**
- * Sets count
- *
- * @param int $count Number of products
- *
- * @return $this
- */
- public function setCount($count)
- {
- $this->container['count'] = $count;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetReports.php b/lib/Model/GetReports.php
deleted file mode 100644
index 07d8bf7..0000000
--- a/lib/Model/GetReports.php
+++ /dev/null
@@ -1,305 +0,0 @@
- '\Brevo\Client\Model\GetReportsReports[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'reports' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'reports' => 'reports'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'reports' => 'setReports'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'reports' => 'getReports'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['reports'] = isset($data['reports']) ? $data['reports'] : null;
- }
-
- /**
- * 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 reports
- *
- * @return \Brevo\Client\Model\GetReportsReports[]
- */
- public function getReports()
- {
- return $this->container['reports'];
- }
-
- /**
- * Sets reports
- *
- * @param \Brevo\Client\Model\GetReportsReports[] $reports reports
- *
- * @return $this
- */
- public function setReports($reports)
- {
- $this->container['reports'] = $reports;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetReportsReports.php b/lib/Model/GetReportsReports.php
deleted file mode 100644
index 49106d6..0000000
--- a/lib/Model/GetReportsReports.php
+++ /dev/null
@@ -1,704 +0,0 @@
- '\DateTime',
- 'requests' => 'int',
- 'delivered' => 'int',
- 'hardBounces' => 'int',
- 'softBounces' => 'int',
- 'clicks' => 'int',
- 'uniqueClicks' => 'int',
- 'opens' => 'int',
- 'uniqueOpens' => 'int',
- 'spamReports' => 'int',
- 'blocked' => 'int',
- 'invalid' => 'int',
- 'unsubscribed' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'date' => 'date',
- 'requests' => 'int64',
- 'delivered' => 'int64',
- 'hardBounces' => 'int64',
- 'softBounces' => 'int64',
- 'clicks' => 'int64',
- 'uniqueClicks' => 'int64',
- 'opens' => 'int64',
- 'uniqueOpens' => 'int64',
- 'spamReports' => 'int64',
- 'blocked' => 'int64',
- 'invalid' => 'int64',
- 'unsubscribed' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'date' => 'date',
- 'requests' => 'requests',
- 'delivered' => 'delivered',
- 'hardBounces' => 'hardBounces',
- 'softBounces' => 'softBounces',
- 'clicks' => 'clicks',
- 'uniqueClicks' => 'uniqueClicks',
- 'opens' => 'opens',
- 'uniqueOpens' => 'uniqueOpens',
- 'spamReports' => 'spamReports',
- 'blocked' => 'blocked',
- 'invalid' => 'invalid',
- 'unsubscribed' => 'unsubscribed'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'date' => 'setDate',
- 'requests' => 'setRequests',
- 'delivered' => 'setDelivered',
- 'hardBounces' => 'setHardBounces',
- 'softBounces' => 'setSoftBounces',
- 'clicks' => 'setClicks',
- 'uniqueClicks' => 'setUniqueClicks',
- 'opens' => 'setOpens',
- 'uniqueOpens' => 'setUniqueOpens',
- 'spamReports' => 'setSpamReports',
- 'blocked' => 'setBlocked',
- 'invalid' => 'setInvalid',
- 'unsubscribed' => 'setUnsubscribed'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'date' => 'getDate',
- 'requests' => 'getRequests',
- 'delivered' => 'getDelivered',
- 'hardBounces' => 'getHardBounces',
- 'softBounces' => 'getSoftBounces',
- 'clicks' => 'getClicks',
- 'uniqueClicks' => 'getUniqueClicks',
- 'opens' => 'getOpens',
- 'uniqueOpens' => 'getUniqueOpens',
- 'spamReports' => 'getSpamReports',
- 'blocked' => 'getBlocked',
- 'invalid' => 'getInvalid',
- 'unsubscribed' => 'getUnsubscribed'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['date'] = isset($data['date']) ? $data['date'] : null;
- $this->container['requests'] = isset($data['requests']) ? $data['requests'] : null;
- $this->container['delivered'] = isset($data['delivered']) ? $data['delivered'] : null;
- $this->container['hardBounces'] = isset($data['hardBounces']) ? $data['hardBounces'] : null;
- $this->container['softBounces'] = isset($data['softBounces']) ? $data['softBounces'] : null;
- $this->container['clicks'] = isset($data['clicks']) ? $data['clicks'] : null;
- $this->container['uniqueClicks'] = isset($data['uniqueClicks']) ? $data['uniqueClicks'] : null;
- $this->container['opens'] = isset($data['opens']) ? $data['opens'] : null;
- $this->container['uniqueOpens'] = isset($data['uniqueOpens']) ? $data['uniqueOpens'] : null;
- $this->container['spamReports'] = isset($data['spamReports']) ? $data['spamReports'] : null;
- $this->container['blocked'] = isset($data['blocked']) ? $data['blocked'] : null;
- $this->container['invalid'] = isset($data['invalid']) ? $data['invalid'] : null;
- $this->container['unsubscribed'] = isset($data['unsubscribed']) ? $data['unsubscribed'] : null;
- }
-
- /**
- * 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['requests'] === null) {
- $invalidProperties[] = "'requests' can't be null";
- }
- if ($this->container['delivered'] === null) {
- $invalidProperties[] = "'delivered' can't be null";
- }
- if ($this->container['hardBounces'] === null) {
- $invalidProperties[] = "'hardBounces' can't be null";
- }
- if ($this->container['softBounces'] === null) {
- $invalidProperties[] = "'softBounces' can't be null";
- }
- if ($this->container['clicks'] === null) {
- $invalidProperties[] = "'clicks' can't be null";
- }
- if ($this->container['uniqueClicks'] === null) {
- $invalidProperties[] = "'uniqueClicks' can't be null";
- }
- if ($this->container['opens'] === null) {
- $invalidProperties[] = "'opens' can't be null";
- }
- if ($this->container['uniqueOpens'] === null) {
- $invalidProperties[] = "'uniqueOpens' can't be null";
- }
- if ($this->container['spamReports'] === null) {
- $invalidProperties[] = "'spamReports' can't be null";
- }
- if ($this->container['blocked'] === null) {
- $invalidProperties[] = "'blocked' can't be null";
- }
- if ($this->container['invalid'] === null) {
- $invalidProperties[] = "'invalid' can't be null";
- }
- if ($this->container['unsubscribed'] === null) {
- $invalidProperties[] = "'unsubscribed' 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 of the statistics
- *
- * @return $this
- */
- public function setDate($date)
- {
- $this->container['date'] = $date;
-
- return $this;
- }
-
- /**
- * Gets requests
- *
- * @return int
- */
- public function getRequests()
- {
- return $this->container['requests'];
- }
-
- /**
- * Sets requests
- *
- * @param int $requests Number of requests for the date
- *
- * @return $this
- */
- public function setRequests($requests)
- {
- $this->container['requests'] = $requests;
-
- return $this;
- }
-
- /**
- * Gets delivered
- *
- * @return int
- */
- public function getDelivered()
- {
- return $this->container['delivered'];
- }
-
- /**
- * Sets delivered
- *
- * @param int $delivered Number of delivered emails for the date
- *
- * @return $this
- */
- public function setDelivered($delivered)
- {
- $this->container['delivered'] = $delivered;
-
- return $this;
- }
-
- /**
- * Gets hardBounces
- *
- * @return int
- */
- public function getHardBounces()
- {
- return $this->container['hardBounces'];
- }
-
- /**
- * Sets hardBounces
- *
- * @param int $hardBounces Number of hardbounces for the date
- *
- * @return $this
- */
- public function setHardBounces($hardBounces)
- {
- $this->container['hardBounces'] = $hardBounces;
-
- return $this;
- }
-
- /**
- * Gets softBounces
- *
- * @return int
- */
- public function getSoftBounces()
- {
- return $this->container['softBounces'];
- }
-
- /**
- * Sets softBounces
- *
- * @param int $softBounces Number of softbounces for the date
- *
- * @return $this
- */
- public function setSoftBounces($softBounces)
- {
- $this->container['softBounces'] = $softBounces;
-
- return $this;
- }
-
- /**
- * Gets clicks
- *
- * @return int
- */
- public function getClicks()
- {
- return $this->container['clicks'];
- }
-
- /**
- * Sets clicks
- *
- * @param int $clicks Number of clicks for the date
- *
- * @return $this
- */
- public function setClicks($clicks)
- {
- $this->container['clicks'] = $clicks;
-
- return $this;
- }
-
- /**
- * Gets uniqueClicks
- *
- * @return int
- */
- public function getUniqueClicks()
- {
- return $this->container['uniqueClicks'];
- }
-
- /**
- * Sets uniqueClicks
- *
- * @param int $uniqueClicks Number of unique clicks for the date
- *
- * @return $this
- */
- public function setUniqueClicks($uniqueClicks)
- {
- $this->container['uniqueClicks'] = $uniqueClicks;
-
- return $this;
- }
-
- /**
- * Gets opens
- *
- * @return int
- */
- public function getOpens()
- {
- return $this->container['opens'];
- }
-
- /**
- * Sets opens
- *
- * @param int $opens Number of openings for the date
- *
- * @return $this
- */
- public function setOpens($opens)
- {
- $this->container['opens'] = $opens;
-
- return $this;
- }
-
- /**
- * Gets uniqueOpens
- *
- * @return int
- */
- public function getUniqueOpens()
- {
- return $this->container['uniqueOpens'];
- }
-
- /**
- * Sets uniqueOpens
- *
- * @param int $uniqueOpens Number of unique openings for the date
- *
- * @return $this
- */
- public function setUniqueOpens($uniqueOpens)
- {
- $this->container['uniqueOpens'] = $uniqueOpens;
-
- return $this;
- }
-
- /**
- * Gets spamReports
- *
- * @return int
- */
- public function getSpamReports()
- {
- return $this->container['spamReports'];
- }
-
- /**
- * Sets spamReports
- *
- * @param int $spamReports Number of complaints (spam reports) for the date
- *
- * @return $this
- */
- public function setSpamReports($spamReports)
- {
- $this->container['spamReports'] = $spamReports;
-
- return $this;
- }
-
- /**
- * Gets blocked
- *
- * @return int
- */
- public function getBlocked()
- {
- return $this->container['blocked'];
- }
-
- /**
- * Sets blocked
- *
- * @param int $blocked Number of blocked emails for the date
- *
- * @return $this
- */
- public function setBlocked($blocked)
- {
- $this->container['blocked'] = $blocked;
-
- return $this;
- }
-
- /**
- * Gets invalid
- *
- * @return int
- */
- public function getInvalid()
- {
- return $this->container['invalid'];
- }
-
- /**
- * Sets invalid
- *
- * @param int $invalid Number of invalid emails for the date
- *
- * @return $this
- */
- public function setInvalid($invalid)
- {
- $this->container['invalid'] = $invalid;
-
- return $this;
- }
-
- /**
- * Gets unsubscribed
- *
- * @return int
- */
- public function getUnsubscribed()
- {
- return $this->container['unsubscribed'];
- }
-
- /**
- * Sets unsubscribed
- *
- * @param int $unsubscribed Number of unsubscribed emails for the date
- *
- * @return $this
- */
- public function setUnsubscribed($unsubscribed)
- {
- $this->container['unsubscribed'] = $unsubscribed;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetScheduledEmailByBatchId.php b/lib/Model/GetScheduledEmailByBatchId.php
deleted file mode 100644
index fc0ad3e..0000000
--- a/lib/Model/GetScheduledEmailByBatchId.php
+++ /dev/null
@@ -1,335 +0,0 @@
- 'int',
- 'batches' => '\Brevo\Client\Model\GetScheduledEmailByBatchIdBatches[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'count' => null,
- 'batches' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'count' => 'count',
- 'batches' => 'batches'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'count' => 'setCount',
- 'batches' => 'setBatches'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'count' => 'getCount',
- 'batches' => 'getBatches'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['count'] = isset($data['count']) ? $data['count'] : null;
- $this->container['batches'] = isset($data['batches']) ? $data['batches'] : null;
- }
-
- /**
- * 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 count
- *
- * @return int
- */
- public function getCount()
- {
- return $this->container['count'];
- }
-
- /**
- * Sets count
- *
- * @param int $count Total number of batches
- *
- * @return $this
- */
- public function setCount($count)
- {
- $this->container['count'] = $count;
-
- return $this;
- }
-
- /**
- * Gets batches
- *
- * @return \Brevo\Client\Model\GetScheduledEmailByBatchIdBatches[]
- */
- public function getBatches()
- {
- return $this->container['batches'];
- }
-
- /**
- * Sets batches
- *
- * @param \Brevo\Client\Model\GetScheduledEmailByBatchIdBatches[] $batches batches
- *
- * @return $this
- */
- public function setBatches($batches)
- {
- $this->container['batches'] = $batches;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetScheduledEmailByBatchIdBatches.php b/lib/Model/GetScheduledEmailByBatchIdBatches.php
deleted file mode 100644
index 59bc501..0000000
--- a/lib/Model/GetScheduledEmailByBatchIdBatches.php
+++ /dev/null
@@ -1,410 +0,0 @@
- '\DateTime',
- 'createdAt' => '\DateTime',
- 'status' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'scheduledAt' => 'date-time',
- 'createdAt' => 'date-time',
- 'status' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'scheduledAt' => 'scheduledAt',
- 'createdAt' => 'createdAt',
- 'status' => 'status'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'scheduledAt' => 'setScheduledAt',
- 'createdAt' => 'setCreatedAt',
- 'status' => 'setStatus'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'scheduledAt' => 'getScheduledAt',
- 'createdAt' => 'getCreatedAt',
- '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::$swaggerModelName;
- }
-
- const STATUS_IN_PROGRESS = 'inProgress';
- const STATUS_QUEUED = 'queued';
- const STATUS_PROCESSED = 'processed';
- const STATUS_ERROR = 'error';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getStatusAllowableValues()
- {
- return [
- self::STATUS_IN_PROGRESS,
- self::STATUS_QUEUED,
- self::STATUS_PROCESSED,
- self::STATUS_ERROR,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['scheduledAt'] = isset($data['scheduledAt']) ? $data['scheduledAt'] : null;
- $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null;
- $this->container['status'] = isset($data['status']) ? $data['status'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['scheduledAt'] === null) {
- $invalidProperties[] = "'scheduledAt' can't be null";
- }
- if ($this->container['createdAt'] === null) {
- $invalidProperties[] = "'createdAt' can't be null";
- }
- if ($this->container['status'] === null) {
- $invalidProperties[] = "'status' can't be null";
- }
- $allowedValues = $this->getStatusAllowableValues();
- if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'status', must be one of '%s'",
- 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 scheduledAt
- *
- * @return \DateTime
- */
- public function getScheduledAt()
- {
- return $this->container['scheduledAt'];
- }
-
- /**
- * Sets scheduledAt
- *
- * @param \DateTime $scheduledAt Datetime for which the batch was scheduled
- *
- * @return $this
- */
- public function setScheduledAt($scheduledAt)
- {
- $this->container['scheduledAt'] = $scheduledAt;
-
- return $this;
- }
-
- /**
- * Gets createdAt
- *
- * @return \DateTime
- */
- public function getCreatedAt()
- {
- return $this->container['createdAt'];
- }
-
- /**
- * Sets createdAt
- *
- * @param \DateTime $createdAt Datetime on which the batch was scheduled
- *
- * @return $this
- */
- public function setCreatedAt($createdAt)
- {
- $this->container['createdAt'] = $createdAt;
-
- return $this;
- }
-
- /**
- * Gets status
- *
- * @return string
- */
- public function getStatus()
- {
- return $this->container['status'];
- }
-
- /**
- * Sets status
- *
- * @param string $status Current status of the scheduled batch
- *
- * @return $this
- */
- public function setStatus($status)
- {
- $allowedValues = $this->getStatusAllowableValues();
- if (!in_array($status, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'status', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['status'] = $status;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetScheduledEmailByMessageId.php b/lib/Model/GetScheduledEmailByMessageId.php
deleted file mode 100644
index 7064a41..0000000
--- a/lib/Model/GetScheduledEmailByMessageId.php
+++ /dev/null
@@ -1,410 +0,0 @@
- '\DateTime',
- 'createdAt' => '\DateTime',
- 'status' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'scheduledAt' => 'date-time',
- 'createdAt' => 'date-time',
- 'status' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'scheduledAt' => 'scheduledAt',
- 'createdAt' => 'createdAt',
- 'status' => 'status'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'scheduledAt' => 'setScheduledAt',
- 'createdAt' => 'setCreatedAt',
- 'status' => 'setStatus'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'scheduledAt' => 'getScheduledAt',
- 'createdAt' => 'getCreatedAt',
- '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::$swaggerModelName;
- }
-
- const STATUS_IN_PROGRESS = 'inProgress';
- const STATUS_QUEUED = 'queued';
- const STATUS_PROCESSED = 'processed';
- const STATUS_ERROR = 'error';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getStatusAllowableValues()
- {
- return [
- self::STATUS_IN_PROGRESS,
- self::STATUS_QUEUED,
- self::STATUS_PROCESSED,
- self::STATUS_ERROR,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['scheduledAt'] = isset($data['scheduledAt']) ? $data['scheduledAt'] : null;
- $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null;
- $this->container['status'] = isset($data['status']) ? $data['status'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['scheduledAt'] === null) {
- $invalidProperties[] = "'scheduledAt' can't be null";
- }
- if ($this->container['createdAt'] === null) {
- $invalidProperties[] = "'createdAt' can't be null";
- }
- if ($this->container['status'] === null) {
- $invalidProperties[] = "'status' can't be null";
- }
- $allowedValues = $this->getStatusAllowableValues();
- if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'status', must be one of '%s'",
- 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 scheduledAt
- *
- * @return \DateTime
- */
- public function getScheduledAt()
- {
- return $this->container['scheduledAt'];
- }
-
- /**
- * Sets scheduledAt
- *
- * @param \DateTime $scheduledAt Datetime for which the email was scheduled
- *
- * @return $this
- */
- public function setScheduledAt($scheduledAt)
- {
- $this->container['scheduledAt'] = $scheduledAt;
-
- return $this;
- }
-
- /**
- * Gets createdAt
- *
- * @return \DateTime
- */
- public function getCreatedAt()
- {
- return $this->container['createdAt'];
- }
-
- /**
- * Sets createdAt
- *
- * @param \DateTime $createdAt Datetime on which the email was scheduled
- *
- * @return $this
- */
- public function setCreatedAt($createdAt)
- {
- $this->container['createdAt'] = $createdAt;
-
- return $this;
- }
-
- /**
- * Gets status
- *
- * @return string
- */
- public function getStatus()
- {
- return $this->container['status'];
- }
-
- /**
- * Sets status
- *
- * @param string $status Current status of the scheduled email
- *
- * @return $this
- */
- public function setStatus($status)
- {
- $allowedValues = $this->getStatusAllowableValues();
- if (!in_array($status, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'status', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['status'] = $status;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetSegments.php b/lib/Model/GetSegments.php
deleted file mode 100644
index 96c0b51..0000000
--- a/lib/Model/GetSegments.php
+++ /dev/null
@@ -1,335 +0,0 @@
- '\Brevo\Client\Model\GetSegmentsSegments',
- 'count' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'segments' => null,
- 'count' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'segments' => 'segments',
- 'count' => 'count'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'segments' => 'setSegments',
- 'count' => 'setCount'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'segments' => 'getSegments',
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['segments'] = isset($data['segments']) ? $data['segments'] : null;
- $this->container['count'] = isset($data['count']) ? $data['count'] : null;
- }
-
- /**
- * 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 segments
- *
- * @return \Brevo\Client\Model\GetSegmentsSegments
- */
- public function getSegments()
- {
- return $this->container['segments'];
- }
-
- /**
- * Sets segments
- *
- * @param \Brevo\Client\Model\GetSegmentsSegments $segments segments
- *
- * @return $this
- */
- public function setSegments($segments)
- {
- $this->container['segments'] = $segments;
-
- return $this;
- }
-
- /**
- * Gets count
- *
- * @return int
- */
- public function getCount()
- {
- return $this->container['count'];
- }
-
- /**
- * Sets count
- *
- * @param int $count Number of Segments available in your account
- *
- * @return $this
- */
- public function setCount($count)
- {
- $this->container['count'] = $count;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetSegmentsSegments.php b/lib/Model/GetSegmentsSegments.php
deleted file mode 100644
index fed8fc0..0000000
--- a/lib/Model/GetSegmentsSegments.php
+++ /dev/null
@@ -1,395 +0,0 @@
- 'int',
- 'segmentName' => 'string',
- 'categoryName' => 'string',
- 'updatedAt' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'int64',
- 'segmentName' => null,
- 'categoryName' => 'string',
- 'updatedAt' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'segmentName' => 'segmentName',
- 'categoryName' => 'categoryName',
- 'updatedAt' => 'updatedAt'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'segmentName' => 'setSegmentName',
- 'categoryName' => 'setCategoryName',
- 'updatedAt' => 'setUpdatedAt'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'segmentName' => 'getSegmentName',
- 'categoryName' => 'getCategoryName',
- 'updatedAt' => 'getUpdatedAt'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['segmentName'] = isset($data['segmentName']) ? $data['segmentName'] : null;
- $this->container['categoryName'] = isset($data['categoryName']) ? $data['categoryName'] : null;
- $this->container['updatedAt'] = isset($data['updatedAt']) ? $data['updatedAt'] : null;
- }
-
- /**
- * 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 id
- *
- * @return int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id ID of the list
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets segmentName
- *
- * @return string
- */
- public function getSegmentName()
- {
- return $this->container['segmentName'];
- }
-
- /**
- * Sets segmentName
- *
- * @param string $segmentName Name of the Segment
- *
- * @return $this
- */
- public function setSegmentName($segmentName)
- {
- $this->container['segmentName'] = $segmentName;
-
- return $this;
- }
-
- /**
- * Gets categoryName
- *
- * @return string
- */
- public function getCategoryName()
- {
- return $this->container['categoryName'];
- }
-
- /**
- * Sets categoryName
- *
- * @param string $categoryName Name of the Segment Category
- *
- * @return $this
- */
- public function setCategoryName($categoryName)
- {
- $this->container['categoryName'] = $categoryName;
-
- return $this;
- }
-
- /**
- * Gets updatedAt
- *
- * @return string
- */
- public function getUpdatedAt()
- {
- return $this->container['updatedAt'];
- }
-
- /**
- * Sets updatedAt
- *
- * @param string $updatedAt Updation UTC date-time of the segment (YYYY-MM-DDTHH:mm:ss.SSSZ)
- *
- * @return $this
- */
- public function setUpdatedAt($updatedAt)
- {
- $this->container['updatedAt'] = $updatedAt;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetSendersList.php b/lib/Model/GetSendersList.php
deleted file mode 100644
index 4651dc8..0000000
--- a/lib/Model/GetSendersList.php
+++ /dev/null
@@ -1,305 +0,0 @@
- '\Brevo\Client\Model\GetSendersListSenders[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'senders' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'senders' => 'senders'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'senders' => 'setSenders'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'senders' => 'getSenders'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['senders'] = isset($data['senders']) ? $data['senders'] : null;
- }
-
- /**
- * 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 senders
- *
- * @return \Brevo\Client\Model\GetSendersListSenders[]
- */
- public function getSenders()
- {
- return $this->container['senders'];
- }
-
- /**
- * Sets senders
- *
- * @param \Brevo\Client\Model\GetSendersListSenders[] $senders List of the senders available in your account
- *
- * @return $this
- */
- public function setSenders($senders)
- {
- $this->container['senders'] = $senders;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetSendersListIps.php b/lib/Model/GetSendersListIps.php
deleted file mode 100644
index 8bfc1fb..0000000
--- a/lib/Model/GetSendersListIps.php
+++ /dev/null
@@ -1,374 +0,0 @@
- 'string',
- 'domain' => 'string',
- 'weight' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'ip' => null,
- 'domain' => null,
- 'weight' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'ip' => 'ip',
- 'domain' => 'domain',
- 'weight' => 'weight'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'ip' => 'setIp',
- 'domain' => 'setDomain',
- 'weight' => 'setWeight'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'ip' => 'getIp',
- 'domain' => 'getDomain',
- 'weight' => 'getWeight'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null;
- $this->container['domain'] = isset($data['domain']) ? $data['domain'] : null;
- $this->container['weight'] = isset($data['weight']) ? $data['weight'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['ip'] === null) {
- $invalidProperties[] = "'ip' can't be null";
- }
- if ($this->container['domain'] === null) {
- $invalidProperties[] = "'domain' can't be null";
- }
- if ($this->container['weight'] === null) {
- $invalidProperties[] = "'weight' 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 ip
- *
- * @return string
- */
- public function getIp()
- {
- return $this->container['ip'];
- }
-
- /**
- * Sets ip
- *
- * @param string $ip Dedicated IP available in your account
- *
- * @return $this
- */
- public function setIp($ip)
- {
- $this->container['ip'] = $ip;
-
- return $this;
- }
-
- /**
- * Gets domain
- *
- * @return string
- */
- public function getDomain()
- {
- return $this->container['domain'];
- }
-
- /**
- * Sets domain
- *
- * @param string $domain Domain of the IP
- *
- * @return $this
- */
- public function setDomain($domain)
- {
- $this->container['domain'] = $domain;
-
- return $this;
- }
-
- /**
- * Gets weight
- *
- * @return int
- */
- public function getWeight()
- {
- return $this->container['weight'];
- }
-
- /**
- * Sets weight
- *
- * @param int $weight Weight of the IP for this sender
- *
- * @return $this
- */
- public function setWeight($weight)
- {
- $this->container['weight'] = $weight;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetSendersListSenders.php b/lib/Model/GetSendersListSenders.php
deleted file mode 100644
index b621f86..0000000
--- a/lib/Model/GetSendersListSenders.php
+++ /dev/null
@@ -1,437 +0,0 @@
- 'int',
- 'name' => 'string',
- 'email' => 'string',
- 'active' => 'bool',
- 'ips' => '\Brevo\Client\Model\GetSendersListIps[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'int64',
- 'name' => null,
- 'email' => null,
- 'active' => null,
- 'ips' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'name' => 'name',
- 'email' => 'email',
- 'active' => 'active',
- 'ips' => 'ips'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'name' => 'setName',
- 'email' => 'setEmail',
- 'active' => 'setActive',
- 'ips' => 'setIps'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'name' => 'getName',
- 'email' => 'getEmail',
- 'active' => 'getActive',
- 'ips' => 'getIps'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['active'] = isset($data['active']) ? $data['active'] : null;
- $this->container['ips'] = isset($data['ips']) ? $data['ips'] : null;
- }
-
- /**
- * 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['name'] === null) {
- $invalidProperties[] = "'name' can't be null";
- }
- if ($this->container['email'] === null) {
- $invalidProperties[] = "'email' can't be null";
- }
- if ($this->container['active'] === null) {
- $invalidProperties[] = "'active' 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 int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id Id of the sender
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name From Name associated to the sender
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email From Email associated to the sender
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets active
- *
- * @return bool
- */
- public function getActive()
- {
- return $this->container['active'];
- }
-
- /**
- * Sets active
- *
- * @param bool $active Status of sender (true=activated, false=deactivated)
- *
- * @return $this
- */
- public function setActive($active)
- {
- $this->container['active'] = $active;
-
- return $this;
- }
-
- /**
- * Gets ips
- *
- * @return \Brevo\Client\Model\GetSendersListIps[]
- */
- public function getIps()
- {
- return $this->container['ips'];
- }
-
- /**
- * Sets ips
- *
- * @param \Brevo\Client\Model\GetSendersListIps[] $ips List of dedicated IP(s) available in the account. This data is displayed only for dedicated IPs
- *
- * @return $this
- */
- public function setIps($ips)
- {
- $this->container['ips'] = $ips;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetSharedTemplateUrl.php b/lib/Model/GetSharedTemplateUrl.php
deleted file mode 100644
index 62e3eb3..0000000
--- a/lib/Model/GetSharedTemplateUrl.php
+++ /dev/null
@@ -1,308 +0,0 @@
- 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'sharedUrl' => 'url'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'sharedUrl' => 'sharedUrl'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'sharedUrl' => 'setSharedUrl'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'sharedUrl' => 'getSharedUrl'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['sharedUrl'] = isset($data['sharedUrl']) ? $data['sharedUrl'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['sharedUrl'] === null) {
- $invalidProperties[] = "'sharedUrl' 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 sharedUrl
- *
- * @return string
- */
- public function getSharedUrl()
- {
- return $this->container['sharedUrl'];
- }
-
- /**
- * Sets sharedUrl
- *
- * @param string $sharedUrl A unique URL for the email campaign or transactional template. This URL can be shared with other Brevo users.
- *
- * @return $this
- */
- public function setSharedUrl($sharedUrl)
- {
- $this->container['sharedUrl'] = $sharedUrl;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetSmsCampaign.php b/lib/Model/GetSmsCampaign.php
deleted file mode 100644
index 4499ec6..0000000
--- a/lib/Model/GetSmsCampaign.php
+++ /dev/null
@@ -1,642 +0,0 @@
- 'int',
- 'name' => 'string',
- 'status' => 'string',
- 'content' => 'string',
- 'scheduledAt' => 'string',
- 'sender' => 'string',
- 'createdAt' => 'string',
- 'modifiedAt' => 'string',
- 'recipients' => 'object',
- 'statistics' => 'object'
- ];
-
- /**
- @@ -75,14 +65,6 @@ class GetSmsCampaign implements ModelInterface, ArrayAccess
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'int64',
- 'name' => null,
- 'status' => null,
- 'content' => null,
- 'scheduledAt' => null,
- 'sender' => null,
- 'createdAt' => null,
- 'modifiedAt' => null,
- 'recipients' => null,
- 'statistics' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'name' => 'name',
- 'status' => 'status',
- 'content' => 'content',
- 'scheduledAt' => 'scheduledAt',
- 'sender' => 'sender',
- 'createdAt' => 'createdAt',
- 'modifiedAt' => 'modifiedAt',
- 'recipients' => 'recipients',
- 'statistics' => 'statistics'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'name' => 'setName',
- 'status' => 'setStatus',
- 'content' => 'setContent',
- 'scheduledAt' => 'setScheduledAt',
- 'sender' => 'setSender',
- 'createdAt' => 'setCreatedAt',
- 'modifiedAt' => 'setModifiedAt',
- 'recipients' => 'setRecipients',
- 'statistics' => 'setStatistics'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'name' => 'getName',
- 'status' => 'getStatus',
- 'content' => 'getContent',
- 'scheduledAt' => 'getScheduledAt',
- 'sender' => 'getSender',
- 'createdAt' => 'getCreatedAt',
- 'modifiedAt' => 'getModifiedAt',
- 'recipients' => 'getRecipients',
- 'statistics' => 'getStatistics'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const STATUS_DRAFT = 'draft';
- const STATUS_SENT = 'sent';
- const STATUS_ARCHIVE = 'archive';
- const STATUS_QUEUED = 'queued';
- const STATUS_SUSPENDED = 'suspended';
- const STATUS_IN_PROCESS = 'inProcess';
-
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getStatusAllowableValues()
- {
- return [
- self::STATUS_DRAFT,
- self::STATUS_SENT,
- self::STATUS_ARCHIVE,
- self::STATUS_QUEUED,
- self::STATUS_SUSPENDED,
- self::STATUS_IN_PROCESS,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['status'] = isset($data['status']) ? $data['status'] : null;
- $this->container['content'] = isset($data['content']) ? $data['content'] : null;
- $this->container['scheduledAt'] = isset($data['scheduledAt']) ? $data['scheduledAt'] : null;
- $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null;
- $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null;
- $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null;
- $this->container['recipients'] = isset($data['recipients']) ? $data['recipients'] : null;
- $this->container['statistics'] = isset($data['statistics']) ? $data['statistics'] : null;
- }
-
- /**
- * 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['name'] === null) {
- $invalidProperties[] = "'name' can't be null";
- }
- if ($this->container['status'] === null) {
- $invalidProperties[] = "'status' can't be null";
- }
- $allowedValues = $this->getStatusAllowableValues();
- if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'status', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- if ($this->container['content'] === null) {
- $invalidProperties[] = "'content' can't be null";
- }
- if ($this->container['sender'] === null) {
- $invalidProperties[] = "'sender' can't be null";
- }
- if ($this->container['createdAt'] === null) {
- $invalidProperties[] = "'createdAt' can't be null";
- }
- if ($this->container['modifiedAt'] === null) {
- $invalidProperties[] = "'modifiedAt' can't be null";
- }
- if ($this->container['recipients'] === null) {
- $invalidProperties[] = "'recipients' can't be null";
- }
- if ($this->container['statistics'] === null) {
- $invalidProperties[] = "'statistics' 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 int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id ID of the SMS Campaign
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the SMS Campaign
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets status
- *
- * @return string
- */
- public function getStatus()
- {
- return $this->container['status'];
- }
-
- /**
- * Sets status
- *
- * @param string $status Status of the SMS Campaign
- *
- * @return $this
- */
- public function setStatus($status)
- {
- $allowedValues = $this->getStatusAllowableValues();
- if (!in_array($status, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'status', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['status'] = $status;
-
- return $this;
- }
-
- /**
- * Gets content
- *
- * @return string
- */
- public function getContent()
- {
- return $this->container['content'];
- }
-
- /**
- * Sets content
- *
- * @param string $content Content of the SMS Campaign
- *
- * @return $this
- */
- public function setContent($content)
- {
- $this->container['content'] = $content;
-
- return $this;
- }
-
- /**
- * Gets scheduledAt
- *
- * @return string
- */
- public function getScheduledAt()
- {
- return $this->container['scheduledAt'];
- }
-
- /**
- * Sets scheduledAt
- *
- * @param string $scheduledAt UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format
- *
- * @return $this
- */
- public function setScheduledAt($scheduledAt)
- {
- $this->container['scheduledAt'] = $scheduledAt;
-
- return $this;
- }
-
- /**
- * Gets sender
- *
- * @return string
- */
- public function getSender()
- {
- return $this->container['sender'];
- }
-
- /**
- * Sets sender
- *
- * @param string $sender Sender of the SMS Campaign
- *
- * @return $this
- */
- public function setSender($sender)
- {
- $this->container['sender'] = $sender;
-
- return $this;
- }
-
- /**
- * Gets createdAt
- *
- * @return string
- */
- public function getCreatedAt()
- {
- return $this->container['createdAt'];
- }
-
- /**
- * Sets createdAt
- *
- * @param string $createdAt Creation UTC date-time of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ)
- *
- * @return $this
- */
- public function setCreatedAt($createdAt)
- {
- $this->container['createdAt'] = $createdAt;
-
- return $this;
- }
-
- /**
- * Gets modifiedAt
- *
- * @return string
- */
- public function getModifiedAt()
- {
- return $this->container['modifiedAt'];
- }
-
- /**
- * Sets modifiedAt
- *
- * @param string $modifiedAt UTC date-time of last modification of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ)
- *
- * @return $this
- */
- public function setModifiedAt($modifiedAt)
- {
- $this->container['modifiedAt'] = $modifiedAt;
-
- return $this;
- }
-
- /**
- * Gets recipients
- *
- * @return object
- */
- public function getRecipients()
- {
- return $this->container['recipients'];
- }
-
- /**
- * Sets recipients
- *
- * @param object $recipients recipients
- *
- * @return $this
- */
- public function setRecipients($recipients)
- {
- $this->container['recipients'] = $recipients;
-
- return $this;
- }
-
- /**
- * Gets statistics
- *
- * @return object
- */
- public function getStatistics()
- {
- return $this->container['statistics'];
- }
-
- /**
- * Sets statistics
- *
- * @param object $statistics statistics
- *
- * @return $this
- */
- public function setStatistics($statistics)
- {
- $this->container['statistics'] = $statistics;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetSmsCampaignOverview.php b/lib/Model/GetSmsCampaignOverview.php
deleted file mode 100644
index 739cde9..0000000
--- a/lib/Model/GetSmsCampaignOverview.php
+++ /dev/null
@@ -1,576 +0,0 @@
- 'int',
- 'name' => 'string',
- 'status' => 'string',
- 'content' => 'string',
- 'scheduledAt' => 'string',
- 'sender' => 'string',
- 'createdAt' => 'string',
- 'modifiedAt' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'int64',
- 'name' => null,
- 'status' => null,
- 'content' => null,
- 'scheduledAt' => null,
- 'sender' => null,
- 'createdAt' => null,
- 'modifiedAt' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'name' => 'name',
- 'status' => 'status',
- 'content' => 'content',
- 'scheduledAt' => 'scheduledAt',
- 'sender' => 'sender',
- 'createdAt' => 'createdAt',
- 'modifiedAt' => 'modifiedAt'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'name' => 'setName',
- 'status' => 'setStatus',
- 'content' => 'setContent',
- 'scheduledAt' => 'setScheduledAt',
- 'sender' => 'setSender',
- 'createdAt' => 'setCreatedAt',
- 'modifiedAt' => 'setModifiedAt'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'name' => 'getName',
- 'status' => 'getStatus',
- 'content' => 'getContent',
- 'scheduledAt' => 'getScheduledAt',
- 'sender' => 'getSender',
- 'createdAt' => 'getCreatedAt',
- 'modifiedAt' => 'getModifiedAt'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const STATUS_DRAFT = 'draft';
- const STATUS_SENT = 'sent';
- const STATUS_ARCHIVE = 'archive';
- const STATUS_QUEUED = 'queued';
- const STATUS_SUSPENDED = 'suspended';
- const STATUS_IN_PROCESS = 'inProcess';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getStatusAllowableValues()
- {
- return [
- self::STATUS_DRAFT,
- self::STATUS_SENT,
- self::STATUS_ARCHIVE,
- self::STATUS_QUEUED,
- self::STATUS_SUSPENDED,
- self::STATUS_IN_PROCESS,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['status'] = isset($data['status']) ? $data['status'] : null;
- $this->container['content'] = isset($data['content']) ? $data['content'] : null;
- $this->container['scheduledAt'] = isset($data['scheduledAt']) ? $data['scheduledAt'] : null;
- $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null;
- $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null;
- $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null;
- }
-
- /**
- * 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['name'] === null) {
- $invalidProperties[] = "'name' can't be null";
- }
- if ($this->container['status'] === null) {
- $invalidProperties[] = "'status' can't be null";
- }
- $allowedValues = $this->getStatusAllowableValues();
- if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'status', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- if ($this->container['content'] === null) {
- $invalidProperties[] = "'content' can't be null";
- }
- if ($this->container['sender'] === null) {
- $invalidProperties[] = "'sender' can't be null";
- }
- if ($this->container['createdAt'] === null) {
- $invalidProperties[] = "'createdAt' can't be null";
- }
- if ($this->container['modifiedAt'] === null) {
- $invalidProperties[] = "'modifiedAt' 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 int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id ID of the SMS Campaign
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the SMS Campaign
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets status
- *
- * @return string
- */
- public function getStatus()
- {
- return $this->container['status'];
- }
-
- /**
- * Sets status
- *
- * @param string $status Status of the SMS Campaign
- *
- * @return $this
- */
- public function setStatus($status)
- {
- $allowedValues = $this->getStatusAllowableValues();
- if (!in_array($status, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'status', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['status'] = $status;
-
- return $this;
- }
-
- /**
- * Gets content
- *
- * @return string
- */
- public function getContent()
- {
- return $this->container['content'];
- }
-
- /**
- * Sets content
- *
- * @param string $content Content of the SMS Campaign
- *
- * @return $this
- */
- public function setContent($content)
- {
- $this->container['content'] = $content;
-
- return $this;
- }
-
- /**
- * Gets scheduledAt
- *
- * @return string
- */
- public function getScheduledAt()
- {
- return $this->container['scheduledAt'];
- }
-
- /**
- * Sets scheduledAt
- *
- * @param string $scheduledAt UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format
- *
- * @return $this
- */
- public function setScheduledAt($scheduledAt)
- {
- $this->container['scheduledAt'] = $scheduledAt;
-
- return $this;
- }
-
- /**
- * Gets sender
- *
- * @return string
- */
- public function getSender()
- {
- return $this->container['sender'];
- }
-
- /**
- * Sets sender
- *
- * @param string $sender Sender of the SMS Campaign
- *
- * @return $this
- */
- public function setSender($sender)
- {
- $this->container['sender'] = $sender;
-
- return $this;
- }
-
- /**
- * Gets createdAt
- *
- * @return string
- */
- public function getCreatedAt()
- {
- return $this->container['createdAt'];
- }
-
- /**
- * Sets createdAt
- *
- * @param string $createdAt Creation UTC date-time of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ)
- *
- * @return $this
- */
- public function setCreatedAt($createdAt)
- {
- $this->container['createdAt'] = $createdAt;
-
- return $this;
- }
-
- /**
- * Gets modifiedAt
- *
- * @return string
- */
- public function getModifiedAt()
- {
- return $this->container['modifiedAt'];
- }
-
- /**
- * Sets modifiedAt
- *
- * @param string $modifiedAt UTC date-time of last modification of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ)
- *
- * @return $this
- */
- public function setModifiedAt($modifiedAt)
- {
- $this->container['modifiedAt'] = $modifiedAt;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetSmsCampaignRecipients.php b/lib/Model/GetSmsCampaignRecipients.php
deleted file mode 100644
index fecf2a6..0000000
--- a/lib/Model/GetSmsCampaignRecipients.php
+++ /dev/null
@@ -1,280 +0,0 @@
-listInvalidProperties()) === 0;
- }
-
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetSmsCampaignStats.php b/lib/Model/GetSmsCampaignStats.php
deleted file mode 100644
index d6b528d..0000000
--- a/lib/Model/GetSmsCampaignStats.php
+++ /dev/null
@@ -1,506 +0,0 @@
- 'int',
- 'sent' => 'int',
- 'processing' => 'int',
- 'softBounces' => 'int',
- 'hardBounces' => 'int',
- 'unsubscriptions' => 'int',
- 'answered' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'delivered' => 'int64',
- 'sent' => 'int64',
- 'processing' => 'int64',
- 'softBounces' => 'int64',
- 'hardBounces' => 'int64',
- 'unsubscriptions' => 'int64',
- 'answered' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'delivered' => 'delivered',
- 'sent' => 'sent',
- 'processing' => 'processing',
- 'softBounces' => 'softBounces',
- 'hardBounces' => 'hardBounces',
- 'unsubscriptions' => 'unsubscriptions',
- 'answered' => 'answered'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'delivered' => 'setDelivered',
- 'sent' => 'setSent',
- 'processing' => 'setProcessing',
- 'softBounces' => 'setSoftBounces',
- 'hardBounces' => 'setHardBounces',
- 'unsubscriptions' => 'setUnsubscriptions',
- 'answered' => 'setAnswered'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'delivered' => 'getDelivered',
- 'sent' => 'getSent',
- 'processing' => 'getProcessing',
- 'softBounces' => 'getSoftBounces',
- 'hardBounces' => 'getHardBounces',
- 'unsubscriptions' => 'getUnsubscriptions',
- 'answered' => 'getAnswered'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['delivered'] = isset($data['delivered']) ? $data['delivered'] : null;
- $this->container['sent'] = isset($data['sent']) ? $data['sent'] : null;
- $this->container['processing'] = isset($data['processing']) ? $data['processing'] : null;
- $this->container['softBounces'] = isset($data['softBounces']) ? $data['softBounces'] : null;
- $this->container['hardBounces'] = isset($data['hardBounces']) ? $data['hardBounces'] : null;
- $this->container['unsubscriptions'] = isset($data['unsubscriptions']) ? $data['unsubscriptions'] : null;
- $this->container['answered'] = isset($data['answered']) ? $data['answered'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['delivered'] === null) {
- $invalidProperties[] = "'delivered' can't be null";
- }
- if ($this->container['sent'] === null) {
- $invalidProperties[] = "'sent' can't be null";
- }
- if ($this->container['processing'] === null) {
- $invalidProperties[] = "'processing' can't be null";
- }
- if ($this->container['softBounces'] === null) {
- $invalidProperties[] = "'softBounces' can't be null";
- }
- if ($this->container['hardBounces'] === null) {
- $invalidProperties[] = "'hardBounces' can't be null";
- }
- if ($this->container['unsubscriptions'] === null) {
- $invalidProperties[] = "'unsubscriptions' can't be null";
- }
- if ($this->container['answered'] === null) {
- $invalidProperties[] = "'answered' 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 delivered
- *
- * @return int
- */
- public function getDelivered()
- {
- return $this->container['delivered'];
- }
-
- /**
- * Sets delivered
- *
- * @param int $delivered Number of delivered SMS
- *
- * @return $this
- */
- public function setDelivered($delivered)
- {
- $this->container['delivered'] = $delivered;
-
- return $this;
- }
-
- /**
- * Gets sent
- *
- * @return int
- */
- public function getSent()
- {
- return $this->container['sent'];
- }
-
- /**
- * Sets sent
- *
- * @param int $sent Number of sent SMS
- *
- * @return $this
- */
- public function setSent($sent)
- {
- $this->container['sent'] = $sent;
-
- return $this;
- }
-
- /**
- * Gets processing
- *
- * @return int
- */
- public function getProcessing()
- {
- return $this->container['processing'];
- }
-
- /**
- * Sets processing
- *
- * @param int $processing Number of processing SMS
- *
- * @return $this
- */
- public function setProcessing($processing)
- {
- $this->container['processing'] = $processing;
-
- return $this;
- }
-
- /**
- * Gets softBounces
- *
- * @return int
- */
- public function getSoftBounces()
- {
- return $this->container['softBounces'];
- }
-
- /**
- * Sets softBounces
- *
- * @param int $softBounces Number of softbounced SMS
- *
- * @return $this
- */
- public function setSoftBounces($softBounces)
- {
- $this->container['softBounces'] = $softBounces;
-
- return $this;
- }
-
- /**
- * Gets hardBounces
- *
- * @return int
- */
- public function getHardBounces()
- {
- return $this->container['hardBounces'];
- }
-
- /**
- * Sets hardBounces
- *
- * @param int $hardBounces Number of hardbounced SMS
- *
- * @return $this
- */
- public function setHardBounces($hardBounces)
- {
- $this->container['hardBounces'] = $hardBounces;
-
- return $this;
- }
-
- /**
- * Gets unsubscriptions
- *
- * @return int
- */
- public function getUnsubscriptions()
- {
- return $this->container['unsubscriptions'];
- }
-
- /**
- * Sets unsubscriptions
- *
- * @param int $unsubscriptions Number of unsubscription SMS
- *
- * @return $this
- */
- public function setUnsubscriptions($unsubscriptions)
- {
- $this->container['unsubscriptions'] = $unsubscriptions;
-
- return $this;
- }
-
- /**
- * Gets answered
- *
- * @return int
- */
- public function getAnswered()
- {
- return $this->container['answered'];
- }
-
- /**
- * Sets answered
- *
- * @param int $answered Number of replies to the SMS
- *
- * @return $this
- */
- public function setAnswered($answered)
- {
- $this->container['answered'] = $answered;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetSmsCampaigns.php b/lib/Model/GetSmsCampaigns.php
deleted file mode 100644
index 09a711d..0000000
--- a/lib/Model/GetSmsCampaigns.php
+++ /dev/null
@@ -1,335 +0,0 @@
- 'object[]',
- 'count' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'campaigns' => null,
- 'count' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'campaigns' => 'campaigns',
- 'count' => 'count'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'campaigns' => 'setCampaigns',
- 'count' => 'setCount'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'campaigns' => 'getCampaigns',
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['campaigns'] = isset($data['campaigns']) ? $data['campaigns'] : null;
- $this->container['count'] = isset($data['count']) ? $data['count'] : null;
- }
-
- /**
- * 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 campaigns
- *
- * @return object[]
- */
- public function getCampaigns()
- {
- return $this->container['campaigns'];
- }
-
- /**
- * Sets campaigns
- *
- * @param object[] $campaigns campaigns
- *
- * @return $this
- */
- public function setCampaigns($campaigns)
- {
- $this->container['campaigns'] = $campaigns;
-
- return $this;
- }
-
- /**
- * Gets count
- *
- * @return int
- */
- public function getCount()
- {
- return $this->container['count'];
- }
-
- /**
- * Sets count
- *
- * @param int $count Number of SMS campaigns retrieved
- *
- * @return $this
- */
- public function setCount($count)
- {
- $this->container['count'] = $count;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetSmsEventReport.php b/lib/Model/GetSmsEventReport.php
deleted file mode 100644
index 89833ec..0000000
--- a/lib/Model/GetSmsEventReport.php
+++ /dev/null
@@ -1,305 +0,0 @@
- '\Brevo\Client\Model\GetSmsEventReportEvents[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'events' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'events' => 'events'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'events' => 'setEvents'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'events' => 'getEvents'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['events'] = isset($data['events']) ? $data['events'] : null;
- }
-
- /**
- * 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 events
- *
- * @return \Brevo\Client\Model\GetSmsEventReportEvents[]
- */
- public function getEvents()
- {
- return $this->container['events'];
- }
-
- /**
- * Sets events
- *
- * @param \Brevo\Client\Model\GetSmsEventReportEvents[] $events events
- *
- * @return $this
- */
- public function setEvents($events)
- {
- $this->container['events'] = $events;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetSmsEventReportEvents.php b/lib/Model/GetSmsEventReportEvents.php
deleted file mode 100644
index d10ee82..0000000
--- a/lib/Model/GetSmsEventReportEvents.php
+++ /dev/null
@@ -1,533 +0,0 @@
- 'string',
- 'date' => 'string',
- 'messageId' => 'string',
- 'event' => 'string',
- 'reason' => 'string',
- 'reply' => 'string',
- 'tag' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'phoneNumber' => null,
- 'date' => null,
- 'messageId' => null,
- 'event' => null,
- 'reason' => null,
- 'reply' => null,
- 'tag' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'phoneNumber' => 'phoneNumber',
- 'date' => 'date',
- 'messageId' => 'messageId',
- 'event' => 'event',
- 'reason' => 'reason',
- 'reply' => 'reply',
- 'tag' => 'tag'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'phoneNumber' => 'setPhoneNumber',
- 'date' => 'setDate',
- 'messageId' => 'setMessageId',
- 'event' => 'setEvent',
- 'reason' => 'setReason',
- 'reply' => 'setReply',
- 'tag' => 'setTag'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'phoneNumber' => 'getPhoneNumber',
- 'date' => 'getDate',
- 'messageId' => 'getMessageId',
- 'event' => 'getEvent',
- 'reason' => 'getReason',
- 'reply' => 'getReply',
- 'tag' => 'getTag'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const EVENT_BOUNCES = 'bounces';
- const EVENT_HARD_BOUNCES = 'hardBounces';
- const EVENT_SOFT_BOUNCES = 'softBounces';
- const EVENT_DELIVERED = 'delivered';
- const EVENT_SENT = 'sent';
- const EVENT_ACCEPTED = 'accepted';
- const EVENT_UNSUBSCRIPTION = 'unsubscription';
- const EVENT_REPLIES = 'replies';
- const EVENT_BLOCKED = 'blocked';
- const EVENT_REJECTED = 'rejected';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getEventAllowableValues()
- {
- return [
- self::EVENT_BOUNCES,
- self::EVENT_HARD_BOUNCES,
- self::EVENT_SOFT_BOUNCES,
- self::EVENT_DELIVERED,
- self::EVENT_SENT,
- self::EVENT_ACCEPTED,
- self::EVENT_UNSUBSCRIPTION,
- self::EVENT_REPLIES,
- self::EVENT_BLOCKED,
- self::EVENT_REJECTED,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['phoneNumber'] = isset($data['phoneNumber']) ? $data['phoneNumber'] : null;
- $this->container['date'] = isset($data['date']) ? $data['date'] : null;
- $this->container['messageId'] = isset($data['messageId']) ? $data['messageId'] : null;
- $this->container['event'] = isset($data['event']) ? $data['event'] : null;
- $this->container['reason'] = isset($data['reason']) ? $data['reason'] : null;
- $this->container['reply'] = isset($data['reply']) ? $data['reply'] : null;
- $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- $allowedValues = $this->getEventAllowableValues();
- if (!is_null($this->container['event']) && !in_array($this->container['event'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'event', must be one of '%s'",
- 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 phoneNumber
- *
- * @return string
- */
- public function getPhoneNumber()
- {
- return $this->container['phoneNumber'];
- }
-
- /**
- * Sets phoneNumber
- *
- * @param string $phoneNumber Phone number which has generated the event
- *
- * @return $this
- */
- public function setPhoneNumber($phoneNumber)
- {
- $this->container['phoneNumber'] = $phoneNumber;
-
- return $this;
- }
-
- /**
- * Gets date
- *
- * @return string
- */
- public function getDate()
- {
- return $this->container['date'];
- }
-
- /**
- * Sets date
- *
- * @param string $date UTC date-time on which the event has been generated
- *
- * @return $this
- */
- public function setDate($date)
- {
- $this->container['date'] = $date;
-
- return $this;
- }
-
- /**
- * Gets messageId
- *
- * @return string
- */
- public function getMessageId()
- {
- return $this->container['messageId'];
- }
-
- /**
- * Sets messageId
- *
- * @param string $messageId Message ID which generated the event
- *
- * @return $this
- */
- public function setMessageId($messageId)
- {
- $this->container['messageId'] = $messageId;
-
- return $this;
- }
-
- /**
- * Gets event
- *
- * @return string
- */
- public function getEvent()
- {
- return $this->container['event'];
- }
-
- /**
- * Sets event
- *
- * @param string $event Event which occurred
- *
- * @return $this
- */
- public function setEvent($event)
- {
- $allowedValues = $this->getEventAllowableValues();
- if (!is_null($event) && !in_array($event, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'event', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['event'] = $event;
-
- return $this;
- }
-
- /**
- * Gets reason
- *
- * @return string
- */
- public function getReason()
- {
- return $this->container['reason'];
- }
-
- /**
- * Sets reason
- *
- * @param string $reason Reason of bounce (only available if the event is hardbounce or softbounce)
- *
- * @return $this
- */
- public function setReason($reason)
- {
- $this->container['reason'] = $reason;
-
- return $this;
- }
-
- /**
- * Gets reply
- *
- * @return string
- */
- public function getReply()
- {
- return $this->container['reply'];
- }
-
- /**
- * Sets reply
- *
- * @param string $reply reply
- *
- * @return $this
- */
- public function setReply($reply)
- {
- $this->container['reply'] = $reply;
-
- return $this;
- }
-
- /**
- * Gets tag
- *
- * @return string
- */
- public function getTag()
- {
- return $this->container['tag'];
- }
-
- /**
- * Sets tag
- *
- * @param string $tag Tag of the SMS which generated the event
- *
- * @return $this
- */
- public function setTag($tag)
- {
- $this->container['tag'] = $tag;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetSmtpTemplateOverview.php b/lib/Model/GetSmtpTemplateOverview.php
deleted file mode 100644
index 4a42b55..0000000
--- a/lib/Model/GetSmtpTemplateOverview.php
+++ /dev/null
@@ -1,701 +0,0 @@
- 'int',
- 'name' => 'string',
- 'subject' => 'string',
- 'isActive' => 'bool',
- 'testSent' => 'bool',
- 'sender' => '\Brevo\Client\Model\GetSmtpTemplateOverviewSender',
- 'replyTo' => 'string',
- 'toField' => 'string',
- 'tag' => 'string',
- 'htmlContent' => 'string',
- 'createdAt' => 'string',
- 'modifiedAt' => 'string',
- 'doiTemplate' => 'bool'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'int64',
- 'name' => null,
- 'subject' => null,
- 'isActive' => null,
- 'testSent' => null,
- 'sender' => null,
- 'replyTo' => 'email',
- 'toField' => null,
- 'tag' => null,
- 'htmlContent' => null,
- 'createdAt' => null,
- 'modifiedAt' => null,
- 'doiTemplate' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'name' => 'name',
- 'subject' => 'subject',
- 'isActive' => 'isActive',
- 'testSent' => 'testSent',
- 'sender' => 'sender',
- 'replyTo' => 'replyTo',
- 'toField' => 'toField',
- 'tag' => 'tag',
- 'htmlContent' => 'htmlContent',
- 'createdAt' => 'createdAt',
- 'modifiedAt' => 'modifiedAt',
- 'doiTemplate' => 'doiTemplate'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'name' => 'setName',
- 'subject' => 'setSubject',
- 'isActive' => 'setIsActive',
- 'testSent' => 'setTestSent',
- 'sender' => 'setSender',
- 'replyTo' => 'setReplyTo',
- 'toField' => 'setToField',
- 'tag' => 'setTag',
- 'htmlContent' => 'setHtmlContent',
- 'createdAt' => 'setCreatedAt',
- 'modifiedAt' => 'setModifiedAt',
- 'doiTemplate' => 'setDoiTemplate'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'name' => 'getName',
- 'subject' => 'getSubject',
- 'isActive' => 'getIsActive',
- 'testSent' => 'getTestSent',
- 'sender' => 'getSender',
- 'replyTo' => 'getReplyTo',
- 'toField' => 'getToField',
- 'tag' => 'getTag',
- 'htmlContent' => 'getHtmlContent',
- 'createdAt' => 'getCreatedAt',
- 'modifiedAt' => 'getModifiedAt',
- 'doiTemplate' => 'getDoiTemplate'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null;
- $this->container['isActive'] = isset($data['isActive']) ? $data['isActive'] : null;
- $this->container['testSent'] = isset($data['testSent']) ? $data['testSent'] : null;
- $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null;
- $this->container['replyTo'] = isset($data['replyTo']) ? $data['replyTo'] : null;
- $this->container['toField'] = isset($data['toField']) ? $data['toField'] : null;
- $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null;
- $this->container['htmlContent'] = isset($data['htmlContent']) ? $data['htmlContent'] : null;
- $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null;
- $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null;
- $this->container['doiTemplate'] = isset($data['doiTemplate']) ? $data['doiTemplate'] : null;
- }
-
- /**
- * 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['name'] === null) {
- $invalidProperties[] = "'name' can't be null";
- }
- if ($this->container['subject'] === null) {
- $invalidProperties[] = "'subject' can't be null";
- }
- if ($this->container['isActive'] === null) {
- $invalidProperties[] = "'isActive' can't be null";
- }
- if ($this->container['testSent'] === null) {
- $invalidProperties[] = "'testSent' can't be null";
- }
- if ($this->container['sender'] === null) {
- $invalidProperties[] = "'sender' can't be null";
- }
- if ($this->container['replyTo'] === null) {
- $invalidProperties[] = "'replyTo' can't be null";
- }
- if ($this->container['toField'] === null) {
- $invalidProperties[] = "'toField' can't be null";
- }
- if ($this->container['tag'] === null) {
- $invalidProperties[] = "'tag' can't be null";
- }
- if ($this->container['htmlContent'] === null) {
- $invalidProperties[] = "'htmlContent' can't be null";
- }
- if ($this->container['createdAt'] === null) {
- $invalidProperties[] = "'createdAt' can't be null";
- }
- if ($this->container['modifiedAt'] === null) {
- $invalidProperties[] = "'modifiedAt' 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 int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id ID of the template
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the template
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets subject
- *
- * @return string
- */
- public function getSubject()
- {
- return $this->container['subject'];
- }
-
- /**
- * Sets subject
- *
- * @param string $subject Subject of the template
- *
- * @return $this
- */
- public function setSubject($subject)
- {
- $this->container['subject'] = $subject;
-
- return $this;
- }
-
- /**
- * Gets isActive
- *
- * @return bool
- */
- public function getIsActive()
- {
- return $this->container['isActive'];
- }
-
- /**
- * Sets isActive
- *
- * @param bool $isActive Status of template (true=active, false=inactive)
- *
- * @return $this
- */
- public function setIsActive($isActive)
- {
- $this->container['isActive'] = $isActive;
-
- return $this;
- }
-
- /**
- * Gets testSent
- *
- * @return bool
- */
- public function getTestSent()
- {
- return $this->container['testSent'];
- }
-
- /**
- * Sets testSent
- *
- * @param bool $testSent Status of test sending for the template (true=test email has been sent, false=test email has not been sent)
- *
- * @return $this
- */
- public function setTestSent($testSent)
- {
- $this->container['testSent'] = $testSent;
-
- return $this;
- }
-
- /**
- * Gets sender
- *
- * @return \Brevo\Client\Model\GetSmtpTemplateOverviewSender
- */
- public function getSender()
- {
- return $this->container['sender'];
- }
-
- /**
- * Sets sender
- *
- * @param \Brevo\Client\Model\GetSmtpTemplateOverviewSender $sender sender
- *
- * @return $this
- */
- public function setSender($sender)
- {
- $this->container['sender'] = $sender;
-
- return $this;
- }
-
- /**
- * Gets replyTo
- *
- * @return string
- */
- public function getReplyTo()
- {
- return $this->container['replyTo'];
- }
-
- /**
- * Sets replyTo
- *
- * @param string $replyTo Email defined as the \"Reply to\" for the template
- *
- * @return $this
- */
- public function setReplyTo($replyTo)
- {
- $this->container['replyTo'] = $replyTo;
-
- return $this;
- }
-
- /**
- * Gets toField
- *
- * @return string
- */
- public function getToField()
- {
- return $this->container['toField'];
- }
-
- /**
- * Sets toField
- *
- * @param string $toField Customisation of the \"to\" field for the template
- *
- * @return $this
- */
- public function setToField($toField)
- {
- $this->container['toField'] = $toField;
-
- return $this;
- }
-
- /**
- * Gets tag
- *
- * @return string
- */
- public function getTag()
- {
- return $this->container['tag'];
- }
-
- /**
- * Sets tag
- *
- * @param string $tag Tag of the template
- *
- * @return $this
- */
- public function setTag($tag)
- {
- $this->container['tag'] = $tag;
-
- return $this;
- }
-
- /**
- * Gets htmlContent
- *
- * @return string
- */
- public function getHtmlContent()
- {
- return $this->container['htmlContent'];
- }
-
- /**
- * Sets htmlContent
- *
- * @param string $htmlContent HTML content of the template
- *
- * @return $this
- */
- public function setHtmlContent($htmlContent)
- {
- $this->container['htmlContent'] = $htmlContent;
-
- return $this;
- }
-
- /**
- * Gets createdAt
- *
- * @return string
- */
- public function getCreatedAt()
- {
- return $this->container['createdAt'];
- }
-
- /**
- * Sets createdAt
- *
- * @param string $createdAt Creation UTC date-time of the template (YYYY-MM-DDTHH:mm:ss.SSSZ)
- *
- * @return $this
- */
- public function setCreatedAt($createdAt)
- {
- $this->container['createdAt'] = $createdAt;
-
- return $this;
- }
-
- /**
- * Gets modifiedAt
- *
- * @return string
- */
- public function getModifiedAt()
- {
- return $this->container['modifiedAt'];
- }
-
- /**
- * Sets modifiedAt
- *
- * @param string $modifiedAt Last modification UTC date-time of the template (YYYY-MM-DDTHH:mm:ss.SSSZ)
- *
- * @return $this
- */
- public function setModifiedAt($modifiedAt)
- {
- $this->container['modifiedAt'] = $modifiedAt;
-
- return $this;
- }
-
- /**
- * Gets doiTemplate
- *
- * @return bool
- */
- public function getDoiTemplate()
- {
- return $this->container['doiTemplate'];
- }
-
- /**
- * Sets doiTemplate
- *
- * @param bool $doiTemplate It is true if template is a valid Double opt-in (DOI) template, otherwise it is false. This field will be available only in case of single template detail call.
- *
- * @return $this
- */
- public function setDoiTemplate($doiTemplate)
- {
- $this->container['doiTemplate'] = $doiTemplate;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetSmtpTemplateOverviewSender.php b/lib/Model/GetSmtpTemplateOverviewSender.php
deleted file mode 100644
index c753826..0000000
--- a/lib/Model/GetSmtpTemplateOverviewSender.php
+++ /dev/null
@@ -1,365 +0,0 @@
- 'string',
- 'email' => 'string',
- 'id' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'email' => 'email',
- 'id' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'email' => 'email',
- 'id' => 'id'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'email' => 'setEmail',
- 'id' => 'setId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'email' => 'getEmail',
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- }
-
- /**
- * 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name From email for the template
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email From email for the template
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets id
- *
- * @return string
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param string $id Sender id of the template
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetSmtpTemplates.php b/lib/Model/GetSmtpTemplates.php
deleted file mode 100644
index fd481a4..0000000
--- a/lib/Model/GetSmtpTemplates.php
+++ /dev/null
@@ -1,335 +0,0 @@
- 'int',
- 'templates' => '\Brevo\Client\Model\GetSmtpTemplateOverview[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'count' => 'int64',
- 'templates' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'count' => 'count',
- 'templates' => 'templates'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'count' => 'setCount',
- 'templates' => 'setTemplates'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'count' => 'getCount',
- 'templates' => 'getTemplates'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['count'] = isset($data['count']) ? $data['count'] : null;
- $this->container['templates'] = isset($data['templates']) ? $data['templates'] : null;
- }
-
- /**
- * 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 count
- *
- * @return int
- */
- public function getCount()
- {
- return $this->container['count'];
- }
-
- /**
- * Sets count
- *
- * @param int $count Count of transactional email templates
- *
- * @return $this
- */
- public function setCount($count)
- {
- $this->container['count'] = $count;
-
- return $this;
- }
-
- /**
- * Gets templates
- *
- * @return \Brevo\Client\Model\GetSmtpTemplateOverview[]
- */
- public function getTemplates()
- {
- return $this->container['templates'];
- }
-
- /**
- * Sets templates
- *
- * @param \Brevo\Client\Model\GetSmtpTemplateOverview[] $templates templates
- *
- * @return $this
- */
- public function setTemplates($templates)
- {
- $this->container['templates'] = $templates;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetSsoToken.php b/lib/Model/GetSsoToken.php
deleted file mode 100644
index 37dd969..0000000
--- a/lib/Model/GetSsoToken.php
+++ /dev/null
@@ -1,308 +0,0 @@
- 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'token' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'token' => 'token'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'token' => 'setToken'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'token' => 'getToken'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['token'] = isset($data['token']) ? $data['token'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['token'] === null) {
- $invalidProperties[] = "'token' 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 token
- *
- * @return string
- */
- public function getToken()
- {
- return $this->container['token'];
- }
-
- /**
- * Sets token
- *
- * @param string $token Session token, it will remain valid for 15 days.
- *
- * @return $this
- */
- public function setToken($token)
- {
- $this->container['token'] = $token;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetStatsByBrowser.php b/lib/Model/GetStatsByBrowser.php
deleted file mode 100644
index f999856..0000000
--- a/lib/Model/GetStatsByBrowser.php
+++ /dev/null
@@ -1,280 +0,0 @@
-listInvalidProperties()) === 0;
- }
-
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetStatsByDevice.php b/lib/Model/GetStatsByDevice.php
deleted file mode 100644
index ab3d9b5..0000000
--- a/lib/Model/GetStatsByDevice.php
+++ /dev/null
@@ -1,395 +0,0 @@
- 'map[string,\Brevo\Client\Model\GetDeviceBrowserStats]',
- 'mobile' => 'map[string,\Brevo\Client\Model\GetDeviceBrowserStats]',
- 'tablet' => 'map[string,\Brevo\Client\Model\GetDeviceBrowserStats]',
- 'unknown' => 'map[string,\Brevo\Client\Model\GetDeviceBrowserStats]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'desktop' => null,
- 'mobile' => null,
- 'tablet' => null,
- 'unknown' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'desktop' => 'desktop',
- 'mobile' => 'mobile',
- 'tablet' => 'tablet',
- 'unknown' => 'unknown'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'desktop' => 'setDesktop',
- 'mobile' => 'setMobile',
- 'tablet' => 'setTablet',
- 'unknown' => 'setUnknown'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'desktop' => 'getDesktop',
- 'mobile' => 'getMobile',
- 'tablet' => 'getTablet',
- 'unknown' => 'getUnknown'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['desktop'] = isset($data['desktop']) ? $data['desktop'] : null;
- $this->container['mobile'] = isset($data['mobile']) ? $data['mobile'] : null;
- $this->container['tablet'] = isset($data['tablet']) ? $data['tablet'] : null;
- $this->container['unknown'] = isset($data['unknown']) ? $data['unknown'] : null;
- }
-
- /**
- * 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 desktop
- *
- * @return map[string,\Brevo\Client\Model\GetDeviceBrowserStats]
- */
- public function getDesktop()
- {
- return $this->container['desktop'];
- }
-
- /**
- * Sets desktop
- *
- * @param map[string,\Brevo\Client\Model\GetDeviceBrowserStats] $desktop Statistics of the campaign on the basis of desktop devices
- *
- * @return $this
- */
- public function setDesktop($desktop)
- {
- $this->container['desktop'] = $desktop;
-
- return $this;
- }
-
- /**
- * Gets mobile
- *
- * @return map[string,\Brevo\Client\Model\GetDeviceBrowserStats]
- */
- public function getMobile()
- {
- return $this->container['mobile'];
- }
-
- /**
- * Sets mobile
- *
- * @param map[string,\Brevo\Client\Model\GetDeviceBrowserStats] $mobile Statistics of the campaign on the basis of mobile devices
- *
- * @return $this
- */
- public function setMobile($mobile)
- {
- $this->container['mobile'] = $mobile;
-
- return $this;
- }
-
- /**
- * Gets tablet
- *
- * @return map[string,\Brevo\Client\Model\GetDeviceBrowserStats]
- */
- public function getTablet()
- {
- return $this->container['tablet'];
- }
-
- /**
- * Sets tablet
- *
- * @param map[string,\Brevo\Client\Model\GetDeviceBrowserStats] $tablet Statistics of the campaign on the basis of tablet devices
- *
- * @return $this
- */
- public function setTablet($tablet)
- {
- $this->container['tablet'] = $tablet;
-
- return $this;
- }
-
- /**
- * Gets unknown
- *
- * @return map[string,\Brevo\Client\Model\GetDeviceBrowserStats]
- */
- public function getUnknown()
- {
- return $this->container['unknown'];
- }
-
- /**
- * Sets unknown
- *
- * @param map[string,\Brevo\Client\Model\GetDeviceBrowserStats] $unknown Statistics of the campaign on the basis of unknown devices
- *
- * @return $this
- */
- public function setUnknown($unknown)
- {
- $this->container['unknown'] = $unknown;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetStatsByDomain.php b/lib/Model/GetStatsByDomain.php
deleted file mode 100644
index fca7c01..0000000
--- a/lib/Model/GetStatsByDomain.php
+++ /dev/null
@@ -1,280 +0,0 @@
-listInvalidProperties()) === 0;
- }
-
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetTransacAggregatedSmsReport.php b/lib/Model/GetTransacAggregatedSmsReport.php
deleted file mode 100644
index 97c0af0..0000000
--- a/lib/Model/GetTransacAggregatedSmsReport.php
+++ /dev/null
@@ -1,575 +0,0 @@
- 'string',
- 'requests' => 'int',
- 'delivered' => 'int',
- 'hardBounces' => 'int',
- 'softBounces' => 'int',
- 'blocked' => 'int',
- 'unsubscribed' => 'int',
- 'replied' => 'int',
- 'accepted' => 'int',
- 'rejected' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'range' => null,
- 'requests' => 'int64',
- 'delivered' => 'int64',
- 'hardBounces' => 'int64',
- 'softBounces' => 'int64',
- 'blocked' => 'int64',
- 'unsubscribed' => 'int64',
- 'replied' => 'int64',
- 'accepted' => 'int64',
- 'rejected' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'range' => 'range',
- 'requests' => 'requests',
- 'delivered' => 'delivered',
- 'hardBounces' => 'hardBounces',
- 'softBounces' => 'softBounces',
- 'blocked' => 'blocked',
- 'unsubscribed' => 'unsubscribed',
- 'replied' => 'replied',
- 'accepted' => 'accepted',
- 'rejected' => 'rejected'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'range' => 'setRange',
- 'requests' => 'setRequests',
- 'delivered' => 'setDelivered',
- 'hardBounces' => 'setHardBounces',
- 'softBounces' => 'setSoftBounces',
- 'blocked' => 'setBlocked',
- 'unsubscribed' => 'setUnsubscribed',
- 'replied' => 'setReplied',
- 'accepted' => 'setAccepted',
- 'rejected' => 'setRejected'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'range' => 'getRange',
- 'requests' => 'getRequests',
- 'delivered' => 'getDelivered',
- 'hardBounces' => 'getHardBounces',
- 'softBounces' => 'getSoftBounces',
- 'blocked' => 'getBlocked',
- 'unsubscribed' => 'getUnsubscribed',
- 'replied' => 'getReplied',
- 'accepted' => 'getAccepted',
- 'rejected' => 'getRejected'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['range'] = isset($data['range']) ? $data['range'] : null;
- $this->container['requests'] = isset($data['requests']) ? $data['requests'] : null;
- $this->container['delivered'] = isset($data['delivered']) ? $data['delivered'] : null;
- $this->container['hardBounces'] = isset($data['hardBounces']) ? $data['hardBounces'] : null;
- $this->container['softBounces'] = isset($data['softBounces']) ? $data['softBounces'] : null;
- $this->container['blocked'] = isset($data['blocked']) ? $data['blocked'] : null;
- $this->container['unsubscribed'] = isset($data['unsubscribed']) ? $data['unsubscribed'] : null;
- $this->container['replied'] = isset($data['replied']) ? $data['replied'] : null;
- $this->container['accepted'] = isset($data['accepted']) ? $data['accepted'] : null;
- $this->container['rejected'] = isset($data['rejected']) ? $data['rejected'] : null;
- }
-
- /**
- * 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 range
- *
- * @return string
- */
- public function getRange()
- {
- return $this->container['range'];
- }
-
- /**
- * Sets range
- *
- * @param string $range Time frame of the report
- *
- * @return $this
- */
- public function setRange($range)
- {
- $this->container['range'] = $range;
-
- return $this;
- }
-
- /**
- * Gets requests
- *
- * @return int
- */
- public function getRequests()
- {
- return $this->container['requests'];
- }
-
- /**
- * Sets requests
- *
- * @param int $requests Number of requests for the timeframe
- *
- * @return $this
- */
- public function setRequests($requests)
- {
- $this->container['requests'] = $requests;
-
- return $this;
- }
-
- /**
- * Gets delivered
- *
- * @return int
- */
- public function getDelivered()
- {
- return $this->container['delivered'];
- }
-
- /**
- * Sets delivered
- *
- * @param int $delivered Number of delivered SMS for the timeframe
- *
- * @return $this
- */
- public function setDelivered($delivered)
- {
- $this->container['delivered'] = $delivered;
-
- return $this;
- }
-
- /**
- * Gets hardBounces
- *
- * @return int
- */
- public function getHardBounces()
- {
- return $this->container['hardBounces'];
- }
-
- /**
- * Sets hardBounces
- *
- * @param int $hardBounces Number of hardbounces for the timeframe
- *
- * @return $this
- */
- public function setHardBounces($hardBounces)
- {
- $this->container['hardBounces'] = $hardBounces;
-
- return $this;
- }
-
- /**
- * Gets softBounces
- *
- * @return int
- */
- public function getSoftBounces()
- {
- return $this->container['softBounces'];
- }
-
- /**
- * Sets softBounces
- *
- * @param int $softBounces Number of softbounces for the timeframe
- *
- * @return $this
- */
- public function setSoftBounces($softBounces)
- {
- $this->container['softBounces'] = $softBounces;
-
- return $this;
- }
-
- /**
- * Gets blocked
- *
- * @return int
- */
- public function getBlocked()
- {
- return $this->container['blocked'];
- }
-
- /**
- * Sets blocked
- *
- * @param int $blocked Number of blocked contact for the timeframe
- *
- * @return $this
- */
- public function setBlocked($blocked)
- {
- $this->container['blocked'] = $blocked;
-
- return $this;
- }
-
- /**
- * Gets unsubscribed
- *
- * @return int
- */
- public function getUnsubscribed()
- {
- return $this->container['unsubscribed'];
- }
-
- /**
- * Sets unsubscribed
- *
- * @param int $unsubscribed Number of unsubscription for the timeframe
- *
- * @return $this
- */
- public function setUnsubscribed($unsubscribed)
- {
- $this->container['unsubscribed'] = $unsubscribed;
-
- return $this;
- }
-
- /**
- * Gets replied
- *
- * @return int
- */
- public function getReplied()
- {
- return $this->container['replied'];
- }
-
- /**
- * Sets replied
- *
- * @param int $replied Number of answered SMS for the timeframe
- *
- * @return $this
- */
- public function setReplied($replied)
- {
- $this->container['replied'] = $replied;
-
- return $this;
- }
-
- /**
- * Gets accepted
- *
- * @return int
- */
- public function getAccepted()
- {
- return $this->container['accepted'];
- }
-
- /**
- * Sets accepted
- *
- * @param int $accepted Number of accepted for the timeframe
- *
- * @return $this
- */
- public function setAccepted($accepted)
- {
- $this->container['accepted'] = $accepted;
-
- return $this;
- }
-
- /**
- * Gets rejected
- *
- * @return int
- */
- public function getRejected()
- {
- return $this->container['rejected'];
- }
-
- /**
- * Sets rejected
- *
- * @param int $rejected Number of rejected for the timeframe
- *
- * @return $this
- */
- public function setRejected($rejected)
- {
- $this->container['rejected'] = $rejected;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetTransacBlockedContacts.php b/lib/Model/GetTransacBlockedContacts.php
deleted file mode 100644
index 0481377..0000000
--- a/lib/Model/GetTransacBlockedContacts.php
+++ /dev/null
@@ -1,335 +0,0 @@
- 'int',
- 'contacts' => '\Brevo\Client\Model\GetTransacBlockedContactsContacts[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'count' => 'int64',
- 'contacts' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'count' => 'count',
- 'contacts' => 'contacts'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'count' => 'setCount',
- 'contacts' => 'setContacts'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'count' => 'getCount',
- 'contacts' => 'getContacts'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['count'] = isset($data['count']) ? $data['count'] : null;
- $this->container['contacts'] = isset($data['contacts']) ? $data['contacts'] : null;
- }
-
- /**
- * 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 count
- *
- * @return int
- */
- public function getCount()
- {
- return $this->container['count'];
- }
-
- /**
- * Sets count
- *
- * @param int $count Count of blocked or unsubscribed contact
- *
- * @return $this
- */
- public function setCount($count)
- {
- $this->container['count'] = $count;
-
- return $this;
- }
-
- /**
- * Gets contacts
- *
- * @return \Brevo\Client\Model\GetTransacBlockedContactsContacts[]
- */
- public function getContacts()
- {
- return $this->container['contacts'];
- }
-
- /**
- * Sets contacts
- *
- * @param \Brevo\Client\Model\GetTransacBlockedContactsContacts[] $contacts contacts
- *
- * @return $this
- */
- public function setContacts($contacts)
- {
- $this->container['contacts'] = $contacts;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetTransacBlockedContactsContacts.php b/lib/Model/GetTransacBlockedContactsContacts.php
deleted file mode 100644
index d66e52a..0000000
--- a/lib/Model/GetTransacBlockedContactsContacts.php
+++ /dev/null
@@ -1,407 +0,0 @@
- 'string',
- 'senderEmail' => 'string',
- 'reason' => '\Brevo\Client\Model\GetTransacBlockedContactsReason',
- 'blockedAt' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'email' => 'email',
- 'senderEmail' => 'email',
- 'reason' => null,
- 'blockedAt' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'email' => 'email',
- 'senderEmail' => 'senderEmail',
- 'reason' => 'reason',
- 'blockedAt' => 'blockedAt'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'email' => 'setEmail',
- 'senderEmail' => 'setSenderEmail',
- 'reason' => 'setReason',
- 'blockedAt' => 'setBlockedAt'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'email' => 'getEmail',
- 'senderEmail' => 'getSenderEmail',
- 'reason' => 'getReason',
- 'blockedAt' => 'getBlockedAt'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['senderEmail'] = isset($data['senderEmail']) ? $data['senderEmail'] : null;
- $this->container['reason'] = isset($data['reason']) ? $data['reason'] : null;
- $this->container['blockedAt'] = isset($data['blockedAt']) ? $data['blockedAt'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['email'] === null) {
- $invalidProperties[] = "'email' can't be null";
- }
- if ($this->container['senderEmail'] === null) {
- $invalidProperties[] = "'senderEmail' can't be null";
- }
- if ($this->container['reason'] === null) {
- $invalidProperties[] = "'reason' can't be null";
- }
- if ($this->container['blockedAt'] === null) {
- $invalidProperties[] = "'blockedAt' 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 email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Email address of the blocked or unsubscribed contact
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets senderEmail
- *
- * @return string
- */
- public function getSenderEmail()
- {
- return $this->container['senderEmail'];
- }
-
- /**
- * Sets senderEmail
- *
- * @param string $senderEmail Sender email address of the blocked or unsubscribed contact
- *
- * @return $this
- */
- public function setSenderEmail($senderEmail)
- {
- $this->container['senderEmail'] = $senderEmail;
-
- return $this;
- }
-
- /**
- * Gets reason
- *
- * @return \Brevo\Client\Model\GetTransacBlockedContactsReason
- */
- public function getReason()
- {
- return $this->container['reason'];
- }
-
- /**
- * Sets reason
- *
- * @param \Brevo\Client\Model\GetTransacBlockedContactsReason $reason reason
- *
- * @return $this
- */
- public function setReason($reason)
- {
- $this->container['reason'] = $reason;
-
- return $this;
- }
-
- /**
- * Gets blockedAt
- *
- * @return string
- */
- public function getBlockedAt()
- {
- return $this->container['blockedAt'];
- }
-
- /**
- * Sets blockedAt
- *
- * @param string $blockedAt Date when the contact was blocked or unsubscribed on
- *
- * @return $this
- */
- public function setBlockedAt($blockedAt)
- {
- $this->container['blockedAt'] = $blockedAt;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetTransacBlockedContactsReason.php b/lib/Model/GetTransacBlockedContactsReason.php
deleted file mode 100644
index ea51329..0000000
--- a/lib/Model/GetTransacBlockedContactsReason.php
+++ /dev/null
@@ -1,376 +0,0 @@
- 'string',
- 'message' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'code' => null,
- 'message' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'code' => 'code',
- 'message' => 'message'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'code' => 'setCode',
- 'message' => 'setMessage'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'code' => 'getCode',
- 'message' => 'getMessage'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const CODE_UNSUBSCRIBED_VIA_MA = 'unsubscribedViaMA';
- const CODE_UNSUBSCRIBED_VIA_EMAIL = 'unsubscribedViaEmail';
- const CODE_ADMIN_BLOCKED = 'adminBlocked';
- const CODE_UNSUBSCRIBED_VIA_API = 'unsubscribedViaApi';
- const CODE_HARD_BOUNCE = 'hardBounce';
- const CODE_CONTACT_FLAGGED_AS_SPAM = 'contactFlaggedAsSpam';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getCodeAllowableValues()
- {
- return [
- self::CODE_UNSUBSCRIBED_VIA_MA,
- self::CODE_UNSUBSCRIBED_VIA_EMAIL,
- self::CODE_ADMIN_BLOCKED,
- self::CODE_UNSUBSCRIBED_VIA_API,
- self::CODE_HARD_BOUNCE,
- self::CODE_CONTACT_FLAGGED_AS_SPAM,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['code'] = isset($data['code']) ? $data['code'] : null;
- $this->container['message'] = isset($data['message']) ? $data['message'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- $allowedValues = $this->getCodeAllowableValues();
- if (!is_null($this->container['code']) && !in_array($this->container['code'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'code', must be one of '%s'",
- 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 code
- *
- * @return string
- */
- public function getCode()
- {
- return $this->container['code'];
- }
-
- /**
- * Sets code
- *
- * @param string $code Reason code for blocking / unsubscribing (This code is safe for comparison)
- *
- * @return $this
- */
- public function setCode($code)
- {
- $allowedValues = $this->getCodeAllowableValues();
- if (!is_null($code) && !in_array($code, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'code', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['code'] = $code;
-
- return $this;
- }
-
- /**
- * Gets message
- *
- * @return string
- */
- public function getMessage()
- {
- return $this->container['message'];
- }
-
- /**
- * Sets message
- *
- * @param string $message Reason for blocking / unsubscribing (This string is not safe for comparison)
- *
- * @return $this
- */
- public function setMessage($message)
- {
- $this->container['message'] = $message;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetTransacEmailContent.php b/lib/Model/GetTransacEmailContent.php
deleted file mode 100644
index 75e2357..0000000
--- a/lib/Model/GetTransacEmailContent.php
+++ /dev/null
@@ -1,503 +0,0 @@
- 'string',
- 'subject' => 'string',
- 'templateId' => 'int',
- 'date' => 'string',
- 'events' => '\Brevo\Client\Model\GetTransacEmailContentEvents[]',
- 'body' => 'string',
- 'attachmentCount' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'email' => 'email',
- 'subject' => null,
- 'templateId' => 'int64',
- 'date' => null,
- 'events' => null,
- 'body' => null,
- 'attachmentCount' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'email' => 'email',
- 'subject' => 'subject',
- 'templateId' => 'templateId',
- 'date' => 'date',
- 'events' => 'events',
- 'body' => 'body',
- 'attachmentCount' => 'attachmentCount'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'email' => 'setEmail',
- 'subject' => 'setSubject',
- 'templateId' => 'setTemplateId',
- 'date' => 'setDate',
- 'events' => 'setEvents',
- 'body' => 'setBody',
- 'attachmentCount' => 'setAttachmentCount'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'email' => 'getEmail',
- 'subject' => 'getSubject',
- 'templateId' => 'getTemplateId',
- 'date' => 'getDate',
- 'events' => 'getEvents',
- 'body' => 'getBody',
- 'attachmentCount' => 'getAttachmentCount'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null;
- $this->container['templateId'] = isset($data['templateId']) ? $data['templateId'] : null;
- $this->container['date'] = isset($data['date']) ? $data['date'] : null;
- $this->container['events'] = isset($data['events']) ? $data['events'] : null;
- $this->container['body'] = isset($data['body']) ? $data['body'] : null;
- $this->container['attachmentCount'] = isset($data['attachmentCount']) ? $data['attachmentCount'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['email'] === null) {
- $invalidProperties[] = "'email' can't be null";
- }
- if ($this->container['subject'] === null) {
- $invalidProperties[] = "'subject' can't be null";
- }
- if ($this->container['date'] === null) {
- $invalidProperties[] = "'date' can't be null";
- }
- if ($this->container['events'] === null) {
- $invalidProperties[] = "'events' can't be null";
- }
- if ($this->container['body'] === null) {
- $invalidProperties[] = "'body' can't be null";
- }
- if ($this->container['attachmentCount'] === null) {
- $invalidProperties[] = "'attachmentCount' 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 email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Email address to which transactional email has been sent
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets subject
- *
- * @return string
- */
- public function getSubject()
- {
- return $this->container['subject'];
- }
-
- /**
- * Sets subject
- *
- * @param string $subject Subject of the sent email
- *
- * @return $this
- */
- public function setSubject($subject)
- {
- $this->container['subject'] = $subject;
-
- return $this;
- }
-
- /**
- * Gets templateId
- *
- * @return int
- */
- public function getTemplateId()
- {
- return $this->container['templateId'];
- }
-
- /**
- * Sets templateId
- *
- * @param int $templateId Id of the template
- *
- * @return $this
- */
- public function setTemplateId($templateId)
- {
- $this->container['templateId'] = $templateId;
-
- return $this;
- }
-
- /**
- * Gets date
- *
- * @return string
- */
- public function getDate()
- {
- return $this->container['date'];
- }
-
- /**
- * Sets date
- *
- * @param string $date Date on which transactional email was sent
- *
- * @return $this
- */
- public function setDate($date)
- {
- $this->container['date'] = $date;
-
- return $this;
- }
-
- /**
- * Gets events
- *
- * @return \Brevo\Client\Model\GetTransacEmailContentEvents[]
- */
- public function getEvents()
- {
- return $this->container['events'];
- }
-
- /**
- * Sets events
- *
- * @param \Brevo\Client\Model\GetTransacEmailContentEvents[] $events Series of events which occurred on the transactional email
- *
- * @return $this
- */
- public function setEvents($events)
- {
- $this->container['events'] = $events;
-
- return $this;
- }
-
- /**
- * Gets body
- *
- * @return string
- */
- public function getBody()
- {
- return $this->container['body'];
- }
-
- /**
- * Sets body
- *
- * @param string $body Actual content of the transactional email that has been sent
- *
- * @return $this
- */
- public function setBody($body)
- {
- $this->container['body'] = $body;
-
- return $this;
- }
-
- /**
- * Gets attachmentCount
- *
- * @return int
- */
- public function getAttachmentCount()
- {
- return $this->container['attachmentCount'];
- }
-
- /**
- * Sets attachmentCount
- *
- * @param int $attachmentCount Count of the attachments that were sent in the email
- *
- * @return $this
- */
- public function setAttachmentCount($attachmentCount)
- {
- $this->container['attachmentCount'] = $attachmentCount;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetTransacEmailContentEvents.php b/lib/Model/GetTransacEmailContentEvents.php
deleted file mode 100644
index 138080e..0000000
--- a/lib/Model/GetTransacEmailContentEvents.php
+++ /dev/null
@@ -1,341 +0,0 @@
- 'string',
- 'time' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'time' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'time' => 'time'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'time' => 'setTime'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'time' => 'getTime'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['time'] = isset($data['time']) ? $data['time'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['name'] === null) {
- $invalidProperties[] = "'name' can't be null";
- }
- if ($this->container['time'] === null) {
- $invalidProperties[] = "'time' 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the event that occurred on the sent email
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets time
- *
- * @return string
- */
- public function getTime()
- {
- return $this->container['time'];
- }
-
- /**
- * Sets time
- *
- * @param string $time Time at which the event occurred
- *
- * @return $this
- */
- public function setTime($time)
- {
- $this->container['time'] = $time;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetTransacEmailsList.php b/lib/Model/GetTransacEmailsList.php
deleted file mode 100644
index ff752dd..0000000
--- a/lib/Model/GetTransacEmailsList.php
+++ /dev/null
@@ -1,335 +0,0 @@
- 'int',
- 'transactionalEmails' => '\Brevo\Client\Model\GetTransacEmailsListTransactionalEmails[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'count' => 'int64',
- 'transactionalEmails' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'count' => 'count',
- 'transactionalEmails' => 'transactionalEmails'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'count' => 'setCount',
- 'transactionalEmails' => 'setTransactionalEmails'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'count' => 'getCount',
- 'transactionalEmails' => 'getTransactionalEmails'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['count'] = isset($data['count']) ? $data['count'] : null;
- $this->container['transactionalEmails'] = isset($data['transactionalEmails']) ? $data['transactionalEmails'] : null;
- }
-
- /**
- * 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 count
- *
- * @return int
- */
- public function getCount()
- {
- return $this->container['count'];
- }
-
- /**
- * Sets count
- *
- * @param int $count Total number of transactional emails available on your account according to the passed filter
- *
- * @return $this
- */
- public function setCount($count)
- {
- $this->container['count'] = $count;
-
- return $this;
- }
-
- /**
- * Gets transactionalEmails
- *
- * @return \Brevo\Client\Model\GetTransacEmailsListTransactionalEmails[]
- */
- public function getTransactionalEmails()
- {
- return $this->container['transactionalEmails'];
- }
-
- /**
- * Sets transactionalEmails
- *
- * @param \Brevo\Client\Model\GetTransacEmailsListTransactionalEmails[] $transactionalEmails transactionalEmails
- *
- * @return $this
- */
- public function setTransactionalEmails($transactionalEmails)
- {
- $this->container['transactionalEmails'] = $transactionalEmails;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetTransacEmailsListTransactionalEmails.php b/lib/Model/GetTransacEmailsListTransactionalEmails.php
deleted file mode 100644
index 23df786..0000000
--- a/lib/Model/GetTransacEmailsListTransactionalEmails.php
+++ /dev/null
@@ -1,530 +0,0 @@
- 'string',
- 'subject' => 'string',
- 'templateId' => 'int',
- 'messageId' => 'string',
- 'uuid' => 'string',
- 'date' => 'string',
- 'from' => 'string',
- 'tags' => 'string[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'email' => 'email',
- 'subject' => null,
- 'templateId' => 'int64',
- 'messageId' => null,
- 'uuid' => null,
- 'date' => null,
- 'from' => 'email',
- 'tags' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'email' => 'email',
- 'subject' => 'subject',
- 'templateId' => 'templateId',
- 'messageId' => 'messageId',
- 'uuid' => 'uuid',
- 'date' => 'date',
- 'from' => 'from',
- 'tags' => 'tags'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'email' => 'setEmail',
- 'subject' => 'setSubject',
- 'templateId' => 'setTemplateId',
- 'messageId' => 'setMessageId',
- 'uuid' => 'setUuid',
- 'date' => 'setDate',
- 'from' => 'setFrom',
- 'tags' => 'setTags'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'email' => 'getEmail',
- 'subject' => 'getSubject',
- 'templateId' => 'getTemplateId',
- 'messageId' => 'getMessageId',
- 'uuid' => 'getUuid',
- 'date' => 'getDate',
- 'from' => 'getFrom',
- 'tags' => 'getTags'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null;
- $this->container['templateId'] = isset($data['templateId']) ? $data['templateId'] : null;
- $this->container['messageId'] = isset($data['messageId']) ? $data['messageId'] : null;
- $this->container['uuid'] = isset($data['uuid']) ? $data['uuid'] : null;
- $this->container['date'] = isset($data['date']) ? $data['date'] : null;
- $this->container['from'] = isset($data['from']) ? $data['from'] : null;
- $this->container['tags'] = isset($data['tags']) ? $data['tags'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['email'] === null) {
- $invalidProperties[] = "'email' can't be null";
- }
- if ($this->container['subject'] === null) {
- $invalidProperties[] = "'subject' can't be null";
- }
- if ($this->container['messageId'] === null) {
- $invalidProperties[] = "'messageId' can't be null";
- }
- if ($this->container['uuid'] === null) {
- $invalidProperties[] = "'uuid' can't be null";
- }
- if ($this->container['date'] === null) {
- $invalidProperties[] = "'date' 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 email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Email address to which transactional email has been sent
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets subject
- *
- * @return string
- */
- public function getSubject()
- {
- return $this->container['subject'];
- }
-
- /**
- * Sets subject
- *
- * @param string $subject Subject of the sent email
- *
- * @return $this
- */
- public function setSubject($subject)
- {
- $this->container['subject'] = $subject;
-
- return $this;
- }
-
- /**
- * Gets templateId
- *
- * @return int
- */
- public function getTemplateId()
- {
- return $this->container['templateId'];
- }
-
- /**
- * Sets templateId
- *
- * @param int $templateId Id of the template
- *
- * @return $this
- */
- public function setTemplateId($templateId)
- {
- $this->container['templateId'] = $templateId;
-
- return $this;
- }
-
- /**
- * Gets messageId
- *
- * @return string
- */
- public function getMessageId()
- {
- return $this->container['messageId'];
- }
-
- /**
- * Sets messageId
- *
- * @param string $messageId Message Id of the sent email
- *
- * @return $this
- */
- public function setMessageId($messageId)
- {
- $this->container['messageId'] = $messageId;
-
- return $this;
- }
-
- /**
- * Gets uuid
- *
- * @return string
- */
- public function getUuid()
- {
- return $this->container['uuid'];
- }
-
- /**
- * Sets uuid
- *
- * @param string $uuid Unique id of the email sent to a particular contact
- *
- * @return $this
- */
- public function setUuid($uuid)
- {
- $this->container['uuid'] = $uuid;
-
- return $this;
- }
-
- /**
- * Gets date
- *
- * @return string
- */
- public function getDate()
- {
- return $this->container['date'];
- }
-
- /**
- * Sets date
- *
- * @param string $date Date on which transactional email was sent
- *
- * @return $this
- */
- public function setDate($date)
- {
- $this->container['date'] = $date;
-
- return $this;
- }
-
- /**
- * Gets from
- *
- * @return string
- */
- public function getFrom()
- {
- return $this->container['from'];
- }
-
- /**
- * Sets from
- *
- * @param string $from Email address of the sender from which the email was sent
- *
- * @return $this
- */
- public function setFrom($from)
- {
- $this->container['from'] = $from;
-
- return $this;
- }
-
- /**
- * Gets tags
- *
- * @return string[]
- */
- public function getTags()
- {
- return $this->container['tags'];
- }
-
- /**
- * Sets tags
- *
- * @param string[] $tags Tags used for your email
- *
- * @return $this
- */
- public function setTags($tags)
- {
- $this->container['tags'] = $tags;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetTransacSmsReport.php b/lib/Model/GetTransacSmsReport.php
deleted file mode 100644
index 9363b55..0000000
--- a/lib/Model/GetTransacSmsReport.php
+++ /dev/null
@@ -1,305 +0,0 @@
- '\Brevo\Client\Model\GetTransacSmsReportReports[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'reports' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'reports' => 'reports'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'reports' => 'setReports'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'reports' => 'getReports'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['reports'] = isset($data['reports']) ? $data['reports'] : null;
- }
-
- /**
- * 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 reports
- *
- * @return \Brevo\Client\Model\GetTransacSmsReportReports[]
- */
- public function getReports()
- {
- return $this->container['reports'];
- }
-
- /**
- * Sets reports
- *
- * @param \Brevo\Client\Model\GetTransacSmsReportReports[] $reports reports
- *
- * @return $this
- */
- public function setReports($reports)
- {
- $this->container['reports'] = $reports;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetTransacSmsReportReports.php b/lib/Model/GetTransacSmsReportReports.php
deleted file mode 100644
index 87d2bdd..0000000
--- a/lib/Model/GetTransacSmsReportReports.php
+++ /dev/null
@@ -1,575 +0,0 @@
- '\DateTime',
- 'requests' => 'int',
- 'delivered' => 'int',
- 'hardBounces' => 'int',
- 'softBounces' => 'int',
- 'blocked' => 'int',
- 'unsubscribed' => 'int',
- 'replied' => 'int',
- 'accepted' => 'int',
- 'rejected' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'date' => 'date',
- 'requests' => 'int64',
- 'delivered' => 'int64',
- 'hardBounces' => 'int64',
- 'softBounces' => 'int64',
- 'blocked' => 'int64',
- 'unsubscribed' => 'int64',
- 'replied' => 'int64',
- 'accepted' => 'int64',
- 'rejected' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'date' => 'date',
- 'requests' => 'requests',
- 'delivered' => 'delivered',
- 'hardBounces' => 'hardBounces',
- 'softBounces' => 'softBounces',
- 'blocked' => 'blocked',
- 'unsubscribed' => 'unsubscribed',
- 'replied' => 'replied',
- 'accepted' => 'accepted',
- 'rejected' => 'rejected'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'date' => 'setDate',
- 'requests' => 'setRequests',
- 'delivered' => 'setDelivered',
- 'hardBounces' => 'setHardBounces',
- 'softBounces' => 'setSoftBounces',
- 'blocked' => 'setBlocked',
- 'unsubscribed' => 'setUnsubscribed',
- 'replied' => 'setReplied',
- 'accepted' => 'setAccepted',
- 'rejected' => 'setRejected'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'date' => 'getDate',
- 'requests' => 'getRequests',
- 'delivered' => 'getDelivered',
- 'hardBounces' => 'getHardBounces',
- 'softBounces' => 'getSoftBounces',
- 'blocked' => 'getBlocked',
- 'unsubscribed' => 'getUnsubscribed',
- 'replied' => 'getReplied',
- 'accepted' => 'getAccepted',
- 'rejected' => 'getRejected'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['date'] = isset($data['date']) ? $data['date'] : null;
- $this->container['requests'] = isset($data['requests']) ? $data['requests'] : null;
- $this->container['delivered'] = isset($data['delivered']) ? $data['delivered'] : null;
- $this->container['hardBounces'] = isset($data['hardBounces']) ? $data['hardBounces'] : null;
- $this->container['softBounces'] = isset($data['softBounces']) ? $data['softBounces'] : null;
- $this->container['blocked'] = isset($data['blocked']) ? $data['blocked'] : null;
- $this->container['unsubscribed'] = isset($data['unsubscribed']) ? $data['unsubscribed'] : null;
- $this->container['replied'] = isset($data['replied']) ? $data['replied'] : null;
- $this->container['accepted'] = isset($data['accepted']) ? $data['accepted'] : null;
- $this->container['rejected'] = isset($data['rejected']) ? $data['rejected'] : null;
- }
-
- /**
- * 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 date
- *
- * @return \DateTime
- */
- public function getDate()
- {
- return $this->container['date'];
- }
-
- /**
- * Sets date
- *
- * @param \DateTime $date Date for which statistics are retrieved
- *
- * @return $this
- */
- public function setDate($date)
- {
- $this->container['date'] = $date;
-
- return $this;
- }
-
- /**
- * Gets requests
- *
- * @return int
- */
- public function getRequests()
- {
- return $this->container['requests'];
- }
-
- /**
- * Sets requests
- *
- * @param int $requests Number of requests for the date
- *
- * @return $this
- */
- public function setRequests($requests)
- {
- $this->container['requests'] = $requests;
-
- return $this;
- }
-
- /**
- * Gets delivered
- *
- * @return int
- */
- public function getDelivered()
- {
- return $this->container['delivered'];
- }
-
- /**
- * Sets delivered
- *
- * @param int $delivered Number of delivered SMS for the date
- *
- * @return $this
- */
- public function setDelivered($delivered)
- {
- $this->container['delivered'] = $delivered;
-
- return $this;
- }
-
- /**
- * Gets hardBounces
- *
- * @return int
- */
- public function getHardBounces()
- {
- return $this->container['hardBounces'];
- }
-
- /**
- * Sets hardBounces
- *
- * @param int $hardBounces Number of hardbounces for the date
- *
- * @return $this
- */
- public function setHardBounces($hardBounces)
- {
- $this->container['hardBounces'] = $hardBounces;
-
- return $this;
- }
-
- /**
- * Gets softBounces
- *
- * @return int
- */
- public function getSoftBounces()
- {
- return $this->container['softBounces'];
- }
-
- /**
- * Sets softBounces
- *
- * @param int $softBounces Number of softbounces for the date
- *
- * @return $this
- */
- public function setSoftBounces($softBounces)
- {
- $this->container['softBounces'] = $softBounces;
-
- return $this;
- }
-
- /**
- * Gets blocked
- *
- * @return int
- */
- public function getBlocked()
- {
- return $this->container['blocked'];
- }
-
- /**
- * Sets blocked
- *
- * @param int $blocked Number of blocked contact for the date
- *
- * @return $this
- */
- public function setBlocked($blocked)
- {
- $this->container['blocked'] = $blocked;
-
- return $this;
- }
-
- /**
- * Gets unsubscribed
- *
- * @return int
- */
- public function getUnsubscribed()
- {
- return $this->container['unsubscribed'];
- }
-
- /**
- * Sets unsubscribed
- *
- * @param int $unsubscribed Number of unsubscription for the date
- *
- * @return $this
- */
- public function setUnsubscribed($unsubscribed)
- {
- $this->container['unsubscribed'] = $unsubscribed;
-
- return $this;
- }
-
- /**
- * Gets replied
- *
- * @return int
- */
- public function getReplied()
- {
- return $this->container['replied'];
- }
-
- /**
- * Sets replied
- *
- * @param int $replied Number of answered SMS for the date
- *
- * @return $this
- */
- public function setReplied($replied)
- {
- $this->container['replied'] = $replied;
-
- return $this;
- }
-
- /**
- * Gets accepted
- *
- * @return int
- */
- public function getAccepted()
- {
- return $this->container['accepted'];
- }
-
- /**
- * Sets accepted
- *
- * @param int $accepted Number of accepted for the date
- *
- * @return $this
- */
- public function setAccepted($accepted)
- {
- $this->container['accepted'] = $accepted;
-
- return $this;
- }
-
- /**
- * Gets rejected
- *
- * @return int
- */
- public function getRejected()
- {
- return $this->container['rejected'];
- }
-
- /**
- * Sets rejected
- *
- * @param int $rejected Number of rejected for the date
- *
- * @return $this
- */
- public function setRejected($rejected)
- {
- $this->container['rejected'] = $rejected;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetUserPermission.php b/lib/Model/GetUserPermission.php
deleted file mode 100644
index 5ce95fd..0000000
--- a/lib/Model/GetUserPermission.php
+++ /dev/null
@@ -1,375 +0,0 @@
- 'string',
- 'status' => 'string',
- 'privileges' => '\Brevo\Client\Model\GetUserPermissionPrivileges[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'email' => null,
- 'status' => null,
- 'privileges' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'email' => 'email',
- 'status' => 'status',
- 'privileges' => 'privileges'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'email' => 'setEmail',
- 'status' => 'setStatus',
- 'privileges' => 'setPrivileges'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'email' => 'getEmail',
- 'status' => 'getStatus',
- 'privileges' => 'getPrivileges'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['status'] = isset($data['status']) ? $data['status'] : null;
- $this->container['privileges'] = isset($data['privileges']) ? $data['privileges'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['email'] === null) {
- $invalidProperties[] = "'email' can't be null";
- }
- if ($this->container['status'] === null) {
- $invalidProperties[] = "'status' can't be null";
- }
- if ($this->container['privileges'] === null) {
- $invalidProperties[] = "'privileges' 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 email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Email address of the user.
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets status
- *
- * @return string
- */
- public function getStatus()
- {
- return $this->container['status'];
- }
-
- /**
- * Sets status
- *
- * @param string $status Status of the invited user.
- *
- * @return $this
- */
- public function setStatus($status)
- {
- $this->container['status'] = $status;
-
- return $this;
- }
-
- /**
- * Gets privileges
- *
- * @return \Brevo\Client\Model\GetUserPermissionPrivileges[]
- */
- public function getPrivileges()
- {
- return $this->container['privileges'];
- }
-
- /**
- * Sets privileges
- *
- * @param \Brevo\Client\Model\GetUserPermissionPrivileges[] $privileges Granular feature permissions given to the user.
- *
- * @return $this
- */
- public function setPrivileges($privileges)
- {
- $this->container['privileges'] = $privileges;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetUserPermissionPrivileges.php b/lib/Model/GetUserPermissionPrivileges.php
deleted file mode 100644
index 03a5d17..0000000
--- a/lib/Model/GetUserPermissionPrivileges.php
+++ /dev/null
@@ -1,341 +0,0 @@
- 'string',
- 'permissions' => 'string[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'feature' => null,
- 'permissions' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'feature' => 'feature',
- 'permissions' => 'permissions'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'feature' => 'setFeature',
- 'permissions' => 'setPermissions'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'feature' => 'getFeature',
- 'permissions' => 'getPermissions'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['feature'] = isset($data['feature']) ? $data['feature'] : null;
- $this->container['permissions'] = isset($data['permissions']) ? $data['permissions'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['feature'] === null) {
- $invalidProperties[] = "'feature' can't be null";
- }
- if ($this->container['permissions'] === null) {
- $invalidProperties[] = "'permissions' 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 feature
- *
- * @return string
- */
- public function getFeature()
- {
- return $this->container['feature'];
- }
-
- /**
- * Sets feature
- *
- * @param string $feature feature
- *
- * @return $this
- */
- public function setFeature($feature)
- {
- $this->container['feature'] = $feature;
-
- return $this;
- }
-
- /**
- * Gets permissions
- *
- * @return string[]
- */
- public function getPermissions()
- {
- return $this->container['permissions'];
- }
-
- /**
- * Sets permissions
- *
- * @param string[] $permissions permissions
- *
- * @return $this
- */
- public function setPermissions($permissions)
- {
- $this->container['permissions'] = $permissions;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetWATemplates.php b/lib/Model/GetWATemplates.php
deleted file mode 100644
index 9d4eebd..0000000
--- a/lib/Model/GetWATemplates.php
+++ /dev/null
@@ -1,341 +0,0 @@
- '\Brevo\Client\Model\GetWATemplatesTemplates[]',
- 'count' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'templates' => null,
- 'count' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'templates' => 'templates',
- 'count' => 'count'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'templates' => 'setTemplates',
- 'count' => 'setCount'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'templates' => 'getTemplates',
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['templates'] = isset($data['templates']) ? $data['templates'] : null;
- $this->container['count'] = isset($data['count']) ? $data['count'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['templates'] === null) {
- $invalidProperties[] = "'templates' 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 templates
- *
- * @return \Brevo\Client\Model\GetWATemplatesTemplates[]
- */
- public function getTemplates()
- {
- return $this->container['templates'];
- }
-
- /**
- * Sets templates
- *
- * @param \Brevo\Client\Model\GetWATemplatesTemplates[] $templates templates
- *
- * @return $this
- */
- public function setTemplates($templates)
- {
- $this->container['templates'] = $templates;
-
- return $this;
- }
-
- /**
- * Gets count
- *
- * @return int
- */
- public function getCount()
- {
- return $this->container['count'];
- }
-
- /**
- * Sets count
- *
- * @param int $count Number of whatsApp templates retrived
- *
- * @return $this
- */
- public function setCount($count)
- {
- $this->container['count'] = $count;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetWATemplatesTemplates.php b/lib/Model/GetWATemplatesTemplates.php
deleted file mode 100644
index f1aef50..0000000
--- a/lib/Model/GetWATemplatesTemplates.php
+++ /dev/null
@@ -1,536 +0,0 @@
- 'string',
- 'name' => 'string',
- 'status' => 'string',
- 'language' => 'string',
- 'category' => 'string',
- 'errorReason' => 'string',
- 'createdAt' => 'string',
- 'modifiedAt' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => null,
- 'name' => null,
- 'status' => null,
- 'language' => null,
- 'category' => null,
- 'errorReason' => null,
- 'createdAt' => null,
- 'modifiedAt' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'name' => 'name',
- 'status' => 'status',
- 'language' => 'language',
- 'category' => 'category',
- 'errorReason' => 'errorReason',
- 'createdAt' => 'createdAt',
- 'modifiedAt' => 'modifiedAt'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'name' => 'setName',
- 'status' => 'setStatus',
- 'language' => 'setLanguage',
- 'category' => 'setCategory',
- 'errorReason' => 'setErrorReason',
- 'createdAt' => 'setCreatedAt',
- 'modifiedAt' => 'setModifiedAt'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'name' => 'getName',
- 'status' => 'getStatus',
- 'language' => 'getLanguage',
- 'category' => 'getCategory',
- 'errorReason' => 'getErrorReason',
- 'createdAt' => 'getCreatedAt',
- 'modifiedAt' => 'getModifiedAt'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['status'] = isset($data['status']) ? $data['status'] : null;
- $this->container['language'] = isset($data['language']) ? $data['language'] : null;
- $this->container['category'] = isset($data['category']) ? $data['category'] : null;
- $this->container['errorReason'] = isset($data['errorReason']) ? $data['errorReason'] : null;
- $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null;
- $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null;
- }
-
- /**
- * 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['name'] === null) {
- $invalidProperties[] = "'name' can't be null";
- }
- if ($this->container['status'] === null) {
- $invalidProperties[] = "'status' can't be null";
- }
- if ($this->container['language'] === null) {
- $invalidProperties[] = "'language' can't be null";
- }
- if ($this->container['category'] === null) {
- $invalidProperties[] = "'category' can't be null";
- }
- if ($this->container['createdAt'] === null) {
- $invalidProperties[] = "'createdAt' can't be null";
- }
- if ($this->container['modifiedAt'] === null) {
- $invalidProperties[] = "'modifiedAt' 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 of the template
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the WhatsApp template
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets status
- *
- * @return string
- */
- public function getStatus()
- {
- return $this->container['status'];
- }
-
- /**
- * Sets status
- *
- * @param string $status Status of the WhatsApp template
- *
- * @return $this
- */
- public function setStatus($status)
- {
- $this->container['status'] = $status;
-
- return $this;
- }
-
- /**
- * Gets language
- *
- * @return string
- */
- public function getLanguage()
- {
- return $this->container['language'];
- }
-
- /**
- * Sets language
- *
- * @param string $language Language in which template exists
- *
- * @return $this
- */
- public function setLanguage($language)
- {
- $this->container['language'] = $language;
-
- return $this;
- }
-
- /**
- * Gets category
- *
- * @return string
- */
- public function getCategory()
- {
- return $this->container['category'];
- }
-
- /**
- * Sets category
- *
- * @param string $category category of the template
- *
- * @return $this
- */
- public function setCategory($category)
- {
- $this->container['category'] = $category;
-
- return $this;
- }
-
- /**
- * Gets errorReason
- *
- * @return string
- */
- public function getErrorReason()
- {
- return $this->container['errorReason'];
- }
-
- /**
- * Sets errorReason
- *
- * @param string $errorReason Error reason in the template creation
- *
- * @return $this
- */
- public function setErrorReason($errorReason)
- {
- $this->container['errorReason'] = $errorReason;
-
- return $this;
- }
-
- /**
- * Gets createdAt
- *
- * @return string
- */
- public function getCreatedAt()
- {
- return $this->container['createdAt'];
- }
-
- /**
- * Sets createdAt
- *
- * @param string $createdAt Creation UTC date-time of the whatsApp template (YYYY-MM-DDTHH:mm:ss.SSSZ)
- *
- * @return $this
- */
- public function setCreatedAt($createdAt)
- {
- $this->container['createdAt'] = $createdAt;
-
- return $this;
- }
-
- /**
- * Gets modifiedAt
- *
- * @return string
- */
- public function getModifiedAt()
- {
- return $this->container['modifiedAt'];
- }
-
- /**
- * Sets modifiedAt
- *
- * @param string $modifiedAt UTC date-time of last modification of the whatsApp template (YYYY-MM-DDTHH:mm:ss.SSSZ)
- *
- * @return $this
- */
- public function setModifiedAt($modifiedAt)
- {
- $this->container['modifiedAt'] = $modifiedAt;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetWebhook.php b/lib/Model/GetWebhook.php
deleted file mode 100644
index 0e4871d..0000000
--- a/lib/Model/GetWebhook.php
+++ /dev/null
@@ -1,628 +0,0 @@
- 'string',
- 'id' => 'int',
- 'description' => 'string',
- 'events' => 'string[]',
- 'type' => 'string',
- 'createdAt' => 'string',
- 'modifiedAt' => 'string',
- 'batched' => 'bool',
- 'auth' => '\Brevo\Client\Model\GetWebhookAuth',
- 'headers' => '\Brevo\Client\Model\GetWebhookHeaders[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'url' => 'url',
- 'id' => 'int64',
- 'description' => null,
- 'events' => null,
- 'type' => null,
- 'createdAt' => null,
- 'modifiedAt' => null,
- 'batched' => null,
- 'auth' => null,
- 'headers' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'url' => 'url',
- 'id' => 'id',
- 'description' => 'description',
- 'events' => 'events',
- 'type' => 'type',
- 'createdAt' => 'createdAt',
- 'modifiedAt' => 'modifiedAt',
- 'batched' => 'batched',
- 'auth' => 'auth',
- 'headers' => 'headers'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'url' => 'setUrl',
- 'id' => 'setId',
- 'description' => 'setDescription',
- 'events' => 'setEvents',
- 'type' => 'setType',
- 'createdAt' => 'setCreatedAt',
- 'modifiedAt' => 'setModifiedAt',
- 'batched' => 'setBatched',
- 'auth' => 'setAuth',
- 'headers' => 'setHeaders'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'url' => 'getUrl',
- 'id' => 'getId',
- 'description' => 'getDescription',
- 'events' => 'getEvents',
- 'type' => 'getType',
- 'createdAt' => 'getCreatedAt',
- 'modifiedAt' => 'getModifiedAt',
- 'batched' => 'getBatched',
- 'auth' => 'getAuth',
- 'headers' => 'getHeaders'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const TYPE_MARKETING = 'marketing';
- const TYPE_TRANSACTIONAL = 'transactional';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getTypeAllowableValues()
- {
- return [
- self::TYPE_MARKETING,
- self::TYPE_TRANSACTIONAL,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['url'] = isset($data['url']) ? $data['url'] : null;
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['description'] = isset($data['description']) ? $data['description'] : null;
- $this->container['events'] = isset($data['events']) ? $data['events'] : null;
- $this->container['type'] = isset($data['type']) ? $data['type'] : null;
- $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null;
- $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null;
- $this->container['batched'] = isset($data['batched']) ? $data['batched'] : null;
- $this->container['auth'] = isset($data['auth']) ? $data['auth'] : null;
- $this->container['headers'] = isset($data['headers']) ? $data['headers'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['url'] === null) {
- $invalidProperties[] = "'url' can't be null";
- }
- if ($this->container['id'] === null) {
- $invalidProperties[] = "'id' can't be null";
- }
- if ($this->container['description'] === null) {
- $invalidProperties[] = "'description' can't be null";
- }
- if ($this->container['events'] === null) {
- $invalidProperties[] = "'events' can't be null";
- }
- if ($this->container['type'] === null) {
- $invalidProperties[] = "'type' can't be null";
- }
- $allowedValues = $this->getTypeAllowableValues();
- if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'type', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- if ($this->container['createdAt'] === null) {
- $invalidProperties[] = "'createdAt' can't be null";
- }
- if ($this->container['modifiedAt'] === null) {
- $invalidProperties[] = "'modifiedAt' 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
- *
- * @return string
- */
- public function getUrl()
- {
- return $this->container['url'];
- }
-
- /**
- * Sets url
- *
- * @param string $url URL of the webhook
- *
- * @return $this
- */
- public function setUrl($url)
- {
- $this->container['url'] = $url;
-
- return $this;
- }
-
- /**
- * Gets id
- *
- * @return int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id ID of the webhook
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets description
- *
- * @return string
- */
- public function getDescription()
- {
- return $this->container['description'];
- }
-
- /**
- * Sets description
- *
- * @param string $description Description of the webhook
- *
- * @return $this
- */
- public function setDescription($description)
- {
- $this->container['description'] = $description;
-
- return $this;
- }
-
- /**
- * Gets events
- *
- * @return string[]
- */
- public function getEvents()
- {
- return $this->container['events'];
- }
-
- /**
- * Sets events
- *
- * @param string[] $events events
- *
- * @return $this
- */
- public function setEvents($events)
- {
- $this->container['events'] = $events;
-
- return $this;
- }
-
- /**
- * Gets type
- *
- * @return string
- */
- public function getType()
- {
- return $this->container['type'];
- }
-
- /**
- * Sets type
- *
- * @param string $type Type of webhook (marketing or transactional)
- *
- * @return $this
- */
- public function setType($type)
- {
- $allowedValues = $this->getTypeAllowableValues();
- if (!in_array($type, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'type', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['type'] = $type;
-
- return $this;
- }
-
- /**
- * Gets createdAt
- *
- * @return string
- */
- public function getCreatedAt()
- {
- return $this->container['createdAt'];
- }
-
- /**
- * Sets createdAt
- *
- * @param string $createdAt Creation UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ)
- *
- * @return $this
- */
- public function setCreatedAt($createdAt)
- {
- $this->container['createdAt'] = $createdAt;
-
- return $this;
- }
-
- /**
- * Gets modifiedAt
- *
- * @return string
- */
- public function getModifiedAt()
- {
- return $this->container['modifiedAt'];
- }
-
- /**
- * Sets modifiedAt
- *
- * @param string $modifiedAt Last modification UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ)
- *
- * @return $this
- */
- public function setModifiedAt($modifiedAt)
- {
- $this->container['modifiedAt'] = $modifiedAt;
-
- return $this;
- }
-
- /**
- * Gets batched
- *
- * @return bool
- */
- public function getBatched()
- {
- return $this->container['batched'];
- }
-
- /**
- * Sets batched
- *
- * @param bool $batched To send batched webhooks
- *
- * @return $this
- */
- public function setBatched($batched)
- {
- $this->container['batched'] = $batched;
-
- return $this;
- }
-
- /**
- * Gets auth
- *
- * @return \Brevo\Client\Model\GetWebhookAuth
- */
- public function getAuth()
- {
- return $this->container['auth'];
- }
-
- /**
- * Sets auth
- *
- * @param \Brevo\Client\Model\GetWebhookAuth $auth auth
- *
- * @return $this
- */
- public function setAuth($auth)
- {
- $this->container['auth'] = $auth;
-
- return $this;
- }
-
- /**
- * Gets headers
- *
- * @return \Brevo\Client\Model\GetWebhookHeaders[]
- */
- public function getHeaders()
- {
- return $this->container['headers'];
- }
-
- /**
- * Sets headers
- *
- * @param \Brevo\Client\Model\GetWebhookHeaders[] $headers Custom headers to be send with webhooks
- *
- * @return $this
- */
- public function setHeaders($headers)
- {
- $this->container['headers'] = $headers;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetWebhookAuth.php b/lib/Model/GetWebhookAuth.php
deleted file mode 100644
index 234333d..0000000
--- a/lib/Model/GetWebhookAuth.php
+++ /dev/null
@@ -1,336 +0,0 @@
- 'string',
- 'token' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'type' => null,
- 'token' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'type' => 'type',
- 'token' => 'token'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'type' => 'setType',
- 'token' => 'setToken'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'type' => 'getType',
- 'token' => 'getToken'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['type'] = isset($data['type']) ? $data['type'] : null;
- $this->container['token'] = isset($data['token']) ? $data['token'] : null;
- }
-
- /**
- * 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 type
- *
- * @return string
- */
- public function getType()
- {
- return $this->container['type'];
- }
-
- /**
- * Sets type
- *
- * @param string $type Type of authentication
- *
- * @return $this
- */
- public function setType($type)
- {
- $this->container['type'] = $type;
-
- return $this;
- }
-
- /**
- * Gets token
- *
- * @return string
- */
- public function getToken()
- {
- return $this->container['token'];
- }
-
- /**
- * Sets token
- *
- * @param string $token Webhook authentication token
- *
- * @return $this
- */
- public function setToken($token)
- {
- $this->container['token'] = $token;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetWebhookHeaders.php b/lib/Model/GetWebhookHeaders.php
deleted file mode 100644
index aa1f6f0..0000000
--- a/lib/Model/GetWebhookHeaders.php
+++ /dev/null
@@ -1,335 +0,0 @@
- 'string',
- 'value' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'key' => null,
- 'value' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'key' => 'key',
- 'value' => 'value'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'key' => 'setKey',
- 'value' => 'setValue'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'key' => 'getKey',
- 'value' => 'getValue'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['key'] = isset($data['key']) ? $data['key'] : null;
- $this->container['value'] = isset($data['value']) ? $data['value'] : null;
- }
-
- /**
- * 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 key
- *
- * @return string
- */
- public function getKey()
- {
- return $this->container['key'];
- }
-
- /**
- * Sets key
- *
- * @param string $key Header key name
- *
- * @return $this
- */
- public function setKey($key)
- {
- $this->container['key'] = $key;
-
- return $this;
- }
-
- /**
- * Gets value
- *
- * @return string
- */
- public function getValue()
- {
- return $this->container['value'];
- }
-
- /**
- * Sets value
- *
- * @param string $value Header value
- *
- * @return $this
- */
- public function setValue($value)
- {
- $this->container['value'] = $value;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetWebhooks.php b/lib/Model/GetWebhooks.php
deleted file mode 100644
index 6737fe2..0000000
--- a/lib/Model/GetWebhooks.php
+++ /dev/null
@@ -1,308 +0,0 @@
- 'object[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'webhooks' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'webhooks' => 'webhooks'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'webhooks' => 'setWebhooks'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'webhooks' => 'getWebhooks'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['webhooks'] = isset($data['webhooks']) ? $data['webhooks'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['webhooks'] === null) {
- $invalidProperties[] = "'webhooks' 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 webhooks
- *
- * @return object[]
- */
- public function getWebhooks()
- {
- return $this->container['webhooks'];
- }
-
- /**
- * Sets webhooks
- *
- * @param object[] $webhooks webhooks
- *
- * @return $this
- */
- public function setWebhooks($webhooks)
- {
- $this->container['webhooks'] = $webhooks;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetWhatsAppConfig.php b/lib/Model/GetWhatsAppConfig.php
deleted file mode 100644
index 37b1719..0000000
--- a/lib/Model/GetWhatsAppConfig.php
+++ /dev/null
@@ -1,523 +0,0 @@
- 'string',
- 'sendingLimit' => 'string',
- 'phoneNumberQuality' => 'string',
- 'whatsappBusinessAccountStatus' => 'string',
- 'businessStatus' => 'string',
- 'phoneNumberNameStatus' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'whatsappBusinessAccountId' => null,
- 'sendingLimit' => null,
- 'phoneNumberQuality' => null,
- 'whatsappBusinessAccountStatus' => null,
- 'businessStatus' => null,
- 'phoneNumberNameStatus' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'whatsappBusinessAccountId' => 'whatsappBusinessAccountId',
- 'sendingLimit' => 'sendingLimit',
- 'phoneNumberQuality' => 'phoneNumberQuality',
- 'whatsappBusinessAccountStatus' => 'whatsappBusinessAccountStatus',
- 'businessStatus' => 'businessStatus',
- 'phoneNumberNameStatus' => 'phoneNumberNameStatus'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'whatsappBusinessAccountId' => 'setWhatsappBusinessAccountId',
- 'sendingLimit' => 'setSendingLimit',
- 'phoneNumberQuality' => 'setPhoneNumberQuality',
- 'whatsappBusinessAccountStatus' => 'setWhatsappBusinessAccountStatus',
- 'businessStatus' => 'setBusinessStatus',
- 'phoneNumberNameStatus' => 'setPhoneNumberNameStatus'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'whatsappBusinessAccountId' => 'getWhatsappBusinessAccountId',
- 'sendingLimit' => 'getSendingLimit',
- 'phoneNumberQuality' => 'getPhoneNumberQuality',
- 'whatsappBusinessAccountStatus' => 'getWhatsappBusinessAccountStatus',
- 'businessStatus' => 'getBusinessStatus',
- 'phoneNumberNameStatus' => 'getPhoneNumberNameStatus'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const PHONE_NUMBER_QUALITY_GREEN = 'GREEN';
- const PHONE_NUMBER_QUALITY_YELLOW = 'YELLOW';
- const PHONE_NUMBER_QUALITY_RED = 'RED';
- const PHONE_NUMBER_NAME_STATUS_APPROVED = 'APPROVED';
- const PHONE_NUMBER_NAME_STATUS_PENDING = 'PENDING';
- const PHONE_NUMBER_NAME_STATUS_REJECTED = 'REJECTED';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getPhoneNumberQualityAllowableValues()
- {
- return [
- self::PHONE_NUMBER_QUALITY_GREEN,
- self::PHONE_NUMBER_QUALITY_YELLOW,
- self::PHONE_NUMBER_QUALITY_RED,
- ];
- }
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getPhoneNumberNameStatusAllowableValues()
- {
- return [
- self::PHONE_NUMBER_NAME_STATUS_APPROVED,
- self::PHONE_NUMBER_NAME_STATUS_PENDING,
- self::PHONE_NUMBER_NAME_STATUS_REJECTED,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['whatsappBusinessAccountId'] = isset($data['whatsappBusinessAccountId']) ? $data['whatsappBusinessAccountId'] : null;
- $this->container['sendingLimit'] = isset($data['sendingLimit']) ? $data['sendingLimit'] : null;
- $this->container['phoneNumberQuality'] = isset($data['phoneNumberQuality']) ? $data['phoneNumberQuality'] : null;
- $this->container['whatsappBusinessAccountStatus'] = isset($data['whatsappBusinessAccountStatus']) ? $data['whatsappBusinessAccountStatus'] : null;
- $this->container['businessStatus'] = isset($data['businessStatus']) ? $data['businessStatus'] : null;
- $this->container['phoneNumberNameStatus'] = isset($data['phoneNumberNameStatus']) ? $data['phoneNumberNameStatus'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- $allowedValues = $this->getPhoneNumberQualityAllowableValues();
- if (!is_null($this->container['phoneNumberQuality']) && !in_array($this->container['phoneNumberQuality'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'phoneNumberQuality', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- $allowedValues = $this->getPhoneNumberNameStatusAllowableValues();
- if (!is_null($this->container['phoneNumberNameStatus']) && !in_array($this->container['phoneNumberNameStatus'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'phoneNumberNameStatus', must be one of '%s'",
- 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 whatsappBusinessAccountId
- *
- * @return string
- */
- public function getWhatsappBusinessAccountId()
- {
- return $this->container['whatsappBusinessAccountId'];
- }
-
- /**
- * Sets whatsappBusinessAccountId
- *
- * @param string $whatsappBusinessAccountId Id of the WhatsApp business account
- *
- * @return $this
- */
- public function setWhatsappBusinessAccountId($whatsappBusinessAccountId)
- {
- $this->container['whatsappBusinessAccountId'] = $whatsappBusinessAccountId;
-
- return $this;
- }
-
- /**
- * Gets sendingLimit
- *
- * @return string
- */
- public function getSendingLimit()
- {
- return $this->container['sendingLimit'];
- }
-
- /**
- * Sets sendingLimit
- *
- * @param string $sendingLimit Sending limit Information of the WhatsApp API account
- *
- * @return $this
- */
- public function setSendingLimit($sendingLimit)
- {
- $this->container['sendingLimit'] = $sendingLimit;
-
- return $this;
- }
-
- /**
- * Gets phoneNumberQuality
- *
- * @return string
- */
- public function getPhoneNumberQuality()
- {
- return $this->container['phoneNumberQuality'];
- }
-
- /**
- * Sets phoneNumberQuality
- *
- * @param string $phoneNumberQuality Quality status of phone number associated with WhatsApp account. There are three quality ratings. example - **High (GREEN) , Medium (YELLOW) and Low(RED)**
- *
- * @return $this
- */
- public function setPhoneNumberQuality($phoneNumberQuality)
- {
- $allowedValues = $this->getPhoneNumberQualityAllowableValues();
- if (!is_null($phoneNumberQuality) && !in_array($phoneNumberQuality, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'phoneNumberQuality', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['phoneNumberQuality'] = $phoneNumberQuality;
-
- return $this;
- }
-
- /**
- * Gets whatsappBusinessAccountStatus
- *
- * @return string
- */
- public function getWhatsappBusinessAccountStatus()
- {
- return $this->container['whatsappBusinessAccountStatus'];
- }
-
- /**
- * Sets whatsappBusinessAccountStatus
- *
- * @param string $whatsappBusinessAccountStatus Status information related to WhatsApp Api account
- *
- * @return $this
- */
- public function setWhatsappBusinessAccountStatus($whatsappBusinessAccountStatus)
- {
- $this->container['whatsappBusinessAccountStatus'] = $whatsappBusinessAccountStatus;
-
- return $this;
- }
-
- /**
- * Gets businessStatus
- *
- * @return string
- */
- public function getBusinessStatus()
- {
- return $this->container['businessStatus'];
- }
-
- /**
- * Sets businessStatus
- *
- * @param string $businessStatus Verification status information of the Business account
- *
- * @return $this
- */
- public function setBusinessStatus($businessStatus)
- {
- $this->container['businessStatus'] = $businessStatus;
-
- return $this;
- }
-
- /**
- * Gets phoneNumberNameStatus
- *
- * @return string
- */
- public function getPhoneNumberNameStatus()
- {
- return $this->container['phoneNumberNameStatus'];
- }
-
- /**
- * Sets phoneNumberNameStatus
- *
- * @param string $phoneNumberNameStatus Status of the name associated with WhatsApp Phone number
- *
- * @return $this
- */
- public function setPhoneNumberNameStatus($phoneNumberNameStatus)
- {
- $allowedValues = $this->getPhoneNumberNameStatusAllowableValues();
- if (!is_null($phoneNumberNameStatus) && !in_array($phoneNumberNameStatus, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'phoneNumberNameStatus', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['phoneNumberNameStatus'] = $phoneNumberNameStatus;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetWhatsappCampaignOverview.php b/lib/Model/GetWhatsappCampaignOverview.php
deleted file mode 100644
index 6d534b4..0000000
--- a/lib/Model/GetWhatsappCampaignOverview.php
+++ /dev/null
@@ -1,610 +0,0 @@
- 'int',
- 'campaignName' => 'string',
- 'campaignStatus' => 'string',
- 'scheduledAt' => 'string',
- 'senderNumber' => 'string',
- 'stats' => '\Brevo\Client\Model\WhatsappCampStats',
- 'template' => '\Brevo\Client\Model\WhatsappCampTemplate',
- 'createdAt' => 'string',
- 'modifiedAt' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'int64',
- 'campaignName' => null,
- 'campaignStatus' => null,
- 'scheduledAt' => null,
- 'senderNumber' => null,
- 'stats' => null,
- 'template' => null,
- 'createdAt' => null,
- 'modifiedAt' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'campaignName' => 'campaignName',
- 'campaignStatus' => 'campaignStatus',
- 'scheduledAt' => 'scheduledAt',
- 'senderNumber' => 'senderNumber',
- 'stats' => 'stats',
- 'template' => 'template',
- 'createdAt' => 'createdAt',
- 'modifiedAt' => 'modifiedAt'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'campaignName' => 'setCampaignName',
- 'campaignStatus' => 'setCampaignStatus',
- 'scheduledAt' => 'setScheduledAt',
- 'senderNumber' => 'setSenderNumber',
- 'stats' => 'setStats',
- 'template' => 'setTemplate',
- 'createdAt' => 'setCreatedAt',
- 'modifiedAt' => 'setModifiedAt'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'campaignName' => 'getCampaignName',
- 'campaignStatus' => 'getCampaignStatus',
- 'scheduledAt' => 'getScheduledAt',
- 'senderNumber' => 'getSenderNumber',
- 'stats' => 'getStats',
- 'template' => 'getTemplate',
- 'createdAt' => 'getCreatedAt',
- 'modifiedAt' => 'getModifiedAt'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const CAMPAIGN_STATUS_DRAFT = 'draft';
- const CAMPAIGN_STATUS_SCHEDULED = 'scheduled';
- const CAMPAIGN_STATUS_PENDING = 'pending';
- const CAMPAIGN_STATUS_APPROVED = 'approved';
- const CAMPAIGN_STATUS_RUNNING = 'running';
- const CAMPAIGN_STATUS_SUSPENDED = 'suspended';
- const CAMPAIGN_STATUS_REJECTED = 'rejected';
- const CAMPAIGN_STATUS_SENT = 'sent';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getCampaignStatusAllowableValues()
- {
- return [
- self::CAMPAIGN_STATUS_DRAFT,
- self::CAMPAIGN_STATUS_SCHEDULED,
- self::CAMPAIGN_STATUS_PENDING,
- self::CAMPAIGN_STATUS_APPROVED,
- self::CAMPAIGN_STATUS_RUNNING,
- self::CAMPAIGN_STATUS_SUSPENDED,
- self::CAMPAIGN_STATUS_REJECTED,
- self::CAMPAIGN_STATUS_SENT,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['campaignName'] = isset($data['campaignName']) ? $data['campaignName'] : null;
- $this->container['campaignStatus'] = isset($data['campaignStatus']) ? $data['campaignStatus'] : null;
- $this->container['scheduledAt'] = isset($data['scheduledAt']) ? $data['scheduledAt'] : null;
- $this->container['senderNumber'] = isset($data['senderNumber']) ? $data['senderNumber'] : null;
- $this->container['stats'] = isset($data['stats']) ? $data['stats'] : null;
- $this->container['template'] = isset($data['template']) ? $data['template'] : null;
- $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null;
- $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null;
- }
-
- /**
- * 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['campaignName'] === null) {
- $invalidProperties[] = "'campaignName' can't be null";
- }
- if ($this->container['campaignStatus'] === null) {
- $invalidProperties[] = "'campaignStatus' can't be null";
- }
- $allowedValues = $this->getCampaignStatusAllowableValues();
- if (!is_null($this->container['campaignStatus']) && !in_array($this->container['campaignStatus'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'campaignStatus', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- if ($this->container['senderNumber'] === null) {
- $invalidProperties[] = "'senderNumber' can't be null";
- }
- if ($this->container['template'] === null) {
- $invalidProperties[] = "'template' can't be null";
- }
- if ($this->container['createdAt'] === null) {
- $invalidProperties[] = "'createdAt' can't be null";
- }
- if ($this->container['modifiedAt'] === null) {
- $invalidProperties[] = "'modifiedAt' 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 int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id ID of the WhatsApp Campaign
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets campaignName
- *
- * @return string
- */
- public function getCampaignName()
- {
- return $this->container['campaignName'];
- }
-
- /**
- * Sets campaignName
- *
- * @param string $campaignName Name of the WhatsApp Campaign
- *
- * @return $this
- */
- public function setCampaignName($campaignName)
- {
- $this->container['campaignName'] = $campaignName;
-
- return $this;
- }
-
- /**
- * Gets campaignStatus
- *
- * @return string
- */
- public function getCampaignStatus()
- {
- return $this->container['campaignStatus'];
- }
-
- /**
- * Sets campaignStatus
- *
- * @param string $campaignStatus Status of the WhatsApp Campaign
- *
- * @return $this
- */
- public function setCampaignStatus($campaignStatus)
- {
- $allowedValues = $this->getCampaignStatusAllowableValues();
- if (!in_array($campaignStatus, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'campaignStatus', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['campaignStatus'] = $campaignStatus;
-
- return $this;
- }
-
- /**
- * Gets scheduledAt
- *
- * @return string
- */
- public function getScheduledAt()
- {
- return $this->container['scheduledAt'];
- }
-
- /**
- * Sets scheduledAt
- *
- * @param string $scheduledAt UTC date-time on which WhatsApp campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format
- *
- * @return $this
- */
- public function setScheduledAt($scheduledAt)
- {
- $this->container['scheduledAt'] = $scheduledAt;
-
- return $this;
- }
-
- /**
- * Gets senderNumber
- *
- * @return string
- */
- public function getSenderNumber()
- {
- return $this->container['senderNumber'];
- }
-
- /**
- * Sets senderNumber
- *
- * @param string $senderNumber Sender of the WhatsApp Campaign
- *
- * @return $this
- */
- public function setSenderNumber($senderNumber)
- {
- $this->container['senderNumber'] = $senderNumber;
-
- return $this;
- }
-
- /**
- * Gets stats
- *
- * @return \Brevo\Client\Model\WhatsappCampStats
- */
- public function getStats()
- {
- return $this->container['stats'];
- }
-
- /**
- * Sets stats
- *
- * @param \Brevo\Client\Model\WhatsappCampStats $stats stats
- *
- * @return $this
- */
- public function setStats($stats)
- {
- $this->container['stats'] = $stats;
-
- return $this;
- }
-
- /**
- * Gets template
- *
- * @return \Brevo\Client\Model\WhatsappCampTemplate
- */
- public function getTemplate()
- {
- return $this->container['template'];
- }
-
- /**
- * Sets template
- *
- * @param \Brevo\Client\Model\WhatsappCampTemplate $template template
- *
- * @return $this
- */
- public function setTemplate($template)
- {
- $this->container['template'] = $template;
-
- return $this;
- }
-
- /**
- * Gets createdAt
- *
- * @return string
- */
- public function getCreatedAt()
- {
- return $this->container['createdAt'];
- }
-
- /**
- * Sets createdAt
- *
- * @param string $createdAt Creation UTC date-time of the WhatsApp campaign (YYYY-MM-DDTHH:mm:ss.SSSZ)
- *
- * @return $this
- */
- public function setCreatedAt($createdAt)
- {
- $this->container['createdAt'] = $createdAt;
-
- return $this;
- }
-
- /**
- * Gets modifiedAt
- *
- * @return string
- */
- public function getModifiedAt()
- {
- return $this->container['modifiedAt'];
- }
-
- /**
- * Sets modifiedAt
- *
- * @param string $modifiedAt UTC date-time of last modification of the WhatsApp campaign (YYYY-MM-DDTHH:mm:ss.SSSZ)
- *
- * @return $this
- */
- public function setModifiedAt($modifiedAt)
- {
- $this->container['modifiedAt'] = $modifiedAt;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetWhatsappCampaigns.php b/lib/Model/GetWhatsappCampaigns.php
deleted file mode 100644
index 2534986..0000000
--- a/lib/Model/GetWhatsappCampaigns.php
+++ /dev/null
@@ -1,335 +0,0 @@
- '\Brevo\Client\Model\GetWhatsappCampaignsCampaigns[]',
- 'count' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'campaigns' => null,
- 'count' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'campaigns' => 'campaigns',
- 'count' => 'count'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'campaigns' => 'setCampaigns',
- 'count' => 'setCount'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'campaigns' => 'getCampaigns',
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['campaigns'] = isset($data['campaigns']) ? $data['campaigns'] : null;
- $this->container['count'] = isset($data['count']) ? $data['count'] : null;
- }
-
- /**
- * 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 campaigns
- *
- * @return \Brevo\Client\Model\GetWhatsappCampaignsCampaigns[]
- */
- public function getCampaigns()
- {
- return $this->container['campaigns'];
- }
-
- /**
- * Sets campaigns
- *
- * @param \Brevo\Client\Model\GetWhatsappCampaignsCampaigns[] $campaigns campaigns
- *
- * @return $this
- */
- public function setCampaigns($campaigns)
- {
- $this->container['campaigns'] = $campaigns;
-
- return $this;
- }
-
- /**
- * Gets count
- *
- * @return int
- */
- public function getCount()
- {
- return $this->container['count'];
- }
-
- /**
- * Sets count
- *
- * @param int $count Number of WhatsApp campaigns retrived
- *
- * @return $this
- */
- public function setCount($count)
- {
- $this->container['count'] = $count;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetWhatsappCampaignsCampaigns.php b/lib/Model/GetWhatsappCampaignsCampaigns.php
deleted file mode 100644
index 32d2ceb..0000000
--- a/lib/Model/GetWhatsappCampaignsCampaigns.php
+++ /dev/null
@@ -1,670 +0,0 @@
- 'int',
- 'campaignName' => 'string',
- 'templateId' => 'string',
- 'campaignStatus' => 'string',
- 'scheduledAt' => 'string',
- 'errorReason' => 'string',
- 'invalidatedContacts' => 'int',
- 'readPercentage' => 'float',
- 'stats' => '\Brevo\Client\Model\WhatsappCampStats',
- 'createdAt' => 'string',
- 'modifiedAt' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'int64',
- 'campaignName' => null,
- 'templateId' => null,
- 'campaignStatus' => null,
- 'scheduledAt' => null,
- 'errorReason' => null,
- 'invalidatedContacts' => 'int64',
- 'readPercentage' => 'float',
- 'stats' => null,
- 'createdAt' => null,
- 'modifiedAt' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'campaignName' => 'campaignName',
- 'templateId' => 'templateId',
- 'campaignStatus' => 'campaignStatus',
- 'scheduledAt' => 'scheduledAt',
- 'errorReason' => 'errorReason',
- 'invalidatedContacts' => 'invalidatedContacts',
- 'readPercentage' => 'readPercentage',
- 'stats' => 'stats',
- 'createdAt' => 'createdAt',
- 'modifiedAt' => 'modifiedAt'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'campaignName' => 'setCampaignName',
- 'templateId' => 'setTemplateId',
- 'campaignStatus' => 'setCampaignStatus',
- 'scheduledAt' => 'setScheduledAt',
- 'errorReason' => 'setErrorReason',
- 'invalidatedContacts' => 'setInvalidatedContacts',
- 'readPercentage' => 'setReadPercentage',
- 'stats' => 'setStats',
- 'createdAt' => 'setCreatedAt',
- 'modifiedAt' => 'setModifiedAt'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'campaignName' => 'getCampaignName',
- 'templateId' => 'getTemplateId',
- 'campaignStatus' => 'getCampaignStatus',
- 'scheduledAt' => 'getScheduledAt',
- 'errorReason' => 'getErrorReason',
- 'invalidatedContacts' => 'getInvalidatedContacts',
- 'readPercentage' => 'getReadPercentage',
- 'stats' => 'getStats',
- 'createdAt' => 'getCreatedAt',
- 'modifiedAt' => 'getModifiedAt'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const CAMPAIGN_STATUS_DRAFT = 'draft';
- const CAMPAIGN_STATUS_SCHEDULED = 'scheduled';
- const CAMPAIGN_STATUS_PENDING = 'pending';
- const CAMPAIGN_STATUS_APPROVED = 'approved';
- const CAMPAIGN_STATUS_RUNNING = 'running';
- const CAMPAIGN_STATUS_SUSPENDED = 'suspended';
- const CAMPAIGN_STATUS_REJECTED = 'rejected';
- const CAMPAIGN_STATUS_SENT = 'sent';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getCampaignStatusAllowableValues()
- {
- return [
- self::CAMPAIGN_STATUS_DRAFT,
- self::CAMPAIGN_STATUS_SCHEDULED,
- self::CAMPAIGN_STATUS_PENDING,
- self::CAMPAIGN_STATUS_APPROVED,
- self::CAMPAIGN_STATUS_RUNNING,
- self::CAMPAIGN_STATUS_SUSPENDED,
- self::CAMPAIGN_STATUS_REJECTED,
- self::CAMPAIGN_STATUS_SENT,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['campaignName'] = isset($data['campaignName']) ? $data['campaignName'] : null;
- $this->container['templateId'] = isset($data['templateId']) ? $data['templateId'] : null;
- $this->container['campaignStatus'] = isset($data['campaignStatus']) ? $data['campaignStatus'] : null;
- $this->container['scheduledAt'] = isset($data['scheduledAt']) ? $data['scheduledAt'] : null;
- $this->container['errorReason'] = isset($data['errorReason']) ? $data['errorReason'] : null;
- $this->container['invalidatedContacts'] = isset($data['invalidatedContacts']) ? $data['invalidatedContacts'] : null;
- $this->container['readPercentage'] = isset($data['readPercentage']) ? $data['readPercentage'] : null;
- $this->container['stats'] = isset($data['stats']) ? $data['stats'] : null;
- $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null;
- $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null;
- }
-
- /**
- * 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['campaignName'] === null) {
- $invalidProperties[] = "'campaignName' can't be null";
- }
- if ($this->container['templateId'] === null) {
- $invalidProperties[] = "'templateId' can't be null";
- }
- if ($this->container['campaignStatus'] === null) {
- $invalidProperties[] = "'campaignStatus' can't be null";
- }
- $allowedValues = $this->getCampaignStatusAllowableValues();
- if (!is_null($this->container['campaignStatus']) && !in_array($this->container['campaignStatus'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'campaignStatus', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- if ($this->container['scheduledAt'] === null) {
- $invalidProperties[] = "'scheduledAt' can't be null";
- }
- if ($this->container['createdAt'] === null) {
- $invalidProperties[] = "'createdAt' can't be null";
- }
- if ($this->container['modifiedAt'] === null) {
- $invalidProperties[] = "'modifiedAt' 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 int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id ID of the WhatsApp Campaign
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets campaignName
- *
- * @return string
- */
- public function getCampaignName()
- {
- return $this->container['campaignName'];
- }
-
- /**
- * Sets campaignName
- *
- * @param string $campaignName Name of the WhatsApp Campaign
- *
- * @return $this
- */
- public function setCampaignName($campaignName)
- {
- $this->container['campaignName'] = $campaignName;
-
- return $this;
- }
-
- /**
- * Gets templateId
- *
- * @return string
- */
- public function getTemplateId()
- {
- return $this->container['templateId'];
- }
-
- /**
- * Sets templateId
- *
- * @param string $templateId Id of the WhatsApp template
- *
- * @return $this
- */
- public function setTemplateId($templateId)
- {
- $this->container['templateId'] = $templateId;
-
- return $this;
- }
-
- /**
- * Gets campaignStatus
- *
- * @return string
- */
- public function getCampaignStatus()
- {
- return $this->container['campaignStatus'];
- }
-
- /**
- * Sets campaignStatus
- *
- * @param string $campaignStatus Status of the WhatsApp Campaign
- *
- * @return $this
- */
- public function setCampaignStatus($campaignStatus)
- {
- $allowedValues = $this->getCampaignStatusAllowableValues();
- if (!in_array($campaignStatus, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'campaignStatus', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['campaignStatus'] = $campaignStatus;
-
- return $this;
- }
-
- /**
- * Gets scheduledAt
- *
- * @return string
- */
- public function getScheduledAt()
- {
- return $this->container['scheduledAt'];
- }
-
- /**
- * Sets scheduledAt
- *
- * @param string $scheduledAt UTC date-time on which WhatsApp campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format
- *
- * @return $this
- */
- public function setScheduledAt($scheduledAt)
- {
- $this->container['scheduledAt'] = $scheduledAt;
-
- return $this;
- }
-
- /**
- * Gets errorReason
- *
- * @return string
- */
- public function getErrorReason()
- {
- return $this->container['errorReason'];
- }
-
- /**
- * Sets errorReason
- *
- * @param string $errorReason Error reason in the campaign creation
- *
- * @return $this
- */
- public function setErrorReason($errorReason)
- {
- $this->container['errorReason'] = $errorReason;
-
- return $this;
- }
-
- /**
- * Gets invalidatedContacts
- *
- * @return int
- */
- public function getInvalidatedContacts()
- {
- return $this->container['invalidatedContacts'];
- }
-
- /**
- * Sets invalidatedContacts
- *
- * @param int $invalidatedContacts Count of invalidated contacts
- *
- * @return $this
- */
- public function setInvalidatedContacts($invalidatedContacts)
- {
- $this->container['invalidatedContacts'] = $invalidatedContacts;
-
- return $this;
- }
-
- /**
- * Gets readPercentage
- *
- * @return float
- */
- public function getReadPercentage()
- {
- return $this->container['readPercentage'];
- }
-
- /**
- * Sets readPercentage
- *
- * @param float $readPercentage Read percentage of the the WhatsApp campaign created
- *
- * @return $this
- */
- public function setReadPercentage($readPercentage)
- {
- $this->container['readPercentage'] = $readPercentage;
-
- return $this;
- }
-
- /**
- * Gets stats
- *
- * @return \Brevo\Client\Model\WhatsappCampStats
- */
- public function getStats()
- {
- return $this->container['stats'];
- }
-
- /**
- * Sets stats
- *
- * @param \Brevo\Client\Model\WhatsappCampStats $stats stats
- *
- * @return $this
- */
- public function setStats($stats)
- {
- $this->container['stats'] = $stats;
-
- return $this;
- }
-
- /**
- * Gets createdAt
- *
- * @return string
- */
- public function getCreatedAt()
- {
- return $this->container['createdAt'];
- }
-
- /**
- * Sets createdAt
- *
- * @param string $createdAt Creation UTC date-time of the WhatsApp campaign (YYYY-MM-DDTHH:mm:ss.SSSZ)
- *
- * @return $this
- */
- public function setCreatedAt($createdAt)
- {
- $this->container['createdAt'] = $createdAt;
-
- return $this;
- }
-
- /**
- * Gets modifiedAt
- *
- * @return string
- */
- public function getModifiedAt()
- {
- return $this->container['modifiedAt'];
- }
-
- /**
- * Sets modifiedAt
- *
- * @param string $modifiedAt UTC date-time of last modification of the whatsapp template (YYYY-MM-DDTHH:mm:ss.SSSZ)
- *
- * @return $this
- */
- public function setModifiedAt($modifiedAt)
- {
- $this->container['modifiedAt'] = $modifiedAt;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetWhatsappEventReport.php b/lib/Model/GetWhatsappEventReport.php
deleted file mode 100644
index 1ebd730..0000000
--- a/lib/Model/GetWhatsappEventReport.php
+++ /dev/null
@@ -1,305 +0,0 @@
- '\Brevo\Client\Model\GetWhatsappEventReportEvents[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'events' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'events' => 'events'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'events' => 'setEvents'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'events' => 'getEvents'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['events'] = isset($data['events']) ? $data['events'] : null;
- }
-
- /**
- * 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 events
- *
- * @return \Brevo\Client\Model\GetWhatsappEventReportEvents[]
- */
- public function getEvents()
- {
- return $this->container['events'];
- }
-
- /**
- * Sets events
- *
- * @param \Brevo\Client\Model\GetWhatsappEventReportEvents[] $events events
- *
- * @return $this
- */
- public function setEvents($events)
- {
- $this->container['events'] = $events;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/GetWhatsappEventReportEvents.php b/lib/Model/GetWhatsappEventReportEvents.php
deleted file mode 100644
index 8a45339..0000000
--- a/lib/Model/GetWhatsappEventReportEvents.php
+++ /dev/null
@@ -1,572 +0,0 @@
- 'string',
- 'date' => 'string',
- 'messageId' => 'string',
- 'event' => 'string',
- 'reason' => 'string',
- 'body' => 'string',
- 'mediaUrl' => 'string',
- 'senderNumber' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'contactNumber' => 'mobile',
- 'date' => null,
- 'messageId' => null,
- 'event' => null,
- 'reason' => null,
- 'body' => null,
- 'mediaUrl' => 'url',
- 'senderNumber' => 'mobile'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'contactNumber' => 'contactNumber',
- 'date' => 'date',
- 'messageId' => 'messageId',
- 'event' => 'event',
- 'reason' => 'reason',
- 'body' => 'body',
- 'mediaUrl' => 'mediaUrl',
- 'senderNumber' => 'senderNumber'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'contactNumber' => 'setContactNumber',
- 'date' => 'setDate',
- 'messageId' => 'setMessageId',
- 'event' => 'setEvent',
- 'reason' => 'setReason',
- 'body' => 'setBody',
- 'mediaUrl' => 'setMediaUrl',
- 'senderNumber' => 'setSenderNumber'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'contactNumber' => 'getContactNumber',
- 'date' => 'getDate',
- 'messageId' => 'getMessageId',
- 'event' => 'getEvent',
- 'reason' => 'getReason',
- 'body' => 'getBody',
- 'mediaUrl' => 'getMediaUrl',
- 'senderNumber' => 'getSenderNumber'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const EVENT_SENT = 'sent';
- const EVENT_DELIVERED = 'delivered';
- const EVENT_READ = 'read';
- const EVENT_ERROR = 'error';
- const EVENT_UNSUBSCRIBE = 'unsubscribe';
- const EVENT_REPLY = 'reply';
- const EVENT_SOFT_BOUNCE = 'soft-bounce';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getEventAllowableValues()
- {
- return [
- self::EVENT_SENT,
- self::EVENT_DELIVERED,
- self::EVENT_READ,
- self::EVENT_ERROR,
- self::EVENT_UNSUBSCRIBE,
- self::EVENT_REPLY,
- self::EVENT_SOFT_BOUNCE,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['contactNumber'] = isset($data['contactNumber']) ? $data['contactNumber'] : null;
- $this->container['date'] = isset($data['date']) ? $data['date'] : null;
- $this->container['messageId'] = isset($data['messageId']) ? $data['messageId'] : null;
- $this->container['event'] = isset($data['event']) ? $data['event'] : null;
- $this->container['reason'] = isset($data['reason']) ? $data['reason'] : null;
- $this->container['body'] = isset($data['body']) ? $data['body'] : null;
- $this->container['mediaUrl'] = isset($data['mediaUrl']) ? $data['mediaUrl'] : null;
- $this->container['senderNumber'] = isset($data['senderNumber']) ? $data['senderNumber'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['contactNumber'] === null) {
- $invalidProperties[] = "'contactNumber' can't be null";
- }
- if ($this->container['date'] === null) {
- $invalidProperties[] = "'date' can't be null";
- }
- if ($this->container['messageId'] === null) {
- $invalidProperties[] = "'messageId' can't be null";
- }
- if ($this->container['event'] === null) {
- $invalidProperties[] = "'event' can't be null";
- }
- $allowedValues = $this->getEventAllowableValues();
- if (!is_null($this->container['event']) && !in_array($this->container['event'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'event', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- if ($this->container['senderNumber'] === null) {
- $invalidProperties[] = "'senderNumber' 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 contactNumber
- *
- * @return string
- */
- public function getContactNumber()
- {
- return $this->container['contactNumber'];
- }
-
- /**
- * Sets contactNumber
- *
- * @param string $contactNumber WhatsApp Number with country code. Example, 85264318721
- *
- * @return $this
- */
- public function setContactNumber($contactNumber)
- {
- $this->container['contactNumber'] = $contactNumber;
-
- return $this;
- }
-
- /**
- * Gets date
- *
- * @return string
- */
- public function getDate()
- {
- return $this->container['date'];
- }
-
- /**
- * Sets date
- *
- * @param string $date UTC date-time on which the event has been generated
- *
- * @return $this
- */
- public function setDate($date)
- {
- $this->container['date'] = $date;
-
- return $this;
- }
-
- /**
- * Gets messageId
- *
- * @return string
- */
- public function getMessageId()
- {
- return $this->container['messageId'];
- }
-
- /**
- * Sets messageId
- *
- * @param string $messageId Message ID which generated the event
- *
- * @return $this
- */
- public function setMessageId($messageId)
- {
- $this->container['messageId'] = $messageId;
-
- return $this;
- }
-
- /**
- * Gets event
- *
- * @return string
- */
- public function getEvent()
- {
- return $this->container['event'];
- }
-
- /**
- * Sets event
- *
- * @param string $event Event which occurred
- *
- * @return $this
- */
- public function setEvent($event)
- {
- $allowedValues = $this->getEventAllowableValues();
- if (!in_array($event, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'event', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['event'] = $event;
-
- return $this;
- }
-
- /**
- * Gets reason
- *
- * @return string
- */
- public function getReason()
- {
- return $this->container['reason'];
- }
-
- /**
- * Sets reason
- *
- * @param string $reason Reason for the event (will be there in case of `error` and `soft-bounce` events)
- *
- * @return $this
- */
- public function setReason($reason)
- {
- $this->container['reason'] = $reason;
-
- return $this;
- }
-
- /**
- * Gets body
- *
- * @return string
- */
- public function getBody()
- {
- return $this->container['body'];
- }
-
- /**
- * Sets body
- *
- * @param string $body Text of the reply (will be there only in case of `reply` event with text)
- *
- * @return $this
- */
- public function setBody($body)
- {
- $this->container['body'] = $body;
-
- return $this;
- }
-
- /**
- * Gets mediaUrl
- *
- * @return string
- */
- public function getMediaUrl()
- {
- return $this->container['mediaUrl'];
- }
-
- /**
- * Sets mediaUrl
- *
- * @param string $mediaUrl Url of the media reply (will be there only in case of `reply` event with media)
- *
- * @return $this
- */
- public function setMediaUrl($mediaUrl)
- {
- $this->container['mediaUrl'] = $mediaUrl;
-
- return $this;
- }
-
- /**
- * Gets senderNumber
- *
- * @return string
- */
- public function getSenderNumber()
- {
- return $this->container['senderNumber'];
- }
-
- /**
- * Sets senderNumber
- *
- * @param string $senderNumber WhatsApp Number with country code. Example, 85264318721
- *
- * @return $this
- */
- public function setSenderNumber($senderNumber)
- {
- $this->container['senderNumber'] = $senderNumber;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/InlineResponse200.php b/lib/Model/InlineResponse200.php
deleted file mode 100644
index 29347f6..0000000
--- a/lib/Model/InlineResponse200.php
+++ /dev/null
@@ -1,335 +0,0 @@
- 'string',
- 'groupName' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => null,
- 'groupName' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'groupName' => 'groupName'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'groupName' => 'setGroupName'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'groupName' => 'getGroupName'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['groupName'] = isset($data['groupName']) ? $data['groupName'] : null;
- }
-
- /**
- * 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 id
- *
- * @return string
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param string $id Unique id of the group
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets groupName
- *
- * @return string
- */
- public function getGroupName()
- {
- return $this->container['groupName'];
- }
-
- /**
- * Sets groupName
- *
- * @param string $groupName The name of the group of sub-accounts
- *
- * @return $this
- */
- public function setGroupName($groupName)
- {
- $this->container['groupName'] = $groupName;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/InlineResponse2001.php b/lib/Model/InlineResponse2001.php
deleted file mode 100644
index 4ffa18c..0000000
--- a/lib/Model/InlineResponse2001.php
+++ /dev/null
@@ -1,309 +0,0 @@
- 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- }
-
- /**
- * 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";
- }
- 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 Unique company id
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/InlineResponse2002.php b/lib/Model/InlineResponse2002.php
deleted file mode 100644
index 52f600e..0000000
--- a/lib/Model/InlineResponse2002.php
+++ /dev/null
@@ -1,374 +0,0 @@
- 'string',
- 'name' => 'string',
- 'defaultCoupon' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'uuidv4',
- 'name' => 'uuidv4',
- 'defaultCoupon' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'name' => 'name',
- 'defaultCoupon' => 'defaultCoupon'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'name' => 'setName',
- 'defaultCoupon' => 'setDefaultCoupon'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'name' => 'getName',
- 'defaultCoupon' => 'getDefaultCoupon'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['defaultCoupon'] = isset($data['defaultCoupon']) ? $data['defaultCoupon'] : null;
- }
-
- /**
- * 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['name'] === null) {
- $invalidProperties[] = "'name' can't be null";
- }
- if ($this->container['defaultCoupon'] === null) {
- $invalidProperties[] = "'defaultCoupon' 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 The id of the collection
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name The name of the collection
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets defaultCoupon
- *
- * @return string
- */
- public function getDefaultCoupon()
- {
- return $this->container['defaultCoupon'];
- }
-
- /**
- * Sets defaultCoupon
- *
- * @param string $defaultCoupon The default coupon of the collection
- *
- * @return $this
- */
- public function setDefaultCoupon($defaultCoupon)
- {
- $this->container['defaultCoupon'] = $defaultCoupon;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/InlineResponse201.php b/lib/Model/InlineResponse201.php
deleted file mode 100644
index 0c085bb..0000000
--- a/lib/Model/InlineResponse201.php
+++ /dev/null
@@ -1,305 +0,0 @@
- 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- }
-
- /**
- * 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 id
- *
- * @return string
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param string $id id
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/InlineResponse2011.php b/lib/Model/InlineResponse2011.php
deleted file mode 100644
index 78d2ddc..0000000
--- a/lib/Model/InlineResponse2011.php
+++ /dev/null
@@ -1,309 +0,0 @@
- 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- }
-
- /**
- * 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";
- }
- 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 Unique deal id
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/InlineResponse2012.php b/lib/Model/InlineResponse2012.php
deleted file mode 100644
index 8cc8472..0000000
--- a/lib/Model/InlineResponse2012.php
+++ /dev/null
@@ -1,309 +0,0 @@
- 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- }
-
- /**
- * 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";
- }
- 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 Unique task id
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/InlineResponse2013.php b/lib/Model/InlineResponse2013.php
deleted file mode 100644
index 4ee7657..0000000
--- a/lib/Model/InlineResponse2013.php
+++ /dev/null
@@ -1,308 +0,0 @@
- 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'uuidv4'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- }
-
- /**
- * 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";
- }
- 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 The id of the created collection
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/InlineResponse2014.php b/lib/Model/InlineResponse2014.php
deleted file mode 100644
index d1cecdb..0000000
--- a/lib/Model/InlineResponse2014.php
+++ /dev/null
@@ -1,308 +0,0 @@
- 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'messageId' => 'uuidv4'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'messageId' => 'messageId'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'messageId' => 'setMessageId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'messageId' => 'getMessageId'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['messageId'] = isset($data['messageId']) ? $data['messageId'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['messageId'] === null) {
- $invalidProperties[] = "'messageId' 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 messageId
- *
- * @return string
- */
- public function getMessageId()
- {
- return $this->container['messageId'];
- }
-
- /**
- * Sets messageId
- *
- * @param string $messageId messageId of sent message
- *
- * @return $this
- */
- public function setMessageId($messageId)
- {
- $this->container['messageId'] = $messageId;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/InlineResponse2015.php b/lib/Model/InlineResponse2015.php
deleted file mode 100644
index 65f1c00..0000000
--- a/lib/Model/InlineResponse2015.php
+++ /dev/null
@@ -1,308 +0,0 @@
- 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'uuidv4'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- }
-
- /**
- * 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";
- }
- 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 of the object created
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/InviteAdminUser.php b/lib/Model/InviteAdminUser.php
deleted file mode 100644
index 75dbb6b..0000000
--- a/lib/Model/InviteAdminUser.php
+++ /dev/null
@@ -1,404 +0,0 @@
- 'string',
- 'allFeaturesAccess' => 'bool',
- 'groupIds' => 'string[]',
- 'privileges' => '\Brevo\Client\Model\InviteAdminUserPrivileges[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'email' => 'email',
- 'allFeaturesAccess' => null,
- 'groupIds' => null,
- 'privileges' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'email' => 'email',
- 'allFeaturesAccess' => 'all_features_access',
- 'groupIds' => 'groupIds',
- 'privileges' => 'privileges'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'email' => 'setEmail',
- 'allFeaturesAccess' => 'setAllFeaturesAccess',
- 'groupIds' => 'setGroupIds',
- 'privileges' => 'setPrivileges'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'email' => 'getEmail',
- 'allFeaturesAccess' => 'getAllFeaturesAccess',
- 'groupIds' => 'getGroupIds',
- 'privileges' => 'getPrivileges'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['allFeaturesAccess'] = isset($data['allFeaturesAccess']) ? $data['allFeaturesAccess'] : null;
- $this->container['groupIds'] = isset($data['groupIds']) ? $data['groupIds'] : null;
- $this->container['privileges'] = isset($data['privileges']) ? $data['privileges'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['email'] === null) {
- $invalidProperties[] = "'email' can't be null";
- }
- if ($this->container['allFeaturesAccess'] === null) {
- $invalidProperties[] = "'allFeaturesAccess' can't be null";
- }
- if ($this->container['privileges'] === null) {
- $invalidProperties[] = "'privileges' 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 email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Email address for the organization
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets allFeaturesAccess
- *
- * @return bool
- */
- public function getAllFeaturesAccess()
- {
- return $this->container['allFeaturesAccess'];
- }
-
- /**
- * Sets allFeaturesAccess
- *
- * @param bool $allFeaturesAccess All access to the features
- *
- * @return $this
- */
- public function setAllFeaturesAccess($allFeaturesAccess)
- {
- $this->container['allFeaturesAccess'] = $allFeaturesAccess;
-
- return $this;
- }
-
- /**
- * Gets groupIds
- *
- * @return string[]
- */
- public function getGroupIds()
- {
- return $this->container['groupIds'];
- }
-
- /**
- * Sets groupIds
- *
- * @param string[] $groupIds Ids of Group
- *
- * @return $this
- */
- public function setGroupIds($groupIds)
- {
- $this->container['groupIds'] = $groupIds;
-
- return $this;
- }
-
- /**
- * Gets privileges
- *
- * @return \Brevo\Client\Model\InviteAdminUserPrivileges[]
- */
- public function getPrivileges()
- {
- return $this->container['privileges'];
- }
-
- /**
- * Sets privileges
- *
- * @param \Brevo\Client\Model\InviteAdminUserPrivileges[] $privileges privileges
- *
- * @return $this
- */
- public function setPrivileges($privileges)
- {
- $this->container['privileges'] = $privileges;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/InviteAdminUserPrivileges.php b/lib/Model/InviteAdminUserPrivileges.php
deleted file mode 100644
index 32b2f8c..0000000
--- a/lib/Model/InviteAdminUserPrivileges.php
+++ /dev/null
@@ -1,396 +0,0 @@
- 'string',
- 'permissions' => 'string[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'feature' => null,
- 'permissions' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'feature' => 'feature',
- 'permissions' => 'permissions'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'feature' => 'setFeature',
- 'permissions' => 'setPermissions'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'feature' => 'getFeature',
- 'permissions' => 'getPermissions'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const FEATURE_MY_PLAN = 'my_plan';
- const FEATURE_API = 'api';
- const FEATURE_USER_MANAGEMENT = 'user_management';
- const FEATURE_APP_MANAGEMENT = 'app_management';
- const PERMISSIONS_ALL = 'all';
- const PERMISSIONS_NONE = 'none';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getFeatureAllowableValues()
- {
- return [
- self::FEATURE_MY_PLAN,
- self::FEATURE_API,
- self::FEATURE_USER_MANAGEMENT,
- self::FEATURE_APP_MANAGEMENT,
- ];
- }
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getPermissionsAllowableValues()
- {
- return [
- self::PERMISSIONS_ALL,
- self::PERMISSIONS_NONE,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['feature'] = isset($data['feature']) ? $data['feature'] : null;
- $this->container['permissions'] = isset($data['permissions']) ? $data['permissions'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- $allowedValues = $this->getFeatureAllowableValues();
- if (!is_null($this->container['feature']) && !in_array($this->container['feature'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'feature', must be one of '%s'",
- 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 feature
- *
- * @return string
- */
- public function getFeature()
- {
- return $this->container['feature'];
- }
-
- /**
- * Sets feature
- *
- * @param string $feature Feature name
- *
- * @return $this
- */
- public function setFeature($feature)
- {
- $allowedValues = $this->getFeatureAllowableValues();
- if (!is_null($feature) && !in_array($feature, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'feature', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['feature'] = $feature;
-
- return $this;
- }
-
- /**
- * Gets permissions
- *
- * @return string[]
- */
- public function getPermissions()
- {
- return $this->container['permissions'];
- }
-
- /**
- * Sets permissions
- *
- * @param string[] $permissions Permissions for a given feature
- *
- * @return $this
- */
- public function setPermissions($permissions)
- {
- $allowedValues = $this->getPermissionsAllowableValues();
- if (!is_null($permissions) && array_diff($permissions, $allowedValues)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'permissions', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['permissions'] = $permissions;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/Inviteuser.php b/lib/Model/Inviteuser.php
deleted file mode 100644
index 88a888a..0000000
--- a/lib/Model/Inviteuser.php
+++ /dev/null
@@ -1,374 +0,0 @@
- 'string',
- 'allFeaturesAccess' => 'bool',
- 'privileges' => '\Brevo\Client\Model\InviteuserPrivileges[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'email' => 'email',
- 'allFeaturesAccess' => null,
- 'privileges' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'email' => 'email',
- 'allFeaturesAccess' => 'all_features_access',
- 'privileges' => 'privileges'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'email' => 'setEmail',
- 'allFeaturesAccess' => 'setAllFeaturesAccess',
- 'privileges' => 'setPrivileges'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'email' => 'getEmail',
- 'allFeaturesAccess' => 'getAllFeaturesAccess',
- 'privileges' => 'getPrivileges'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['allFeaturesAccess'] = isset($data['allFeaturesAccess']) ? $data['allFeaturesAccess'] : null;
- $this->container['privileges'] = isset($data['privileges']) ? $data['privileges'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['email'] === null) {
- $invalidProperties[] = "'email' can't be null";
- }
- if ($this->container['allFeaturesAccess'] === null) {
- $invalidProperties[] = "'allFeaturesAccess' can't be null";
- }
- if ($this->container['privileges'] === null) {
- $invalidProperties[] = "'privileges' 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 email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Email address for the organization
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets allFeaturesAccess
- *
- * @return bool
- */
- public function getAllFeaturesAccess()
- {
- return $this->container['allFeaturesAccess'];
- }
-
- /**
- * Sets allFeaturesAccess
- *
- * @param bool $allFeaturesAccess All access to the features
- *
- * @return $this
- */
- public function setAllFeaturesAccess($allFeaturesAccess)
- {
- $this->container['allFeaturesAccess'] = $allFeaturesAccess;
-
- return $this;
- }
-
- /**
- * Gets privileges
- *
- * @return \Brevo\Client\Model\InviteuserPrivileges[]
- */
- public function getPrivileges()
- {
- return $this->container['privileges'];
- }
-
- /**
- * Sets privileges
- *
- * @param \Brevo\Client\Model\InviteuserPrivileges[] $privileges privileges
- *
- * @return $this
- */
- public function setPrivileges($privileges)
- {
- $this->container['privileges'] = $privileges;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/InviteuserPrivileges.php b/lib/Model/InviteuserPrivileges.php
deleted file mode 100644
index 5832ae9..0000000
--- a/lib/Model/InviteuserPrivileges.php
+++ /dev/null
@@ -1,468 +0,0 @@
- 'string',
- 'permissions' => 'string[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'feature' => null,
- 'permissions' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'feature' => 'feature',
- 'permissions' => 'permissions'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'feature' => 'setFeature',
- 'permissions' => 'setPermissions'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'feature' => 'getFeature',
- 'permissions' => 'getPermissions'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const FEATURE_EMAIL_CAMPAIGNS = 'email_campaigns';
- const FEATURE_SMS_CAMPAIGNS = 'sms_campaigns';
- const FEATURE_CONTACTS = 'contacts';
- const FEATURE_TEMPLATES = 'templates';
- const FEATURE_WORKFLOWS = 'workflows';
- const FEATURE_FACEBOOK_ADS = 'facebook_ads';
- const FEATURE_LANDING_PAGES = 'landing_pages';
- const FEATURE_TRANSACTIONAL_EMAILS = 'transactional_emails';
- const FEATURE_SMTP_API = 'smtp_api';
- const FEATURE_USER_MANAGEMENT = 'user_management';
- const FEATURE_SALES_PLATFORM = 'sales_platform';
- const FEATURE_PHONE = 'phone';
- const FEATURE_CONVERSATIONS = 'conversations';
- const FEATURE_SENDERS_DOMAINS_DEDICATED_IPS = 'senders_domains_dedicated_ips';
- const FEATURE_PUSH_NOTIFICATIONS = 'push_notifications';
- const PERMISSIONS_CREATE_EDIT_DELETE = 'create_edit_delete';
- const PERMISSIONS_SEND_SCHEDULE_SUSPEND = 'send_schedule_suspend';
- const PERMISSIONS_VIEW = 'view';
- const PERMISSIONS_IMPORT = 'import';
- const PERMISSIONS_EXPORT = 'export';
- const PERMISSIONS_LIST_AND_ATTRIBUTES = 'list_and_attributes';
- const PERMISSIONS_FORMS = 'forms';
- const PERMISSIONS_ACTIVATE_DEACTIVATE = 'activate_deactivate';
- const PERMISSIONS_ACTIVATE_DEACTIVATE_PAUSE = 'activate_deactivate_pause';
- const PERMISSIONS_SETTINGS = 'settings';
- const PERMISSIONS_SCHEDULE_PAUSE = 'schedule_pause';
- const PERMISSIONS_ALL = 'all';
- const PERMISSIONS_LOGS = 'logs';
- const PERMISSIONS_ACCESS = 'access';
- const PERMISSIONS_ASSIGN = 'assign';
- const PERMISSIONS_CONFIGURE = 'configure';
- const PERMISSIONS_MANAGE_OWNED_DEALS_TASKS_COMPANIES = 'manage_owned_deals_tasks_companies';
- const PERMISSIONS_MANAGE_OTHERS_DEALS_TASKS_COMPANIES = 'manage_others_deals_tasks_companies';
- const PERMISSIONS_REPORTS = 'reports';
- const PERMISSIONS_SENDERS_MANAGEMENT = 'senders_management';
- const PERMISSIONS_DOMAINS_MANAGEMENT = 'domains_management';
- const PERMISSIONS_DEDICATED_IPS_MANAGEMENT = 'dedicated_ips_management';
- const PERMISSIONS_SEND = 'send';
- const PERMISSIONS_SMTP = 'smtp';
- const PERMISSIONS_API_KEYS = 'api_keys';
- const PERMISSIONS_AUTHORIZED_IPS = 'authorized_ips';
- const PERMISSIONS_NONE = 'none';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getFeatureAllowableValues()
- {
- return [
- self::FEATURE_EMAIL_CAMPAIGNS,
- self::FEATURE_SMS_CAMPAIGNS,
- self::FEATURE_CONTACTS,
- self::FEATURE_TEMPLATES,
- self::FEATURE_WORKFLOWS,
- self::FEATURE_FACEBOOK_ADS,
- self::FEATURE_LANDING_PAGES,
- self::FEATURE_TRANSACTIONAL_EMAILS,
- self::FEATURE_SMTP_API,
- self::FEATURE_USER_MANAGEMENT,
- self::FEATURE_SALES_PLATFORM,
- self::FEATURE_PHONE,
- self::FEATURE_CONVERSATIONS,
- self::FEATURE_SENDERS_DOMAINS_DEDICATED_IPS,
- self::FEATURE_PUSH_NOTIFICATIONS,
- ];
- }
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getPermissionsAllowableValues()
- {
- return [
- self::PERMISSIONS_CREATE_EDIT_DELETE,
- self::PERMISSIONS_SEND_SCHEDULE_SUSPEND,
- self::PERMISSIONS_VIEW,
- self::PERMISSIONS_IMPORT,
- self::PERMISSIONS_EXPORT,
- self::PERMISSIONS_LIST_AND_ATTRIBUTES,
- self::PERMISSIONS_FORMS,
- self::PERMISSIONS_ACTIVATE_DEACTIVATE,
- self::PERMISSIONS_ACTIVATE_DEACTIVATE_PAUSE,
- self::PERMISSIONS_SETTINGS,
- self::PERMISSIONS_SCHEDULE_PAUSE,
- self::PERMISSIONS_ALL,
- self::PERMISSIONS_LOGS,
- self::PERMISSIONS_ACCESS,
- self::PERMISSIONS_ASSIGN,
- self::PERMISSIONS_CONFIGURE,
- self::PERMISSIONS_MANAGE_OWNED_DEALS_TASKS_COMPANIES,
- self::PERMISSIONS_MANAGE_OTHERS_DEALS_TASKS_COMPANIES,
- self::PERMISSIONS_REPORTS,
- self::PERMISSIONS_SENDERS_MANAGEMENT,
- self::PERMISSIONS_DOMAINS_MANAGEMENT,
- self::PERMISSIONS_DEDICATED_IPS_MANAGEMENT,
- self::PERMISSIONS_SEND,
- self::PERMISSIONS_SMTP,
- self::PERMISSIONS_API_KEYS,
- self::PERMISSIONS_AUTHORIZED_IPS,
- self::PERMISSIONS_NONE,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['feature'] = isset($data['feature']) ? $data['feature'] : null;
- $this->container['permissions'] = isset($data['permissions']) ? $data['permissions'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- $allowedValues = $this->getFeatureAllowableValues();
- if (!is_null($this->container['feature']) && !in_array($this->container['feature'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'feature', must be one of '%s'",
- 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 feature
- *
- * @return string
- */
- public function getFeature()
- {
- return $this->container['feature'];
- }
-
- /**
- * Sets feature
- *
- * @param string $feature Feature name
- *
- * @return $this
- */
- public function setFeature($feature)
- {
- $allowedValues = $this->getFeatureAllowableValues();
- if (!is_null($feature) && !in_array($feature, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'feature', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['feature'] = $feature;
-
- return $this;
- }
-
- /**
- * Gets permissions
- *
- * @return string[]
- */
- public function getPermissions()
- {
- return $this->container['permissions'];
- }
-
- /**
- * Sets permissions
- *
- * @param string[] $permissions Permissions for a given feature
- *
- * @return $this
- */
- public function setPermissions($permissions)
- {
- $allowedValues = $this->getPermissionsAllowableValues();
- if (!is_null($permissions) && array_diff($permissions, $allowedValues)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'permissions', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['permissions'] = $permissions;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/ManageIp.php b/lib/Model/ManageIp.php
deleted file mode 100644
index d3c973c..0000000
--- a/lib/Model/ManageIp.php
+++ /dev/null
@@ -1,305 +0,0 @@
- 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'ip' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'ip' => 'ip'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'ip' => 'setIp'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'ip' => 'getIp'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null;
- }
-
- /**
- * 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 ip
- *
- * @return string
- */
- public function getIp()
- {
- return $this->container['ip'];
- }
-
- /**
- * Sets ip
- *
- * @param string $ip Dedicated ID
- *
- * @return $this
- */
- public function setIp($ip)
- {
- $this->container['ip'] = $ip;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/MasterDetailsResponse.php b/lib/Model/MasterDetailsResponse.php
deleted file mode 100644
index 3b98206..0000000
--- a/lib/Model/MasterDetailsResponse.php
+++ /dev/null
@@ -1,485 +0,0 @@
- 'string',
- 'companyName' => 'string',
- 'id' => 'int',
- 'currencyCode' => 'string',
- 'timezone' => 'string',
- 'billingInfo' => '\Brevo\Client\Model\MasterDetailsResponseBillingInfo',
- 'planInfo' => '\Brevo\Client\Model\MasterDetailsResponsePlanInfo'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'email' => null,
- 'companyName' => null,
- 'id' => 'int64',
- 'currencyCode' => null,
- 'timezone' => null,
- 'billingInfo' => null,
- 'planInfo' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'email' => 'email',
- 'companyName' => 'companyName',
- 'id' => 'id',
- 'currencyCode' => 'currencyCode',
- 'timezone' => 'timezone',
- 'billingInfo' => 'billingInfo',
- 'planInfo' => 'planInfo'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'email' => 'setEmail',
- 'companyName' => 'setCompanyName',
- 'id' => 'setId',
- 'currencyCode' => 'setCurrencyCode',
- 'timezone' => 'setTimezone',
- 'billingInfo' => 'setBillingInfo',
- 'planInfo' => 'setPlanInfo'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'email' => 'getEmail',
- 'companyName' => 'getCompanyName',
- 'id' => 'getId',
- 'currencyCode' => 'getCurrencyCode',
- 'timezone' => 'getTimezone',
- 'billingInfo' => 'getBillingInfo',
- 'planInfo' => 'getPlanInfo'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['companyName'] = isset($data['companyName']) ? $data['companyName'] : null;
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['currencyCode'] = isset($data['currencyCode']) ? $data['currencyCode'] : null;
- $this->container['timezone'] = isset($data['timezone']) ? $data['timezone'] : null;
- $this->container['billingInfo'] = isset($data['billingInfo']) ? $data['billingInfo'] : null;
- $this->container['planInfo'] = isset($data['planInfo']) ? $data['planInfo'] : null;
- }
-
- /**
- * 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 email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Email id of master account
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets companyName
- *
- * @return string
- */
- public function getCompanyName()
- {
- return $this->container['companyName'];
- }
-
- /**
- * Sets companyName
- *
- * @param string $companyName Company name of master account organization
- *
- * @return $this
- */
- public function setCompanyName($companyName)
- {
- $this->container['companyName'] = $companyName;
-
- return $this;
- }
-
- /**
- * Gets id
- *
- * @return int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id Unique identifier of the master account organization
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets currencyCode
- *
- * @return string
- */
- public function getCurrencyCode()
- {
- return $this->container['currencyCode'];
- }
-
- /**
- * Sets currencyCode
- *
- * @param string $currencyCode Currency code of the master account organization
- *
- * @return $this
- */
- public function setCurrencyCode($currencyCode)
- {
- $this->container['currencyCode'] = $currencyCode;
-
- return $this;
- }
-
- /**
- * Gets timezone
- *
- * @return string
- */
- public function getTimezone()
- {
- return $this->container['timezone'];
- }
-
- /**
- * Sets timezone
- *
- * @param string $timezone Timezone of the master account organization
- *
- * @return $this
- */
- public function setTimezone($timezone)
- {
- $this->container['timezone'] = $timezone;
-
- return $this;
- }
-
- /**
- * Gets billingInfo
- *
- * @return \Brevo\Client\Model\MasterDetailsResponseBillingInfo
- */
- public function getBillingInfo()
- {
- return $this->container['billingInfo'];
- }
-
- /**
- * Sets billingInfo
- *
- * @param \Brevo\Client\Model\MasterDetailsResponseBillingInfo $billingInfo billingInfo
- *
- * @return $this
- */
- public function setBillingInfo($billingInfo)
- {
- $this->container['billingInfo'] = $billingInfo;
-
- return $this;
- }
-
- /**
- * Gets planInfo
- *
- * @return \Brevo\Client\Model\MasterDetailsResponsePlanInfo
- */
- public function getPlanInfo()
- {
- return $this->container['planInfo'];
- }
-
- /**
- * Sets planInfo
- *
- * @param \Brevo\Client\Model\MasterDetailsResponsePlanInfo $planInfo planInfo
- *
- * @return $this
- */
- public function setPlanInfo($planInfo)
- {
- $this->container['planInfo'] = $planInfo;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/MasterDetailsResponseBillingInfo.php b/lib/Model/MasterDetailsResponseBillingInfo.php
deleted file mode 100644
index 519790b..0000000
--- a/lib/Model/MasterDetailsResponseBillingInfo.php
+++ /dev/null
@@ -1,396 +0,0 @@
- 'string',
- 'companyName' => 'string',
- 'name' => '\Brevo\Client\Model\MasterDetailsResponseBillingInfoName',
- 'address' => '\Brevo\Client\Model\MasterDetailsResponseBillingInfoAddress'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'email' => null,
- 'companyName' => null,
- 'name' => null,
- 'address' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'email' => 'email',
- 'companyName' => 'companyName',
- 'name' => 'name',
- 'address' => 'address'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'email' => 'setEmail',
- 'companyName' => 'setCompanyName',
- 'name' => 'setName',
- 'address' => 'setAddress'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'email' => 'getEmail',
- 'companyName' => 'getCompanyName',
- 'name' => 'getName',
- 'address' => 'getAddress'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['companyName'] = isset($data['companyName']) ? $data['companyName'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['address'] = isset($data['address']) ? $data['address'] : null;
- }
-
- /**
- * 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 email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Billing email id of master account
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets companyName
- *
- * @return string
- */
- public function getCompanyName()
- {
- return $this->container['companyName'];
- }
-
- /**
- * Sets companyName
- *
- * @param string $companyName Company name of master account
- *
- * @return $this
- */
- public function setCompanyName($companyName)
- {
- $this->container['companyName'] = $companyName;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return \Brevo\Client\Model\MasterDetailsResponseBillingInfoName
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param \Brevo\Client\Model\MasterDetailsResponseBillingInfoName $name name
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets address
- *
- * @return \Brevo\Client\Model\MasterDetailsResponseBillingInfoAddress
- */
- public function getAddress()
- {
- return $this->container['address'];
- }
-
- /**
- * Sets address
- *
- * @param \Brevo\Client\Model\MasterDetailsResponseBillingInfoAddress $address address
- *
- * @return $this
- */
- public function setAddress($address)
- {
- $this->container['address'] = $address;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/MasterDetailsResponseBillingInfoAddress.php b/lib/Model/MasterDetailsResponseBillingInfoAddress.php
deleted file mode 100644
index 0fd11cf..0000000
--- a/lib/Model/MasterDetailsResponseBillingInfoAddress.php
+++ /dev/null
@@ -1,426 +0,0 @@
- 'string',
- 'locality' => 'string',
- 'postalCode' => 'string',
- 'stateCode' => 'string',
- 'countryCode' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'streetAddress' => null,
- 'locality' => null,
- 'postalCode' => null,
- 'stateCode' => null,
- 'countryCode' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'streetAddress' => 'streetAddress',
- 'locality' => 'locality',
- 'postalCode' => 'postalCode',
- 'stateCode' => 'stateCode',
- 'countryCode' => 'countryCode'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'streetAddress' => 'setStreetAddress',
- 'locality' => 'setLocality',
- 'postalCode' => 'setPostalCode',
- 'stateCode' => 'setStateCode',
- 'countryCode' => 'setCountryCode'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'streetAddress' => 'getStreetAddress',
- 'locality' => 'getLocality',
- 'postalCode' => 'getPostalCode',
- 'stateCode' => 'getStateCode',
- 'countryCode' => 'getCountryCode'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['streetAddress'] = isset($data['streetAddress']) ? $data['streetAddress'] : null;
- $this->container['locality'] = isset($data['locality']) ? $data['locality'] : null;
- $this->container['postalCode'] = isset($data['postalCode']) ? $data['postalCode'] : null;
- $this->container['stateCode'] = isset($data['stateCode']) ? $data['stateCode'] : null;
- $this->container['countryCode'] = isset($data['countryCode']) ? $data['countryCode'] : null;
- }
-
- /**
- * 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 streetAddress
- *
- * @return string
- */
- public function getStreetAddress()
- {
- return $this->container['streetAddress'];
- }
-
- /**
- * Sets streetAddress
- *
- * @param string $streetAddress Street address
- *
- * @return $this
- */
- public function setStreetAddress($streetAddress)
- {
- $this->container['streetAddress'] = $streetAddress;
-
- return $this;
- }
-
- /**
- * Gets locality
- *
- * @return string
- */
- public function getLocality()
- {
- return $this->container['locality'];
- }
-
- /**
- * Sets locality
- *
- * @param string $locality Locality
- *
- * @return $this
- */
- public function setLocality($locality)
- {
- $this->container['locality'] = $locality;
-
- return $this;
- }
-
- /**
- * Gets postalCode
- *
- * @return string
- */
- public function getPostalCode()
- {
- return $this->container['postalCode'];
- }
-
- /**
- * Sets postalCode
- *
- * @param string $postalCode Postal code
- *
- * @return $this
- */
- public function setPostalCode($postalCode)
- {
- $this->container['postalCode'] = $postalCode;
-
- return $this;
- }
-
- /**
- * Gets stateCode
- *
- * @return string
- */
- public function getStateCode()
- {
- return $this->container['stateCode'];
- }
-
- /**
- * Sets stateCode
- *
- * @param string $stateCode State code
- *
- * @return $this
- */
- public function setStateCode($stateCode)
- {
- $this->container['stateCode'] = $stateCode;
-
- return $this;
- }
-
- /**
- * Gets countryCode
- *
- * @return string
- */
- public function getCountryCode()
- {
- return $this->container['countryCode'];
- }
-
- /**
- * Sets countryCode
- *
- * @param string $countryCode Country code
- *
- * @return $this
- */
- public function setCountryCode($countryCode)
- {
- $this->container['countryCode'] = $countryCode;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/MasterDetailsResponseBillingInfoName.php b/lib/Model/MasterDetailsResponseBillingInfoName.php
deleted file mode 100644
index 9eaebdf..0000000
--- a/lib/Model/MasterDetailsResponseBillingInfoName.php
+++ /dev/null
@@ -1,336 +0,0 @@
- 'string',
- 'familyName' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'givenName' => null,
- 'familyName' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'givenName' => 'givenName',
- 'familyName' => 'familyName'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'givenName' => 'setGivenName',
- 'familyName' => 'setFamilyName'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'givenName' => 'getGivenName',
- 'familyName' => 'getFamilyName'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['givenName'] = isset($data['givenName']) ? $data['givenName'] : null;
- $this->container['familyName'] = isset($data['familyName']) ? $data['familyName'] : null;
- }
-
- /**
- * 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 givenName
- *
- * @return string
- */
- public function getGivenName()
- {
- return $this->container['givenName'];
- }
-
- /**
- * Sets givenName
- *
- * @param string $givenName First name for billing
- *
- * @return $this
- */
- public function setGivenName($givenName)
- {
- $this->container['givenName'] = $givenName;
-
- return $this;
- }
-
- /**
- * Gets familyName
- *
- * @return string
- */
- public function getFamilyName()
- {
- return $this->container['familyName'];
- }
-
- /**
- * Sets familyName
- *
- * @param string $familyName Last name for billing
- *
- * @return $this
- */
- public function setFamilyName($familyName)
- {
- $this->container['familyName'] = $familyName;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/MasterDetailsResponsePlanInfo.php b/lib/Model/MasterDetailsResponsePlanInfo.php
deleted file mode 100644
index 366576b..0000000
--- a/lib/Model/MasterDetailsResponsePlanInfo.php
+++ /dev/null
@@ -1,488 +0,0 @@
- 'string',
- 'nextBillingAt' => 'int',
- 'price' => 'float',
- 'planPeriod' => 'string',
- 'subAccounts' => 'int',
- 'features' => '\Brevo\Client\Model\MasterDetailsResponsePlanInfoFeatures[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'currencyCode' => null,
- 'nextBillingAt' => 'int64',
- 'price' => null,
- 'planPeriod' => null,
- 'subAccounts' => null,
- 'features' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'currencyCode' => 'currencyCode',
- 'nextBillingAt' => 'nextBillingAt',
- 'price' => 'price',
- 'planPeriod' => 'planPeriod',
- 'subAccounts' => 'subAccounts',
- 'features' => 'features'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'currencyCode' => 'setCurrencyCode',
- 'nextBillingAt' => 'setNextBillingAt',
- 'price' => 'setPrice',
- 'planPeriod' => 'setPlanPeriod',
- 'subAccounts' => 'setSubAccounts',
- 'features' => 'setFeatures'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'currencyCode' => 'getCurrencyCode',
- 'nextBillingAt' => 'getNextBillingAt',
- 'price' => 'getPrice',
- 'planPeriod' => 'getPlanPeriod',
- 'subAccounts' => 'getSubAccounts',
- 'features' => 'getFeatures'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const PLAN_PERIOD_MONTH = 'month';
- const PLAN_PERIOD_YEAR = 'year';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getPlanPeriodAllowableValues()
- {
- return [
- self::PLAN_PERIOD_MONTH,
- self::PLAN_PERIOD_YEAR,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['currencyCode'] = isset($data['currencyCode']) ? $data['currencyCode'] : null;
- $this->container['nextBillingAt'] = isset($data['nextBillingAt']) ? $data['nextBillingAt'] : null;
- $this->container['price'] = isset($data['price']) ? $data['price'] : null;
- $this->container['planPeriod'] = isset($data['planPeriod']) ? $data['planPeriod'] : null;
- $this->container['subAccounts'] = isset($data['subAccounts']) ? $data['subAccounts'] : null;
- $this->container['features'] = isset($data['features']) ? $data['features'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- $allowedValues = $this->getPlanPeriodAllowableValues();
- if (!is_null($this->container['planPeriod']) && !in_array($this->container['planPeriod'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'planPeriod', must be one of '%s'",
- 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 currencyCode
- *
- * @return string
- */
- public function getCurrencyCode()
- {
- return $this->container['currencyCode'];
- }
-
- /**
- * Sets currencyCode
- *
- * @param string $currencyCode Plan currency
- *
- * @return $this
- */
- public function setCurrencyCode($currencyCode)
- {
- $this->container['currencyCode'] = $currencyCode;
-
- return $this;
- }
-
- /**
- * Gets nextBillingAt
- *
- * @return int
- */
- public function getNextBillingAt()
- {
- return $this->container['nextBillingAt'];
- }
-
- /**
- * Sets nextBillingAt
- *
- * @param int $nextBillingAt Timestamp of next billing date
- *
- * @return $this
- */
- public function setNextBillingAt($nextBillingAt)
- {
- $this->container['nextBillingAt'] = $nextBillingAt;
-
- return $this;
- }
-
- /**
- * Gets price
- *
- * @return float
- */
- public function getPrice()
- {
- return $this->container['price'];
- }
-
- /**
- * Sets price
- *
- * @param float $price Plan amount
- *
- * @return $this
- */
- public function setPrice($price)
- {
- $this->container['price'] = $price;
-
- return $this;
- }
-
- /**
- * Gets planPeriod
- *
- * @return string
- */
- public function getPlanPeriod()
- {
- return $this->container['planPeriod'];
- }
-
- /**
- * Sets planPeriod
- *
- * @param string $planPeriod Plan period type
- *
- * @return $this
- */
- public function setPlanPeriod($planPeriod)
- {
- $allowedValues = $this->getPlanPeriodAllowableValues();
- if (!is_null($planPeriod) && !in_array($planPeriod, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'planPeriod', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['planPeriod'] = $planPeriod;
-
- return $this;
- }
-
- /**
- * Gets subAccounts
- *
- * @return int
- */
- public function getSubAccounts()
- {
- return $this->container['subAccounts'];
- }
-
- /**
- * Sets subAccounts
- *
- * @param int $subAccounts Number of sub-accounts
- *
- * @return $this
- */
- public function setSubAccounts($subAccounts)
- {
- $this->container['subAccounts'] = $subAccounts;
-
- return $this;
- }
-
- /**
- * Gets features
- *
- * @return \Brevo\Client\Model\MasterDetailsResponsePlanInfoFeatures[]
- */
- public function getFeatures()
- {
- return $this->container['features'];
- }
-
- /**
- * Sets features
- *
- * @param \Brevo\Client\Model\MasterDetailsResponsePlanInfoFeatures[] $features List of provided features in the plan
- *
- * @return $this
- */
- public function setFeatures($features)
- {
- $this->container['features'] = $features;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/MasterDetailsResponsePlanInfoFeatures.php b/lib/Model/MasterDetailsResponsePlanInfoFeatures.php
deleted file mode 100644
index cb40811..0000000
--- a/lib/Model/MasterDetailsResponsePlanInfoFeatures.php
+++ /dev/null
@@ -1,485 +0,0 @@
- 'string',
- 'unitValue' => 'string',
- 'quantity' => 'int',
- 'quantityWithOverages' => 'int',
- 'used' => 'int',
- 'usedOverages' => 'int',
- 'remaining' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'unitValue' => null,
- 'quantity' => 'int64',
- 'quantityWithOverages' => 'int64',
- 'used' => 'int64',
- 'usedOverages' => 'int64',
- 'remaining' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'unitValue' => 'unitValue',
- 'quantity' => 'quantity',
- 'quantityWithOverages' => 'quantityWithOverages',
- 'used' => 'used',
- 'usedOverages' => 'usedOverages',
- 'remaining' => 'remaining'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'unitValue' => 'setUnitValue',
- 'quantity' => 'setQuantity',
- 'quantityWithOverages' => 'setQuantityWithOverages',
- 'used' => 'setUsed',
- 'usedOverages' => 'setUsedOverages',
- 'remaining' => 'setRemaining'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'unitValue' => 'getUnitValue',
- 'quantity' => 'getQuantity',
- 'quantityWithOverages' => 'getQuantityWithOverages',
- 'used' => 'getUsed',
- 'usedOverages' => 'getUsedOverages',
- 'remaining' => 'getRemaining'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['unitValue'] = isset($data['unitValue']) ? $data['unitValue'] : null;
- $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null;
- $this->container['quantityWithOverages'] = isset($data['quantityWithOverages']) ? $data['quantityWithOverages'] : null;
- $this->container['used'] = isset($data['used']) ? $data['used'] : null;
- $this->container['usedOverages'] = isset($data['usedOverages']) ? $data['usedOverages'] : null;
- $this->container['remaining'] = isset($data['remaining']) ? $data['remaining'] : null;
- }
-
- /**
- * 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the feature
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets unitValue
- *
- * @return string
- */
- public function getUnitValue()
- {
- return $this->container['unitValue'];
- }
-
- /**
- * Sets unitValue
- *
- * @param string $unitValue Unit value of the feature
- *
- * @return $this
- */
- public function setUnitValue($unitValue)
- {
- $this->container['unitValue'] = $unitValue;
-
- return $this;
- }
-
- /**
- * Gets quantity
- *
- * @return int
- */
- public function getQuantity()
- {
- return $this->container['quantity'];
- }
-
- /**
- * Sets quantity
- *
- * @param int $quantity Quantity provided in the plan
- *
- * @return $this
- */
- public function setQuantity($quantity)
- {
- $this->container['quantity'] = $quantity;
-
- return $this;
- }
-
- /**
- * Gets quantityWithOverages
- *
- * @return int
- */
- public function getQuantityWithOverages()
- {
- return $this->container['quantityWithOverages'];
- }
-
- /**
- * Sets quantityWithOverages
- *
- * @param int $quantityWithOverages Quantity with overages provided in the plan (only applicable on ENTv2)
- *
- * @return $this
- */
- public function setQuantityWithOverages($quantityWithOverages)
- {
- $this->container['quantityWithOverages'] = $quantityWithOverages;
-
- return $this;
- }
-
- /**
- * Gets used
- *
- * @return int
- */
- public function getUsed()
- {
- return $this->container['used'];
- }
-
- /**
- * Sets used
- *
- * @param int $used Quantity consumed by master
- *
- * @return $this
- */
- public function setUsed($used)
- {
- $this->container['used'] = $used;
-
- return $this;
- }
-
- /**
- * Gets usedOverages
- *
- * @return int
- */
- public function getUsedOverages()
- {
- return $this->container['usedOverages'];
- }
-
- /**
- * Sets usedOverages
- *
- * @param int $usedOverages Quantity consumed by sub-organizations over the admin plan limit (only applicable on ENTv2)
- *
- * @return $this
- */
- public function setUsedOverages($usedOverages)
- {
- $this->container['usedOverages'] = $usedOverages;
-
- return $this;
- }
-
- /**
- * Gets remaining
- *
- * @return int
- */
- public function getRemaining()
- {
- return $this->container['remaining'];
- }
-
- /**
- * Sets remaining
- *
- * @param int $remaining Quantity remaining in the plan
- *
- * @return $this
- */
- public function setRemaining($remaining)
- {
- $this->container['remaining'] = $remaining;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/ModelInterface.php b/lib/Model/ModelInterface.php
deleted file mode 100644
index 4aebc13..0000000
--- a/lib/Model/ModelInterface.php
+++ /dev/null
@@ -1,96 +0,0 @@
- 'string',
- 'text' => 'string',
- 'contactIds' => 'int[]',
- 'dealIds' => 'string[]',
- 'authorId' => 'object',
- 'createdAt' => '\DateTime',
- 'updatedAt' => '\DateTime'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => null,
- 'text' => null,
- 'contactIds' => null,
- 'dealIds' => null,
- 'authorId' => null,
- 'createdAt' => 'date-time',
- 'updatedAt' => 'date-time'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'text' => 'text',
- 'contactIds' => 'contactIds',
- 'dealIds' => 'dealIds',
- 'authorId' => 'authorId',
- 'createdAt' => 'createdAt',
- 'updatedAt' => 'updatedAt'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'text' => 'setText',
- 'contactIds' => 'setContactIds',
- 'dealIds' => 'setDealIds',
- 'authorId' => 'setAuthorId',
- 'createdAt' => 'setCreatedAt',
- 'updatedAt' => 'setUpdatedAt'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'text' => 'getText',
- 'contactIds' => 'getContactIds',
- 'dealIds' => 'getDealIds',
- 'authorId' => 'getAuthorId',
- 'createdAt' => 'getCreatedAt',
- 'updatedAt' => 'getUpdatedAt'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['text'] = isset($data['text']) ? $data['text'] : null;
- $this->container['contactIds'] = isset($data['contactIds']) ? $data['contactIds'] : null;
- $this->container['dealIds'] = isset($data['dealIds']) ? $data['dealIds'] : null;
- $this->container['authorId'] = isset($data['authorId']) ? $data['authorId'] : null;
- $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null;
- $this->container['updatedAt'] = isset($data['updatedAt']) ? $data['updatedAt'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['text'] === null) {
- $invalidProperties[] = "'text' can't be null";
- }
- if ((mb_strlen($this->container['text']) > 3000)) {
- $invalidProperties[] = "invalid value for 'text', the character length must be smaller than or equal to 3000.";
- }
-
- if ((mb_strlen($this->container['text']) < 1)) {
- $invalidProperties[] = "invalid value for 'text', the character length must be bigger than or equal to 1.";
- }
-
- 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 Unique note Id
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets text
- *
- * @return string
- */
- public function getText()
- {
- return $this->container['text'];
- }
-
- /**
- * Sets text
- *
- * @param string $text Text content of a note
- *
- * @return $this
- */
- public function setText($text)
- {
- if ((mb_strlen($text) > 3000)) {
- throw new \InvalidArgumentException('invalid length for $text when calling Note., must be smaller than or equal to 3000.');
- }
- if ((mb_strlen($text) < 1)) {
- throw new \InvalidArgumentException('invalid length for $text when calling Note., must be bigger than or equal to 1.');
- }
-
- $this->container['text'] = $text;
-
- return $this;
- }
-
- /**
- * Gets contactIds
- *
- * @return int[]
- */
- public function getContactIds()
- {
- return $this->container['contactIds'];
- }
-
- /**
- * Sets contactIds
- *
- * @param int[] $contactIds Contact ids linked to a note
- *
- * @return $this
- */
- public function setContactIds($contactIds)
- {
- $this->container['contactIds'] = $contactIds;
-
- return $this;
- }
-
- /**
- * Gets dealIds
- *
- * @return string[]
- */
- public function getDealIds()
- {
- return $this->container['dealIds'];
- }
-
- /**
- * Sets dealIds
- *
- * @param string[] $dealIds Deal ids linked to a note
- *
- * @return $this
- */
- public function setDealIds($dealIds)
- {
- $this->container['dealIds'] = $dealIds;
-
- return $this;
- }
-
- /**
- * Gets authorId
- *
- * @return object
- */
- public function getAuthorId()
- {
- return $this->container['authorId'];
- }
-
- /**
- * Sets authorId
- *
- * @param object $authorId Account details of user which created the note
- *
- * @return $this
- */
- public function setAuthorId($authorId)
- {
- $this->container['authorId'] = $authorId;
-
- return $this;
- }
-
- /**
- * Gets createdAt
- *
- * @return \DateTime
- */
- public function getCreatedAt()
- {
- return $this->container['createdAt'];
- }
-
- /**
- * Sets createdAt
- *
- * @param \DateTime $createdAt Note created date/time
- *
- * @return $this
- */
- public function setCreatedAt($createdAt)
- {
- $this->container['createdAt'] = $createdAt;
-
- return $this;
- }
-
- /**
- * Gets updatedAt
- *
- * @return \DateTime
- */
- public function getUpdatedAt()
- {
- return $this->container['updatedAt'];
- }
-
- /**
- * Sets updatedAt
- *
- * @param \DateTime $updatedAt Note updated date/time
- *
- * @return $this
- */
- public function setUpdatedAt($updatedAt)
- {
- $this->container['updatedAt'] = $updatedAt;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/NoteData.php b/lib/Model/NoteData.php
deleted file mode 100644
index 0b23fb0..0000000
--- a/lib/Model/NoteData.php
+++ /dev/null
@@ -1,414 +0,0 @@
- 'string',
- 'contactIds' => 'int[]',
- 'dealIds' => 'string[]',
- 'companyIds' => 'string[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'text' => null,
- 'contactIds' => null,
- 'dealIds' => null,
- 'companyIds' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'text' => 'text',
- 'contactIds' => 'contactIds',
- 'dealIds' => 'dealIds',
- 'companyIds' => 'companyIds'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'text' => 'setText',
- 'contactIds' => 'setContactIds',
- 'dealIds' => 'setDealIds',
- 'companyIds' => 'setCompanyIds'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'text' => 'getText',
- 'contactIds' => 'getContactIds',
- 'dealIds' => 'getDealIds',
- 'companyIds' => 'getCompanyIds'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['text'] = isset($data['text']) ? $data['text'] : null;
- $this->container['contactIds'] = isset($data['contactIds']) ? $data['contactIds'] : null;
- $this->container['dealIds'] = isset($data['dealIds']) ? $data['dealIds'] : null;
- $this->container['companyIds'] = isset($data['companyIds']) ? $data['companyIds'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['text'] === null) {
- $invalidProperties[] = "'text' can't be null";
- }
- if ((mb_strlen($this->container['text']) > 3000)) {
- $invalidProperties[] = "invalid value for 'text', the character length must be smaller than or equal to 3000.";
- }
-
- if ((mb_strlen($this->container['text']) < 1)) {
- $invalidProperties[] = "invalid value for 'text', the character length must be bigger than or equal to 1.";
- }
-
- 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 text
- *
- * @return string
- */
- public function getText()
- {
- return $this->container['text'];
- }
-
- /**
- * Sets text
- *
- * @param string $text Text content of a note
- *
- * @return $this
- */
- public function setText($text)
- {
- if ((mb_strlen($text) > 3000)) {
- throw new \InvalidArgumentException('invalid length for $text when calling NoteData., must be smaller than or equal to 3000.');
- }
- if ((mb_strlen($text) < 1)) {
- throw new \InvalidArgumentException('invalid length for $text when calling NoteData., must be bigger than or equal to 1.');
- }
-
- $this->container['text'] = $text;
-
- return $this;
- }
-
- /**
- * Gets contactIds
- *
- * @return int[]
- */
- public function getContactIds()
- {
- return $this->container['contactIds'];
- }
-
- /**
- * Sets contactIds
- *
- * @param int[] $contactIds Contact Ids linked to a note
- *
- * @return $this
- */
- public function setContactIds($contactIds)
- {
- $this->container['contactIds'] = $contactIds;
-
- return $this;
- }
-
- /**
- * Gets dealIds
- *
- * @return string[]
- */
- public function getDealIds()
- {
- return $this->container['dealIds'];
- }
-
- /**
- * Sets dealIds
- *
- * @param string[] $dealIds Deal Ids linked to a note
- *
- * @return $this
- */
- public function setDealIds($dealIds)
- {
- $this->container['dealIds'] = $dealIds;
-
- return $this;
- }
-
- /**
- * Gets companyIds
- *
- * @return string[]
- */
- public function getCompanyIds()
- {
- return $this->container['companyIds'];
- }
-
- /**
- * Sets companyIds
- *
- * @param string[] $companyIds Company Ids linked to a note
- *
- * @return $this
- */
- public function setCompanyIds($companyIds)
- {
- $this->container['companyIds'] = $companyIds;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/NoteId.php b/lib/Model/NoteId.php
deleted file mode 100644
index 30d6181..0000000
--- a/lib/Model/NoteId.php
+++ /dev/null
@@ -1,306 +0,0 @@
- 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- }
-
- /**
- * 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 id
- *
- * @return string
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param string $id Unique note Id
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/NoteList.php b/lib/Model/NoteList.php
deleted file mode 100644
index 93e4cad..0000000
--- a/lib/Model/NoteList.php
+++ /dev/null
@@ -1,281 +0,0 @@
-listInvalidProperties()) === 0;
- }
-
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/Order.php b/lib/Model/Order.php
deleted file mode 100644
index 688f576..0000000
--- a/lib/Model/Order.php
+++ /dev/null
@@ -1,563 +0,0 @@
- 'string',
- 'createdAt' => 'string',
- 'updatedAt' => 'string',
- 'status' => 'string',
- 'amount' => 'float',
- 'products' => '\Brevo\Client\Model\OrderProducts[]',
- 'email' => 'string',
- 'billing' => '\Brevo\Client\Model\OrderBilling',
- 'coupons' => 'string[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => null,
- 'createdAt' => null,
- 'updatedAt' => null,
- 'status' => null,
- 'amount' => null,
- 'products' => null,
- 'email' => null,
- 'billing' => null,
- 'coupons' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'createdAt' => 'createdAt',
- 'updatedAt' => 'updatedAt',
- 'status' => 'status',
- 'amount' => 'amount',
- 'products' => 'products',
- 'email' => 'email',
- 'billing' => 'billing',
- 'coupons' => 'coupons'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'createdAt' => 'setCreatedAt',
- 'updatedAt' => 'setUpdatedAt',
- 'status' => 'setStatus',
- 'amount' => 'setAmount',
- 'products' => 'setProducts',
- 'email' => 'setEmail',
- 'billing' => 'setBilling',
- 'coupons' => 'setCoupons'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'createdAt' => 'getCreatedAt',
- 'updatedAt' => 'getUpdatedAt',
- 'status' => 'getStatus',
- 'amount' => 'getAmount',
- 'products' => 'getProducts',
- 'email' => 'getEmail',
- 'billing' => 'getBilling',
- 'coupons' => 'getCoupons'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null;
- $this->container['updatedAt'] = isset($data['updatedAt']) ? $data['updatedAt'] : null;
- $this->container['status'] = isset($data['status']) ? $data['status'] : null;
- $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null;
- $this->container['products'] = isset($data['products']) ? $data['products'] : null;
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['billing'] = isset($data['billing']) ? $data['billing'] : null;
- $this->container['coupons'] = isset($data['coupons']) ? $data['coupons'] : null;
- }
-
- /**
- * 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['createdAt'] === null) {
- $invalidProperties[] = "'createdAt' can't be null";
- }
- if ($this->container['updatedAt'] === null) {
- $invalidProperties[] = "'updatedAt' can't be null";
- }
- if ($this->container['status'] === null) {
- $invalidProperties[] = "'status' can't be null";
- }
- if ($this->container['amount'] === null) {
- $invalidProperties[] = "'amount' can't be null";
- }
- if ($this->container['products'] === null) {
- $invalidProperties[] = "'products' 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 Unique ID of the order.
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets createdAt
- *
- * @return string
- */
- public function getCreatedAt()
- {
- return $this->container['createdAt'];
- }
-
- /**
- * Sets createdAt
- *
- * @param string $createdAt Event occurrence UTC date-time (YYYY-MM-DDTHH:mm:ssZ), when order is actually created.
- *
- * @return $this
- */
- public function setCreatedAt($createdAt)
- {
- $this->container['createdAt'] = $createdAt;
-
- return $this;
- }
-
- /**
- * Gets updatedAt
- *
- * @return string
- */
- public function getUpdatedAt()
- {
- return $this->container['updatedAt'];
- }
-
- /**
- * Sets updatedAt
- *
- * @param string $updatedAt Event updated UTC date-time (YYYY-MM-DDTHH:mm:ssZ), when the status of the order is actually changed/updated.
- *
- * @return $this
- */
- public function setUpdatedAt($updatedAt)
- {
- $this->container['updatedAt'] = $updatedAt;
-
- return $this;
- }
-
- /**
- * Gets status
- *
- * @return string
- */
- public function getStatus()
- {
- return $this->container['status'];
- }
-
- /**
- * Sets status
- *
- * @param string $status State of the order.
- *
- * @return $this
- */
- public function setStatus($status)
- {
- $this->container['status'] = $status;
-
- return $this;
- }
-
- /**
- * Gets amount
- *
- * @return float
- */
- public function getAmount()
- {
- return $this->container['amount'];
- }
-
- /**
- * Sets amount
- *
- * @param float $amount Total amount of the order, including all shipping expenses, tax and the price of items.
- *
- * @return $this
- */
- public function setAmount($amount)
- {
- $this->container['amount'] = $amount;
-
- return $this;
- }
-
- /**
- * Gets products
- *
- * @return \Brevo\Client\Model\OrderProducts[]
- */
- public function getProducts()
- {
- return $this->container['products'];
- }
-
- /**
- * Sets products
- *
- * @param \Brevo\Client\Model\OrderProducts[] $products products
- *
- * @return $this
- */
- public function setProducts($products)
- {
- $this->container['products'] = $products;
-
- return $this;
- }
-
- /**
- * Gets email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Email of the contact, Mandatory if \"phone\" field is not passed in \"billing\" parameter.
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets billing
- *
- * @return \Brevo\Client\Model\OrderBilling
- */
- public function getBilling()
- {
- return $this->container['billing'];
- }
-
- /**
- * Sets billing
- *
- * @param \Brevo\Client\Model\OrderBilling $billing billing
- *
- * @return $this
- */
- public function setBilling($billing)
- {
- $this->container['billing'] = $billing;
-
- return $this;
- }
-
- /**
- * Gets coupons
- *
- * @return string[]
- */
- public function getCoupons()
- {
- return $this->container['coupons'];
- }
-
- /**
- * Sets coupons
- *
- * @param string[] $coupons Coupons applied to the order. Stored case insensitive.
- *
- * @return $this
- */
- public function setCoupons($coupons)
- {
- $this->container['coupons'] = $coupons;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/OrderBatch.php b/lib/Model/OrderBatch.php
deleted file mode 100644
index 98a9fed..0000000
--- a/lib/Model/OrderBatch.php
+++ /dev/null
@@ -1,368 +0,0 @@
- '\Brevo\Client\Model\Order[]',
- 'notifyUrl' => 'string',
- 'historical' => 'bool'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'orders' => null,
- 'notifyUrl' => null,
- 'historical' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'orders' => 'orders',
- 'notifyUrl' => 'notifyUrl',
- 'historical' => 'historical'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'orders' => 'setOrders',
- 'notifyUrl' => 'setNotifyUrl',
- 'historical' => 'setHistorical'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'orders' => 'getOrders',
- 'notifyUrl' => 'getNotifyUrl',
- 'historical' => 'getHistorical'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['orders'] = isset($data['orders']) ? $data['orders'] : null;
- $this->container['notifyUrl'] = isset($data['notifyUrl']) ? $data['notifyUrl'] : null;
- $this->container['historical'] = isset($data['historical']) ? $data['historical'] : true;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['orders'] === null) {
- $invalidProperties[] = "'orders' 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 orders
- *
- * @return \Brevo\Client\Model\Order[]
- */
- public function getOrders()
- {
- return $this->container['orders'];
- }
-
- /**
- * Sets orders
- *
- * @param \Brevo\Client\Model\Order[] $orders array of order objects
- *
- * @return $this
- */
- public function setOrders($orders)
- {
- $this->container['orders'] = $orders;
-
- return $this;
- }
-
- /**
- * Gets notifyUrl
- *
- * @return string
- */
- public function getNotifyUrl()
- {
- return $this->container['notifyUrl'];
- }
-
- /**
- * Sets notifyUrl
- *
- * @param string $notifyUrl Notify Url provided by client to get the status of batch request
- *
- * @return $this
- */
- public function setNotifyUrl($notifyUrl)
- {
- $this->container['notifyUrl'] = $notifyUrl;
-
- return $this;
- }
-
- /**
- * Gets historical
- *
- * @return bool
- */
- public function getHistorical()
- {
- return $this->container['historical'];
- }
-
- /**
- * Sets historical
- *
- * @param bool $historical Defines wether you want your orders to be considered as live data or as historical data (import of past data, synchronising data). True: orders will not trigger any automation workflows. False: orders will trigger workflows as usual.
- *
- * @return $this
- */
- public function setHistorical($historical)
- {
- $this->container['historical'] = $historical;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/OrderBilling.php b/lib/Model/OrderBilling.php
deleted file mode 100644
index ded706a..0000000
--- a/lib/Model/OrderBilling.php
+++ /dev/null
@@ -1,486 +0,0 @@
- 'string',
- 'city' => 'string',
- 'countryCode' => 'string',
- 'phone' => 'string',
- 'postCode' => 'string',
- 'paymentMethod' => 'string',
- 'region' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'address' => null,
- 'city' => null,
- 'countryCode' => null,
- 'phone' => null,
- 'postCode' => null,
- 'paymentMethod' => null,
- 'region' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'address' => 'address',
- 'city' => 'city',
- 'countryCode' => 'countryCode',
- 'phone' => 'phone',
- 'postCode' => 'postCode',
- 'paymentMethod' => 'paymentMethod',
- 'region' => 'region'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'address' => 'setAddress',
- 'city' => 'setCity',
- 'countryCode' => 'setCountryCode',
- 'phone' => 'setPhone',
- 'postCode' => 'setPostCode',
- 'paymentMethod' => 'setPaymentMethod',
- 'region' => 'setRegion'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'address' => 'getAddress',
- 'city' => 'getCity',
- 'countryCode' => 'getCountryCode',
- 'phone' => 'getPhone',
- 'postCode' => 'getPostCode',
- 'paymentMethod' => 'getPaymentMethod',
- 'region' => 'getRegion'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['address'] = isset($data['address']) ? $data['address'] : null;
- $this->container['city'] = isset($data['city']) ? $data['city'] : null;
- $this->container['countryCode'] = isset($data['countryCode']) ? $data['countryCode'] : null;
- $this->container['phone'] = isset($data['phone']) ? $data['phone'] : null;
- $this->container['postCode'] = isset($data['postCode']) ? $data['postCode'] : null;
- $this->container['paymentMethod'] = isset($data['paymentMethod']) ? $data['paymentMethod'] : null;
- $this->container['region'] = isset($data['region']) ? $data['region'] : null;
- }
-
- /**
- * 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 address
- *
- * @return string
- */
- public function getAddress()
- {
- return $this->container['address'];
- }
-
- /**
- * Sets address
- *
- * @param string $address Full billing address.
- *
- * @return $this
- */
- public function setAddress($address)
- {
- $this->container['address'] = $address;
-
- return $this;
- }
-
- /**
- * Gets city
- *
- * @return string
- */
- public function getCity()
- {
- return $this->container['city'];
- }
-
- /**
- * Sets city
- *
- * @param string $city Exact city of the address.
- *
- * @return $this
- */
- public function setCity($city)
- {
- $this->container['city'] = $city;
-
- return $this;
- }
-
- /**
- * Gets countryCode
- *
- * @return string
- */
- public function getCountryCode()
- {
- return $this->container['countryCode'];
- }
-
- /**
- * Sets countryCode
- *
- * @param string $countryCode Billing country 2-letter ISO code.
- *
- * @return $this
- */
- public function setCountryCode($countryCode)
- {
- $this->container['countryCode'] = $countryCode;
-
- return $this;
- }
-
- /**
- * Gets phone
- *
- * @return string
- */
- public function getPhone()
- {
- return $this->container['phone'];
- }
-
- /**
- * Sets phone
- *
- * @param string $phone Phone number to contact for further details about the order, Mandatory if \"email\" field is not passed.
- *
- * @return $this
- */
- public function setPhone($phone)
- {
- $this->container['phone'] = $phone;
-
- return $this;
- }
-
- /**
- * Gets postCode
- *
- * @return string
- */
- public function getPostCode()
- {
- return $this->container['postCode'];
- }
-
- /**
- * Sets postCode
- *
- * @param string $postCode Postcode for delivery and billing.
- *
- * @return $this
- */
- public function setPostCode($postCode)
- {
- $this->container['postCode'] = $postCode;
-
- return $this;
- }
-
- /**
- * Gets paymentMethod
- *
- * @return string
- */
- public function getPaymentMethod()
- {
- return $this->container['paymentMethod'];
- }
-
- /**
- * Sets paymentMethod
- *
- * @param string $paymentMethod How the visitor will pay for the item(s), e.g. paypal, check, etc.
- *
- * @return $this
- */
- public function setPaymentMethod($paymentMethod)
- {
- $this->container['paymentMethod'] = $paymentMethod;
-
- return $this;
- }
-
- /**
- * Gets region
- *
- * @return string
- */
- public function getRegion()
- {
- return $this->container['region'];
- }
-
- /**
- * Sets region
- *
- * @param string $region Exact region (state/province) for delivery and billing.
- *
- * @return $this
- */
- public function setRegion($region)
- {
- $this->container['region'] = $region;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/OrderProducts.php b/lib/Model/OrderProducts.php
deleted file mode 100644
index 1a921c2..0000000
--- a/lib/Model/OrderProducts.php
+++ /dev/null
@@ -1,405 +0,0 @@
- 'string',
- 'quantity' => 'float',
- 'variantId' => 'string',
- 'price' => 'float'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'productId' => null,
- 'quantity' => null,
- 'variantId' => null,
- 'price' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'productId' => 'productId',
- 'quantity' => 'quantity',
- 'variantId' => 'variantId',
- 'price' => 'price'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'productId' => 'setProductId',
- 'quantity' => 'setQuantity',
- 'variantId' => 'setVariantId',
- 'price' => 'setPrice'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'productId' => 'getProductId',
- 'quantity' => 'getQuantity',
- 'variantId' => 'getVariantId',
- 'price' => 'getPrice'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['productId'] = isset($data['productId']) ? $data['productId'] : null;
- $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null;
- $this->container['variantId'] = isset($data['variantId']) ? $data['variantId'] : null;
- $this->container['price'] = isset($data['price']) ? $data['price'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['productId'] === null) {
- $invalidProperties[] = "'productId' can't be null";
- }
- if ($this->container['quantity'] === null) {
- $invalidProperties[] = "'quantity' can't be null";
- }
- if ($this->container['price'] === null) {
- $invalidProperties[] = "'price' 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 productId
- *
- * @return string
- */
- public function getProductId()
- {
- return $this->container['productId'];
- }
-
- /**
- * Sets productId
- *
- * @param string $productId ID of the product.
- *
- * @return $this
- */
- public function setProductId($productId)
- {
- $this->container['productId'] = $productId;
-
- return $this;
- }
-
- /**
- * Gets quantity
- *
- * @return float
- */
- public function getQuantity()
- {
- return $this->container['quantity'];
- }
-
- /**
- * Sets quantity
- *
- * @param float $quantity How many pieces of the product the visitor has added to the cart.
- *
- * @return $this
- */
- public function setQuantity($quantity)
- {
- $this->container['quantity'] = $quantity;
-
- return $this;
- }
-
- /**
- * Gets variantId
- *
- * @return string
- */
- public function getVariantId()
- {
- return $this->container['variantId'];
- }
-
- /**
- * Sets variantId
- *
- * @param string $variantId Product ID of the red color shirts.
- *
- * @return $this
- */
- public function setVariantId($variantId)
- {
- $this->container['variantId'] = $variantId;
-
- return $this;
- }
-
- /**
- * Gets price
- *
- * @return float
- */
- public function getPrice()
- {
- return $this->container['price'];
- }
-
- /**
- * Sets price
- *
- * @param float $price The price of a unit of product
- *
- * @return $this
- */
- public function setPrice($price)
- {
- $this->container['price'] = $price;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/Otp.php b/lib/Model/Otp.php
deleted file mode 100644
index 89a28c0..0000000
--- a/lib/Model/Otp.php
+++ /dev/null
@@ -1,305 +0,0 @@
- 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- }
-
- /**
- * 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 name
- *
- * @return int
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param int $name 6 digit OTP received on email
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/Pipeline.php b/lib/Model/Pipeline.php
deleted file mode 100644
index 02ab62c..0000000
--- a/lib/Model/Pipeline.php
+++ /dev/null
@@ -1,366 +0,0 @@
- 'string',
- 'pipelineName' => 'string',
- 'stages' => '\Brevo\Client\Model\PipelineStage[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'pipeline' => null,
- 'pipelineName' => null,
- 'stages' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'pipeline' => 'pipeline',
- 'pipelineName' => 'pipeline_name',
- 'stages' => 'stages'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'pipeline' => 'setPipeline',
- 'pipelineName' => 'setPipelineName',
- 'stages' => 'setStages'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'pipeline' => 'getPipeline',
- 'pipelineName' => 'getPipelineName',
- 'stages' => 'getStages'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['pipeline'] = isset($data['pipeline']) ? $data['pipeline'] : null;
- $this->container['pipelineName'] = isset($data['pipelineName']) ? $data['pipelineName'] : null;
- $this->container['stages'] = isset($data['stages']) ? $data['stages'] : null;
- }
-
- /**
- * 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 pipeline
- *
- * @return string
- */
- public function getPipeline()
- {
- return $this->container['pipeline'];
- }
-
- /**
- * Sets pipeline
- *
- * @param string $pipeline Pipeline id
- *
- * @return $this
- */
- public function setPipeline($pipeline)
- {
- $this->container['pipeline'] = $pipeline;
-
- return $this;
- }
-
- /**
- * Gets pipelineName
- *
- * @return string
- */
- public function getPipelineName()
- {
- return $this->container['pipelineName'];
- }
-
- /**
- * Sets pipelineName
- *
- * @param string $pipelineName Pipeline Name
- *
- * @return $this
- */
- public function setPipelineName($pipelineName)
- {
- $this->container['pipelineName'] = $pipelineName;
-
- return $this;
- }
-
- /**
- * Gets stages
- *
- * @return \Brevo\Client\Model\PipelineStage[]
- */
- public function getStages()
- {
- return $this->container['stages'];
- }
-
- /**
- * Sets stages
- *
- * @param \Brevo\Client\Model\PipelineStage[] $stages List of stages
- *
- * @return $this
- */
- public function setStages($stages)
- {
- $this->container['stages'] = $stages;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/PipelineStage.php b/lib/Model/PipelineStage.php
deleted file mode 100644
index cf6d2f8..0000000
--- a/lib/Model/PipelineStage.php
+++ /dev/null
@@ -1,336 +0,0 @@
- 'string',
- 'name' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => null,
- 'name' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'name' => 'name'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'name' => 'setName'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'name' => 'getName'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- }
-
- /**
- * 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 id
- *
- * @return string
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param string $id Stage id
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Stage name
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/Pipelines.php b/lib/Model/Pipelines.php
deleted file mode 100644
index c07200d..0000000
--- a/lib/Model/Pipelines.php
+++ /dev/null
@@ -1,281 +0,0 @@
-listInvalidProperties()) === 0;
- }
-
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/PostContactInfo.php b/lib/Model/PostContactInfo.php
deleted file mode 100644
index 46d17d2..0000000
--- a/lib/Model/PostContactInfo.php
+++ /dev/null
@@ -1,308 +0,0 @@
- '\Brevo\Client\Model\PostContactInfoContacts'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'contacts' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'contacts' => 'contacts'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'contacts' => 'setContacts'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'contacts' => 'getContacts'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['contacts'] = isset($data['contacts']) ? $data['contacts'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['contacts'] === null) {
- $invalidProperties[] = "'contacts' 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 contacts
- *
- * @return \Brevo\Client\Model\PostContactInfoContacts
- */
- public function getContacts()
- {
- return $this->container['contacts'];
- }
-
- /**
- * Sets contacts
- *
- * @param \Brevo\Client\Model\PostContactInfoContacts $contacts contacts
- *
- * @return $this
- */
- public function setContacts($contacts)
- {
- $this->container['contacts'] = $contacts;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/PostContactInfoContacts.php b/lib/Model/PostContactInfoContacts.php
deleted file mode 100644
index 978c032..0000000
--- a/lib/Model/PostContactInfoContacts.php
+++ /dev/null
@@ -1,395 +0,0 @@
- 'string[]',
- 'failure' => 'string[]',
- 'total' => 'int',
- 'processId' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'success' => 'email',
- 'failure' => 'email',
- 'total' => 'int64',
- 'processId' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'success' => 'success',
- 'failure' => 'failure',
- 'total' => 'total',
- 'processId' => 'processId'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'success' => 'setSuccess',
- 'failure' => 'setFailure',
- 'total' => 'setTotal',
- 'processId' => 'setProcessId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'success' => 'getSuccess',
- 'failure' => 'getFailure',
- 'total' => 'getTotal',
- 'processId' => 'getProcessId'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['success'] = isset($data['success']) ? $data['success'] : null;
- $this->container['failure'] = isset($data['failure']) ? $data['failure'] : null;
- $this->container['total'] = isset($data['total']) ? $data['total'] : null;
- $this->container['processId'] = isset($data['processId']) ? $data['processId'] : null;
- }
-
- /**
- * 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 success
- *
- * @return string[]
- */
- public function getSuccess()
- {
- return $this->container['success'];
- }
-
- /**
- * Sets success
- *
- * @param string[] $success success
- *
- * @return $this
- */
- public function setSuccess($success)
- {
- $this->container['success'] = $success;
-
- return $this;
- }
-
- /**
- * Gets failure
- *
- * @return string[]
- */
- public function getFailure()
- {
- return $this->container['failure'];
- }
-
- /**
- * Sets failure
- *
- * @param string[] $failure failure
- *
- * @return $this
- */
- public function setFailure($failure)
- {
- $this->container['failure'] = $failure;
-
- return $this;
- }
-
- /**
- * Gets total
- *
- * @return int
- */
- public function getTotal()
- {
- return $this->container['total'];
- }
-
- /**
- * Sets total
- *
- * @param int $total Displays the count of total number of contacts removed from list when user opts for \"all\" option.
- *
- * @return $this
- */
- public function setTotal($total)
- {
- $this->container['total'] = $total;
-
- return $this;
- }
-
- /**
- * Gets processId
- *
- * @return int
- */
- public function getProcessId()
- {
- return $this->container['processId'];
- }
-
- /**
- * Sets processId
- *
- * @param int $processId Id of the process created to remove contacts from list when user opts for \"all\" option.
- *
- * @return $this
- */
- public function setProcessId($processId)
- {
- $this->container['processId'] = $processId;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/PostSendFailed.php b/lib/Model/PostSendFailed.php
deleted file mode 100644
index 8c7567d..0000000
--- a/lib/Model/PostSendFailed.php
+++ /dev/null
@@ -1,431 +0,0 @@
- 'int',
- 'message' => 'string',
- 'unexistingEmails' => 'string[]',
- 'withoutListEmails' => 'string[]',
- 'blackListedEmails' => 'string[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'code' => 'int64',
- 'message' => null,
- 'unexistingEmails' => 'email',
- 'withoutListEmails' => 'email',
- 'blackListedEmails' => 'email'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'code' => 'code',
- 'message' => 'message',
- 'unexistingEmails' => 'unexistingEmails',
- 'withoutListEmails' => 'withoutListEmails',
- 'blackListedEmails' => 'blackListedEmails'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'code' => 'setCode',
- 'message' => 'setMessage',
- 'unexistingEmails' => 'setUnexistingEmails',
- 'withoutListEmails' => 'setWithoutListEmails',
- 'blackListedEmails' => 'setBlackListedEmails'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'code' => 'getCode',
- 'message' => 'getMessage',
- 'unexistingEmails' => 'getUnexistingEmails',
- 'withoutListEmails' => 'getWithoutListEmails',
- 'blackListedEmails' => 'getBlackListedEmails'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['code'] = isset($data['code']) ? $data['code'] : null;
- $this->container['message'] = isset($data['message']) ? $data['message'] : null;
- $this->container['unexistingEmails'] = isset($data['unexistingEmails']) ? $data['unexistingEmails'] : null;
- $this->container['withoutListEmails'] = isset($data['withoutListEmails']) ? $data['withoutListEmails'] : null;
- $this->container['blackListedEmails'] = isset($data['blackListedEmails']) ? $data['blackListedEmails'] : null;
- }
-
- /**
- * 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['message'] === null) {
- $invalidProperties[] = "'message' 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 int
- */
- public function getCode()
- {
- return $this->container['code'];
- }
-
- /**
- * Sets code
- *
- * @param int $code Response code
- *
- * @return $this
- */
- public function setCode($code)
- {
- $this->container['code'] = $code;
-
- return $this;
- }
-
- /**
- * Gets message
- *
- * @return string
- */
- public function getMessage()
- {
- return $this->container['message'];
- }
-
- /**
- * Sets message
- *
- * @param string $message Response message
- *
- * @return $this
- */
- public function setMessage($message)
- {
- $this->container['message'] = $message;
-
- return $this;
- }
-
- /**
- * Gets unexistingEmails
- *
- * @return string[]
- */
- public function getUnexistingEmails()
- {
- return $this->container['unexistingEmails'];
- }
-
- /**
- * Sets unexistingEmails
- *
- * @param string[] $unexistingEmails unexistingEmails
- *
- * @return $this
- */
- public function setUnexistingEmails($unexistingEmails)
- {
- $this->container['unexistingEmails'] = $unexistingEmails;
-
- return $this;
- }
-
- /**
- * Gets withoutListEmails
- *
- * @return string[]
- */
- public function getWithoutListEmails()
- {
- return $this->container['withoutListEmails'];
- }
-
- /**
- * Sets withoutListEmails
- *
- * @param string[] $withoutListEmails withoutListEmails
- *
- * @return $this
- */
- public function setWithoutListEmails($withoutListEmails)
- {
- $this->container['withoutListEmails'] = $withoutListEmails;
-
- return $this;
- }
-
- /**
- * Gets blackListedEmails
- *
- * @return string[]
- */
- public function getBlackListedEmails()
- {
- return $this->container['blackListedEmails'];
- }
-
- /**
- * Sets blackListedEmails
- *
- * @param string[] $blackListedEmails blackListedEmails
- *
- * @return $this
- */
- public function setBlackListedEmails($blackListedEmails)
- {
- $this->container['blackListedEmails'] = $blackListedEmails;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/PostSendSmsTestFailed.php b/lib/Model/PostSendSmsTestFailed.php
deleted file mode 100644
index a74ea9d..0000000
--- a/lib/Model/PostSendSmsTestFailed.php
+++ /dev/null
@@ -1,401 +0,0 @@
- 'int',
- 'message' => 'string',
- 'unexistingSms' => 'string[]',
- 'withoutListSms' => 'string[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'code' => 'int64',
- 'message' => null,
- 'unexistingSms' => 'email',
- 'withoutListSms' => 'email'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'code' => 'code',
- 'message' => 'message',
- 'unexistingSms' => 'unexistingSms',
- 'withoutListSms' => 'withoutListSms'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'code' => 'setCode',
- 'message' => 'setMessage',
- 'unexistingSms' => 'setUnexistingSms',
- 'withoutListSms' => 'setWithoutListSms'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'code' => 'getCode',
- 'message' => 'getMessage',
- 'unexistingSms' => 'getUnexistingSms',
- 'withoutListSms' => 'getWithoutListSms'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['code'] = isset($data['code']) ? $data['code'] : null;
- $this->container['message'] = isset($data['message']) ? $data['message'] : null;
- $this->container['unexistingSms'] = isset($data['unexistingSms']) ? $data['unexistingSms'] : null;
- $this->container['withoutListSms'] = isset($data['withoutListSms']) ? $data['withoutListSms'] : null;
- }
-
- /**
- * 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['message'] === null) {
- $invalidProperties[] = "'message' 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 int
- */
- public function getCode()
- {
- return $this->container['code'];
- }
-
- /**
- * Sets code
- *
- * @param int $code Response code
- *
- * @return $this
- */
- public function setCode($code)
- {
- $this->container['code'] = $code;
-
- return $this;
- }
-
- /**
- * Gets message
- *
- * @return string
- */
- public function getMessage()
- {
- return $this->container['message'];
- }
-
- /**
- * Sets message
- *
- * @param string $message Response message
- *
- * @return $this
- */
- public function setMessage($message)
- {
- $this->container['message'] = $message;
-
- return $this;
- }
-
- /**
- * Gets unexistingSms
- *
- * @return string[]
- */
- public function getUnexistingSms()
- {
- return $this->container['unexistingSms'];
- }
-
- /**
- * Sets unexistingSms
- *
- * @param string[] $unexistingSms unexistingSms
- *
- * @return $this
- */
- public function setUnexistingSms($unexistingSms)
- {
- $this->container['unexistingSms'] = $unexistingSms;
-
- return $this;
- }
-
- /**
- * Gets withoutListSms
- *
- * @return string[]
- */
- public function getWithoutListSms()
- {
- return $this->container['withoutListSms'];
- }
-
- /**
- * Sets withoutListSms
- *
- * @param string[] $withoutListSms withoutListSms
- *
- * @return $this
- */
- public function setWithoutListSms($withoutListSms)
- {
- $this->container['withoutListSms'] = $withoutListSms;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/PutRevokeUserPermission.php b/lib/Model/PutRevokeUserPermission.php
deleted file mode 100644
index b527afd..0000000
--- a/lib/Model/PutRevokeUserPermission.php
+++ /dev/null
@@ -1,309 +0,0 @@
- 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'email' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'email' => 'email'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'email' => 'setEmail'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'email' => 'getEmail'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['email'] === null) {
- $invalidProperties[] = "'email' 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 email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Email address of the user.
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/Putresendcancelinvitation.php b/lib/Model/Putresendcancelinvitation.php
deleted file mode 100644
index ba77e8b..0000000
--- a/lib/Model/Putresendcancelinvitation.php
+++ /dev/null
@@ -1,309 +0,0 @@
- 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'email' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'email' => 'email'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'email' => 'setEmail'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'email' => 'getEmail'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['email'] === null) {
- $invalidProperties[] = "'email' 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 email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Email address of the user.
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/RemainingCreditModel.php b/lib/Model/RemainingCreditModel.php
deleted file mode 100644
index 2502d8c..0000000
--- a/lib/Model/RemainingCreditModel.php
+++ /dev/null
@@ -1,341 +0,0 @@
- '\Brevo\Client\Model\RemainingCreditModelChild',
- 'reseller' => '\Brevo\Client\Model\RemainingCreditModelReseller'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'child' => null,
- 'reseller' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'child' => 'child',
- 'reseller' => 'reseller'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'child' => 'setChild',
- 'reseller' => 'setReseller'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'child' => 'getChild',
- 'reseller' => 'getReseller'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['child'] = isset($data['child']) ? $data['child'] : null;
- $this->container['reseller'] = isset($data['reseller']) ? $data['reseller'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['child'] === null) {
- $invalidProperties[] = "'child' can't be null";
- }
- if ($this->container['reseller'] === null) {
- $invalidProperties[] = "'reseller' 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 child
- *
- * @return \Brevo\Client\Model\RemainingCreditModelChild
- */
- public function getChild()
- {
- return $this->container['child'];
- }
-
- /**
- * Sets child
- *
- * @param \Brevo\Client\Model\RemainingCreditModelChild $child child
- *
- * @return $this
- */
- public function setChild($child)
- {
- $this->container['child'] = $child;
-
- return $this;
- }
-
- /**
- * Gets reseller
- *
- * @return \Brevo\Client\Model\RemainingCreditModelReseller
- */
- public function getReseller()
- {
- return $this->container['reseller'];
- }
-
- /**
- * Sets reseller
- *
- * @param \Brevo\Client\Model\RemainingCreditModelReseller $reseller reseller
- *
- * @return $this
- */
- public function setReseller($reseller)
- {
- $this->container['reseller'] = $reseller;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/RemainingCreditModelChild.php b/lib/Model/RemainingCreditModelChild.php
deleted file mode 100644
index 98b9769..0000000
--- a/lib/Model/RemainingCreditModelChild.php
+++ /dev/null
@@ -1,342 +0,0 @@
- 'double',
- 'email' => 'double'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'sms' => 'double',
- 'email' => 'double'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'sms' => 'sms',
- 'email' => 'email'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'sms' => 'setSms',
- 'email' => 'setEmail'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'sms' => 'getSms',
- 'email' => 'getEmail'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['sms'] = isset($data['sms']) ? $data['sms'] : null;
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['sms'] === null) {
- $invalidProperties[] = "'sms' can't be null";
- }
- if ($this->container['email'] === null) {
- $invalidProperties[] = "'email' 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 sms
- *
- * @return double
- */
- public function getSms()
- {
- return $this->container['sms'];
- }
-
- /**
- * Sets sms
- *
- * @param double $sms SMS Credits remaining for child account
- *
- * @return $this
- */
- public function setSms($sms)
- {
- $this->container['sms'] = $sms;
-
- return $this;
- }
-
- /**
- * Gets email
- *
- * @return double
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param double $email Email Credits remaining for child account
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/RemainingCreditModelReseller.php b/lib/Model/RemainingCreditModelReseller.php
deleted file mode 100644
index 288b708..0000000
--- a/lib/Model/RemainingCreditModelReseller.php
+++ /dev/null
@@ -1,341 +0,0 @@
- 'double',
- 'email' => 'double'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'sms' => 'double',
- 'email' => 'double'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'sms' => 'sms',
- 'email' => 'email'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'sms' => 'setSms',
- 'email' => 'setEmail'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'sms' => 'getSms',
- 'email' => 'getEmail'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['sms'] = isset($data['sms']) ? $data['sms'] : null;
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['sms'] === null) {
- $invalidProperties[] = "'sms' can't be null";
- }
- if ($this->container['email'] === null) {
- $invalidProperties[] = "'email' 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 sms
- *
- * @return double
- */
- public function getSms()
- {
- return $this->container['sms'];
- }
-
- /**
- * Sets sms
- *
- * @param double $sms SMS Credits remaining for reseller account
- *
- * @return $this
- */
- public function setSms($sms)
- {
- $this->container['sms'] = $sms;
-
- return $this;
- }
-
- /**
- * Gets email
- *
- * @return double
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param double $email Email Credits remaining for reseller account
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/RemoveContactFromList.php b/lib/Model/RemoveContactFromList.php
deleted file mode 100644
index b34889c..0000000
--- a/lib/Model/RemoveContactFromList.php
+++ /dev/null
@@ -1,365 +0,0 @@
- 'string[]',
- 'ids' => 'int[]',
- 'all' => 'bool'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'emails' => null,
- 'ids' => 'int64',
- 'all' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'emails' => 'emails',
- 'ids' => 'ids',
- 'all' => 'all'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'emails' => 'setEmails',
- 'ids' => 'setIds',
- 'all' => 'setAll'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'emails' => 'getEmails',
- 'ids' => 'getIds',
- 'all' => 'getAll'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['emails'] = isset($data['emails']) ? $data['emails'] : null;
- $this->container['ids'] = isset($data['ids']) ? $data['ids'] : null;
- $this->container['all'] = isset($data['all']) ? $data['all'] : null;
- }
-
- /**
- * 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 emails
- *
- * @return string[]
- */
- public function getEmails()
- {
- return $this->container['emails'];
- }
-
- /**
- * Sets emails
- *
- * @param string[] $emails Required if 'all' is false. Emails to remove from a list. You can pass a maximum of 150 emails for removal in one request.
- *
- * @return $this
- */
- public function setEmails($emails)
- {
- $this->container['emails'] = $emails;
-
- return $this;
- }
-
- /**
- * Gets ids
- *
- * @return int[]
- */
- public function getIds()
- {
- return $this->container['ids'];
- }
-
- /**
- * Sets ids
- *
- * @param int[] $ids Mandatory if Emails are not passed, ignored otherwise. Emails to add to a list. You can pass a maximum of 150 emails for addition in one request. If you need to add the emails in bulk, please prefer /contacts/import api.
- *
- * @return $this
- */
- public function setIds($ids)
- {
- $this->container['ids'] = $ids;
-
- return $this;
- }
-
- /**
- * Gets all
- *
- * @return bool
- */
- public function getAll()
- {
- return $this->container['all'];
- }
-
- /**
- * Sets all
- *
- * @param bool $all Required if none of 'emails' or 'ids' are passed. Remove all existing contacts from a list. A process will be created in this scenario. You can fetch the process details to know about the progress
- *
- * @return $this
- */
- public function setAll($all)
- {
- $this->container['all'] = $all;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/RemoveCredits.php b/lib/Model/RemoveCredits.php
deleted file mode 100644
index a214ae6..0000000
--- a/lib/Model/RemoveCredits.php
+++ /dev/null
@@ -1,335 +0,0 @@
- 'int',
- 'email' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'sms' => 'int64',
- 'email' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'sms' => 'sms',
- 'email' => 'email'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'sms' => 'setSms',
- 'email' => 'setEmail'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'sms' => 'getSms',
- 'email' => 'getEmail'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['sms'] = isset($data['sms']) ? $data['sms'] : null;
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- }
-
- /**
- * 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 sms
- *
- * @return int
- */
- public function getSms()
- {
- return $this->container['sms'];
- }
-
- /**
- * Sets sms
- *
- * @param int $sms Required if email credits are empty. SMS credits to be removed from the child account
- *
- * @return $this
- */
- public function setSms($sms)
- {
- $this->container['sms'] = $sms;
-
- return $this;
- }
-
- /**
- * Gets email
- *
- * @return int
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param int $email Required if sms credits are empty. Email credits to be removed from the child account
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/RequestContactExport.php b/lib/Model/RequestContactExport.php
deleted file mode 100644
index 37de0a5..0000000
--- a/lib/Model/RequestContactExport.php
+++ /dev/null
@@ -1,368 +0,0 @@
- 'string[]',
- 'customContactFilter' => '\Brevo\Client\Model\RequestContactExportCustomContactFilter',
- 'notifyUrl' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'exportAttributes' => null,
- 'customContactFilter' => null,
- 'notifyUrl' => 'url'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'exportAttributes' => 'exportAttributes',
- 'customContactFilter' => 'customContactFilter',
- 'notifyUrl' => 'notifyUrl'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'exportAttributes' => 'setExportAttributes',
- 'customContactFilter' => 'setCustomContactFilter',
- 'notifyUrl' => 'setNotifyUrl'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'exportAttributes' => 'getExportAttributes',
- 'customContactFilter' => 'getCustomContactFilter',
- 'notifyUrl' => 'getNotifyUrl'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['exportAttributes'] = isset($data['exportAttributes']) ? $data['exportAttributes'] : null;
- $this->container['customContactFilter'] = isset($data['customContactFilter']) ? $data['customContactFilter'] : null;
- $this->container['notifyUrl'] = isset($data['notifyUrl']) ? $data['notifyUrl'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['customContactFilter'] === null) {
- $invalidProperties[] = "'customContactFilter' 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 exportAttributes
- *
- * @return string[]
- */
- public function getExportAttributes()
- {
- return $this->container['exportAttributes'];
- }
-
- /**
- * Sets exportAttributes
- *
- * @param string[] $exportAttributes List of all the attributes that you want to export. These attributes must be present in your contact database. For example, ['fname', 'lname', 'email'].
- *
- * @return $this
- */
- public function setExportAttributes($exportAttributes)
- {
- $this->container['exportAttributes'] = $exportAttributes;
-
- return $this;
- }
-
- /**
- * Gets customContactFilter
- *
- * @return \Brevo\Client\Model\RequestContactExportCustomContactFilter
- */
- public function getCustomContactFilter()
- {
- return $this->container['customContactFilter'];
- }
-
- /**
- * Sets customContactFilter
- *
- * @param \Brevo\Client\Model\RequestContactExportCustomContactFilter $customContactFilter customContactFilter
- *
- * @return $this
- */
- public function setCustomContactFilter($customContactFilter)
- {
- $this->container['customContactFilter'] = $customContactFilter;
-
- return $this;
- }
-
- /**
- * Gets notifyUrl
- *
- * @return string
- */
- public function getNotifyUrl()
- {
- return $this->container['notifyUrl'];
- }
-
- /**
- * Sets notifyUrl
- *
- * @param string $notifyUrl Webhook that will be called once the export process is finished. For reference, https://help.brevo.com/hc/en-us/articles/360007666479
- *
- * @return $this
- */
- public function setNotifyUrl($notifyUrl)
- {
- $this->container['notifyUrl'] = $notifyUrl;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/RequestContactExportCustomContactFilter.php b/lib/Model/RequestContactExportCustomContactFilter.php
deleted file mode 100644
index baf63ba..0000000
--- a/lib/Model/RequestContactExportCustomContactFilter.php
+++ /dev/null
@@ -1,568 +0,0 @@
- 'string',
- 'actionForEmailCampaigns' => 'string',
- 'actionForSmsCampaigns' => 'string',
- 'listId' => 'int',
- 'emailCampaignId' => 'int',
- 'smsCampaignId' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'actionForContacts' => null,
- 'actionForEmailCampaigns' => null,
- 'actionForSmsCampaigns' => null,
- 'listId' => 'int64',
- 'emailCampaignId' => 'int64',
- 'smsCampaignId' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'actionForContacts' => 'actionForContacts',
- 'actionForEmailCampaigns' => 'actionForEmailCampaigns',
- 'actionForSmsCampaigns' => 'actionForSmsCampaigns',
- 'listId' => 'listId',
- 'emailCampaignId' => 'emailCampaignId',
- 'smsCampaignId' => 'smsCampaignId'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'actionForContacts' => 'setActionForContacts',
- 'actionForEmailCampaigns' => 'setActionForEmailCampaigns',
- 'actionForSmsCampaigns' => 'setActionForSmsCampaigns',
- 'listId' => 'setListId',
- 'emailCampaignId' => 'setEmailCampaignId',
- 'smsCampaignId' => 'setSmsCampaignId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'actionForContacts' => 'getActionForContacts',
- 'actionForEmailCampaigns' => 'getActionForEmailCampaigns',
- 'actionForSmsCampaigns' => 'getActionForSmsCampaigns',
- 'listId' => 'getListId',
- 'emailCampaignId' => 'getEmailCampaignId',
- 'smsCampaignId' => 'getSmsCampaignId'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const ACTION_FOR_CONTACTS_ALL_CONTACTS = 'allContacts';
- const ACTION_FOR_CONTACTS_SUBSCRIBED = 'subscribed';
- const ACTION_FOR_CONTACTS_UNSUBSCRIBED = 'unsubscribed';
- const ACTION_FOR_CONTACTS_UNSUBSCRIBED_PER_LIST = 'unsubscribedPerList';
- const ACTION_FOR_EMAIL_CAMPAIGNS_OPENERS = 'openers';
- const ACTION_FOR_EMAIL_CAMPAIGNS_NON_OPENERS = 'nonOpeners';
- const ACTION_FOR_EMAIL_CAMPAIGNS_CLICKERS = 'clickers';
- const ACTION_FOR_EMAIL_CAMPAIGNS_NON_CLICKERS = 'nonClickers';
- const ACTION_FOR_EMAIL_CAMPAIGNS_UNSUBSCRIBED = 'unsubscribed';
- const ACTION_FOR_EMAIL_CAMPAIGNS_HARD_BOUNCES = 'hardBounces';
- const ACTION_FOR_EMAIL_CAMPAIGNS_SOFT_BOUNCES = 'softBounces';
- const ACTION_FOR_SMS_CAMPAIGNS_HARD_BOUNCES = 'hardBounces';
- const ACTION_FOR_SMS_CAMPAIGNS_SOFT_BOUNCES = 'softBounces';
- const ACTION_FOR_SMS_CAMPAIGNS_UNSUBSCRIBED = 'unsubscribed';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getActionForContactsAllowableValues()
- {
- return [
- self::ACTION_FOR_CONTACTS_ALL_CONTACTS,
- self::ACTION_FOR_CONTACTS_SUBSCRIBED,
- self::ACTION_FOR_CONTACTS_UNSUBSCRIBED,
- self::ACTION_FOR_CONTACTS_UNSUBSCRIBED_PER_LIST,
- ];
- }
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getActionForEmailCampaignsAllowableValues()
- {
- return [
- self::ACTION_FOR_EMAIL_CAMPAIGNS_OPENERS,
- self::ACTION_FOR_EMAIL_CAMPAIGNS_NON_OPENERS,
- self::ACTION_FOR_EMAIL_CAMPAIGNS_CLICKERS,
- self::ACTION_FOR_EMAIL_CAMPAIGNS_NON_CLICKERS,
- self::ACTION_FOR_EMAIL_CAMPAIGNS_UNSUBSCRIBED,
- self::ACTION_FOR_EMAIL_CAMPAIGNS_HARD_BOUNCES,
- self::ACTION_FOR_EMAIL_CAMPAIGNS_SOFT_BOUNCES,
- ];
- }
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getActionForSmsCampaignsAllowableValues()
- {
- return [
- self::ACTION_FOR_SMS_CAMPAIGNS_HARD_BOUNCES,
- self::ACTION_FOR_SMS_CAMPAIGNS_SOFT_BOUNCES,
- self::ACTION_FOR_SMS_CAMPAIGNS_UNSUBSCRIBED,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['actionForContacts'] = isset($data['actionForContacts']) ? $data['actionForContacts'] : null;
- $this->container['actionForEmailCampaigns'] = isset($data['actionForEmailCampaigns']) ? $data['actionForEmailCampaigns'] : null;
- $this->container['actionForSmsCampaigns'] = isset($data['actionForSmsCampaigns']) ? $data['actionForSmsCampaigns'] : null;
- $this->container['listId'] = isset($data['listId']) ? $data['listId'] : null;
- $this->container['emailCampaignId'] = isset($data['emailCampaignId']) ? $data['emailCampaignId'] : null;
- $this->container['smsCampaignId'] = isset($data['smsCampaignId']) ? $data['smsCampaignId'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- $allowedValues = $this->getActionForContactsAllowableValues();
- if (!is_null($this->container['actionForContacts']) && !in_array($this->container['actionForContacts'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'actionForContacts', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- $allowedValues = $this->getActionForEmailCampaignsAllowableValues();
- if (!is_null($this->container['actionForEmailCampaigns']) && !in_array($this->container['actionForEmailCampaigns'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'actionForEmailCampaigns', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- $allowedValues = $this->getActionForSmsCampaignsAllowableValues();
- if (!is_null($this->container['actionForSmsCampaigns']) && !in_array($this->container['actionForSmsCampaigns'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'actionForSmsCampaigns', must be one of '%s'",
- 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 actionForContacts
- *
- * @return string
- */
- public function getActionForContacts()
- {
- return $this->container['actionForContacts'];
- }
-
- /**
- * Sets actionForContacts
- *
- * @param string $actionForContacts Mandatory if neither actionForEmailCampaigns nor actionForSmsCampaigns is passed. This will export the contacts on the basis of provided action applied on contacts as per the list id. * allContacts - Fetch the list of all contacts for a particular list. * subscribed & unsubscribed - Fetch the list of subscribed / unsubscribed (blacklisted via any means) contacts for a particular list. * unsubscribedPerList - Fetch the list of contacts that are unsubscribed from a particular list only.
- *
- * @return $this
- */
- public function setActionForContacts($actionForContacts)
- {
- $allowedValues = $this->getActionForContactsAllowableValues();
- if (!is_null($actionForContacts) && !in_array($actionForContacts, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'actionForContacts', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['actionForContacts'] = $actionForContacts;
-
- return $this;
- }
-
- /**
- * Gets actionForEmailCampaigns
- *
- * @return string
- */
- public function getActionForEmailCampaigns()
- {
- return $this->container['actionForEmailCampaigns'];
- }
-
- /**
- * Sets actionForEmailCampaigns
- *
- * @param string $actionForEmailCampaigns Mandatory if neither actionForContacts nor actionForSmsCampaigns is passed. This will export the contacts on the basis of provided action applied on email campaigns. * openers & nonOpeners - emailCampaignId is mandatory. Fetch the list of readers / non-readers for a particular email campaign. * clickers & nonClickers - emailCampaignId is mandatory. Fetch the list of clickers / non-clickers for a particular email campaign. * unsubscribed - emailCampaignId is mandatory. Fetch the list of all unsubscribed (blacklisted via any means) contacts for a particular email campaign. * hardBounces & softBounces - emailCampaignId is optional. Fetch the list of hard bounces / soft bounces for a particular / all email campaign(s).
- *
- * @return $this
- */
- public function setActionForEmailCampaigns($actionForEmailCampaigns)
- {
- $allowedValues = $this->getActionForEmailCampaignsAllowableValues();
- if (!is_null($actionForEmailCampaigns) && !in_array($actionForEmailCampaigns, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'actionForEmailCampaigns', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['actionForEmailCampaigns'] = $actionForEmailCampaigns;
-
- return $this;
- }
-
- /**
- * Gets actionForSmsCampaigns
- *
- * @return string
- */
- public function getActionForSmsCampaigns()
- {
- return $this->container['actionForSmsCampaigns'];
- }
-
- /**
- * Sets actionForSmsCampaigns
- *
- * @param string $actionForSmsCampaigns Mandatory if neither actionForContacts nor actionForEmailCampaigns is passed. This will export the contacts on the basis of provided action applied on sms campaigns. * unsubscribed - Fetch the list of all unsubscribed (blacklisted via any means) contacts for all / particular sms campaigns. * hardBounces & softBounces - Fetch the list of hard bounces / soft bounces for all / particular sms campaigns.
- *
- * @return $this
- */
- public function setActionForSmsCampaigns($actionForSmsCampaigns)
- {
- $allowedValues = $this->getActionForSmsCampaignsAllowableValues();
- if (!is_null($actionForSmsCampaigns) && !in_array($actionForSmsCampaigns, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'actionForSmsCampaigns', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['actionForSmsCampaigns'] = $actionForSmsCampaigns;
-
- return $this;
- }
-
- /**
- * Gets listId
- *
- * @return int
- */
- public function getListId()
- {
- return $this->container['listId'];
- }
-
- /**
- * Sets listId
- *
- * @param int $listId Mandatory if actionForContacts is passed, ignored otherwise. Id of the list for which the corresponding action shall be applied in the filter.
- *
- * @return $this
- */
- public function setListId($listId)
- {
- $this->container['listId'] = $listId;
-
- return $this;
- }
-
- /**
- * Gets emailCampaignId
- *
- * @return int
- */
- public function getEmailCampaignId()
- {
- return $this->container['emailCampaignId'];
- }
-
- /**
- * Sets emailCampaignId
- *
- * @param int $emailCampaignId Considered only if actionForEmailCampaigns is passed, ignored otherwise. Mandatory if action is one of the following - openers, nonOpeners, clickers, nonClickers, unsubscribed. The id of the email campaign for which the corresponding action shall be applied in the filter.
- *
- * @return $this
- */
- public function setEmailCampaignId($emailCampaignId)
- {
- $this->container['emailCampaignId'] = $emailCampaignId;
-
- return $this;
- }
-
- /**
- * Gets smsCampaignId
- *
- * @return int
- */
- public function getSmsCampaignId()
- {
- return $this->container['smsCampaignId'];
- }
-
- /**
- * Sets smsCampaignId
- *
- * @param int $smsCampaignId Considered only if actionForSmsCampaigns is passed, ignored otherwise. The id of sms campaign for which the corresponding action shall be applied in the filter.
- *
- * @return $this
- */
- public function setSmsCampaignId($smsCampaignId)
- {
- $this->container['smsCampaignId'] = $smsCampaignId;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/RequestContactImport.php b/lib/Model/RequestContactImport.php
deleted file mode 100644
index 5e89021..0000000
--- a/lib/Model/RequestContactImport.php
+++ /dev/null
@@ -1,605 +0,0 @@
- 'string',
- 'fileBody' => 'string',
- 'jsonBody' => '\Brevo\Client\Model\RequestContactImportJsonBody[]',
- 'listIds' => 'int[]',
- 'notifyUrl' => 'string',
- 'newList' => '\Brevo\Client\Model\RequestContactImportNewList',
- 'emailBlacklist' => 'bool',
- 'disableNotification' => 'bool',
- 'smsBlacklist' => 'bool',
- 'updateExistingContacts' => 'bool',
- 'emptyContactsAttributes' => 'bool'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'fileUrl' => 'url',
- 'fileBody' => null,
- 'jsonBody' => null,
- 'listIds' => 'int64',
- 'notifyUrl' => 'url',
- 'newList' => null,
- 'emailBlacklist' => null,
- 'disableNotification' => null,
- 'smsBlacklist' => null,
- 'updateExistingContacts' => null,
- 'emptyContactsAttributes' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'fileUrl' => 'fileUrl',
- 'fileBody' => 'fileBody',
- 'jsonBody' => 'jsonBody',
- 'listIds' => 'listIds',
- 'notifyUrl' => 'notifyUrl',
- 'newList' => 'newList',
- 'emailBlacklist' => 'emailBlacklist',
- 'disableNotification' => 'disableNotification',
- 'smsBlacklist' => 'smsBlacklist',
- 'updateExistingContacts' => 'updateExistingContacts',
- 'emptyContactsAttributes' => 'emptyContactsAttributes'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'fileUrl' => 'setFileUrl',
- 'fileBody' => 'setFileBody',
- 'jsonBody' => 'setJsonBody',
- 'listIds' => 'setListIds',
- 'notifyUrl' => 'setNotifyUrl',
- 'newList' => 'setNewList',
- 'emailBlacklist' => 'setEmailBlacklist',
- 'disableNotification' => 'setDisableNotification',
- 'smsBlacklist' => 'setSmsBlacklist',
- 'updateExistingContacts' => 'setUpdateExistingContacts',
- 'emptyContactsAttributes' => 'setEmptyContactsAttributes'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'fileUrl' => 'getFileUrl',
- 'fileBody' => 'getFileBody',
- 'jsonBody' => 'getJsonBody',
- 'listIds' => 'getListIds',
- 'notifyUrl' => 'getNotifyUrl',
- 'newList' => 'getNewList',
- 'emailBlacklist' => 'getEmailBlacklist',
- 'disableNotification' => 'getDisableNotification',
- 'smsBlacklist' => 'getSmsBlacklist',
- 'updateExistingContacts' => 'getUpdateExistingContacts',
- 'emptyContactsAttributes' => 'getEmptyContactsAttributes'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['fileUrl'] = isset($data['fileUrl']) ? $data['fileUrl'] : null;
- $this->container['fileBody'] = isset($data['fileBody']) ? $data['fileBody'] : null;
- $this->container['jsonBody'] = isset($data['jsonBody']) ? $data['jsonBody'] : null;
- $this->container['listIds'] = isset($data['listIds']) ? $data['listIds'] : null;
- $this->container['notifyUrl'] = isset($data['notifyUrl']) ? $data['notifyUrl'] : null;
- $this->container['newList'] = isset($data['newList']) ? $data['newList'] : null;
- $this->container['emailBlacklist'] = isset($data['emailBlacklist']) ? $data['emailBlacklist'] : false;
- $this->container['disableNotification'] = isset($data['disableNotification']) ? $data['disableNotification'] : false;
- $this->container['smsBlacklist'] = isset($data['smsBlacklist']) ? $data['smsBlacklist'] : false;
- $this->container['updateExistingContacts'] = isset($data['updateExistingContacts']) ? $data['updateExistingContacts'] : true;
- $this->container['emptyContactsAttributes'] = isset($data['emptyContactsAttributes']) ? $data['emptyContactsAttributes'] : false;
- }
-
- /**
- * 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 fileUrl
- *
- * @return string
- */
- public function getFileUrl()
- {
- return $this->container['fileUrl'];
- }
-
- /**
- * Sets fileUrl
- *
- * @param string $fileUrl Mandatory if fileBody or jsonBody is not defined. URL of the file to be imported (no local file). Possible file formats: .txt, .csv, .json
- *
- * @return $this
- */
- public function setFileUrl($fileUrl)
- {
- $this->container['fileUrl'] = $fileUrl;
-
- return $this;
- }
-
- /**
- * Gets fileBody
- *
- * @return string
- */
- public function getFileBody()
- {
- return $this->container['fileBody'];
- }
-
- /**
- * Sets fileBody
- *
- * @param string $fileBody Mandatory if fileUrl and jsonBody is not defined. CSV content to be imported. Use semicolon to separate multiple attributes. Maximum allowed file body size is 10MB . However we recommend a safe limit of around 8 MB to avoid the issues caused due to increase of file body size while parsing. Please use fileUrl instead to import bigger files.
- *
- * @return $this
- */
- public function setFileBody($fileBody)
- {
- $this->container['fileBody'] = $fileBody;
-
- return $this;
- }
-
- /**
- * Gets jsonBody
- *
- * @return \Brevo\Client\Model\RequestContactImportJsonBody[]
- */
- public function getJsonBody()
- {
- return $this->container['jsonBody'];
- }
-
- /**
- * Sets jsonBody
- *
- * @param \Brevo\Client\Model\RequestContactImportJsonBody[] $jsonBody **Mandatory if fileUrl and fileBody is not defined.** JSON content to be imported. **Maximum allowed json body size is 10MB** . However we recommend a safe limit of around 8 MB to avoid the issues caused due to increase of json body size while parsing. Please use fileUrl instead to import bigger files.
- *
- * @return $this
- */
- public function setJsonBody($jsonBody)
- {
- $this->container['jsonBody'] = $jsonBody;
-
- return $this;
- }
-
- /**
- * Gets listIds
- *
- * @return int[]
- */
- public function getListIds()
- {
- return $this->container['listIds'];
- }
-
- /**
- * Sets listIds
- *
- * @param int[] $listIds Mandatory if newList is not defined. Ids of the lists in which the contacts shall be imported. For example, [2, 4, 7].
- *
- * @return $this
- */
- public function setListIds($listIds)
- {
- $this->container['listIds'] = $listIds;
-
- return $this;
- }
-
- /**
- * Gets notifyUrl
- *
- * @return string
- */
- public function getNotifyUrl()
- {
- return $this->container['notifyUrl'];
- }
-
- /**
- * Sets notifyUrl
- *
- * @param string $notifyUrl URL that will be called once the import process is finished. For reference, https://help.brevo.com/hc/en-us/articles/360007666479
- *
- * @return $this
- */
- public function setNotifyUrl($notifyUrl)
- {
- $this->container['notifyUrl'] = $notifyUrl;
-
- return $this;
- }
-
- /**
- * Gets newList
- *
- * @return \Brevo\Client\Model\RequestContactImportNewList
- */
- public function getNewList()
- {
- return $this->container['newList'];
- }
-
- /**
- * Sets newList
- *
- * @param \Brevo\Client\Model\RequestContactImportNewList $newList newList
- *
- * @return $this
- */
- public function setNewList($newList)
- {
- $this->container['newList'] = $newList;
-
- return $this;
- }
-
- /**
- * Gets emailBlacklist
- *
- * @return bool
- */
- public function getEmailBlacklist()
- {
- return $this->container['emailBlacklist'];
- }
-
- /**
- * Sets emailBlacklist
- *
- * @param bool $emailBlacklist To blacklist all the contacts for email
- *
- * @return $this
- */
- public function setEmailBlacklist($emailBlacklist)
- {
- $this->container['emailBlacklist'] = $emailBlacklist;
-
- return $this;
- }
-
- /**
- * Gets disableNotification
- *
- * @return bool
- */
- public function getDisableNotification()
- {
- return $this->container['disableNotification'];
- }
-
- /**
- * Sets disableNotification
- *
- * @param bool $disableNotification To disable email notification
- *
- * @return $this
- */
- public function setDisableNotification($disableNotification)
- {
- $this->container['disableNotification'] = $disableNotification;
-
- return $this;
- }
-
- /**
- * Gets smsBlacklist
- *
- * @return bool
- */
- public function getSmsBlacklist()
- {
- return $this->container['smsBlacklist'];
- }
-
- /**
- * Sets smsBlacklist
- *
- * @param bool $smsBlacklist To blacklist all the contacts for sms
- *
- * @return $this
- */
- public function setSmsBlacklist($smsBlacklist)
- {
- $this->container['smsBlacklist'] = $smsBlacklist;
-
- return $this;
- }
-
- /**
- * Gets updateExistingContacts
- *
- * @return bool
- */
- public function getUpdateExistingContacts()
- {
- return $this->container['updateExistingContacts'];
- }
-
- /**
- * Sets updateExistingContacts
- *
- * @param bool $updateExistingContacts To facilitate the choice to update the existing contacts
- *
- * @return $this
- */
- public function setUpdateExistingContacts($updateExistingContacts)
- {
- $this->container['updateExistingContacts'] = $updateExistingContacts;
-
- return $this;
- }
-
- /**
- * Gets emptyContactsAttributes
- *
- * @return bool
- */
- public function getEmptyContactsAttributes()
- {
- return $this->container['emptyContactsAttributes'];
- }
-
- /**
- * Sets emptyContactsAttributes
- *
- * @param bool $emptyContactsAttributes To facilitate the choice to erase any attribute of the existing contacts with empty value. emptyContactsAttributes = true means the empty fields in your import will erase any attribute that currently contain data in Brevo, & emptyContactsAttributes = false means the empty fields will not affect your existing data ( only available if `updateExistingContacts` set to true )
- *
- * @return $this
- */
- public function setEmptyContactsAttributes($emptyContactsAttributes)
- {
- $this->container['emptyContactsAttributes'] = $emptyContactsAttributes;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/RequestContactImportJsonBody.php b/lib/Model/RequestContactImportJsonBody.php
deleted file mode 100644
index dca681a..0000000
--- a/lib/Model/RequestContactImportJsonBody.php
+++ /dev/null
@@ -1,335 +0,0 @@
- 'string',
- 'attributes' => 'object'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'email' => null,
- 'attributes' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'email' => 'email',
- 'attributes' => 'attributes'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'email' => 'setEmail',
- 'attributes' => 'setAttributes'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'email' => 'getEmail',
- 'attributes' => 'getAttributes'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null;
- }
-
- /**
- * 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 email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email email
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets attributes
- *
- * @return object
- */
- public function getAttributes()
- {
- return $this->container['attributes'];
- }
-
- /**
- * Sets attributes
- *
- * @param object $attributes List of attributes to be imported
- *
- * @return $this
- */
- public function setAttributes($attributes)
- {
- $this->container['attributes'] = $attributes;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/RequestContactImportNewList.php b/lib/Model/RequestContactImportNewList.php
deleted file mode 100644
index 9b1ffe7..0000000
--- a/lib/Model/RequestContactImportNewList.php
+++ /dev/null
@@ -1,336 +0,0 @@
- 'string',
- 'folderId' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'listName' => null,
- 'folderId' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'listName' => 'listName',
- 'folderId' => 'folderId'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'listName' => 'setListName',
- 'folderId' => 'setFolderId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'listName' => 'getListName',
- 'folderId' => 'getFolderId'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['listName'] = isset($data['listName']) ? $data['listName'] : null;
- $this->container['folderId'] = isset($data['folderId']) ? $data['folderId'] : null;
- }
-
- /**
- * 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 listName
- *
- * @return string
- */
- public function getListName()
- {
- return $this->container['listName'];
- }
-
- /**
- * Sets listName
- *
- * @param string $listName List with listName will be created first and users will be imported in it (Mandatory if listIds is empty).
- *
- * @return $this
- */
- public function setListName($listName)
- {
- $this->container['listName'] = $listName;
-
- return $this;
- }
-
- /**
- * Gets folderId
- *
- * @return int
- */
- public function getFolderId()
- {
- return $this->container['folderId'];
- }
-
- /**
- * Sets folderId
- *
- * @param int $folderId Id of the folder where this new list shall be created (Mandatory if listName is not empty).
- *
- * @return $this
- */
- public function setFolderId($folderId)
- {
- $this->container['folderId'] = $folderId;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/RequestSmsRecipientExport.php b/lib/Model/RequestSmsRecipientExport.php
deleted file mode 100644
index c9a592c..0000000
--- a/lib/Model/RequestSmsRecipientExport.php
+++ /dev/null
@@ -1,378 +0,0 @@
- 'string',
- 'recipientsType' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'notifyURL' => 'url',
- 'recipientsType' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'notifyURL' => 'notifyURL',
- 'recipientsType' => 'recipientsType'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'notifyURL' => 'setNotifyURL',
- 'recipientsType' => 'setRecipientsType'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'notifyURL' => 'getNotifyURL',
- 'recipientsType' => 'getRecipientsType'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const RECIPIENTS_TYPE_ALL = 'all';
- const RECIPIENTS_TYPE_DELIVERED = 'delivered';
- const RECIPIENTS_TYPE_ANSWERED = 'answered';
- const RECIPIENTS_TYPE_SOFT_BOUNCES = 'softBounces';
- const RECIPIENTS_TYPE_HARD_BOUNCES = 'hardBounces';
- const RECIPIENTS_TYPE_UNSUBSCRIBED = 'unsubscribed';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getRecipientsTypeAllowableValues()
- {
- return [
- self::RECIPIENTS_TYPE_ALL,
- self::RECIPIENTS_TYPE_DELIVERED,
- self::RECIPIENTS_TYPE_ANSWERED,
- self::RECIPIENTS_TYPE_SOFT_BOUNCES,
- self::RECIPIENTS_TYPE_HARD_BOUNCES,
- self::RECIPIENTS_TYPE_UNSUBSCRIBED,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['notifyURL'] = isset($data['notifyURL']) ? $data['notifyURL'] : null;
- $this->container['recipientsType'] = isset($data['recipientsType']) ? $data['recipientsType'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['recipientsType'] === null) {
- $invalidProperties[] = "'recipientsType' can't be null";
- }
- $allowedValues = $this->getRecipientsTypeAllowableValues();
- if (!is_null($this->container['recipientsType']) && !in_array($this->container['recipientsType'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'recipientsType', must be one of '%s'",
- 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 notifyURL
- *
- * @return string
- */
- public function getNotifyURL()
- {
- return $this->container['notifyURL'];
- }
-
- /**
- * Sets notifyURL
- *
- * @param string $notifyURL URL that will be called once the export process is finished. For reference, https://help.brevo.com/hc/en-us/articles/360007666479
- *
- * @return $this
- */
- public function setNotifyURL($notifyURL)
- {
- $this->container['notifyURL'] = $notifyURL;
-
- return $this;
- }
-
- /**
- * Gets recipientsType
- *
- * @return string
- */
- public function getRecipientsType()
- {
- return $this->container['recipientsType'];
- }
-
- /**
- * Sets recipientsType
- *
- * @param string $recipientsType Filter the recipients based on how they interacted with the campaign
- *
- * @return $this
- */
- public function setRecipientsType($recipientsType)
- {
- $allowedValues = $this->getRecipientsTypeAllowableValues();
- if (!in_array($recipientsType, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'recipientsType', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['recipientsType'] = $recipientsType;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/ScheduleSmtpEmail.php b/lib/Model/ScheduleSmtpEmail.php
deleted file mode 100644
index e0f077c..0000000
--- a/lib/Model/ScheduleSmtpEmail.php
+++ /dev/null
@@ -1,365 +0,0 @@
- 'string',
- 'messageIds' => 'string[]',
- 'batchId' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'messageId' => null,
- 'messageIds' => null,
- 'batchId' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'messageId' => 'messageId',
- 'messageIds' => 'messageIds',
- 'batchId' => 'batchId'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'messageId' => 'setMessageId',
- 'messageIds' => 'setMessageIds',
- 'batchId' => 'setBatchId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'messageId' => 'getMessageId',
- 'messageIds' => 'getMessageIds',
- 'batchId' => 'getBatchId'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['messageId'] = isset($data['messageId']) ? $data['messageId'] : null;
- $this->container['messageIds'] = isset($data['messageIds']) ? $data['messageIds'] : null;
- $this->container['batchId'] = isset($data['batchId']) ? $data['batchId'] : null;
- }
-
- /**
- * 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 messageId
- *
- * @return string
- */
- public function getMessageId()
- {
- return $this->container['messageId'];
- }
-
- /**
- * Sets messageId
- *
- * @param string $messageId Message ID of the transactional email scheduled
- *
- * @return $this
- */
- public function setMessageId($messageId)
- {
- $this->container['messageId'] = $messageId;
-
- return $this;
- }
-
- /**
- * Gets messageIds
- *
- * @return string[]
- */
- public function getMessageIds()
- {
- return $this->container['messageIds'];
- }
-
- /**
- * Sets messageIds
- *
- * @param string[] $messageIds messageIds
- *
- * @return $this
- */
- public function setMessageIds($messageIds)
- {
- $this->container['messageIds'] = $messageIds;
-
- return $this;
- }
-
- /**
- * Gets batchId
- *
- * @return string
- */
- public function getBatchId()
- {
- return $this->container['batchId'];
- }
-
- /**
- * Sets batchId
- *
- * @param string $batchId Batch ID of the batch transactional email scheduled
- *
- * @return $this
- */
- public function setBatchId($batchId)
- {
- $this->container['batchId'] = $batchId;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SendReport.php b/lib/Model/SendReport.php
deleted file mode 100644
index 84b0c60..0000000
--- a/lib/Model/SendReport.php
+++ /dev/null
@@ -1,378 +0,0 @@
- 'string',
- 'email' => '\Brevo\Client\Model\SendReportEmail'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'language' => null,
- 'email' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'language' => 'language',
- 'email' => 'email'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'language' => 'setLanguage',
- 'email' => 'setEmail'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'language' => 'getLanguage',
- 'email' => 'getEmail'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const LANGUAGE_FR = 'fr';
- const LANGUAGE_ES = 'es';
- const LANGUAGE_PT = 'pt';
- const LANGUAGE_IT = 'it';
- const LANGUAGE_DE = 'de';
- const LANGUAGE_EN = 'en';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getLanguageAllowableValues()
- {
- return [
- self::LANGUAGE_FR,
- self::LANGUAGE_ES,
- self::LANGUAGE_PT,
- self::LANGUAGE_IT,
- self::LANGUAGE_DE,
- self::LANGUAGE_EN,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['language'] = isset($data['language']) ? $data['language'] : 'fr';
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- $allowedValues = $this->getLanguageAllowableValues();
- if (!is_null($this->container['language']) && !in_array($this->container['language'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'language', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- if ($this->container['email'] === null) {
- $invalidProperties[] = "'email' 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 language
- *
- * @return string
- */
- public function getLanguage()
- {
- return $this->container['language'];
- }
-
- /**
- * Sets language
- *
- * @param string $language Language of email content for campaign report sending.
- *
- * @return $this
- */
- public function setLanguage($language)
- {
- $allowedValues = $this->getLanguageAllowableValues();
- if (!is_null($language) && !in_array($language, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'language', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['language'] = $language;
-
- return $this;
- }
-
- /**
- * Gets email
- *
- * @return \Brevo\Client\Model\SendReportEmail
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param \Brevo\Client\Model\SendReportEmail $email email
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SendReportEmail.php b/lib/Model/SendReportEmail.php
deleted file mode 100644
index a5aa068..0000000
--- a/lib/Model/SendReportEmail.php
+++ /dev/null
@@ -1,342 +0,0 @@
- 'string[]',
- 'body' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'to' => 'email',
- 'body' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'to' => 'to',
- 'body' => 'body'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'to' => 'setTo',
- 'body' => 'setBody'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'to' => 'getTo',
- 'body' => 'getBody'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['to'] = isset($data['to']) ? $data['to'] : null;
- $this->container['body'] = isset($data['body']) ? $data['body'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['to'] === null) {
- $invalidProperties[] = "'to' can't be null";
- }
- if ($this->container['body'] === null) {
- $invalidProperties[] = "'body' 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 to
- *
- * @return string[]
- */
- public function getTo()
- {
- return $this->container['to'];
- }
-
- /**
- * Sets to
- *
- * @param string[] $to Email addresses of the recipients
- *
- * @return $this
- */
- public function setTo($to)
- {
- $this->container['to'] = $to;
-
- return $this;
- }
-
- /**
- * Gets body
- *
- * @return string
- */
- public function getBody()
- {
- return $this->container['body'];
- }
-
- /**
- * Sets body
- *
- * @param string $body Custom text message to be presented in the report email.
- *
- * @return $this
- */
- public function setBody($body)
- {
- $this->container['body'] = $body;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SendSms.php b/lib/Model/SendSms.php
deleted file mode 100644
index b7d1dae..0000000
--- a/lib/Model/SendSms.php
+++ /dev/null
@@ -1,431 +0,0 @@
- 'string',
- 'messageId' => 'int',
- 'smsCount' => 'int',
- 'usedCredits' => 'float',
- 'remainingCredits' => 'float'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'reference' => null,
- 'messageId' => 'int64',
- 'smsCount' => 'int64',
- 'usedCredits' => 'float',
- 'remainingCredits' => 'float'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'reference' => 'reference',
- 'messageId' => 'messageId',
- 'smsCount' => 'smsCount',
- 'usedCredits' => 'usedCredits',
- 'remainingCredits' => 'remainingCredits'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'reference' => 'setReference',
- 'messageId' => 'setMessageId',
- 'smsCount' => 'setSmsCount',
- 'usedCredits' => 'setUsedCredits',
- 'remainingCredits' => 'setRemainingCredits'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'reference' => 'getReference',
- 'messageId' => 'getMessageId',
- 'smsCount' => 'getSmsCount',
- 'usedCredits' => 'getUsedCredits',
- 'remainingCredits' => 'getRemainingCredits'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['reference'] = isset($data['reference']) ? $data['reference'] : null;
- $this->container['messageId'] = isset($data['messageId']) ? $data['messageId'] : null;
- $this->container['smsCount'] = isset($data['smsCount']) ? $data['smsCount'] : null;
- $this->container['usedCredits'] = isset($data['usedCredits']) ? $data['usedCredits'] : null;
- $this->container['remainingCredits'] = isset($data['remainingCredits']) ? $data['remainingCredits'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['reference'] === null) {
- $invalidProperties[] = "'reference' can't be null";
- }
- if ($this->container['messageId'] === null) {
- $invalidProperties[] = "'messageId' 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 reference
- *
- * @return string
- */
- public function getReference()
- {
- return $this->container['reference'];
- }
-
- /**
- * Sets reference
- *
- * @param string $reference reference
- *
- * @return $this
- */
- public function setReference($reference)
- {
- $this->container['reference'] = $reference;
-
- return $this;
- }
-
- /**
- * Gets messageId
- *
- * @return int
- */
- public function getMessageId()
- {
- return $this->container['messageId'];
- }
-
- /**
- * Sets messageId
- *
- * @param int $messageId messageId
- *
- * @return $this
- */
- public function setMessageId($messageId)
- {
- $this->container['messageId'] = $messageId;
-
- return $this;
- }
-
- /**
- * Gets smsCount
- *
- * @return int
- */
- public function getSmsCount()
- {
- return $this->container['smsCount'];
- }
-
- /**
- * Sets smsCount
- *
- * @param int $smsCount Count of SMS's to send multiple text messages
- *
- * @return $this
- */
- public function setSmsCount($smsCount)
- {
- $this->container['smsCount'] = $smsCount;
-
- return $this;
- }
-
- /**
- * Gets usedCredits
- *
- * @return float
- */
- public function getUsedCredits()
- {
- return $this->container['usedCredits'];
- }
-
- /**
- * Sets usedCredits
- *
- * @param float $usedCredits SMS credits used per text message
- *
- * @return $this
- */
- public function setUsedCredits($usedCredits)
- {
- $this->container['usedCredits'] = $usedCredits;
-
- return $this;
- }
-
- /**
- * Gets remainingCredits
- *
- * @return float
- */
- public function getRemainingCredits()
- {
- return $this->container['remainingCredits'];
- }
-
- /**
- * Sets remainingCredits
- *
- * @param float $remainingCredits Remaining SMS credits of the user
- *
- * @return $this
- */
- public function setRemainingCredits($remainingCredits)
- {
- $this->container['remainingCredits'] = $remainingCredits;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SendSmtpEmail.php b/lib/Model/SendSmtpEmail.php
deleted file mode 100644
index 58386de..0000000
--- a/lib/Model/SendSmtpEmail.php
+++ /dev/null
@@ -1,755 +0,0 @@
- '\Brevo\Client\Model\SendSmtpEmailSender',
- 'to' => '\Brevo\Client\Model\SendSmtpEmailTo[]',
- 'bcc' => '\Brevo\Client\Model\SendSmtpEmailBcc[]',
- 'cc' => '\Brevo\Client\Model\SendSmtpEmailCc[]',
- 'htmlContent' => 'string',
- 'textContent' => 'string',
- 'subject' => 'string',
- 'replyTo' => '\Brevo\Client\Model\SendSmtpEmailReplyTo',
- 'attachment' => '\Brevo\Client\Model\SendSmtpEmailAttachment[]',
- 'headers' => 'object',
- 'templateId' => 'int',
- 'params' => 'object',
- 'messageVersions' => '\Brevo\Client\Model\SendSmtpEmailMessageVersions[]',
- 'tags' => 'string[]',
- 'scheduledAt' => '\DateTime',
- 'batchId' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'sender' => null,
- 'to' => null,
- 'bcc' => null,
- 'cc' => null,
- 'htmlContent' => null,
- 'textContent' => null,
- 'subject' => null,
- 'replyTo' => null,
- 'attachment' => null,
- 'headers' => null,
- 'templateId' => 'int64',
- 'params' => null,
- 'messageVersions' => null,
- 'tags' => null,
- 'scheduledAt' => 'date-time',
- 'batchId' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'sender' => 'sender',
- 'to' => 'to',
- 'bcc' => 'bcc',
- 'cc' => 'cc',
- 'htmlContent' => 'htmlContent',
- 'textContent' => 'textContent',
- 'subject' => 'subject',
- 'replyTo' => 'replyTo',
- 'attachment' => 'attachment',
- 'headers' => 'headers',
- 'templateId' => 'templateId',
- 'params' => 'params',
- 'messageVersions' => 'messageVersions',
- 'tags' => 'tags',
- 'scheduledAt' => 'scheduledAt',
- 'batchId' => 'batchId'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'sender' => 'setSender',
- 'to' => 'setTo',
- 'bcc' => 'setBcc',
- 'cc' => 'setCc',
- 'htmlContent' => 'setHtmlContent',
- 'textContent' => 'setTextContent',
- 'subject' => 'setSubject',
- 'replyTo' => 'setReplyTo',
- 'attachment' => 'setAttachment',
- 'headers' => 'setHeaders',
- 'templateId' => 'setTemplateId',
- 'params' => 'setParams',
- 'messageVersions' => 'setMessageVersions',
- 'tags' => 'setTags',
- 'scheduledAt' => 'setScheduledAt',
- 'batchId' => 'setBatchId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'sender' => 'getSender',
- 'to' => 'getTo',
- 'bcc' => 'getBcc',
- 'cc' => 'getCc',
- 'htmlContent' => 'getHtmlContent',
- 'textContent' => 'getTextContent',
- 'subject' => 'getSubject',
- 'replyTo' => 'getReplyTo',
- 'attachment' => 'getAttachment',
- 'headers' => 'getHeaders',
- 'templateId' => 'getTemplateId',
- 'params' => 'getParams',
- 'messageVersions' => 'getMessageVersions',
- 'tags' => 'getTags',
- 'scheduledAt' => 'getScheduledAt',
- 'batchId' => 'getBatchId'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null;
- $this->container['to'] = isset($data['to']) ? $data['to'] : null;
- $this->container['bcc'] = isset($data['bcc']) ? $data['bcc'] : null;
- $this->container['cc'] = isset($data['cc']) ? $data['cc'] : null;
- $this->container['htmlContent'] = isset($data['htmlContent']) ? $data['htmlContent'] : null;
- $this->container['textContent'] = isset($data['textContent']) ? $data['textContent'] : null;
- $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null;
- $this->container['replyTo'] = isset($data['replyTo']) ? $data['replyTo'] : null;
- $this->container['attachment'] = isset($data['attachment']) ? $data['attachment'] : null;
- $this->container['headers'] = isset($data['headers']) ? $data['headers'] : null;
- $this->container['templateId'] = isset($data['templateId']) ? $data['templateId'] : null;
- $this->container['params'] = isset($data['params']) ? $data['params'] : null;
- $this->container['messageVersions'] = isset($data['messageVersions']) ? $data['messageVersions'] : null;
- $this->container['tags'] = isset($data['tags']) ? $data['tags'] : null;
- $this->container['scheduledAt'] = isset($data['scheduledAt']) ? $data['scheduledAt'] : null;
- $this->container['batchId'] = isset($data['batchId']) ? $data['batchId'] : null;
- }
-
- /**
- * 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 sender
- *
- * @return \Brevo\Client\Model\SendSmtpEmailSender
- */
- public function getSender()
- {
- return $this->container['sender'];
- }
-
- /**
- * Sets sender
- *
- * @param \Brevo\Client\Model\SendSmtpEmailSender $sender sender
- *
- * @return $this
- */
- public function setSender($sender)
- {
- $this->container['sender'] = $sender;
-
- return $this;
- }
-
- /**
- * Gets to
- *
- * @return \Brevo\Client\Model\SendSmtpEmailTo[]
- */
- public function getTo()
- {
- return $this->container['to'];
- }
-
- /**
- * Sets to
- *
- * @param \Brevo\Client\Model\SendSmtpEmailTo[] $to Mandatory if messageVersions are not passed, ignored if messageVersions are passed. List of email addresses and names (optional) of the recipients. For example, [{\"name\":\"Jimmy\", \"email\":\"jimmy98@example.com\"}, {\"name\":\"Joe\", \"email\":\"joe@example.com\"}]
- *
- * @return $this
- */
- public function setTo($to)
- {
- $this->container['to'] = $to;
-
- return $this;
- }
-
- /**
- * Gets bcc
- *
- * @return \Brevo\Client\Model\SendSmtpEmailBcc[]
- */
- public function getBcc()
- {
- return $this->container['bcc'];
- }
-
- /**
- * Sets bcc
- *
- * @param \Brevo\Client\Model\SendSmtpEmailBcc[] $bcc List of email addresses and names (optional) of the recipients in bcc
- *
- * @return $this
- */
- public function setBcc($bcc)
- {
- $this->container['bcc'] = $bcc;
-
- return $this;
- }
-
- /**
- * Gets cc
- *
- * @return \Brevo\Client\Model\SendSmtpEmailCc[]
- */
- public function getCc()
- {
- return $this->container['cc'];
- }
-
- /**
- * Sets cc
- *
- * @param \Brevo\Client\Model\SendSmtpEmailCc[] $cc List of email addresses and names (optional) of the recipients in cc
- *
- * @return $this
- */
- public function setCc($cc)
- {
- $this->container['cc'] = $cc;
-
- return $this;
- }
-
- /**
- * Gets htmlContent
- *
- * @return string
- */
- public function getHtmlContent()
- {
- return $this->container['htmlContent'];
- }
-
- /**
- * Sets htmlContent
- *
- * @param string $htmlContent HTML body of the message ( Mandatory if 'templateId' is not passed, ignored if 'templateId' is passed )
- *
- * @return $this
- */
- public function setHtmlContent($htmlContent)
- {
- $this->container['htmlContent'] = $htmlContent;
-
- return $this;
- }
-
- /**
- * Gets textContent
- *
- * @return string
- */
- public function getTextContent()
- {
- return $this->container['textContent'];
- }
-
- /**
- * Sets textContent
- *
- * @param string $textContent Plain Text body of the message ( Ignored if 'templateId' is passed )
- *
- * @return $this
- */
- public function setTextContent($textContent)
- {
- $this->container['textContent'] = $textContent;
-
- return $this;
- }
-
- /**
- * Gets subject
- *
- * @return string
- */
- public function getSubject()
- {
- return $this->container['subject'];
- }
-
- /**
- * Sets subject
- *
- * @param string $subject Subject of the message. Mandatory if 'templateId' is not passed
- *
- * @return $this
- */
- public function setSubject($subject)
- {
- $this->container['subject'] = $subject;
-
- return $this;
- }
-
- /**
- * Gets replyTo
- *
- * @return \Brevo\Client\Model\SendSmtpEmailReplyTo
- */
- public function getReplyTo()
- {
- return $this->container['replyTo'];
- }
-
- /**
- * Sets replyTo
- *
- * @param \Brevo\Client\Model\SendSmtpEmailReplyTo $replyTo replyTo
- *
- * @return $this
- */
- public function setReplyTo($replyTo)
- {
- $this->container['replyTo'] = $replyTo;
-
- return $this;
- }
-
- /**
- * Gets attachment
- *
- * @return \Brevo\Client\Model\SendSmtpEmailAttachment[]
- */
- public function getAttachment()
- {
- return $this->container['attachment'];
- }
-
- /**
- * Sets attachment
- *
- * @param \Brevo\Client\Model\SendSmtpEmailAttachment[] $attachment Pass the absolute URL (no local file) or the base64 content of the attachment along with the attachment name (Mandatory if attachment content is passed). For example, `[{\"url\":\"https://attachment.domain.com/myAttachmentFromUrl.jpg\", \"name\":\"myAttachmentFromUrl.jpg\"}, {\"content\":\"base64 example content\", \"name\":\"myAttachmentFromBase64.jpg\"}]`. Allowed extensions for attachment file: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub, eps, odt, mp3, m4a, m4v, wma, ogg, flac, wav, aif, aifc, aiff, mp4, mov, avi, mkv, mpeg, mpg, wmv, pkpass and xlsm ( If 'templateId' is passed and is in New Template Language format then both attachment url and content are accepted. If template is in Old template Language format, then 'attachment' is ignored )
- *
- * @return $this
- */
- public function setAttachment($attachment)
- {
- $this->container['attachment'] = $attachment;
-
- return $this;
- }
-
- /**
- * Gets headers
- *
- * @return object
- */
- public function getHeaders()
- {
- return $this->container['headers'];
- }
-
- /**
- * Sets headers
- *
- * @param object $headers Pass the set of custom headers (not the standard headers) that shall be sent along the mail headers in the original email. 'sender.ip' header can be set (only for dedicated ip users) to mention the IP to be used for sending transactional emails. Headers are allowed in `This-Case-Only` (i.e. words separated by hyphen with first letter of each word in capital letter), they will be converted to such case styling if not in this format in the request payload. For example, `{\"sender.ip\":\"1.2.3.4\", \"X-Mailin-custom\":\"some_custom_header\", \"idempotencyKey\":\"abc-123\"}`.
- *
- * @return $this
- */
- public function setHeaders($headers)
- {
- $this->container['headers'] = $headers;
-
- return $this;
- }
-
- /**
- * Gets templateId
- *
- * @return int
- */
- public function getTemplateId()
- {
- return $this->container['templateId'];
- }
-
- /**
- * Sets templateId
- *
- * @param int $templateId Id of the template.
- *
- * @return $this
- */
- public function setTemplateId($templateId)
- {
- $this->container['templateId'] = $templateId;
-
- return $this;
- }
-
- /**
- * Gets params
- *
- * @return object
- */
- public function getParams()
- {
- return $this->container['params'];
- }
-
- /**
- * Sets params
- *
- * @param object $params Pass the set of attributes to customize the template. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. It's considered only if template is in New Template Language format.
- *
- * @return $this
- */
- public function setParams($params)
- {
- $this->container['params'] = $params;
-
- return $this;
- }
-
- /**
- * Gets messageVersions
- *
- * @return \Brevo\Client\Model\SendSmtpEmailMessageVersions[]
- */
- public function getMessageVersions()
- {
- return $this->container['messageVersions'];
- }
-
- /**
- * Sets messageVersions
- *
- * @param \Brevo\Client\Model\SendSmtpEmailMessageVersions[] $messageVersions You can customize and send out multiple versions of a mail. templateId can be customized only if global parameter contains templateId. htmlContent and textContent can be customized only if any of the two, htmlContent or textContent, is present in global parameters. Some global parameters such as **to(mandatory), bcc, cc, replyTo, subject** can also be customized specific to each version. Total number of recipients in one API request must not exceed 2000. However, you can still pass upto 99 recipients maximum in one message version. The size of individual params in all the messageVersions shall not exceed 100 KB limit and that of cumulative params shall not exceed 1000 KB. You can follow this **step-by-step guide** on how to use **messageVersions** to batch send emails - https://developers.brevo.com/docs/batch-send-transactional-emails
- *
- * @return $this
- */
- public function setMessageVersions($messageVersions)
- {
- $this->container['messageVersions'] = $messageVersions;
-
- return $this;
- }
-
- /**
- * Gets tags
- *
- * @return string[]
- */
- public function getTags()
- {
- return $this->container['tags'];
- }
-
- /**
- * Sets tags
- *
- * @param string[] $tags Tag your emails to find them more easily
- *
- * @return $this
- */
- public function setTags($tags)
- {
- $this->container['tags'] = $tags;
-
- return $this;
- }
-
- /**
- * Gets scheduledAt
- *
- * @return \DateTime
- */
- public function getScheduledAt()
- {
- return $this->container['scheduledAt'];
- }
-
- /**
- * Sets scheduledAt
- *
- * @param \DateTime $scheduledAt UTC date-time on which the email has to schedule (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for scheduling. There can be an expected delay of +5 minutes in scheduled email delivery. **Please note this feature is currently a public beta**.
- *
- * @return $this
- */
- public function setScheduledAt($scheduledAt)
- {
- $this->container['scheduledAt'] = $scheduledAt;
-
- return $this;
- }
-
- /**
- * Gets batchId
- *
- * @return string
- */
- public function getBatchId()
- {
- return $this->container['batchId'];
- }
-
- /**
- * Sets batchId
- *
- * @param string $batchId Valid UUIDv4 batch id to identify the scheduled batches transactional email. If not passed we will create a valid UUIDv4 batch id at our end.
- *
- * @return $this
- */
- public function setBatchId($batchId)
- {
- $this->container['batchId'] = $batchId;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SendSmtpEmailAttachment.php b/lib/Model/SendSmtpEmailAttachment.php
deleted file mode 100644
index 4775f9c..0000000
--- a/lib/Model/SendSmtpEmailAttachment.php
+++ /dev/null
@@ -1,374 +0,0 @@
- 'string',
- 'content' => 'string',
- 'name' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'url' => 'url',
- 'content' => 'byte',
- 'name' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'url' => 'url',
- 'content' => 'content',
- 'name' => 'name'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'url' => 'setUrl',
- 'content' => 'setContent',
- 'name' => 'setName'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'url' => 'getUrl',
- 'content' => 'getContent',
- 'name' => 'getName'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['url'] = isset($data['url']) ? $data['url'] : null;
- $this->container['content'] = isset($data['content']) ? $data['content'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if (!is_null($this->container['content']) && !preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $this->container['content'])) {
- $invalidProperties[] = "invalid value for 'content', must be conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.";
- }
-
- 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
- *
- * @return string
- */
- public function getUrl()
- {
- return $this->container['url'];
- }
-
- /**
- * Sets url
- *
- * @param string $url Absolute url of the attachment (no local file).
- *
- * @return $this
- */
- public function setUrl($url)
- {
- $this->container['url'] = $url;
-
- return $this;
- }
-
- /**
- * Gets content
- *
- * @return string
- */
- public function getContent()
- {
- return $this->container['content'];
- }
-
- /**
- * Sets content
- *
- * @param string $content Base64 encoded chunk data of the attachment generated on the fly
- *
- * @return $this
- */
- public function setContent($content)
- {
-
- if (!is_null($content) && (!preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $content))) {
- throw new \InvalidArgumentException("invalid value for $content when calling SendSmtpEmailAttachment., must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.");
- }
-
- $this->container['content'] = $content;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Required if content is passed. Name of the attachment
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SendSmtpEmailBcc.php b/lib/Model/SendSmtpEmailBcc.php
deleted file mode 100644
index 507c7f5..0000000
--- a/lib/Model/SendSmtpEmailBcc.php
+++ /dev/null
@@ -1,338 +0,0 @@
- 'string',
- 'name' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'email' => 'email',
- 'name' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'email' => 'email',
- 'name' => 'name'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'email' => 'setEmail',
- 'name' => 'setName'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'email' => 'getEmail',
- 'name' => 'getName'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['email'] === null) {
- $invalidProperties[] = "'email' 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 email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Email address of the recipient in bcc
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the recipient in bcc. Maximum allowed characters are 70.
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SendSmtpEmailCc.php b/lib/Model/SendSmtpEmailCc.php
deleted file mode 100644
index e332a05..0000000
--- a/lib/Model/SendSmtpEmailCc.php
+++ /dev/null
@@ -1,338 +0,0 @@
- 'string',
- 'name' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'email' => 'email',
- 'name' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'email' => 'email',
- 'name' => 'name'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'email' => 'setEmail',
- 'name' => 'setName'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'email' => 'getEmail',
- 'name' => 'getName'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['email'] === null) {
- $invalidProperties[] = "'email' 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 email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Email address of the recipient in cc
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the recipient in cc. Maximum allowed characters are 70.
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SendSmtpEmailMessageVersions.php b/lib/Model/SendSmtpEmailMessageVersions.php
deleted file mode 100644
index 4f9d0f6..0000000
--- a/lib/Model/SendSmtpEmailMessageVersions.php
+++ /dev/null
@@ -1,458 +0,0 @@
- '\Brevo\Client\Model\SendSmtpEmailTo1[]',
- 'params' => 'map[string,object]',
- 'bcc' => '\Brevo\Client\Model\SendSmtpEmailBcc[]',
- 'cc' => '\Brevo\Client\Model\SendSmtpEmailCc[]',
- 'replyTo' => '\Brevo\Client\Model\SendSmtpEmailReplyTo1',
- 'subject' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'to' => null,
- 'params' => null,
- 'bcc' => null,
- 'cc' => null,
- 'replyTo' => null,
- 'subject' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'to' => 'to',
- 'params' => 'params',
- 'bcc' => 'bcc',
- 'cc' => 'cc',
- 'replyTo' => 'replyTo',
- 'subject' => 'subject'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'to' => 'setTo',
- 'params' => 'setParams',
- 'bcc' => 'setBcc',
- 'cc' => 'setCc',
- 'replyTo' => 'setReplyTo',
- 'subject' => 'setSubject'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'to' => 'getTo',
- 'params' => 'getParams',
- 'bcc' => 'getBcc',
- 'cc' => 'getCc',
- 'replyTo' => 'getReplyTo',
- 'subject' => 'getSubject'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['to'] = isset($data['to']) ? $data['to'] : null;
- $this->container['params'] = isset($data['params']) ? $data['params'] : null;
- $this->container['bcc'] = isset($data['bcc']) ? $data['bcc'] : null;
- $this->container['cc'] = isset($data['cc']) ? $data['cc'] : null;
- $this->container['replyTo'] = isset($data['replyTo']) ? $data['replyTo'] : null;
- $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['to'] === null) {
- $invalidProperties[] = "'to' 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 to
- *
- * @return \Brevo\Client\Model\SendSmtpEmailTo1[]
- */
- public function getTo()
- {
- return $this->container['to'];
- }
-
- /**
- * Sets to
- *
- * @param \Brevo\Client\Model\SendSmtpEmailTo1[] $to List of email addresses and names (_optional_) of the recipients. For example, [{\"name\":\"Jimmy\", \"email\":\"jimmy98@example.com\"}, {\"name\":\"Joe\", \"email\":\"joe@example.com\"}]
- *
- * @return $this
- */
- public function setTo($to)
- {
- $this->container['to'] = $to;
-
- return $this;
- }
-
- /**
- * Gets params
- *
- * @return map[string,object]
- */
- public function getParams()
- {
- return $this->container['params'];
- }
-
- /**
- * Sets params
- *
- * @param map[string,object] $params Pass the set of attributes to customize the template. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. It's considered only if template is in New Template Language format.
- *
- * @return $this
- */
- public function setParams($params)
- {
- $this->container['params'] = $params;
-
- return $this;
- }
-
- /**
- * Gets bcc
- *
- * @return \Brevo\Client\Model\SendSmtpEmailBcc[]
- */
- public function getBcc()
- {
- return $this->container['bcc'];
- }
-
- /**
- * Sets bcc
- *
- * @param \Brevo\Client\Model\SendSmtpEmailBcc[] $bcc List of email addresses and names (optional) of the recipients in bcc
- *
- * @return $this
- */
- public function setBcc($bcc)
- {
- $this->container['bcc'] = $bcc;
-
- return $this;
- }
-
- /**
- * Gets cc
- *
- * @return \Brevo\Client\Model\SendSmtpEmailCc[]
- */
- public function getCc()
- {
- return $this->container['cc'];
- }
-
- /**
- * Sets cc
- *
- * @param \Brevo\Client\Model\SendSmtpEmailCc[] $cc List of email addresses and names (optional) of the recipients in cc
- *
- * @return $this
- */
- public function setCc($cc)
- {
- $this->container['cc'] = $cc;
-
- return $this;
- }
-
- /**
- * Gets replyTo
- *
- * @return \Brevo\Client\Model\SendSmtpEmailReplyTo1
- */
- public function getReplyTo()
- {
- return $this->container['replyTo'];
- }
-
- /**
- * Sets replyTo
- *
- * @param \Brevo\Client\Model\SendSmtpEmailReplyTo1 $replyTo replyTo
- *
- * @return $this
- */
- public function setReplyTo($replyTo)
- {
- $this->container['replyTo'] = $replyTo;
-
- return $this;
- }
-
- /**
- * Gets subject
- *
- * @return string
- */
- public function getSubject()
- {
- return $this->container['subject'];
- }
-
- /**
- * Sets subject
- *
- * @param string $subject Custom subject specific to message version
- *
- * @return $this
- */
- public function setSubject($subject)
- {
- $this->container['subject'] = $subject;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SendSmtpEmailReplyTo.php b/lib/Model/SendSmtpEmailReplyTo.php
deleted file mode 100644
index e5231f7..0000000
--- a/lib/Model/SendSmtpEmailReplyTo.php
+++ /dev/null
@@ -1,339 +0,0 @@
- 'string',
- 'name' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'email' => 'email',
- 'name' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'email' => 'email',
- 'name' => 'name'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'email' => 'setEmail',
- 'name' => 'setName'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'email' => 'getEmail',
- 'name' => 'getName'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['email'] === null) {
- $invalidProperties[] = "'email' 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 email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Email address in reply to
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name in reply to. Maximum allowed characters are 70.
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SendSmtpEmailReplyTo1.php b/lib/Model/SendSmtpEmailReplyTo1.php
deleted file mode 100644
index 56280ed..0000000
--- a/lib/Model/SendSmtpEmailReplyTo1.php
+++ /dev/null
@@ -1,339 +0,0 @@
- 'string',
- 'name' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'email' => 'email',
- 'name' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'email' => 'email',
- 'name' => 'name'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'email' => 'setEmail',
- 'name' => 'setName'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'email' => 'getEmail',
- 'name' => 'getName'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['email'] === null) {
- $invalidProperties[] = "'email' 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 email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Email address in reply to
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name in reply to. Maximum allowed characters are 70.
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SendSmtpEmailSender.php b/lib/Model/SendSmtpEmailSender.php
deleted file mode 100644
index b27b168..0000000
--- a/lib/Model/SendSmtpEmailSender.php
+++ /dev/null
@@ -1,366 +0,0 @@
- 'string',
- 'email' => 'string',
- 'id' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'email' => 'email',
- 'id' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'email' => 'email',
- 'id' => 'id'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'email' => 'setEmail',
- 'id' => 'setId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'email' => 'getEmail',
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- }
-
- /**
- * 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the sender from which the emails will be sent. Maximum allowed characters are 70. Applicable only when email is passed.
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Email of the sender from which the emails will be sent. Mandatory if sender id is not passed.
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets id
- *
- * @return int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id Id of the sender from which the emails will be sent. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). Mandatory if email is not passed.
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SendSmtpEmailTo.php b/lib/Model/SendSmtpEmailTo.php
deleted file mode 100644
index e7c164b..0000000
--- a/lib/Model/SendSmtpEmailTo.php
+++ /dev/null
@@ -1,338 +0,0 @@
- 'string',
- 'name' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'email' => 'email',
- 'name' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'email' => 'email',
- 'name' => 'name'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'email' => 'setEmail',
- 'name' => 'setName'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'email' => 'getEmail',
- 'name' => 'getName'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['email'] === null) {
- $invalidProperties[] = "'email' 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 email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Email address of the recipient
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the recipient. Maximum allowed characters are 70.
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SendSmtpEmailTo1.php b/lib/Model/SendSmtpEmailTo1.php
deleted file mode 100644
index 58dafdf..0000000
--- a/lib/Model/SendSmtpEmailTo1.php
+++ /dev/null
@@ -1,338 +0,0 @@
- 'string',
- 'name' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'email' => 'email',
- 'name' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'email' => 'email',
- 'name' => 'name'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'email' => 'setEmail',
- 'name' => 'setName'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'email' => 'getEmail',
- 'name' => 'getName'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['email'] === null) {
- $invalidProperties[] = "'email' 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 email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Email address of the recipient
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the recipient. **Maximum allowed characters are 70**.
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SendTestEmail.php b/lib/Model/SendTestEmail.php
deleted file mode 100644
index ba33577..0000000
--- a/lib/Model/SendTestEmail.php
+++ /dev/null
@@ -1,305 +0,0 @@
- 'string[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'emailTo' => 'email'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'emailTo' => 'emailTo'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'emailTo' => 'setEmailTo'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'emailTo' => 'getEmailTo'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['emailTo'] = isset($data['emailTo']) ? $data['emailTo'] : null;
- }
-
- /**
- * 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 emailTo
- *
- * @return string[]
- */
- public function getEmailTo()
- {
- return $this->container['emailTo'];
- }
-
- /**
- * Sets emailTo
- *
- * @param string[] $emailTo List of the email addresses of the recipients whom you wish to send the test mail. If left empty, the test mail will be sent to your entire test list. You can not send more than 50 test emails per day.
- *
- * @return $this
- */
- public function setEmailTo($emailTo)
- {
- $this->container['emailTo'] = $emailTo;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SendTestSms.php b/lib/Model/SendTestSms.php
deleted file mode 100644
index 3eaeead..0000000
--- a/lib/Model/SendTestSms.php
+++ /dev/null
@@ -1,305 +0,0 @@
- 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'phoneNumber' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'phoneNumber' => 'phoneNumber'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'phoneNumber' => 'setPhoneNumber'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'phoneNumber' => 'getPhoneNumber'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['phoneNumber'] = isset($data['phoneNumber']) ? $data['phoneNumber'] : null;
- }
-
- /**
- * 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 phoneNumber
- *
- * @return string
- */
- public function getPhoneNumber()
- {
- return $this->container['phoneNumber'];
- }
-
- /**
- * Sets phoneNumber
- *
- * @param string $phoneNumber Mobile number of the recipient with the country code. This number must belong to one of your contacts in Brevo account and must not be blacklisted
- *
- * @return $this
- */
- public function setPhoneNumber($phoneNumber)
- {
- $this->container['phoneNumber'] = $phoneNumber;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SendTransacSms.php b/lib/Model/SendTransacSms.php
deleted file mode 100644
index 4ab8659..0000000
--- a/lib/Model/SendTransacSms.php
+++ /dev/null
@@ -1,564 +0,0 @@
- 'string',
- 'recipient' => 'string',
- 'content' => 'string',
- 'type' => 'string',
- 'tag' => 'string',
- 'webUrl' => 'string',
- 'unicodeEnabled' => 'bool',
- 'organisationPrefix' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'sender' => null,
- 'recipient' => null,
- 'content' => null,
- 'type' => null,
- 'tag' => null,
- 'webUrl' => 'url',
- 'unicodeEnabled' => null,
- 'organisationPrefix' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'sender' => 'sender',
- 'recipient' => 'recipient',
- 'content' => 'content',
- 'type' => 'type',
- 'tag' => 'tag',
- 'webUrl' => 'webUrl',
- 'unicodeEnabled' => 'unicodeEnabled',
- 'organisationPrefix' => 'organisationPrefix'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'sender' => 'setSender',
- 'recipient' => 'setRecipient',
- 'content' => 'setContent',
- 'type' => 'setType',
- 'tag' => 'setTag',
- 'webUrl' => 'setWebUrl',
- 'unicodeEnabled' => 'setUnicodeEnabled',
- 'organisationPrefix' => 'setOrganisationPrefix'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'sender' => 'getSender',
- 'recipient' => 'getRecipient',
- 'content' => 'getContent',
- 'type' => 'getType',
- 'tag' => 'getTag',
- 'webUrl' => 'getWebUrl',
- 'unicodeEnabled' => 'getUnicodeEnabled',
- 'organisationPrefix' => 'getOrganisationPrefix'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const TYPE_TRANSACTIONAL = 'transactional';
- const TYPE_MARKETING = 'marketing';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getTypeAllowableValues()
- {
- return [
- self::TYPE_TRANSACTIONAL,
- self::TYPE_MARKETING,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null;
- $this->container['recipient'] = isset($data['recipient']) ? $data['recipient'] : null;
- $this->container['content'] = isset($data['content']) ? $data['content'] : null;
- $this->container['type'] = isset($data['type']) ? $data['type'] : 'transactional';
- $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null;
- $this->container['webUrl'] = isset($data['webUrl']) ? $data['webUrl'] : null;
- $this->container['unicodeEnabled'] = isset($data['unicodeEnabled']) ? $data['unicodeEnabled'] : false;
- $this->container['organisationPrefix'] = isset($data['organisationPrefix']) ? $data['organisationPrefix'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['sender'] === null) {
- $invalidProperties[] = "'sender' can't be null";
- }
- if ((mb_strlen($this->container['sender']) > 15)) {
- $invalidProperties[] = "invalid value for 'sender', the character length must be smaller than or equal to 15.";
- }
-
- if ($this->container['recipient'] === null) {
- $invalidProperties[] = "'recipient' can't be null";
- }
- if ($this->container['content'] === null) {
- $invalidProperties[] = "'content' can't be null";
- }
- $allowedValues = $this->getTypeAllowableValues();
- if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'type', must be one of '%s'",
- 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 sender
- *
- * @return string
- */
- public function getSender()
- {
- return $this->container['sender'];
- }
-
- /**
- * Sets sender
- *
- * @param string $sender Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters**
- *
- * @return $this
- */
- public function setSender($sender)
- {
- if ((mb_strlen($sender) > 15)) {
- throw new \InvalidArgumentException('invalid length for $sender when calling SendTransacSms., must be smaller than or equal to 15.');
- }
-
- $this->container['sender'] = $sender;
-
- return $this;
- }
-
- /**
- * Gets recipient
- *
- * @return string
- */
- public function getRecipient()
- {
- return $this->container['recipient'];
- }
-
- /**
- * Sets recipient
- *
- * @param string $recipient Mobile number to send SMS with the country code
- *
- * @return $this
- */
- public function setRecipient($recipient)
- {
- $this->container['recipient'] = $recipient;
-
- return $this;
- }
-
- /**
- * Gets content
- *
- * @return string
- */
- public function getContent()
- {
- return $this->container['content'];
- }
-
- /**
- * Sets content
- *
- * @param string $content Content of the message. If more than 160 characters long, will be sent as multiple text messages
- *
- * @return $this
- */
- public function setContent($content)
- {
- $this->container['content'] = $content;
-
- return $this;
- }
-
- /**
- * Gets type
- *
- * @return string
- */
- public function getType()
- {
- return $this->container['type'];
- }
-
- /**
- * Sets type
- *
- * @param string $type Type of the SMS. Marketing SMS messages are those sent typically with marketing content. Transactional SMS messages are sent to individuals and are triggered in response to some action, such as a sign-up, purchase, etc.
- *
- * @return $this
- */
- public function setType($type)
- {
- $allowedValues = $this->getTypeAllowableValues();
- if (!is_null($type) && !in_array($type, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'type', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['type'] = $type;
-
- return $this;
- }
-
- /**
- * Gets tag
- *
- * @return string
- */
- public function getTag()
- {
- return $this->container['tag'];
- }
-
- /**
- * Sets tag
- *
- * @param string $tag Tag of the message
- *
- * @return $this
- */
- public function setTag($tag)
- {
- $this->container['tag'] = $tag;
-
- return $this;
- }
-
- /**
- * Gets webUrl
- *
- * @return string
- */
- public function getWebUrl()
- {
- return $this->container['webUrl'];
- }
-
- /**
- * Sets webUrl
- *
- * @param string $webUrl Webhook to call for each event triggered by the message (delivered etc.)
- *
- * @return $this
- */
- public function setWebUrl($webUrl)
- {
- $this->container['webUrl'] = $webUrl;
-
- return $this;
- }
-
- /**
- * Gets unicodeEnabled
- *
- * @return bool
- */
- public function getUnicodeEnabled()
- {
- return $this->container['unicodeEnabled'];
- }
-
- /**
- * Sets unicodeEnabled
- *
- * @param bool $unicodeEnabled Format of the message. It indicates whether the content should be treated as unicode or not.
- *
- * @return $this
- */
- public function setUnicodeEnabled($unicodeEnabled)
- {
- $this->container['unicodeEnabled'] = $unicodeEnabled;
-
- return $this;
- }
-
- /**
- * Gets organisationPrefix
- *
- * @return string
- */
- public function getOrganisationPrefix()
- {
- return $this->container['organisationPrefix'];
- }
-
- /**
- * Sets organisationPrefix
- *
- * @param string $organisationPrefix A recognizable prefix will ensure your audience knows who you are. Recommended by U.S. carriers. This will be added as your Brand Name before the message content. **Prefer verifying maximum length of 160 characters including this prefix in message content to avoid multiple sending of same sms.**
- *
- * @return $this
- */
- public function setOrganisationPrefix($organisationPrefix)
- {
- $this->container['organisationPrefix'] = $organisationPrefix;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SendWhatsappMessage.php b/lib/Model/SendWhatsappMessage.php
deleted file mode 100644
index ecb3ce4..0000000
--- a/lib/Model/SendWhatsappMessage.php
+++ /dev/null
@@ -1,431 +0,0 @@
- 'int',
- 'text' => 'string',
- 'senderNumber' => 'string',
- 'params' => 'object',
- 'contactNumbers' => 'string[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'templateId' => null,
- 'text' => null,
- 'senderNumber' => 'mobile',
- 'params' => null,
- 'contactNumbers' => 'mobile'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'templateId' => 'templateId',
- 'text' => 'text',
- 'senderNumber' => 'senderNumber',
- 'params' => 'params',
- 'contactNumbers' => 'contactNumbers'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'templateId' => 'setTemplateId',
- 'text' => 'setText',
- 'senderNumber' => 'setSenderNumber',
- 'params' => 'setParams',
- 'contactNumbers' => 'setContactNumbers'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'templateId' => 'getTemplateId',
- 'text' => 'getText',
- 'senderNumber' => 'getSenderNumber',
- 'params' => 'getParams',
- 'contactNumbers' => 'getContactNumbers'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['templateId'] = isset($data['templateId']) ? $data['templateId'] : null;
- $this->container['text'] = isset($data['text']) ? $data['text'] : null;
- $this->container['senderNumber'] = isset($data['senderNumber']) ? $data['senderNumber'] : null;
- $this->container['params'] = isset($data['params']) ? $data['params'] : null;
- $this->container['contactNumbers'] = isset($data['contactNumbers']) ? $data['contactNumbers'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['senderNumber'] === null) {
- $invalidProperties[] = "'senderNumber' can't be null";
- }
- if ($this->container['contactNumbers'] === null) {
- $invalidProperties[] = "'contactNumbers' 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 templateId
- *
- * @return int
- */
- public function getTemplateId()
- {
- return $this->container['templateId'];
- }
-
- /**
- * Sets templateId
- *
- * @param int $templateId ID of the template to send
- *
- * @return $this
- */
- public function setTemplateId($templateId)
- {
- $this->container['templateId'] = $templateId;
-
- return $this;
- }
-
- /**
- * Gets text
- *
- * @return string
- */
- public function getText()
- {
- return $this->container['text'];
- }
-
- /**
- * Sets text
- *
- * @param string $text Text to be sent as message body (will be overridden if templateId is passed in the same request)
- *
- * @return $this
- */
- public function setText($text)
- {
- $this->container['text'] = $text;
-
- return $this;
- }
-
- /**
- * Gets senderNumber
- *
- * @return string
- */
- public function getSenderNumber()
- {
- return $this->container['senderNumber'];
- }
-
- /**
- * Sets senderNumber
- *
- * @param string $senderNumber WhatsApp Number with country code. Example, 85264318721
- *
- * @return $this
- */
- public function setSenderNumber($senderNumber)
- {
- $this->container['senderNumber'] = $senderNumber;
-
- return $this;
- }
-
- /**
- * Gets params
- *
- * @return object
- */
- public function getParams()
- {
- return $this->container['params'];
- }
-
- /**
- * Sets params
- *
- * @param object $params Pass the set of attributes to customize the template. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}.
- *
- * @return $this
- */
- public function setParams($params)
- {
- $this->container['params'] = $params;
-
- return $this;
- }
-
- /**
- * Gets contactNumbers
- *
- * @return string[]
- */
- public function getContactNumbers()
- {
- return $this->container['contactNumbers'];
- }
-
- /**
- * Sets contactNumbers
- *
- * @param string[] $contactNumbers List of phone numbers of the contacts
- *
- * @return $this
- */
- public function setContactNumbers($contactNumbers)
- {
- $this->container['contactNumbers'] = $contactNumbers;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SsoTokenRequest.php b/lib/Model/SsoTokenRequest.php
deleted file mode 100644
index b29cedc..0000000
--- a/lib/Model/SsoTokenRequest.php
+++ /dev/null
@@ -1,442 +0,0 @@
- 'int',
- 'email' => 'string',
- 'target' => 'string',
- 'url' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'int64',
- 'email' => null,
- 'target' => null,
- 'url' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'email' => 'email',
- 'target' => 'target',
- 'url' => 'url'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'email' => 'setEmail',
- 'target' => 'setTarget',
- 'url' => 'setUrl'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'email' => 'getEmail',
- 'target' => 'getTarget',
- 'url' => 'getUrl'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const TARGET_AUTOMATION = 'automation';
- const TARGET_EMAIL_CAMPAIGN = 'email_campaign';
- const TARGET_CONTACTS = 'contacts';
- const TARGET_LANDING_PAGES = 'landing_pages';
- const TARGET_EMAIL_TRANSACTIONAL = 'email_transactional';
- const TARGET_SENDERS = 'senders';
- const TARGET_SMS_CAMPAIGN = 'sms_campaign';
- const TARGET_SMS_TRANSACTIONAL = 'sms_transactional';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getTargetAllowableValues()
- {
- return [
- self::TARGET_AUTOMATION,
- self::TARGET_EMAIL_CAMPAIGN,
- self::TARGET_CONTACTS,
- self::TARGET_LANDING_PAGES,
- self::TARGET_EMAIL_TRANSACTIONAL,
- self::TARGET_SENDERS,
- self::TARGET_SMS_CAMPAIGN,
- self::TARGET_SMS_TRANSACTIONAL,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['target'] = isset($data['target']) ? $data['target'] : null;
- $this->container['url'] = isset($data['url']) ? $data['url'] : null;
- }
-
- /**
- * 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";
- }
- $allowedValues = $this->getTargetAllowableValues();
- if (!is_null($this->container['target']) && !in_array($this->container['target'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'target', must be one of '%s'",
- 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 id
- *
- * @return int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id Id of the sub-account organization
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email User email of sub-account organization
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets target
- *
- * @return string
- */
- public function getTarget()
- {
- return $this->container['target'];
- }
-
- /**
- * Sets target
- *
- * @param string $target Set target after login success * automation - Redirect to Automation after login * email_campaign - Redirect to Email Campaign after login * contacts - Redirect to Contacts after login * landing_pages - Redirect to Landing Pages after login * email_transactional - Redirect to Email Transactional after login * senders - Redirect to Contacts after login * sms_campaign - Redirect to Sms Campaign after login * sms_transactional - Redirect to Sms Transactional after login
- *
- * @return $this
- */
- public function setTarget($target)
- {
- $allowedValues = $this->getTargetAllowableValues();
- if (!is_null($target) && !in_array($target, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'target', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['target'] = $target;
-
- return $this;
- }
-
- /**
- * Gets url
- *
- * @return string
- */
- public function getUrl()
- {
- return $this->container['url'];
- }
-
- /**
- * Sets url
- *
- * @param string $url Set the full target URL after login success. The user will land directly on this target URL after login
- *
- * @return $this
- */
- public function setUrl($url)
- {
- $this->container['url'] = $url;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SubAccountAppsToggleRequest.php b/lib/Model/SubAccountAppsToggleRequest.php
deleted file mode 100644
index f7b9392..0000000
--- a/lib/Model/SubAccountAppsToggleRequest.php
+++ /dev/null
@@ -1,666 +0,0 @@
- 'bool',
- 'whatsapp' => 'bool',
- 'automation' => 'bool',
- 'emailCampaigns' => 'bool',
- 'smsCampaigns' => 'bool',
- 'landingPages' => 'bool',
- 'transactionalEmails' => 'bool',
- 'transactionalSms' => 'bool',
- 'facebookAds' => 'bool',
- 'webPush' => 'bool',
- 'meetings' => 'bool',
- 'conversations' => 'bool',
- 'crm' => 'bool'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'inbox' => null,
- 'whatsapp' => null,
- 'automation' => null,
- 'emailCampaigns' => null,
- 'smsCampaigns' => null,
- 'landingPages' => null,
- 'transactionalEmails' => null,
- 'transactionalSms' => null,
- 'facebookAds' => null,
- 'webPush' => null,
- 'meetings' => null,
- 'conversations' => null,
- 'crm' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'inbox' => 'inbox',
- 'whatsapp' => 'whatsapp',
- 'automation' => 'automation',
- 'emailCampaigns' => 'email-campaigns',
- 'smsCampaigns' => 'sms-campaigns',
- 'landingPages' => 'landing-pages',
- 'transactionalEmails' => 'transactional-emails',
- 'transactionalSms' => 'transactional-sms',
- 'facebookAds' => 'facebook-ads',
- 'webPush' => 'web-push',
- 'meetings' => 'meetings',
- 'conversations' => 'conversations',
- 'crm' => 'crm'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'inbox' => 'setInbox',
- 'whatsapp' => 'setWhatsapp',
- 'automation' => 'setAutomation',
- 'emailCampaigns' => 'setEmailCampaigns',
- 'smsCampaigns' => 'setSmsCampaigns',
- 'landingPages' => 'setLandingPages',
- 'transactionalEmails' => 'setTransactionalEmails',
- 'transactionalSms' => 'setTransactionalSms',
- 'facebookAds' => 'setFacebookAds',
- 'webPush' => 'setWebPush',
- 'meetings' => 'setMeetings',
- 'conversations' => 'setConversations',
- 'crm' => 'setCrm'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'inbox' => 'getInbox',
- 'whatsapp' => 'getWhatsapp',
- 'automation' => 'getAutomation',
- 'emailCampaigns' => 'getEmailCampaigns',
- 'smsCampaigns' => 'getSmsCampaigns',
- 'landingPages' => 'getLandingPages',
- 'transactionalEmails' => 'getTransactionalEmails',
- 'transactionalSms' => 'getTransactionalSms',
- 'facebookAds' => 'getFacebookAds',
- 'webPush' => 'getWebPush',
- 'meetings' => 'getMeetings',
- 'conversations' => 'getConversations',
- 'crm' => 'getCrm'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['inbox'] = isset($data['inbox']) ? $data['inbox'] : null;
- $this->container['whatsapp'] = isset($data['whatsapp']) ? $data['whatsapp'] : null;
- $this->container['automation'] = isset($data['automation']) ? $data['automation'] : null;
- $this->container['emailCampaigns'] = isset($data['emailCampaigns']) ? $data['emailCampaigns'] : null;
- $this->container['smsCampaigns'] = isset($data['smsCampaigns']) ? $data['smsCampaigns'] : null;
- $this->container['landingPages'] = isset($data['landingPages']) ? $data['landingPages'] : null;
- $this->container['transactionalEmails'] = isset($data['transactionalEmails']) ? $data['transactionalEmails'] : null;
- $this->container['transactionalSms'] = isset($data['transactionalSms']) ? $data['transactionalSms'] : null;
- $this->container['facebookAds'] = isset($data['facebookAds']) ? $data['facebookAds'] : null;
- $this->container['webPush'] = isset($data['webPush']) ? $data['webPush'] : null;
- $this->container['meetings'] = isset($data['meetings']) ? $data['meetings'] : null;
- $this->container['conversations'] = isset($data['conversations']) ? $data['conversations'] : null;
- $this->container['crm'] = isset($data['crm']) ? $data['crm'] : null;
- }
-
- /**
- * 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 inbox
- *
- * @return bool
- */
- public function getInbox()
- {
- return $this->container['inbox'];
- }
-
- /**
- * Sets inbox
- *
- * @param bool $inbox Set this field to enable or disable Inbox on the sub-account / Not applicable on ENTv2
- *
- * @return $this
- */
- public function setInbox($inbox)
- {
- $this->container['inbox'] = $inbox;
-
- return $this;
- }
-
- /**
- * Gets whatsapp
- *
- * @return bool
- */
- public function getWhatsapp()
- {
- return $this->container['whatsapp'];
- }
-
- /**
- * Sets whatsapp
- *
- * @param bool $whatsapp Set this field to enable or disable Whatsapp campaigns on the sub-account
- *
- * @return $this
- */
- public function setWhatsapp($whatsapp)
- {
- $this->container['whatsapp'] = $whatsapp;
-
- return $this;
- }
-
- /**
- * Gets automation
- *
- * @return bool
- */
- public function getAutomation()
- {
- return $this->container['automation'];
- }
-
- /**
- * Sets automation
- *
- * @param bool $automation Set this field to enable or disable Automation on the sub-account
- *
- * @return $this
- */
- public function setAutomation($automation)
- {
- $this->container['automation'] = $automation;
-
- return $this;
- }
-
- /**
- * Gets emailCampaigns
- *
- * @return bool
- */
- public function getEmailCampaigns()
- {
- return $this->container['emailCampaigns'];
- }
-
- /**
- * Sets emailCampaigns
- *
- * @param bool $emailCampaigns Set this field to enable or disable Email Campaigns on the sub-account
- *
- * @return $this
- */
- public function setEmailCampaigns($emailCampaigns)
- {
- $this->container['emailCampaigns'] = $emailCampaigns;
-
- return $this;
- }
-
- /**
- * Gets smsCampaigns
- *
- * @return bool
- */
- public function getSmsCampaigns()
- {
- return $this->container['smsCampaigns'];
- }
-
- /**
- * Sets smsCampaigns
- *
- * @param bool $smsCampaigns Set this field to enable or disable SMS Marketing on the sub-account
- *
- * @return $this
- */
- public function setSmsCampaigns($smsCampaigns)
- {
- $this->container['smsCampaigns'] = $smsCampaigns;
-
- return $this;
- }
-
- /**
- * Gets landingPages
- *
- * @return bool
- */
- public function getLandingPages()
- {
- return $this->container['landingPages'];
- }
-
- /**
- * Sets landingPages
- *
- * @param bool $landingPages Set this field to enable or disable Landing pages on the sub-account
- *
- * @return $this
- */
- public function setLandingPages($landingPages)
- {
- $this->container['landingPages'] = $landingPages;
-
- return $this;
- }
-
- /**
- * Gets transactionalEmails
- *
- * @return bool
- */
- public function getTransactionalEmails()
- {
- return $this->container['transactionalEmails'];
- }
-
- /**
- * Sets transactionalEmails
- *
- * @param bool $transactionalEmails Set this field to enable or disable Transactional Email on the sub-account
- *
- * @return $this
- */
- public function setTransactionalEmails($transactionalEmails)
- {
- $this->container['transactionalEmails'] = $transactionalEmails;
-
- return $this;
- }
-
- /**
- * Gets transactionalSms
- *
- * @return bool
- */
- public function getTransactionalSms()
- {
- return $this->container['transactionalSms'];
- }
-
- /**
- * Sets transactionalSms
- *
- * @param bool $transactionalSms Set this field to enable or disable Transactional SMS on the sub-account
- *
- * @return $this
- */
- public function setTransactionalSms($transactionalSms)
- {
- $this->container['transactionalSms'] = $transactionalSms;
-
- return $this;
- }
-
- /**
- * Gets facebookAds
- *
- * @return bool
- */
- public function getFacebookAds()
- {
- return $this->container['facebookAds'];
- }
-
- /**
- * Sets facebookAds
- *
- * @param bool $facebookAds Set this field to enable or disable Facebook ads on the sub-account
- *
- * @return $this
- */
- public function setFacebookAds($facebookAds)
- {
- $this->container['facebookAds'] = $facebookAds;
-
- return $this;
- }
-
- /**
- * Gets webPush
- *
- * @return bool
- */
- public function getWebPush()
- {
- return $this->container['webPush'];
- }
-
- /**
- * Sets webPush
- *
- * @param bool $webPush Set this field to enable or disable Web Push on the sub-account
- *
- * @return $this
- */
- public function setWebPush($webPush)
- {
- $this->container['webPush'] = $webPush;
-
- return $this;
- }
-
- /**
- * Gets meetings
- *
- * @return bool
- */
- public function getMeetings()
- {
- return $this->container['meetings'];
- }
-
- /**
- * Sets meetings
- *
- * @param bool $meetings Set this field to enable or disable Meetings on the sub-account
- *
- * @return $this
- */
- public function setMeetings($meetings)
- {
- $this->container['meetings'] = $meetings;
-
- return $this;
- }
-
- /**
- * Gets conversations
- *
- * @return bool
- */
- public function getConversations()
- {
- return $this->container['conversations'];
- }
-
- /**
- * Sets conversations
- *
- * @param bool $conversations Set this field to enable or disable Conversations on the sub-account
- *
- * @return $this
- */
- public function setConversations($conversations)
- {
- $this->container['conversations'] = $conversations;
-
- return $this;
- }
-
- /**
- * Gets crm
- *
- * @return bool
- */
- public function getCrm()
- {
- return $this->container['crm'];
- }
-
- /**
- * Sets crm
- *
- * @param bool $crm Set this field to enable or disable Sales CRM on the sub-account
- *
- * @return $this
- */
- public function setCrm($crm)
- {
- $this->container['crm'] = $crm;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SubAccountDetailsResponse.php b/lib/Model/SubAccountDetailsResponse.php
deleted file mode 100644
index 0c1deca..0000000
--- a/lib/Model/SubAccountDetailsResponse.php
+++ /dev/null
@@ -1,395 +0,0 @@
- 'string',
- 'email' => 'string',
- 'companyName' => 'string',
- 'planInfo' => '\Brevo\Client\Model\SubAccountDetailsResponsePlanInfo'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'email' => null,
- 'companyName' => null,
- 'planInfo' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'email' => 'email',
- 'companyName' => 'companyName',
- 'planInfo' => 'planInfo'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'email' => 'setEmail',
- 'companyName' => 'setCompanyName',
- 'planInfo' => 'setPlanInfo'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'email' => 'getEmail',
- 'companyName' => 'getCompanyName',
- 'planInfo' => 'getPlanInfo'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['companyName'] = isset($data['companyName']) ? $data['companyName'] : null;
- $this->container['planInfo'] = isset($data['planInfo']) ? $data['planInfo'] : null;
- }
-
- /**
- * 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the sub-account user
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Email id of the sub-account organization
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets companyName
- *
- * @return string
- */
- public function getCompanyName()
- {
- return $this->container['companyName'];
- }
-
- /**
- * Sets companyName
- *
- * @param string $companyName Sub-account company name
- *
- * @return $this
- */
- public function setCompanyName($companyName)
- {
- $this->container['companyName'] = $companyName;
-
- return $this;
- }
-
- /**
- * Gets planInfo
- *
- * @return \Brevo\Client\Model\SubAccountDetailsResponsePlanInfo
- */
- public function getPlanInfo()
- {
- return $this->container['planInfo'];
- }
-
- /**
- * Sets planInfo
- *
- * @param \Brevo\Client\Model\SubAccountDetailsResponsePlanInfo $planInfo planInfo
- *
- * @return $this
- */
- public function setPlanInfo($planInfo)
- {
- $this->container['planInfo'] = $planInfo;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SubAccountDetailsResponsePlanInfo.php b/lib/Model/SubAccountDetailsResponsePlanInfo.php
deleted file mode 100644
index 5283b78..0000000
--- a/lib/Model/SubAccountDetailsResponsePlanInfo.php
+++ /dev/null
@@ -1,366 +0,0 @@
- '\Brevo\Client\Model\SubAccountDetailsResponsePlanInfoCredits',
- 'features' => '\Brevo\Client\Model\SubAccountDetailsResponsePlanInfoFeatures',
- 'planType' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'credits' => null,
- 'features' => null,
- 'planType' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'credits' => 'credits',
- 'features' => 'features',
- 'planType' => 'planType'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'credits' => 'setCredits',
- 'features' => 'setFeatures',
- 'planType' => 'setPlanType'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'credits' => 'getCredits',
- 'features' => 'getFeatures',
- 'planType' => 'getPlanType'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['credits'] = isset($data['credits']) ? $data['credits'] : null;
- $this->container['features'] = isset($data['features']) ? $data['features'] : null;
- $this->container['planType'] = isset($data['planType']) ? $data['planType'] : null;
- }
-
- /**
- * 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 credits
- *
- * @return \Brevo\Client\Model\SubAccountDetailsResponsePlanInfoCredits
- */
- public function getCredits()
- {
- return $this->container['credits'];
- }
-
- /**
- * Sets credits
- *
- * @param \Brevo\Client\Model\SubAccountDetailsResponsePlanInfoCredits $credits credits
- *
- * @return $this
- */
- public function setCredits($credits)
- {
- $this->container['credits'] = $credits;
-
- return $this;
- }
-
- /**
- * Gets features
- *
- * @return \Brevo\Client\Model\SubAccountDetailsResponsePlanInfoFeatures
- */
- public function getFeatures()
- {
- return $this->container['features'];
- }
-
- /**
- * Sets features
- *
- * @param \Brevo\Client\Model\SubAccountDetailsResponsePlanInfoFeatures $features features
- *
- * @return $this
- */
- public function setFeatures($features)
- {
- $this->container['features'] = $features;
-
- return $this;
- }
-
- /**
- * Gets planType
- *
- * @return string
- */
- public function getPlanType()
- {
- return $this->container['planType'];
- }
-
- /**
- * Sets planType
- *
- * @param string $planType type of the plan
- *
- * @return $this
- */
- public function setPlanType($planType)
- {
- $this->container['planType'] = $planType;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SubAccountDetailsResponsePlanInfoCredits.php b/lib/Model/SubAccountDetailsResponsePlanInfoCredits.php
deleted file mode 100644
index 425dace..0000000
--- a/lib/Model/SubAccountDetailsResponsePlanInfoCredits.php
+++ /dev/null
@@ -1,336 +0,0 @@
- 'int',
- 'emails' => '\Brevo\Client\Model\SubAccountDetailsResponsePlanInfoCreditsEmails'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'sms' => 'int64',
- 'emails' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'sms' => 'sms',
- 'emails' => 'emails'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'sms' => 'setSms',
- 'emails' => 'setEmails'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'sms' => 'getSms',
- 'emails' => 'getEmails'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['sms'] = isset($data['sms']) ? $data['sms'] : null;
- $this->container['emails'] = isset($data['emails']) ? $data['emails'] : null;
- }
-
- /**
- * 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 sms
- *
- * @return int
- */
- public function getSms()
- {
- return $this->container['sms'];
- }
-
- /**
- * Sets sms
- *
- * @param int $sms SMS credits remaining on the sub-account
- *
- * @return $this
- */
- public function setSms($sms)
- {
- $this->container['sms'] = $sms;
-
- return $this;
- }
-
- /**
- * Gets emails
- *
- * @return \Brevo\Client\Model\SubAccountDetailsResponsePlanInfoCreditsEmails
- */
- public function getEmails()
- {
- return $this->container['emails'];
- }
-
- /**
- * Sets emails
- *
- * @param \Brevo\Client\Model\SubAccountDetailsResponsePlanInfoCreditsEmails $emails emails
- *
- * @return $this
- */
- public function setEmails($emails)
- {
- $this->container['emails'] = $emails;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SubAccountDetailsResponsePlanInfoCreditsEmails.php b/lib/Model/SubAccountDetailsResponsePlanInfoCreditsEmails.php
deleted file mode 100644
index dd1b582..0000000
--- a/lib/Model/SubAccountDetailsResponsePlanInfoCreditsEmails.php
+++ /dev/null
@@ -1,336 +0,0 @@
- 'int',
- 'remaining' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'quantity' => 'int64',
- 'remaining' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'quantity' => 'quantity',
- 'remaining' => 'remaining'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'quantity' => 'setQuantity',
- 'remaining' => 'setRemaining'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'quantity' => 'getQuantity',
- 'remaining' => 'getRemaining'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null;
- $this->container['remaining'] = isset($data['remaining']) ? $data['remaining'] : null;
- }
-
- /**
- * 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 quantity
- *
- * @return int
- */
- public function getQuantity()
- {
- return $this->container['quantity'];
- }
-
- /**
- * Sets quantity
- *
- * @param int $quantity Quantity of email messaging limits provided
- *
- * @return $this
- */
- public function setQuantity($quantity)
- {
- $this->container['quantity'] = $quantity;
-
- return $this;
- }
-
- /**
- * Gets remaining
- *
- * @return int
- */
- public function getRemaining()
- {
- return $this->container['remaining'];
- }
-
- /**
- * Sets remaining
- *
- * @param int $remaining Available email messaging limits for use
- *
- * @return $this
- */
- public function setRemaining($remaining)
- {
- $this->container['remaining'] = $remaining;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SubAccountDetailsResponsePlanInfoFeatures.php b/lib/Model/SubAccountDetailsResponsePlanInfoFeatures.php
deleted file mode 100644
index b79a45f..0000000
--- a/lib/Model/SubAccountDetailsResponsePlanInfoFeatures.php
+++ /dev/null
@@ -1,366 +0,0 @@
- '\Brevo\Client\Model\SubAccountDetailsResponsePlanInfoFeaturesInbox',
- 'landingPage' => '\Brevo\Client\Model\SubAccountDetailsResponsePlanInfoFeaturesLandingPage',
- 'users' => '\Brevo\Client\Model\SubAccountDetailsResponsePlanInfoFeaturesUsers'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'inbox' => null,
- 'landingPage' => null,
- 'users' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'inbox' => 'inbox',
- 'landingPage' => 'landingPage',
- 'users' => 'users'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'inbox' => 'setInbox',
- 'landingPage' => 'setLandingPage',
- 'users' => 'setUsers'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'inbox' => 'getInbox',
- 'landingPage' => 'getLandingPage',
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['inbox'] = isset($data['inbox']) ? $data['inbox'] : null;
- $this->container['landingPage'] = isset($data['landingPage']) ? $data['landingPage'] : null;
- $this->container['users'] = isset($data['users']) ? $data['users'] : null;
- }
-
- /**
- * 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 inbox
- *
- * @return \Brevo\Client\Model\SubAccountDetailsResponsePlanInfoFeaturesInbox
- */
- public function getInbox()
- {
- return $this->container['inbox'];
- }
-
- /**
- * Sets inbox
- *
- * @param \Brevo\Client\Model\SubAccountDetailsResponsePlanInfoFeaturesInbox $inbox inbox
- *
- * @return $this
- */
- public function setInbox($inbox)
- {
- $this->container['inbox'] = $inbox;
-
- return $this;
- }
-
- /**
- * Gets landingPage
- *
- * @return \Brevo\Client\Model\SubAccountDetailsResponsePlanInfoFeaturesLandingPage
- */
- public function getLandingPage()
- {
- return $this->container['landingPage'];
- }
-
- /**
- * Sets landingPage
- *
- * @param \Brevo\Client\Model\SubAccountDetailsResponsePlanInfoFeaturesLandingPage $landingPage landingPage
- *
- * @return $this
- */
- public function setLandingPage($landingPage)
- {
- $this->container['landingPage'] = $landingPage;
-
- return $this;
- }
-
- /**
- * Gets users
- *
- * @return \Brevo\Client\Model\SubAccountDetailsResponsePlanInfoFeaturesUsers
- */
- public function getUsers()
- {
- return $this->container['users'];
- }
-
- /**
- * Sets users
- *
- * @param \Brevo\Client\Model\SubAccountDetailsResponsePlanInfoFeaturesUsers $users users
- *
- * @return $this
- */
- public function setUsers($users)
- {
- $this->container['users'] = $users;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SubAccountDetailsResponsePlanInfoFeaturesInbox.php b/lib/Model/SubAccountDetailsResponsePlanInfoFeaturesInbox.php
deleted file mode 100644
index 76e2f65..0000000
--- a/lib/Model/SubAccountDetailsResponsePlanInfoFeaturesInbox.php
+++ /dev/null
@@ -1,336 +0,0 @@
- 'int',
- 'remaining' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'quantity' => 'int64',
- 'remaining' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'quantity' => 'quantity',
- 'remaining' => 'remaining'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'quantity' => 'setQuantity',
- 'remaining' => 'setRemaining'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'quantity' => 'getQuantity',
- 'remaining' => 'getRemaining'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null;
- $this->container['remaining'] = isset($data['remaining']) ? $data['remaining'] : null;
- }
-
- /**
- * 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 quantity
- *
- * @return int
- */
- public function getQuantity()
- {
- return $this->container['quantity'];
- }
-
- /**
- * Sets quantity
- *
- * @param int $quantity Quantity of inbox provided
- *
- * @return $this
- */
- public function setQuantity($quantity)
- {
- $this->container['quantity'] = $quantity;
-
- return $this;
- }
-
- /**
- * Gets remaining
- *
- * @return int
- */
- public function getRemaining()
- {
- return $this->container['remaining'];
- }
-
- /**
- * Sets remaining
- *
- * @param int $remaining Available inboxes for use
- *
- * @return $this
- */
- public function setRemaining($remaining)
- {
- $this->container['remaining'] = $remaining;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SubAccountDetailsResponsePlanInfoFeaturesLandingPage.php b/lib/Model/SubAccountDetailsResponsePlanInfoFeaturesLandingPage.php
deleted file mode 100644
index 3bce42d..0000000
--- a/lib/Model/SubAccountDetailsResponsePlanInfoFeaturesLandingPage.php
+++ /dev/null
@@ -1,336 +0,0 @@
- 'int',
- 'remaining' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'quantity' => 'int64',
- 'remaining' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'quantity' => 'quantity',
- 'remaining' => 'remaining'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'quantity' => 'setQuantity',
- 'remaining' => 'setRemaining'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'quantity' => 'getQuantity',
- 'remaining' => 'getRemaining'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null;
- $this->container['remaining'] = isset($data['remaining']) ? $data['remaining'] : null;
- }
-
- /**
- * 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 quantity
- *
- * @return int
- */
- public function getQuantity()
- {
- return $this->container['quantity'];
- }
-
- /**
- * Sets quantity
- *
- * @param int $quantity Quantity of landing pages provided
- *
- * @return $this
- */
- public function setQuantity($quantity)
- {
- $this->container['quantity'] = $quantity;
-
- return $this;
- }
-
- /**
- * Gets remaining
- *
- * @return int
- */
- public function getRemaining()
- {
- return $this->container['remaining'];
- }
-
- /**
- * Sets remaining
- *
- * @param int $remaining Available landing pages for use
- *
- * @return $this
- */
- public function setRemaining($remaining)
- {
- $this->container['remaining'] = $remaining;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SubAccountDetailsResponsePlanInfoFeaturesUsers.php b/lib/Model/SubAccountDetailsResponsePlanInfoFeaturesUsers.php
deleted file mode 100644
index 3700796..0000000
--- a/lib/Model/SubAccountDetailsResponsePlanInfoFeaturesUsers.php
+++ /dev/null
@@ -1,336 +0,0 @@
- 'int',
- 'remaining' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'quantity' => 'int64',
- 'remaining' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'quantity' => 'quantity',
- 'remaining' => 'remaining'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'quantity' => 'setQuantity',
- 'remaining' => 'setRemaining'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'quantity' => 'getQuantity',
- 'remaining' => 'getRemaining'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null;
- $this->container['remaining'] = isset($data['remaining']) ? $data['remaining'] : null;
- }
-
- /**
- * 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 quantity
- *
- * @return int
- */
- public function getQuantity()
- {
- return $this->container['quantity'];
- }
-
- /**
- * Sets quantity
- *
- * @param int $quantity Quantity of multi-account's provided
- *
- * @return $this
- */
- public function setQuantity($quantity)
- {
- $this->container['quantity'] = $quantity;
-
- return $this;
- }
-
- /**
- * Gets remaining
- *
- * @return int
- */
- public function getRemaining()
- {
- return $this->container['remaining'];
- }
-
- /**
- * Sets remaining
- *
- * @param int $remaining Available multi-accounts for use
- *
- * @return $this
- */
- public function setRemaining($remaining)
- {
- $this->container['remaining'] = $remaining;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SubAccountUpdatePlanRequest.php b/lib/Model/SubAccountUpdatePlanRequest.php
deleted file mode 100644
index 385a1f0..0000000
--- a/lib/Model/SubAccountUpdatePlanRequest.php
+++ /dev/null
@@ -1,336 +0,0 @@
- '\Brevo\Client\Model\SubAccountUpdatePlanRequestCredits',
- 'features' => '\Brevo\Client\Model\SubAccountUpdatePlanRequestFeatures'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'credits' => null,
- 'features' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'credits' => 'credits',
- 'features' => 'features'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'credits' => 'setCredits',
- 'features' => 'setFeatures'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'credits' => 'getCredits',
- 'features' => 'getFeatures'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['credits'] = isset($data['credits']) ? $data['credits'] : null;
- $this->container['features'] = isset($data['features']) ? $data['features'] : null;
- }
-
- /**
- * 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 credits
- *
- * @return \Brevo\Client\Model\SubAccountUpdatePlanRequestCredits
- */
- public function getCredits()
- {
- return $this->container['credits'];
- }
-
- /**
- * Sets credits
- *
- * @param \Brevo\Client\Model\SubAccountUpdatePlanRequestCredits $credits credits
- *
- * @return $this
- */
- public function setCredits($credits)
- {
- $this->container['credits'] = $credits;
-
- return $this;
- }
-
- /**
- * Gets features
- *
- * @return \Brevo\Client\Model\SubAccountUpdatePlanRequestFeatures
- */
- public function getFeatures()
- {
- return $this->container['features'];
- }
-
- /**
- * Sets features
- *
- * @param \Brevo\Client\Model\SubAccountUpdatePlanRequestFeatures $features features
- *
- * @return $this
- */
- public function setFeatures($features)
- {
- $this->container['features'] = $features;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SubAccountUpdatePlanRequestCredits.php b/lib/Model/SubAccountUpdatePlanRequestCredits.php
deleted file mode 100644
index c116f68..0000000
--- a/lib/Model/SubAccountUpdatePlanRequestCredits.php
+++ /dev/null
@@ -1,306 +0,0 @@
- 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'email' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'email' => 'email'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'email' => 'setEmail'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'email' => 'getEmail'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- }
-
- /**
- * 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 email
- *
- * @return int
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param int $email Number of email credits
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SubAccountUpdatePlanRequestFeatures.php b/lib/Model/SubAccountUpdatePlanRequestFeatures.php
deleted file mode 100644
index d0d20fb..0000000
--- a/lib/Model/SubAccountUpdatePlanRequestFeatures.php
+++ /dev/null
@@ -1,366 +0,0 @@
- 'int',
- 'landingPage' => 'int',
- 'inbox' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'users' => 'int64',
- 'landingPage' => 'int64',
- 'inbox' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'users' => 'users',
- 'landingPage' => 'landingPage',
- 'inbox' => 'inbox'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'users' => 'setUsers',
- 'landingPage' => 'setLandingPage',
- 'inbox' => 'setInbox'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'users' => 'getUsers',
- 'landingPage' => 'getLandingPage',
- 'inbox' => 'getInbox'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['users'] = isset($data['users']) ? $data['users'] : null;
- $this->container['landingPage'] = isset($data['landingPage']) ? $data['landingPage'] : null;
- $this->container['inbox'] = isset($data['inbox']) ? $data['inbox'] : null;
- }
-
- /**
- * 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 users
- *
- * @return int
- */
- public function getUsers()
- {
- return $this->container['users'];
- }
-
- /**
- * Sets users
- *
- * @param int $users Number of multi-users
- *
- * @return $this
- */
- public function setUsers($users)
- {
- $this->container['users'] = $users;
-
- return $this;
- }
-
- /**
- * Gets landingPage
- *
- * @return int
- */
- public function getLandingPage()
- {
- return $this->container['landingPage'];
- }
-
- /**
- * Sets landingPage
- *
- * @param int $landingPage Number of landing pages / Not required on ENTv2
- *
- * @return $this
- */
- public function setLandingPage($landingPage)
- {
- $this->container['landingPage'] = $landingPage;
-
- return $this;
- }
-
- /**
- * Gets inbox
- *
- * @return int
- */
- public function getInbox()
- {
- return $this->container['inbox'];
- }
-
- /**
- * Sets inbox
- *
- * @param int $inbox Number of inboxes / Not required on ENTv2
- *
- * @return $this
- */
- public function setInbox($inbox)
- {
- $this->container['inbox'] = $inbox;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SubAccountsResponse.php b/lib/Model/SubAccountsResponse.php
deleted file mode 100644
index 6f6e088..0000000
--- a/lib/Model/SubAccountsResponse.php
+++ /dev/null
@@ -1,335 +0,0 @@
- 'int',
- 'subAccounts' => '\Brevo\Client\Model\SubAccountsResponseSubAccounts[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'count' => null,
- 'subAccounts' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'count' => 'count',
- 'subAccounts' => 'subAccounts'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'count' => 'setCount',
- 'subAccounts' => 'setSubAccounts'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'count' => 'getCount',
- 'subAccounts' => 'getSubAccounts'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['count'] = isset($data['count']) ? $data['count'] : null;
- $this->container['subAccounts'] = isset($data['subAccounts']) ? $data['subAccounts'] : null;
- }
-
- /**
- * 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 count
- *
- * @return int
- */
- public function getCount()
- {
- return $this->container['count'];
- }
-
- /**
- * Sets count
- *
- * @param int $count Total number of subaccounts
- *
- * @return $this
- */
- public function setCount($count)
- {
- $this->container['count'] = $count;
-
- return $this;
- }
-
- /**
- * Gets subAccounts
- *
- * @return \Brevo\Client\Model\SubAccountsResponseSubAccounts[]
- */
- public function getSubAccounts()
- {
- return $this->container['subAccounts'];
- }
-
- /**
- * Sets subAccounts
- *
- * @param \Brevo\Client\Model\SubAccountsResponseSubAccounts[] $subAccounts subAccounts
- *
- * @return $this
- */
- public function setSubAccounts($subAccounts)
- {
- $this->container['subAccounts'] = $subAccounts;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/SubAccountsResponseSubAccounts.php b/lib/Model/SubAccountsResponseSubAccounts.php
deleted file mode 100644
index 1641dfa..0000000
--- a/lib/Model/SubAccountsResponseSubAccounts.php
+++ /dev/null
@@ -1,407 +0,0 @@
- 'int',
- 'companyName' => 'string',
- 'active' => 'bool',
- 'createdAt' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => 'int64',
- 'companyName' => null,
- 'active' => null,
- 'createdAt' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'companyName' => 'companyName',
- 'active' => 'active',
- 'createdAt' => 'createdAt'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'companyName' => 'setCompanyName',
- 'active' => 'setActive',
- 'createdAt' => 'setCreatedAt'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'companyName' => 'getCompanyName',
- 'active' => 'getActive',
- 'createdAt' => 'getCreatedAt'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['companyName'] = isset($data['companyName']) ? $data['companyName'] : null;
- $this->container['active'] = isset($data['active']) ? $data['active'] : null;
- $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null;
- }
-
- /**
- * 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['companyName'] === null) {
- $invalidProperties[] = "'companyName' can't be null";
- }
- if ($this->container['active'] === null) {
- $invalidProperties[] = "'active' can't be null";
- }
- if ($this->container['createdAt'] === null) {
- $invalidProperties[] = "'createdAt' 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 int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id id of the sub-account
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets companyName
- *
- * @return string
- */
- public function getCompanyName()
- {
- return $this->container['companyName'];
- }
-
- /**
- * Sets companyName
- *
- * @param string $companyName Name of the sub-account company
- *
- * @return $this
- */
- public function setCompanyName($companyName)
- {
- $this->container['companyName'] = $companyName;
-
- return $this;
- }
-
- /**
- * Gets active
- *
- * @return bool
- */
- public function getActive()
- {
- return $this->container['active'];
- }
-
- /**
- * Sets active
- *
- * @param bool $active Whether the sub-account is active or not
- *
- * @return $this
- */
- public function setActive($active)
- {
- $this->container['active'] = $active;
-
- return $this;
- }
-
- /**
- * Gets createdAt
- *
- * @return int
- */
- public function getCreatedAt()
- {
- return $this->container['createdAt'];
- }
-
- /**
- * Sets createdAt
- *
- * @param int $createdAt Timestamp when the sub-account was created
- *
- * @return $this
- */
- public function setCreatedAt($createdAt)
- {
- $this->container['createdAt'] = $createdAt;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/Task.php b/lib/Model/Task.php
deleted file mode 100644
index 08d27b3..0000000
--- a/lib/Model/Task.php
+++ /dev/null
@@ -1,462 +0,0 @@
- 'string',
- 'taskTypeId' => 'string',
- 'name' => 'string',
- 'contactsIds' => 'int[]',
- 'dealsIds' => 'string[]',
- 'companiesIds' => 'string[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => null,
- 'taskTypeId' => null,
- 'name' => null,
- 'contactsIds' => null,
- 'dealsIds' => null,
- 'companiesIds' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'taskTypeId' => 'taskTypeId',
- 'name' => 'name',
- 'contactsIds' => 'contactsIds',
- 'dealsIds' => 'dealsIds',
- 'companiesIds' => 'companiesIds'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'taskTypeId' => 'setTaskTypeId',
- 'name' => 'setName',
- 'contactsIds' => 'setContactsIds',
- 'dealsIds' => 'setDealsIds',
- 'companiesIds' => 'setCompaniesIds'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'taskTypeId' => 'getTaskTypeId',
- 'name' => 'getName',
- 'contactsIds' => 'getContactsIds',
- 'dealsIds' => 'getDealsIds',
- 'companiesIds' => 'getCompaniesIds'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['taskTypeId'] = isset($data['taskTypeId']) ? $data['taskTypeId'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['contactsIds'] = isset($data['contactsIds']) ? $data['contactsIds'] : null;
- $this->container['dealsIds'] = isset($data['dealsIds']) ? $data['dealsIds'] : null;
- $this->container['companiesIds'] = isset($data['companiesIds']) ? $data['companiesIds'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['taskTypeId'] === null) {
- $invalidProperties[] = "'taskTypeId' can't be null";
- }
- if ($this->container['name'] === null) {
- $invalidProperties[] = "'name' 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 Unique task id
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets taskTypeId
- *
- * @return string
- */
- public function getTaskTypeId()
- {
- return $this->container['taskTypeId'];
- }
-
- /**
- * Sets taskTypeId
- *
- * @param string $taskTypeId Id for type of task e.g Call / Email / Meeting etc.
- *
- * @return $this
- */
- public function setTaskTypeId($taskTypeId)
- {
- $this->container['taskTypeId'] = $taskTypeId;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of task
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets contactsIds
- *
- * @return int[]
- */
- public function getContactsIds()
- {
- return $this->container['contactsIds'];
- }
-
- /**
- * Sets contactsIds
- *
- * @param int[] $contactsIds Contact ids for contacts linked to this task
- *
- * @return $this
- */
- public function setContactsIds($contactsIds)
- {
- $this->container['contactsIds'] = $contactsIds;
-
- return $this;
- }
-
- /**
- * Gets dealsIds
- *
- * @return string[]
- */
- public function getDealsIds()
- {
- return $this->container['dealsIds'];
- }
-
- /**
- * Sets dealsIds
- *
- * @param string[] $dealsIds Deal ids for deals a task is linked to
- *
- * @return $this
- */
- public function setDealsIds($dealsIds)
- {
- $this->container['dealsIds'] = $dealsIds;
-
- return $this;
- }
-
- /**
- * Gets companiesIds
- *
- * @return string[]
- */
- public function getCompaniesIds()
- {
- return $this->container['companiesIds'];
- }
-
- /**
- * Sets companiesIds
- *
- * @param string[] $companiesIds Companies ids for companies a task is linked to
- *
- * @return $this
- */
- public function setCompaniesIds($companiesIds)
- {
- $this->container['companiesIds'] = $companiesIds;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/TaskList.php b/lib/Model/TaskList.php
deleted file mode 100644
index 51115b6..0000000
--- a/lib/Model/TaskList.php
+++ /dev/null
@@ -1,306 +0,0 @@
- '\Brevo\Client\Model\Task[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'items' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'items' => 'items'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'items' => 'setItems'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'items' => 'getItems'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['items'] = isset($data['items']) ? $data['items'] : null;
- }
-
- /**
- * 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 items
- *
- * @return \Brevo\Client\Model\Task[]
- */
- public function getItems()
- {
- return $this->container['items'];
- }
-
- /**
- * Sets items
- *
- * @param \Brevo\Client\Model\Task[] $items List of tasks
- *
- * @return $this
- */
- public function setItems($items)
- {
- $this->container['items'] = $items;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/TaskReminder.php b/lib/Model/TaskReminder.php
deleted file mode 100644
index fb84ad0..0000000
--- a/lib/Model/TaskReminder.php
+++ /dev/null
@@ -1,411 +0,0 @@
- 'int',
- 'unit' => 'string',
- 'types' => 'string[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'value' => null,
- 'unit' => null,
- 'types' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'value' => 'value',
- 'unit' => 'unit',
- 'types' => 'types'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'value' => 'setValue',
- 'unit' => 'setUnit',
- 'types' => 'setTypes'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'value' => 'getValue',
- 'unit' => 'getUnit',
- 'types' => 'getTypes'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const UNIT_MINUTES = 'minutes';
- const UNIT_HOURS = 'hours';
- const UNIT_WEEKS = 'weeks';
- const UNIT_DAYS = 'days';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getUnitAllowableValues()
- {
- return [
- self::UNIT_MINUTES,
- self::UNIT_HOURS,
- self::UNIT_WEEKS,
- self::UNIT_DAYS,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['value'] = isset($data['value']) ? $data['value'] : null;
- $this->container['unit'] = isset($data['unit']) ? $data['unit'] : null;
- $this->container['types'] = isset($data['types']) ? $data['types'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['value'] === null) {
- $invalidProperties[] = "'value' can't be null";
- }
- if ($this->container['unit'] === null) {
- $invalidProperties[] = "'unit' can't be null";
- }
- $allowedValues = $this->getUnitAllowableValues();
- if (!is_null($this->container['unit']) && !in_array($this->container['unit'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'unit', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- if ($this->container['types'] === null) {
- $invalidProperties[] = "'types' 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 value
- *
- * @return int
- */
- public function getValue()
- {
- return $this->container['value'];
- }
-
- /**
- * Sets value
- *
- * @param int $value Value of time unit before reminder is to be sent
- *
- * @return $this
- */
- public function setValue($value)
- {
- $this->container['value'] = $value;
-
- return $this;
- }
-
- /**
- * Gets unit
- *
- * @return string
- */
- public function getUnit()
- {
- return $this->container['unit'];
- }
-
- /**
- * Sets unit
- *
- * @param string $unit Unit of time before reminder is to be sent
- *
- * @return $this
- */
- public function setUnit($unit)
- {
- $allowedValues = $this->getUnitAllowableValues();
- if (!in_array($unit, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'unit', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['unit'] = $unit;
-
- return $this;
- }
-
- /**
- * Gets types
- *
- * @return string[]
- */
- public function getTypes()
- {
- return $this->container['types'];
- }
-
- /**
- * Sets types
- *
- * @param string[] $types Type of task reminder e.g email, push
- *
- * @return $this
- */
- public function setTypes($types)
- {
- $this->container['types'] = $types;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/TaskTypes.php b/lib/Model/TaskTypes.php
deleted file mode 100644
index 305351e..0000000
--- a/lib/Model/TaskTypes.php
+++ /dev/null
@@ -1,336 +0,0 @@
- 'string',
- 'title' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'id' => null,
- 'title' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'id' => 'id',
- 'title' => 'title'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'id' => 'setId',
- 'title' => 'setTitle'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'id' => 'getId',
- 'title' => 'getTitle'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['title'] = isset($data['title']) ? $data['title'] : null;
- }
-
- /**
- * 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 id
- *
- * @return string
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param string $id Id of task type
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets title
- *
- * @return string
- */
- public function getTitle()
- {
- return $this->container['title'];
- }
-
- /**
- * Sets title
- *
- * @param string $title Title of task type
- *
- * @return $this
- */
- public function setTitle($title)
- {
- $this->container['title'] = $title;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/UpdateAttribute.php b/lib/Model/UpdateAttribute.php
deleted file mode 100644
index d286e99..0000000
--- a/lib/Model/UpdateAttribute.php
+++ /dev/null
@@ -1,335 +0,0 @@
- 'string',
- 'enumeration' => '\Brevo\Client\Model\UpdateAttributeEnumeration[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'value' => null,
- 'enumeration' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'value' => 'value',
- 'enumeration' => 'enumeration'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'value' => 'setValue',
- 'enumeration' => 'setEnumeration'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'value' => 'getValue',
- 'enumeration' => 'getEnumeration'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['value'] = isset($data['value']) ? $data['value'] : null;
- $this->container['enumeration'] = isset($data['enumeration']) ? $data['enumeration'] : null;
- }
-
- /**
- * 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 value
- *
- * @return string
- */
- public function getValue()
- {
- return $this->container['value'];
- }
-
- /**
- * Sets value
- *
- * @param string $value Value of the attribute to update. Use only if the attribute's category is 'calculated' or 'global'
- *
- * @return $this
- */
- public function setValue($value)
- {
- $this->container['value'] = $value;
-
- return $this;
- }
-
- /**
- * Gets enumeration
- *
- * @return \Brevo\Client\Model\UpdateAttributeEnumeration[]
- */
- public function getEnumeration()
- {
- return $this->container['enumeration'];
- }
-
- /**
- * Sets enumeration
- *
- * @param \Brevo\Client\Model\UpdateAttributeEnumeration[] $enumeration List of the values and labels that the attribute can take. Use only if the attribute's category is \"category\". For example, [{\"value\":1, \"label\":\"male\"}, {\"value\":2, \"label\":\"female\"}]
- *
- * @return $this
- */
- public function setEnumeration($enumeration)
- {
- $this->container['enumeration'] = $enumeration;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/UpdateAttributeEnumeration.php b/lib/Model/UpdateAttributeEnumeration.php
deleted file mode 100644
index 81d9b66..0000000
--- a/lib/Model/UpdateAttributeEnumeration.php
+++ /dev/null
@@ -1,341 +0,0 @@
- 'int',
- 'label' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'value' => null,
- 'label' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'value' => 'value',
- 'label' => 'label'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'value' => 'setValue',
- 'label' => 'setLabel'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'value' => 'getValue',
- 'label' => 'getLabel'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['value'] = isset($data['value']) ? $data['value'] : null;
- $this->container['label'] = isset($data['label']) ? $data['label'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['value'] === null) {
- $invalidProperties[] = "'value' can't be null";
- }
- if ($this->container['label'] === null) {
- $invalidProperties[] = "'label' 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 value
- *
- * @return int
- */
- public function getValue()
- {
- return $this->container['value'];
- }
-
- /**
- * Sets value
- *
- * @param int $value Id of the value
- *
- * @return $this
- */
- public function setValue($value)
- {
- $this->container['value'] = $value;
-
- return $this;
- }
-
- /**
- * Gets label
- *
- * @return string
- */
- public function getLabel()
- {
- return $this->container['label'];
- }
-
- /**
- * Sets label
- *
- * @param string $label Label of the value
- *
- * @return $this
- */
- public function setLabel($label)
- {
- $this->container['label'] = $label;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/UpdateBatchContacts.php b/lib/Model/UpdateBatchContacts.php
deleted file mode 100644
index f922dd7..0000000
--- a/lib/Model/UpdateBatchContacts.php
+++ /dev/null
@@ -1,305 +0,0 @@
- '\Brevo\Client\Model\UpdateBatchContactsContacts[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'contacts' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'contacts' => 'contacts'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'contacts' => 'setContacts'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'contacts' => 'getContacts'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['contacts'] = isset($data['contacts']) ? $data['contacts'] : null;
- }
-
- /**
- * 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 contacts
- *
- * @return \Brevo\Client\Model\UpdateBatchContactsContacts[]
- */
- public function getContacts()
- {
- return $this->container['contacts'];
- }
-
- /**
- * Sets contacts
- *
- * @param \Brevo\Client\Model\UpdateBatchContactsContacts[] $contacts List of contacts to be updated
- *
- * @return $this
- */
- public function setContacts($contacts)
- {
- $this->container['contacts'] = $contacts;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/UpdateBatchContactsContacts.php b/lib/Model/UpdateBatchContactsContacts.php
deleted file mode 100644
index 5de1c5c..0000000
--- a/lib/Model/UpdateBatchContactsContacts.php
+++ /dev/null
@@ -1,575 +0,0 @@
- 'string',
- 'id' => 'int',
- 'sms' => 'string',
- 'extId' => 'string',
- 'attributes' => 'map[string,object]',
- 'emailBlacklisted' => 'bool',
- 'smsBlacklisted' => 'bool',
- 'listIds' => 'int[]',
- 'unlinkListIds' => 'int[]',
- 'smtpBlacklistSender' => 'string[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'email' => 'email',
- 'id' => 'int64',
- 'sms' => null,
- 'extId' => null,
- 'attributes' => null,
- 'emailBlacklisted' => null,
- 'smsBlacklisted' => null,
- 'listIds' => 'int64',
- 'unlinkListIds' => 'int64',
- 'smtpBlacklistSender' => 'email'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'email' => 'email',
- 'id' => 'id',
- 'sms' => 'sms',
- 'extId' => 'ext_id',
- 'attributes' => 'attributes',
- 'emailBlacklisted' => 'emailBlacklisted',
- 'smsBlacklisted' => 'smsBlacklisted',
- 'listIds' => 'listIds',
- 'unlinkListIds' => 'unlinkListIds',
- 'smtpBlacklistSender' => 'smtpBlacklistSender'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'email' => 'setEmail',
- 'id' => 'setId',
- 'sms' => 'setSms',
- 'extId' => 'setExtId',
- 'attributes' => 'setAttributes',
- 'emailBlacklisted' => 'setEmailBlacklisted',
- 'smsBlacklisted' => 'setSmsBlacklisted',
- 'listIds' => 'setListIds',
- 'unlinkListIds' => 'setUnlinkListIds',
- 'smtpBlacklistSender' => 'setSmtpBlacklistSender'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'email' => 'getEmail',
- 'id' => 'getId',
- 'sms' => 'getSms',
- 'extId' => 'getExtId',
- 'attributes' => 'getAttributes',
- 'emailBlacklisted' => 'getEmailBlacklisted',
- 'smsBlacklisted' => 'getSmsBlacklisted',
- 'listIds' => 'getListIds',
- 'unlinkListIds' => 'getUnlinkListIds',
- 'smtpBlacklistSender' => 'getSmtpBlacklistSender'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- $this->container['sms'] = isset($data['sms']) ? $data['sms'] : null;
- $this->container['extId'] = isset($data['extId']) ? $data['extId'] : null;
- $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null;
- $this->container['emailBlacklisted'] = isset($data['emailBlacklisted']) ? $data['emailBlacklisted'] : null;
- $this->container['smsBlacklisted'] = isset($data['smsBlacklisted']) ? $data['smsBlacklisted'] : null;
- $this->container['listIds'] = isset($data['listIds']) ? $data['listIds'] : null;
- $this->container['unlinkListIds'] = isset($data['unlinkListIds']) ? $data['unlinkListIds'] : null;
- $this->container['smtpBlacklistSender'] = isset($data['smtpBlacklistSender']) ? $data['smtpBlacklistSender'] : null;
- }
-
- /**
- * 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 email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Email address of the user to be updated (For each operation only pass one of the supported contact identifiers. Email, id or sms)
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets id
- *
- * @return int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id id of the user to be updated (For each operation only pass one of the supported contact identifiers. Email, id or sms)
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
-
- /**
- * Gets sms
- *
- * @return string
- */
- public function getSms()
- {
- return $this->container['sms'];
- }
-
- /**
- * Sets sms
- *
- * @param string $sms SMS of the user to be updated (For each operation only pass one of the supported contact identifiers. Email, id or sms)
- *
- * @return $this
- */
- public function setSms($sms)
- {
- $this->container['sms'] = $sms;
-
- return $this;
- }
-
- /**
- * Gets extId
- *
- * @return string
- */
- public function getExtId()
- {
- return $this->container['extId'];
- }
-
- /**
- * Sets extId
- *
- * @param string $extId Pass your own Id to update ext_id of a contact.
- *
- * @return $this
- */
- public function setExtId($extId)
- {
- $this->container['extId'] = $extId;
-
- return $this;
- }
-
- /**
- * Gets attributes
- *
- * @return map[string,object]
- */
- public function getAttributes()
- {
- return $this->container['attributes'];
- }
-
- /**
- * Sets attributes
- *
- * @param map[string,object] $attributes Pass the set of attributes to be updated. **These attributes must be present in your account**. To update existing email address of a contact with the new one please pass EMAIL in attribtes. For example, **{ \"EMAIL\":\"newemail@domain.com\", \"FNAME\":\"Ellie\", \"LNAME\":\"Roger\"}**. Keep in mind transactional attributes can be updated the same way as normal attributes. Mobile Number in **SMS** field should be passed with proper country code. For example: **{\"SMS\":\"+91xxxxxxxxxx\"} or {\"SMS\":\"0091xxxxxxxxxx\"}**
- *
- * @return $this
- */
- public function setAttributes($attributes)
- {
- $this->container['attributes'] = $attributes;
-
- return $this;
- }
-
- /**
- * Gets emailBlacklisted
- *
- * @return bool
- */
- public function getEmailBlacklisted()
- {
- return $this->container['emailBlacklisted'];
- }
-
- /**
- * Sets emailBlacklisted
- *
- * @param bool $emailBlacklisted Set/unset this field to blacklist/allow the contact for emails (emailBlacklisted = true)
- *
- * @return $this
- */
- public function setEmailBlacklisted($emailBlacklisted)
- {
- $this->container['emailBlacklisted'] = $emailBlacklisted;
-
- return $this;
- }
-
- /**
- * Gets smsBlacklisted
- *
- * @return bool
- */
- public function getSmsBlacklisted()
- {
- return $this->container['smsBlacklisted'];
- }
-
- /**
- * Sets smsBlacklisted
- *
- * @param bool $smsBlacklisted Set/unset this field to blacklist/allow the contact for SMS (smsBlacklisted = true)
- *
- * @return $this
- */
- public function setSmsBlacklisted($smsBlacklisted)
- {
- $this->container['smsBlacklisted'] = $smsBlacklisted;
-
- return $this;
- }
-
- /**
- * Gets listIds
- *
- * @return int[]
- */
- public function getListIds()
- {
- return $this->container['listIds'];
- }
-
- /**
- * Sets listIds
- *
- * @param int[] $listIds Ids of the lists to add the contact to
- *
- * @return $this
- */
- public function setListIds($listIds)
- {
- $this->container['listIds'] = $listIds;
-
- return $this;
- }
-
- /**
- * Gets unlinkListIds
- *
- * @return int[]
- */
- public function getUnlinkListIds()
- {
- return $this->container['unlinkListIds'];
- }
-
- /**
- * Sets unlinkListIds
- *
- * @param int[] $unlinkListIds Ids of the lists to remove the contact from
- *
- * @return $this
- */
- public function setUnlinkListIds($unlinkListIds)
- {
- $this->container['unlinkListIds'] = $unlinkListIds;
-
- return $this;
- }
-
- /**
- * Gets smtpBlacklistSender
- *
- * @return string[]
- */
- public function getSmtpBlacklistSender()
- {
- return $this->container['smtpBlacklistSender'];
- }
-
- /**
- * Sets smtpBlacklistSender
- *
- * @param string[] $smtpBlacklistSender transactional email forbidden sender for contact. Use only for email Contact
- *
- * @return $this
- */
- public function setSmtpBlacklistSender($smtpBlacklistSender)
- {
- $this->container['smtpBlacklistSender'] = $smtpBlacklistSender;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/UpdateBatchContactsModel.php b/lib/Model/UpdateBatchContactsModel.php
deleted file mode 100644
index afe0a6d..0000000
--- a/lib/Model/UpdateBatchContactsModel.php
+++ /dev/null
@@ -1,335 +0,0 @@
- 'int[]',
- 'failureIds' => 'int[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'successIds' => 'int64',
- 'failureIds' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'successIds' => 'successIds',
- 'failureIds' => 'failureIds'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'successIds' => 'setSuccessIds',
- 'failureIds' => 'setFailureIds'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'successIds' => 'getSuccessIds',
- 'failureIds' => 'getFailureIds'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['successIds'] = isset($data['successIds']) ? $data['successIds'] : null;
- $this->container['failureIds'] = isset($data['failureIds']) ? $data['failureIds'] : null;
- }
-
- /**
- * 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 successIds
- *
- * @return int[]
- */
- public function getSuccessIds()
- {
- return $this->container['successIds'];
- }
-
- /**
- * Sets successIds
- *
- * @param int[] $successIds successIds
- *
- * @return $this
- */
- public function setSuccessIds($successIds)
- {
- $this->container['successIds'] = $successIds;
-
- return $this;
- }
-
- /**
- * Gets failureIds
- *
- * @return int[]
- */
- public function getFailureIds()
- {
- return $this->container['failureIds'];
- }
-
- /**
- * Sets failureIds
- *
- * @param int[] $failureIds failureIds
- *
- * @return $this
- */
- public function setFailureIds($failureIds)
- {
- $this->container['failureIds'] = $failureIds;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/UpdateCampaignStatus.php b/lib/Model/UpdateCampaignStatus.php
deleted file mode 100644
index 98aa902..0000000
--- a/lib/Model/UpdateCampaignStatus.php
+++ /dev/null
@@ -1,350 +0,0 @@
- 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'status' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'status' => 'status'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'status' => 'setStatus'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- '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::$swaggerModelName;
- }
-
- const STATUS_SUSPENDED = 'suspended';
- const STATUS_ARCHIVE = 'archive';
- const STATUS_DARCHIVE = 'darchive';
- const STATUS_SENT = 'sent';
- const STATUS_QUEUED = 'queued';
- const STATUS_REPLICATE = 'replicate';
- const STATUS_REPLICATE_TEMPLATE = 'replicateTemplate';
- const STATUS_DRAFT = 'draft';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getStatusAllowableValues()
- {
- return [
- self::STATUS_SUSPENDED,
- self::STATUS_ARCHIVE,
- self::STATUS_DARCHIVE,
- self::STATUS_SENT,
- self::STATUS_QUEUED,
- self::STATUS_REPLICATE,
- self::STATUS_REPLICATE_TEMPLATE,
- self::STATUS_DRAFT,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['status'] = isset($data['status']) ? $data['status'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- $allowedValues = $this->getStatusAllowableValues();
- if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'status', must be one of '%s'",
- 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 string
- */
- public function getStatus()
- {
- return $this->container['status'];
- }
-
- /**
- * Sets status
- *
- * @param string $status Note:- replicateTemplate status will be available only for template type campaigns.
- *
- * @return $this
- */
- public function setStatus($status)
- {
- $allowedValues = $this->getStatusAllowableValues();
- if (!is_null($status) && !in_array($status, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'status', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['status'] = $status;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/UpdateChild.php b/lib/Model/UpdateChild.php
deleted file mode 100644
index ddcb0d2..0000000
--- a/lib/Model/UpdateChild.php
+++ /dev/null
@@ -1,425 +0,0 @@
- 'string',
- 'firstName' => 'string',
- 'lastName' => 'string',
- 'companyName' => 'string',
- 'password' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'email' => 'email',
- 'firstName' => null,
- 'lastName' => null,
- 'companyName' => null,
- 'password' => 'password'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'email' => 'email',
- 'firstName' => 'firstName',
- 'lastName' => 'lastName',
- 'companyName' => 'companyName',
- 'password' => 'password'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'email' => 'setEmail',
- 'firstName' => 'setFirstName',
- 'lastName' => 'setLastName',
- 'companyName' => 'setCompanyName',
- 'password' => 'setPassword'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'email' => 'getEmail',
- 'firstName' => 'getFirstName',
- 'lastName' => 'getLastName',
- 'companyName' => 'getCompanyName',
- 'password' => 'getPassword'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['firstName'] = isset($data['firstName']) ? $data['firstName'] : null;
- $this->container['lastName'] = isset($data['lastName']) ? $data['lastName'] : null;
- $this->container['companyName'] = isset($data['companyName']) ? $data['companyName'] : null;
- $this->container['password'] = isset($data['password']) ? $data['password'] : null;
- }
-
- /**
- * 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 email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email New Email address to update the child account
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets firstName
- *
- * @return string
- */
- public function getFirstName()
- {
- return $this->container['firstName'];
- }
-
- /**
- * Sets firstName
- *
- * @param string $firstName New First name to use to update the child account
- *
- * @return $this
- */
- public function setFirstName($firstName)
- {
- $this->container['firstName'] = $firstName;
-
- return $this;
- }
-
- /**
- * Gets lastName
- *
- * @return string
- */
- public function getLastName()
- {
- return $this->container['lastName'];
- }
-
- /**
- * Sets lastName
- *
- * @param string $lastName New Last name to use to update the child account
- *
- * @return $this
- */
- public function setLastName($lastName)
- {
- $this->container['lastName'] = $lastName;
-
- return $this;
- }
-
- /**
- * Gets companyName
- *
- * @return string
- */
- public function getCompanyName()
- {
- return $this->container['companyName'];
- }
-
- /**
- * Sets companyName
- *
- * @param string $companyName New Company name to use to update the child account
- *
- * @return $this
- */
- public function setCompanyName($companyName)
- {
- $this->container['companyName'] = $companyName;
-
- return $this;
- }
-
- /**
- * Gets password
- *
- * @return string
- */
- public function getPassword()
- {
- return $this->container['password'];
- }
-
- /**
- * Sets password
- *
- * @param string $password New password for the child account to login
- *
- * @return $this
- */
- public function setPassword($password)
- {
- $this->container['password'] = $password;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/UpdateChildAccountStatus.php b/lib/Model/UpdateChildAccountStatus.php
deleted file mode 100644
index 6fc4ce2..0000000
--- a/lib/Model/UpdateChildAccountStatus.php
+++ /dev/null
@@ -1,395 +0,0 @@
- 'bool',
- 'transactionalSms' => 'bool',
- 'marketingAutomation' => 'bool',
- 'smsCampaign' => 'bool'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'transactionalEmail' => null,
- 'transactionalSms' => null,
- 'marketingAutomation' => null,
- 'smsCampaign' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'transactionalEmail' => 'transactionalEmail',
- 'transactionalSms' => 'transactionalSms',
- 'marketingAutomation' => 'marketingAutomation',
- 'smsCampaign' => 'smsCampaign'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'transactionalEmail' => 'setTransactionalEmail',
- 'transactionalSms' => 'setTransactionalSms',
- 'marketingAutomation' => 'setMarketingAutomation',
- 'smsCampaign' => 'setSmsCampaign'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'transactionalEmail' => 'getTransactionalEmail',
- 'transactionalSms' => 'getTransactionalSms',
- 'marketingAutomation' => 'getMarketingAutomation',
- 'smsCampaign' => 'getSmsCampaign'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['transactionalEmail'] = isset($data['transactionalEmail']) ? $data['transactionalEmail'] : null;
- $this->container['transactionalSms'] = isset($data['transactionalSms']) ? $data['transactionalSms'] : null;
- $this->container['marketingAutomation'] = isset($data['marketingAutomation']) ? $data['marketingAutomation'] : null;
- $this->container['smsCampaign'] = isset($data['smsCampaign']) ? $data['smsCampaign'] : null;
- }
-
- /**
- * 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 transactionalEmail
- *
- * @return bool
- */
- public function getTransactionalEmail()
- {
- return $this->container['transactionalEmail'];
- }
-
- /**
- * Sets transactionalEmail
- *
- * @param bool $transactionalEmail Status of Transactional Email Platform activation for your account (true=enabled, false=disabled)
- *
- * @return $this
- */
- public function setTransactionalEmail($transactionalEmail)
- {
- $this->container['transactionalEmail'] = $transactionalEmail;
-
- return $this;
- }
-
- /**
- * Gets transactionalSms
- *
- * @return bool
- */
- public function getTransactionalSms()
- {
- return $this->container['transactionalSms'];
- }
-
- /**
- * Sets transactionalSms
- *
- * @param bool $transactionalSms Status of Transactional SMS Platform activation for your account (true=enabled, false=disabled)
- *
- * @return $this
- */
- public function setTransactionalSms($transactionalSms)
- {
- $this->container['transactionalSms'] = $transactionalSms;
-
- return $this;
- }
-
- /**
- * Gets marketingAutomation
- *
- * @return bool
- */
- public function getMarketingAutomation()
- {
- return $this->container['marketingAutomation'];
- }
-
- /**
- * Sets marketingAutomation
- *
- * @param bool $marketingAutomation Status of Marketing Automation Platform activation for your account (true=enabled, false=disabled)
- *
- * @return $this
- */
- public function setMarketingAutomation($marketingAutomation)
- {
- $this->container['marketingAutomation'] = $marketingAutomation;
-
- return $this;
- }
-
- /**
- * Gets smsCampaign
- *
- * @return bool
- */
- public function getSmsCampaign()
- {
- return $this->container['smsCampaign'];
- }
-
- /**
- * Sets smsCampaign
- *
- * @param bool $smsCampaign Status of SMS Campaign Platform activation for your account (true=enabled, false=disabled)
- *
- * @return $this
- */
- public function setSmsCampaign($smsCampaign)
- {
- $this->container['smsCampaign'] = $smsCampaign;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/UpdateChildDomain.php b/lib/Model/UpdateChildDomain.php
deleted file mode 100644
index db4d98b..0000000
--- a/lib/Model/UpdateChildDomain.php
+++ /dev/null
@@ -1,305 +0,0 @@
- 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'domain' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'domain' => 'domain'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'domain' => 'setDomain'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'domain' => 'getDomain'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['domain'] = isset($data['domain']) ? $data['domain'] : null;
- }
-
- /**
- * 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 domain
- *
- * @return string
- */
- public function getDomain()
- {
- return $this->container['domain'];
- }
-
- /**
- * Sets domain
- *
- * @param string $domain Value for the sender domain that will replace the existing domain
- *
- * @return $this
- */
- public function setDomain($domain)
- {
- $this->container['domain'] = $domain;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/UpdateContact.php b/lib/Model/UpdateContact.php
deleted file mode 100644
index ff38522..0000000
--- a/lib/Model/UpdateContact.php
+++ /dev/null
@@ -1,485 +0,0 @@
- 'object',
- 'extId' => 'string',
- 'emailBlacklisted' => 'bool',
- 'smsBlacklisted' => 'bool',
- 'listIds' => 'int[]',
- 'unlinkListIds' => 'int[]',
- 'smtpBlacklistSender' => 'string[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'attributes' => null,
- 'extId' => null,
- 'emailBlacklisted' => null,
- 'smsBlacklisted' => null,
- 'listIds' => 'int64',
- 'unlinkListIds' => 'int64',
- 'smtpBlacklistSender' => 'email'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'attributes' => 'attributes',
- 'extId' => 'ext_id',
- 'emailBlacklisted' => 'emailBlacklisted',
- 'smsBlacklisted' => 'smsBlacklisted',
- 'listIds' => 'listIds',
- 'unlinkListIds' => 'unlinkListIds',
- 'smtpBlacklistSender' => 'smtpBlacklistSender'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'attributes' => 'setAttributes',
- 'extId' => 'setExtId',
- 'emailBlacklisted' => 'setEmailBlacklisted',
- 'smsBlacklisted' => 'setSmsBlacklisted',
- 'listIds' => 'setListIds',
- 'unlinkListIds' => 'setUnlinkListIds',
- 'smtpBlacklistSender' => 'setSmtpBlacklistSender'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'attributes' => 'getAttributes',
- 'extId' => 'getExtId',
- 'emailBlacklisted' => 'getEmailBlacklisted',
- 'smsBlacklisted' => 'getSmsBlacklisted',
- 'listIds' => 'getListIds',
- 'unlinkListIds' => 'getUnlinkListIds',
- 'smtpBlacklistSender' => 'getSmtpBlacklistSender'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null;
- $this->container['extId'] = isset($data['extId']) ? $data['extId'] : null;
- $this->container['emailBlacklisted'] = isset($data['emailBlacklisted']) ? $data['emailBlacklisted'] : null;
- $this->container['smsBlacklisted'] = isset($data['smsBlacklisted']) ? $data['smsBlacklisted'] : null;
- $this->container['listIds'] = isset($data['listIds']) ? $data['listIds'] : null;
- $this->container['unlinkListIds'] = isset($data['unlinkListIds']) ? $data['unlinkListIds'] : null;
- $this->container['smtpBlacklistSender'] = isset($data['smtpBlacklistSender']) ? $data['smtpBlacklistSender'] : null;
- }
-
- /**
- * 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 attributes
- *
- * @return object
- */
- public function getAttributes()
- {
- return $this->container['attributes'];
- }
-
- /**
- * Sets attributes
- *
- * @param object $attributes Pass the set of attributes to be updated. These attributes must be present in your account. Values that don't match the attribute type (e.g. text or string in a date attribute) will be ignored.To update existing email address of a contact with the new one please pass EMAIL in attributes. For example, `{ \"EMAIL\":\"newemail@domain.com\", \"FNAME\":\"Ellie\", \"LNAME\":\"Roger\"}`. The attribute's parameter should be passed in capital letter while updating a contact. Keep in mind transactional attributes can be updated the same way as normal attributes. Mobile Number in \"SMS\" field should be passed with proper country code. For example {\"SMS\":\"+91xxxxxxxxxx\"} or {\"SMS\":\"0091xxxxxxxxxx\"}
- *
- * @return $this
- */
- public function setAttributes($attributes)
- {
- $this->container['attributes'] = $attributes;
-
- return $this;
- }
-
- /**
- * Gets extId
- *
- * @return string
- */
- public function getExtId()
- {
- return $this->container['extId'];
- }
-
- /**
- * Sets extId
- *
- * @param string $extId Pass your own Id to update ext_id of a contact.
- *
- * @return $this
- */
- public function setExtId($extId)
- {
- $this->container['extId'] = $extId;
-
- return $this;
- }
-
- /**
- * Gets emailBlacklisted
- *
- * @return bool
- */
- public function getEmailBlacklisted()
- {
- return $this->container['emailBlacklisted'];
- }
-
- /**
- * Sets emailBlacklisted
- *
- * @param bool $emailBlacklisted Set/unset this field to blacklist/allow the contact for emails (emailBlacklisted = true)
- *
- * @return $this
- */
- public function setEmailBlacklisted($emailBlacklisted)
- {
- $this->container['emailBlacklisted'] = $emailBlacklisted;
-
- return $this;
- }
-
- /**
- * Gets smsBlacklisted
- *
- * @return bool
- */
- public function getSmsBlacklisted()
- {
- return $this->container['smsBlacklisted'];
- }
-
- /**
- * Sets smsBlacklisted
- *
- * @param bool $smsBlacklisted Set/unset this field to blacklist/allow the contact for SMS (smsBlacklisted = true)
- *
- * @return $this
- */
- public function setSmsBlacklisted($smsBlacklisted)
- {
- $this->container['smsBlacklisted'] = $smsBlacklisted;
-
- return $this;
- }
-
- /**
- * Gets listIds
- *
- * @return int[]
- */
- public function getListIds()
- {
- return $this->container['listIds'];
- }
-
- /**
- * Sets listIds
- *
- * @param int[] $listIds Ids of the lists to add the contact to
- *
- * @return $this
- */
- public function setListIds($listIds)
- {
- $this->container['listIds'] = $listIds;
-
- return $this;
- }
-
- /**
- * Gets unlinkListIds
- *
- * @return int[]
- */
- public function getUnlinkListIds()
- {
- return $this->container['unlinkListIds'];
- }
-
- /**
- * Sets unlinkListIds
- *
- * @param int[] $unlinkListIds Ids of the lists to remove the contact from
- *
- * @return $this
- */
- public function setUnlinkListIds($unlinkListIds)
- {
- $this->container['unlinkListIds'] = $unlinkListIds;
-
- return $this;
- }
-
- /**
- * Gets smtpBlacklistSender
- *
- * @return string[]
- */
- public function getSmtpBlacklistSender()
- {
- return $this->container['smtpBlacklistSender'];
- }
-
- /**
- * Sets smtpBlacklistSender
- *
- * @param string[] $smtpBlacklistSender transactional email forbidden sender for contact. Use only for email Contact
- *
- * @return $this
- */
- public function setSmtpBlacklistSender($smtpBlacklistSender)
- {
- $this->container['smtpBlacklistSender'] = $smtpBlacklistSender;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/UpdateCouponCollection.php b/lib/Model/UpdateCouponCollection.php
deleted file mode 100644
index fe6b87c..0000000
--- a/lib/Model/UpdateCouponCollection.php
+++ /dev/null
@@ -1,308 +0,0 @@
- 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'defaultCoupon' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'defaultCoupon' => 'defaultCoupon'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'defaultCoupon' => 'setDefaultCoupon'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'defaultCoupon' => 'getDefaultCoupon'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['defaultCoupon'] = isset($data['defaultCoupon']) ? $data['defaultCoupon'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['defaultCoupon'] === null) {
- $invalidProperties[] = "'defaultCoupon' 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 defaultCoupon
- *
- * @return string
- */
- public function getDefaultCoupon()
- {
- return $this->container['defaultCoupon'];
- }
-
- /**
- * Sets defaultCoupon
- *
- * @param string $defaultCoupon A default coupon to be used in case there are no coupons left
- *
- * @return $this
- */
- public function setDefaultCoupon($defaultCoupon)
- {
- $this->container['defaultCoupon'] = $defaultCoupon;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/UpdateEmailCampaign.php b/lib/Model/UpdateEmailCampaign.php
deleted file mode 100644
index 0fc74b8..0000000
--- a/lib/Model/UpdateEmailCampaign.php
+++ /dev/null
@@ -1,1285 +0,0 @@
- 'string',
- 'sender' => '\Brevo\Client\Model\UpdateEmailCampaignSender',
- 'name' => 'string',
- 'htmlContent' => 'string',
- 'htmlUrl' => 'string',
- 'scheduledAt' => 'string',
- 'subject' => 'string',
- 'previewText' => 'string',
- 'replyTo' => 'string',
- 'toField' => 'string',
- 'recipients' => '\Brevo\Client\Model\UpdateEmailCampaignRecipients',
- 'attachmentUrl' => 'string',
- 'inlineImageActivation' => 'bool',
- 'mirrorActive' => 'bool',
- 'recurring' => 'bool',
- 'footer' => 'string',
- 'header' => 'string',
- 'utmCampaign' => 'string',
- 'params' => 'object',
- 'sendAtBestTime' => 'bool',
- 'abTesting' => 'bool',
- 'subjectA' => 'string',
- 'subjectB' => 'string',
- 'splitRule' => 'int',
- 'winnerCriteria' => 'string',
- 'winnerDelay' => 'int',
- 'ipWarmupEnable' => 'bool',
- 'initialQuota' => 'int',
- 'increaseRate' => 'int',
- 'unsubscriptionPageId' => 'string',
- 'updateFormId' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'tag' => null,
- 'sender' => null,
- 'name' => null,
- 'htmlContent' => null,
- 'htmlUrl' => 'url',
- 'scheduledAt' => null,
- 'subject' => null,
- 'previewText' => null,
- 'replyTo' => 'email',
- 'toField' => null,
- 'recipients' => null,
- 'attachmentUrl' => 'url',
- 'inlineImageActivation' => null,
- 'mirrorActive' => null,
- 'recurring' => null,
- 'footer' => null,
- 'header' => null,
- 'utmCampaign' => null,
- 'params' => null,
- 'sendAtBestTime' => null,
- 'abTesting' => null,
- 'subjectA' => null,
- 'subjectB' => null,
- 'splitRule' => 'int64',
- 'winnerCriteria' => null,
- 'winnerDelay' => 'int64',
- 'ipWarmupEnable' => null,
- 'initialQuota' => 'int64',
- 'increaseRate' => 'int64',
- 'unsubscriptionPageId' => null,
- 'updateFormId' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'tag' => 'tag',
- 'sender' => 'sender',
- 'name' => 'name',
- 'htmlContent' => 'htmlContent',
- 'htmlUrl' => 'htmlUrl',
- 'scheduledAt' => 'scheduledAt',
- 'subject' => 'subject',
- 'previewText' => 'previewText',
- 'replyTo' => 'replyTo',
- 'toField' => 'toField',
- 'recipients' => 'recipients',
- 'attachmentUrl' => 'attachmentUrl',
- 'inlineImageActivation' => 'inlineImageActivation',
- 'mirrorActive' => 'mirrorActive',
- 'recurring' => 'recurring',
- 'footer' => 'footer',
- 'header' => 'header',
- 'utmCampaign' => 'utmCampaign',
- 'params' => 'params',
- 'sendAtBestTime' => 'sendAtBestTime',
- 'abTesting' => 'abTesting',
- 'subjectA' => 'subjectA',
- 'subjectB' => 'subjectB',
- 'splitRule' => 'splitRule',
- 'winnerCriteria' => 'winnerCriteria',
- 'winnerDelay' => 'winnerDelay',
- 'ipWarmupEnable' => 'ipWarmupEnable',
- 'initialQuota' => 'initialQuota',
- 'increaseRate' => 'increaseRate',
- 'unsubscriptionPageId' => 'unsubscriptionPageId',
- 'updateFormId' => 'updateFormId'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'tag' => 'setTag',
- 'sender' => 'setSender',
- 'name' => 'setName',
- 'htmlContent' => 'setHtmlContent',
- 'htmlUrl' => 'setHtmlUrl',
- 'scheduledAt' => 'setScheduledAt',
- 'subject' => 'setSubject',
- 'previewText' => 'setPreviewText',
- 'replyTo' => 'setReplyTo',
- 'toField' => 'setToField',
- 'recipients' => 'setRecipients',
- 'attachmentUrl' => 'setAttachmentUrl',
- 'inlineImageActivation' => 'setInlineImageActivation',
- 'mirrorActive' => 'setMirrorActive',
- 'recurring' => 'setRecurring',
- 'footer' => 'setFooter',
- 'header' => 'setHeader',
- 'utmCampaign' => 'setUtmCampaign',
- 'params' => 'setParams',
- 'sendAtBestTime' => 'setSendAtBestTime',
- 'abTesting' => 'setAbTesting',
- 'subjectA' => 'setSubjectA',
- 'subjectB' => 'setSubjectB',
- 'splitRule' => 'setSplitRule',
- 'winnerCriteria' => 'setWinnerCriteria',
- 'winnerDelay' => 'setWinnerDelay',
- 'ipWarmupEnable' => 'setIpWarmupEnable',
- 'initialQuota' => 'setInitialQuota',
- 'increaseRate' => 'setIncreaseRate',
- 'unsubscriptionPageId' => 'setUnsubscriptionPageId',
- 'updateFormId' => 'setUpdateFormId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'tag' => 'getTag',
- 'sender' => 'getSender',
- 'name' => 'getName',
- 'htmlContent' => 'getHtmlContent',
- 'htmlUrl' => 'getHtmlUrl',
- 'scheduledAt' => 'getScheduledAt',
- 'subject' => 'getSubject',
- 'previewText' => 'getPreviewText',
- 'replyTo' => 'getReplyTo',
- 'toField' => 'getToField',
- 'recipients' => 'getRecipients',
- 'attachmentUrl' => 'getAttachmentUrl',
- 'inlineImageActivation' => 'getInlineImageActivation',
- 'mirrorActive' => 'getMirrorActive',
- 'recurring' => 'getRecurring',
- 'footer' => 'getFooter',
- 'header' => 'getHeader',
- 'utmCampaign' => 'getUtmCampaign',
- 'params' => 'getParams',
- 'sendAtBestTime' => 'getSendAtBestTime',
- 'abTesting' => 'getAbTesting',
- 'subjectA' => 'getSubjectA',
- 'subjectB' => 'getSubjectB',
- 'splitRule' => 'getSplitRule',
- 'winnerCriteria' => 'getWinnerCriteria',
- 'winnerDelay' => 'getWinnerDelay',
- 'ipWarmupEnable' => 'getIpWarmupEnable',
- 'initialQuota' => 'getInitialQuota',
- 'increaseRate' => 'getIncreaseRate',
- 'unsubscriptionPageId' => 'getUnsubscriptionPageId',
- 'updateFormId' => 'getUpdateFormId'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const WINNER_CRITERIA_OPEN = 'open';
- const WINNER_CRITERIA_CLICK = 'click';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getWinnerCriteriaAllowableValues()
- {
- return [
- self::WINNER_CRITERIA_OPEN,
- self::WINNER_CRITERIA_CLICK,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null;
- $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['htmlContent'] = isset($data['htmlContent']) ? $data['htmlContent'] : null;
- $this->container['htmlUrl'] = isset($data['htmlUrl']) ? $data['htmlUrl'] : null;
- $this->container['scheduledAt'] = isset($data['scheduledAt']) ? $data['scheduledAt'] : null;
- $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null;
- $this->container['previewText'] = isset($data['previewText']) ? $data['previewText'] : null;
- $this->container['replyTo'] = isset($data['replyTo']) ? $data['replyTo'] : null;
- $this->container['toField'] = isset($data['toField']) ? $data['toField'] : null;
- $this->container['recipients'] = isset($data['recipients']) ? $data['recipients'] : null;
- $this->container['attachmentUrl'] = isset($data['attachmentUrl']) ? $data['attachmentUrl'] : null;
- $this->container['inlineImageActivation'] = isset($data['inlineImageActivation']) ? $data['inlineImageActivation'] : false;
- $this->container['mirrorActive'] = isset($data['mirrorActive']) ? $data['mirrorActive'] : null;
- $this->container['recurring'] = isset($data['recurring']) ? $data['recurring'] : false;
- $this->container['footer'] = isset($data['footer']) ? $data['footer'] : null;
- $this->container['header'] = isset($data['header']) ? $data['header'] : null;
- $this->container['utmCampaign'] = isset($data['utmCampaign']) ? $data['utmCampaign'] : null;
- $this->container['params'] = isset($data['params']) ? $data['params'] : null;
- $this->container['sendAtBestTime'] = isset($data['sendAtBestTime']) ? $data['sendAtBestTime'] : null;
- $this->container['abTesting'] = isset($data['abTesting']) ? $data['abTesting'] : false;
- $this->container['subjectA'] = isset($data['subjectA']) ? $data['subjectA'] : null;
- $this->container['subjectB'] = isset($data['subjectB']) ? $data['subjectB'] : null;
- $this->container['splitRule'] = isset($data['splitRule']) ? $data['splitRule'] : null;
- $this->container['winnerCriteria'] = isset($data['winnerCriteria']) ? $data['winnerCriteria'] : null;
- $this->container['winnerDelay'] = isset($data['winnerDelay']) ? $data['winnerDelay'] : null;
- $this->container['ipWarmupEnable'] = isset($data['ipWarmupEnable']) ? $data['ipWarmupEnable'] : false;
- $this->container['initialQuota'] = isset($data['initialQuota']) ? $data['initialQuota'] : null;
- $this->container['increaseRate'] = isset($data['increaseRate']) ? $data['increaseRate'] : null;
- $this->container['unsubscriptionPageId'] = isset($data['unsubscriptionPageId']) ? $data['unsubscriptionPageId'] : null;
- $this->container['updateFormId'] = isset($data['updateFormId']) ? $data['updateFormId'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if (!is_null($this->container['splitRule']) && ($this->container['splitRule'] > 50)) {
- $invalidProperties[] = "invalid value for 'splitRule', must be smaller than or equal to 50.";
- }
-
- if (!is_null($this->container['splitRule']) && ($this->container['splitRule'] < 1)) {
- $invalidProperties[] = "invalid value for 'splitRule', must be bigger than or equal to 1.";
- }
-
- $allowedValues = $this->getWinnerCriteriaAllowableValues();
- if (!is_null($this->container['winnerCriteria']) && !in_array($this->container['winnerCriteria'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'winnerCriteria', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- if (!is_null($this->container['winnerDelay']) && ($this->container['winnerDelay'] > 168)) {
- $invalidProperties[] = "invalid value for 'winnerDelay', must be smaller than or equal to 168.";
- }
-
- if (!is_null($this->container['winnerDelay']) && ($this->container['winnerDelay'] < 1)) {
- $invalidProperties[] = "invalid value for 'winnerDelay', must be bigger than or equal to 1.";
- }
-
- if (!is_null($this->container['increaseRate']) && ($this->container['increaseRate'] > 100)) {
- $invalidProperties[] = "invalid value for 'increaseRate', must be smaller than or equal to 100.";
- }
-
- if (!is_null($this->container['increaseRate']) && ($this->container['increaseRate'] < 0)) {
- $invalidProperties[] = "invalid value for 'increaseRate', must be bigger than or equal to 0.";
- }
-
- 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 tag
- *
- * @return string
- */
- public function getTag()
- {
- return $this->container['tag'];
- }
-
- /**
- * Sets tag
- *
- * @param string $tag Tag of the campaign
- *
- * @return $this
- */
- public function setTag($tag)
- {
- $this->container['tag'] = $tag;
-
- return $this;
- }
-
- /**
- * Gets sender
- *
- * @return \Brevo\Client\Model\UpdateEmailCampaignSender
- */
- public function getSender()
- {
- return $this->container['sender'];
- }
-
- /**
- * Sets sender
- *
- * @param \Brevo\Client\Model\UpdateEmailCampaignSender $sender sender
- *
- * @return $this
- */
- public function setSender($sender)
- {
- $this->container['sender'] = $sender;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the campaign
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets htmlContent
- *
- * @return string
- */
- public function getHtmlContent()
- {
- return $this->container['htmlContent'];
- }
-
- /**
- * Sets htmlContent
- *
- * @param string $htmlContent Body of the message (HTML version). If the campaign is designed using Drag & Drop editor via HTML content, then the design page will not have Drag & Drop editor access for that campaign. REQUIRED if htmlUrl is empty
- *
- * @return $this
- */
- public function setHtmlContent($htmlContent)
- {
- $this->container['htmlContent'] = $htmlContent;
-
- return $this;
- }
-
- /**
- * Gets htmlUrl
- *
- * @return string
- */
- public function getHtmlUrl()
- {
- return $this->container['htmlUrl'];
- }
-
- /**
- * Sets htmlUrl
- *
- * @param string $htmlUrl Url which contents the body of the email message. REQUIRED if htmlContent is empty
- *
- * @return $this
- */
- public function setHtmlUrl($htmlUrl)
- {
- $this->container['htmlUrl'] = $htmlUrl;
-
- return $this;
- }
-
- /**
- * Gets scheduledAt
- *
- * @return string
- */
- public function getScheduledAt()
- {
- return $this->container['scheduledAt'];
- }
-
- /**
- * Sets scheduledAt
- *
- * @param string $scheduledAt UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part).
- *
- * @return $this
- */
- public function setScheduledAt($scheduledAt)
- {
- $this->container['scheduledAt'] = $scheduledAt;
-
- return $this;
- }
-
- /**
- * Gets subject
- *
- * @return string
- */
- public function getSubject()
- {
- return $this->container['subject'];
- }
-
- /**
- * Sets subject
- *
- * @param string $subject Subject of the campaign
- *
- * @return $this
- */
- public function setSubject($subject)
- {
- $this->container['subject'] = $subject;
-
- return $this;
- }
-
- /**
- * Gets previewText
- *
- * @return string
- */
- public function getPreviewText()
- {
- return $this->container['previewText'];
- }
-
- /**
- * Sets previewText
- *
- * @param string $previewText Preview text or preheader of the email campaign
- *
- * @return $this
- */
- public function setPreviewText($previewText)
- {
- $this->container['previewText'] = $previewText;
-
- return $this;
- }
-
- /**
- * Gets replyTo
- *
- * @return string
- */
- public function getReplyTo()
- {
- return $this->container['replyTo'];
- }
-
- /**
- * Sets replyTo
- *
- * @param string $replyTo Email on which campaign recipients will be able to reply to
- *
- * @return $this
- */
- public function setReplyTo($replyTo)
- {
- $this->container['replyTo'] = $replyTo;
-
- return $this;
- }
-
- /**
- * Gets toField
- *
- * @return string
- */
- public function getToField()
- {
- return $this->container['toField'];
- }
-
- /**
- * Sets toField
- *
- * @param string $toField To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your Brevo account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization
- *
- * @return $this
- */
- public function setToField($toField)
- {
- $this->container['toField'] = $toField;
-
- return $this;
- }
-
- /**
- * Gets recipients
- *
- * @return \Brevo\Client\Model\UpdateEmailCampaignRecipients
- */
- public function getRecipients()
- {
- return $this->container['recipients'];
- }
-
- /**
- * Sets recipients
- *
- * @param \Brevo\Client\Model\UpdateEmailCampaignRecipients $recipients recipients
- *
- * @return $this
- */
- public function setRecipients($recipients)
- {
- $this->container['recipients'] = $recipients;
-
- return $this;
- }
-
- /**
- * Gets attachmentUrl
- *
- * @return string
- */
- public function getAttachmentUrl()
- {
- return $this->container['attachmentUrl'];
- }
-
- /**
- * Sets attachmentUrl
- *
- * @param string $attachmentUrl Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps
- *
- * @return $this
- */
- public function setAttachmentUrl($attachmentUrl)
- {
- $this->container['attachmentUrl'] = $attachmentUrl;
-
- return $this;
- }
-
- /**
- * Gets inlineImageActivation
- *
- * @return bool
- */
- public function getInlineImageActivation()
- {
- return $this->container['inlineImageActivation'];
- }
-
- /**
- * Sets inlineImageActivation
- *
- * @param bool $inlineImageActivation Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. You cannot send a campaign of more than 4MB with images embedded in the email. Campaigns with the images embedded in the email must be sent to less than 5000 contacts.
- *
- * @return $this
- */
- public function setInlineImageActivation($inlineImageActivation)
- {
- $this->container['inlineImageActivation'] = $inlineImageActivation;
-
- return $this;
- }
-
- /**
- * Gets mirrorActive
- *
- * @return bool
- */
- public function getMirrorActive()
- {
- return $this->container['mirrorActive'];
- }
-
- /**
- * Sets mirrorActive
- *
- * @param bool $mirrorActive Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign
- *
- * @return $this
- */
- public function setMirrorActive($mirrorActive)
- {
- $this->container['mirrorActive'] = $mirrorActive;
-
- return $this;
- }
-
- /**
- * Gets recurring
- *
- * @return bool
- */
- public function getRecurring()
- {
- return $this->container['recurring'];
- }
-
- /**
- * Sets recurring
- *
- * @param bool $recurring FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times
- *
- * @return $this
- */
- public function setRecurring($recurring)
- {
- $this->container['recurring'] = $recurring;
-
- return $this;
- }
-
- /**
- * Gets footer
- *
- * @return string
- */
- public function getFooter()
- {
- return $this->container['footer'];
- }
-
- /**
- * Sets footer
- *
- * @param string $footer Footer of the email campaign
- *
- * @return $this
- */
- public function setFooter($footer)
- {
- $this->container['footer'] = $footer;
-
- return $this;
- }
-
- /**
- * Gets header
- *
- * @return string
- */
- public function getHeader()
- {
- return $this->container['header'];
- }
-
- /**
- * Sets header
- *
- * @param string $header Header of the email campaign
- *
- * @return $this
- */
- public function setHeader($header)
- {
- $this->container['header'] = $header;
-
- return $this;
- }
-
- /**
- * Gets utmCampaign
- *
- * @return string
- */
- public function getUtmCampaign()
- {
- return $this->container['utmCampaign'];
- }
-
- /**
- * Sets utmCampaign
- *
- * @param string $utmCampaign Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed
- *
- * @return $this
- */
- public function setUtmCampaign($utmCampaign)
- {
- $this->container['utmCampaign'] = $utmCampaign;
-
- return $this;
- }
-
- /**
- * Gets params
- *
- * @return object
- */
- public function getParams()
- {
- return $this->container['params'];
- }
-
- /**
- * Sets params
- *
- * @param object $params Pass the set of attributes to customize the type 'classic' campaign. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. The 'params' field will get updated, only if the campaign is in New Template Language, else ignored. The New Template Language is dependent on the values of 'subject', 'htmlContent/htmlUrl', 'sender.name' & 'toField'
- *
- * @return $this
- */
- public function setParams($params)
- {
- $this->container['params'] = $params;
-
- return $this;
- }
-
- /**
- * Gets sendAtBestTime
- *
- * @return bool
- */
- public function getSendAtBestTime()
- {
- return $this->container['sendAtBestTime'];
- }
-
- /**
- * Sets sendAtBestTime
- *
- * @param bool $sendAtBestTime Set this to true if you want to send your campaign at best time. Note:- if true, warmup ip will be disabled.
- *
- * @return $this
- */
- public function setSendAtBestTime($sendAtBestTime)
- {
- $this->container['sendAtBestTime'] = $sendAtBestTime;
-
- return $this;
- }
-
- /**
- * Gets abTesting
- *
- * @return bool
- */
- public function getAbTesting()
- {
- return $this->container['abTesting'];
- }
-
- /**
- * Sets abTesting
- *
- * @param bool $abTesting Status of A/B Test. abTesting = false means it is disabled, & abTesting = true means it is enabled. 'subjectA', 'subjectB', 'splitRule', 'winnerCriteria' & 'winnerDelay' will be considered if abTesting is set to true. 'subject' if passed is ignored. Can be set to true only if 'sendAtBestTime' is 'false'. You will be able to set up two subject lines for your campaign and send them to a random sample of your total recipients. Half of the test group will receive version A, and the other half will receive version B
- *
- * @return $this
- */
- public function setAbTesting($abTesting)
- {
- $this->container['abTesting'] = $abTesting;
-
- return $this;
- }
-
- /**
- * Gets subjectA
- *
- * @return string
- */
- public function getSubjectA()
- {
- return $this->container['subjectA'];
- }
-
- /**
- * Sets subjectA
- *
- * @param string $subjectA Subject A of the campaign. Considered if abTesting = true. subjectA & subjectB should have unique value
- *
- * @return $this
- */
- public function setSubjectA($subjectA)
- {
- $this->container['subjectA'] = $subjectA;
-
- return $this;
- }
-
- /**
- * Gets subjectB
- *
- * @return string
- */
- public function getSubjectB()
- {
- return $this->container['subjectB'];
- }
-
- /**
- * Sets subjectB
- *
- * @param string $subjectB Subject B of the campaign. Considered if abTesting = true. subjectA & subjectB should have unique value
- *
- * @return $this
- */
- public function setSubjectB($subjectB)
- {
- $this->container['subjectB'] = $subjectB;
-
- return $this;
- }
-
- /**
- * Gets splitRule
- *
- * @return int
- */
- public function getSplitRule()
- {
- return $this->container['splitRule'];
- }
-
- /**
- * Sets splitRule
- *
- * @param int $splitRule Add the size of your test groups. Considered if abTesting = true. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else
- *
- * @return $this
- */
- public function setSplitRule($splitRule)
- {
-
- if (!is_null($splitRule) && ($splitRule > 50)) {
- throw new \InvalidArgumentException('invalid value for $splitRule when calling UpdateEmailCampaign., must be smaller than or equal to 50.');
- }
- if (!is_null($splitRule) && ($splitRule < 1)) {
- throw new \InvalidArgumentException('invalid value for $splitRule when calling UpdateEmailCampaign., must be bigger than or equal to 1.');
- }
-
- $this->container['splitRule'] = $splitRule;
-
- return $this;
- }
-
- /**
- * Gets winnerCriteria
- *
- * @return string
- */
- public function getWinnerCriteria()
- {
- return $this->container['winnerCriteria'];
- }
-
- /**
- * Sets winnerCriteria
- *
- * @param string $winnerCriteria Choose the metrics that will determinate the winning version. Considered if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerCriteria' is ignored if passed or alreday exist in record
- *
- * @return $this
- */
- public function setWinnerCriteria($winnerCriteria)
- {
- $allowedValues = $this->getWinnerCriteriaAllowableValues();
- if (!is_null($winnerCriteria) && !in_array($winnerCriteria, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'winnerCriteria', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['winnerCriteria'] = $winnerCriteria;
-
- return $this;
- }
-
- /**
- * Gets winnerDelay
- *
- * @return int
- */
- public function getWinnerDelay()
- {
- return $this->container['winnerDelay'];
- }
-
- /**
- * Sets winnerDelay
- *
- * @param int $winnerDelay Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. Considered if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerDelay' is ignored if passed or alreday exist in record
- *
- * @return $this
- */
- public function setWinnerDelay($winnerDelay)
- {
-
- if (!is_null($winnerDelay) && ($winnerDelay > 168)) {
- throw new \InvalidArgumentException('invalid value for $winnerDelay when calling UpdateEmailCampaign., must be smaller than or equal to 168.');
- }
- if (!is_null($winnerDelay) && ($winnerDelay < 1)) {
- throw new \InvalidArgumentException('invalid value for $winnerDelay when calling UpdateEmailCampaign., must be bigger than or equal to 1.');
- }
-
- $this->container['winnerDelay'] = $winnerDelay;
-
- return $this;
- }
-
- /**
- * Gets ipWarmupEnable
- *
- * @return bool
- */
- public function getIpWarmupEnable()
- {
- return $this->container['ipWarmupEnable'];
- }
-
- /**
- * Sets ipWarmupEnable
- *
- * @param bool $ipWarmupEnable Available for dedicated ip clients. Set this to true if you wish to warm up your ip.
- *
- * @return $this
- */
- public function setIpWarmupEnable($ipWarmupEnable)
- {
- $this->container['ipWarmupEnable'] = $ipWarmupEnable;
-
- return $this;
- }
-
- /**
- * Gets initialQuota
- *
- * @return int
- */
- public function getInitialQuota()
- {
- return $this->container['initialQuota'];
- }
-
- /**
- * Sets initialQuota
- *
- * @param int $initialQuota Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000.
- *
- * @return $this
- */
- public function setInitialQuota($initialQuota)
- {
- $this->container['initialQuota'] = $initialQuota;
-
- return $this;
- }
-
- /**
- * Gets increaseRate
- *
- * @return int
- */
- public function getIncreaseRate()
- {
- return $this->container['increaseRate'];
- }
-
- /**
- * Sets increaseRate
- *
- * @param int $increaseRate Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%.
- *
- * @return $this
- */
- public function setIncreaseRate($increaseRate)
- {
-
- if (!is_null($increaseRate) && ($increaseRate > 100)) {
- throw new \InvalidArgumentException('invalid value for $increaseRate when calling UpdateEmailCampaign., must be smaller than or equal to 100.');
- }
- if (!is_null($increaseRate) && ($increaseRate < 0)) {
- throw new \InvalidArgumentException('invalid value for $increaseRate when calling UpdateEmailCampaign., must be bigger than or equal to 0.');
- }
-
- $this->container['increaseRate'] = $increaseRate;
-
- return $this;
- }
-
- /**
- * Gets unsubscriptionPageId
- *
- * @return string
- */
- public function getUnsubscriptionPageId()
- {
- return $this->container['unsubscriptionPageId'];
- }
-
- /**
- * Sets unsubscriptionPageId
- *
- * @param string $unsubscriptionPageId Enter an unsubscription page id. The page id is a 24 digit alphanumeric id that can be found in the URL when editing the page.
- *
- * @return $this
- */
- public function setUnsubscriptionPageId($unsubscriptionPageId)
- {
- $this->container['unsubscriptionPageId'] = $unsubscriptionPageId;
-
- return $this;
- }
-
- /**
- * Gets updateFormId
- *
- * @return string
- */
- public function getUpdateFormId()
- {
- return $this->container['updateFormId'];
- }
-
- /**
- * Sets updateFormId
- *
- * @param string $updateFormId Mandatory if templateId is used containing the {{ update_profile }} tag. Enter an update profile form id. The form id is a 24 digit alphanumeric id that can be found in the URL when editing the form.
- *
- * @return $this
- */
- public function setUpdateFormId($updateFormId)
- {
- $this->container['updateFormId'] = $updateFormId;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/UpdateEmailCampaignRecipients.php b/lib/Model/UpdateEmailCampaignRecipients.php
deleted file mode 100644
index 11e1e8a..0000000
--- a/lib/Model/UpdateEmailCampaignRecipients.php
+++ /dev/null
@@ -1,366 +0,0 @@
- 'int[]',
- 'listIds' => 'int[]',
- 'segmentIds' => 'int[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'exclusionListIds' => 'int64',
- 'listIds' => 'int64',
- 'segmentIds' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'exclusionListIds' => 'exclusionListIds',
- 'listIds' => 'listIds',
- 'segmentIds' => 'segmentIds'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'exclusionListIds' => 'setExclusionListIds',
- 'listIds' => 'setListIds',
- 'segmentIds' => 'setSegmentIds'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'exclusionListIds' => 'getExclusionListIds',
- 'listIds' => 'getListIds',
- 'segmentIds' => 'getSegmentIds'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['exclusionListIds'] = isset($data['exclusionListIds']) ? $data['exclusionListIds'] : null;
- $this->container['listIds'] = isset($data['listIds']) ? $data['listIds'] : null;
- $this->container['segmentIds'] = isset($data['segmentIds']) ? $data['segmentIds'] : null;
- }
-
- /**
- * 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 exclusionListIds
- *
- * @return int[]
- */
- public function getExclusionListIds()
- {
- return $this->container['exclusionListIds'];
- }
-
- /**
- * Sets exclusionListIds
- *
- * @param int[] $exclusionListIds List ids which have to be excluded from a campaign
- *
- * @return $this
- */
- public function setExclusionListIds($exclusionListIds)
- {
- $this->container['exclusionListIds'] = $exclusionListIds;
-
- return $this;
- }
-
- /**
- * Gets listIds
- *
- * @return int[]
- */
- public function getListIds()
- {
- return $this->container['listIds'];
- }
-
- /**
- * Sets listIds
- *
- * @param int[] $listIds Lists Ids to send the campaign to. Campaign should only be updated with listIds if listIds were used to create it. REQUIRED if already not present in campaign and scheduledAt is not empty
- *
- * @return $this
- */
- public function setListIds($listIds)
- {
- $this->container['listIds'] = $listIds;
-
- return $this;
- }
-
- /**
- * Gets segmentIds
- *
- * @return int[]
- */
- public function getSegmentIds()
- {
- return $this->container['segmentIds'];
- }
-
- /**
- * Sets segmentIds
- *
- * @param int[] $segmentIds Mandatory if listIds are not used. Campaign should only be updated with segmentIds if segmentIds were used to create it. Segment ids to send the campaign to.
- *
- * @return $this
- */
- public function setSegmentIds($segmentIds)
- {
- $this->container['segmentIds'] = $segmentIds;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/UpdateEmailCampaignSender.php b/lib/Model/UpdateEmailCampaignSender.php
deleted file mode 100644
index a0e3f2d..0000000
--- a/lib/Model/UpdateEmailCampaignSender.php
+++ /dev/null
@@ -1,366 +0,0 @@
- 'string',
- 'email' => 'string',
- 'id' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'email' => 'email',
- 'id' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'email' => 'email',
- 'id' => 'id'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'email' => 'setEmail',
- 'id' => 'setId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'email' => 'getEmail',
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- }
-
- /**
- * 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Sender Name from which the campaign emails are sent
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Sender email from which the campaign emails are sent
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets id
- *
- * @return int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id Select the sender for the campaign on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email).
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/UpdateExternalFeed.php b/lib/Model/UpdateExternalFeed.php
deleted file mode 100644
index f6034cc..0000000
--- a/lib/Model/UpdateExternalFeed.php
+++ /dev/null
@@ -1,595 +0,0 @@
- 'string',
- 'url' => 'string',
- 'authType' => 'string',
- 'username' => 'string',
- 'password' => 'string',
- 'token' => 'string',
- 'headers' => '\Brevo\Client\Model\GetExternalFeedByUUIDHeaders[]',
- 'maxRetries' => 'int',
- 'cache' => 'bool'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'url' => 'url',
- 'authType' => null,
- 'username' => null,
- 'password' => null,
- 'token' => null,
- 'headers' => null,
- 'maxRetries' => null,
- 'cache' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'url' => 'url',
- 'authType' => 'authType',
- 'username' => 'username',
- 'password' => 'password',
- 'token' => 'token',
- 'headers' => 'headers',
- 'maxRetries' => 'maxRetries',
- 'cache' => 'cache'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'url' => 'setUrl',
- 'authType' => 'setAuthType',
- 'username' => 'setUsername',
- 'password' => 'setPassword',
- 'token' => 'setToken',
- 'headers' => 'setHeaders',
- 'maxRetries' => 'setMaxRetries',
- 'cache' => 'setCache'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'url' => 'getUrl',
- 'authType' => 'getAuthType',
- 'username' => 'getUsername',
- 'password' => 'getPassword',
- 'token' => 'getToken',
- 'headers' => 'getHeaders',
- 'maxRetries' => 'getMaxRetries',
- 'cache' => 'getCache'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const AUTH_TYPE_BASIC = 'basic';
- const AUTH_TYPE_TOKEN = 'token';
- const AUTH_TYPE_NO_AUTH = 'noAuth';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getAuthTypeAllowableValues()
- {
- return [
- self::AUTH_TYPE_BASIC,
- self::AUTH_TYPE_TOKEN,
- self::AUTH_TYPE_NO_AUTH,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['url'] = isset($data['url']) ? $data['url'] : null;
- $this->container['authType'] = isset($data['authType']) ? $data['authType'] : null;
- $this->container['username'] = isset($data['username']) ? $data['username'] : null;
- $this->container['password'] = isset($data['password']) ? $data['password'] : null;
- $this->container['token'] = isset($data['token']) ? $data['token'] : null;
- $this->container['headers'] = isset($data['headers']) ? $data['headers'] : null;
- $this->container['maxRetries'] = isset($data['maxRetries']) ? $data['maxRetries'] : null;
- $this->container['cache'] = isset($data['cache']) ? $data['cache'] : false;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- $allowedValues = $this->getAuthTypeAllowableValues();
- if (!is_null($this->container['authType']) && !in_array($this->container['authType'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'authType', must be one of '%s'",
- implode("', '", $allowedValues)
- );
- }
-
- if (!is_null($this->container['maxRetries']) && ($this->container['maxRetries'] > 5)) {
- $invalidProperties[] = "invalid value for 'maxRetries', must be smaller than or equal to 5.";
- }
-
- if (!is_null($this->container['maxRetries']) && ($this->container['maxRetries'] < 0)) {
- $invalidProperties[] = "invalid value for 'maxRetries', must be bigger than or equal to 0.";
- }
-
- 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the feed
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets url
- *
- * @return string
- */
- public function getUrl()
- {
- return $this->container['url'];
- }
-
- /**
- * Sets url
- *
- * @param string $url URL of the feed
- *
- * @return $this
- */
- public function setUrl($url)
- {
- $this->container['url'] = $url;
-
- return $this;
- }
-
- /**
- * Gets authType
- *
- * @return string
- */
- public function getAuthType()
- {
- return $this->container['authType'];
- }
-
- /**
- * Sets authType
- *
- * @param string $authType Auth type of the feed: * `basic` * `token` * `noAuth`
- *
- * @return $this
- */
- public function setAuthType($authType)
- {
- $allowedValues = $this->getAuthTypeAllowableValues();
- if (!is_null($authType) && !in_array($authType, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'authType', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['authType'] = $authType;
-
- return $this;
- }
-
- /**
- * Gets username
- *
- * @return string
- */
- public function getUsername()
- {
- return $this->container['username'];
- }
-
- /**
- * Sets username
- *
- * @param string $username Username for authType `basic`
- *
- * @return $this
- */
- public function setUsername($username)
- {
- $this->container['username'] = $username;
-
- return $this;
- }
-
- /**
- * Gets password
- *
- * @return string
- */
- public function getPassword()
- {
- return $this->container['password'];
- }
-
- /**
- * Sets password
- *
- * @param string $password Password for authType `basic`
- *
- * @return $this
- */
- public function setPassword($password)
- {
- $this->container['password'] = $password;
-
- return $this;
- }
-
- /**
- * Gets token
- *
- * @return string
- */
- public function getToken()
- {
- return $this->container['token'];
- }
-
- /**
- * Sets token
- *
- * @param string $token Token for authType `token`
- *
- * @return $this
- */
- public function setToken($token)
- {
- $this->container['token'] = $token;
-
- return $this;
- }
-
- /**
- * Gets headers
- *
- * @return \Brevo\Client\Model\GetExternalFeedByUUIDHeaders[]
- */
- public function getHeaders()
- {
- return $this->container['headers'];
- }
-
- /**
- * Sets headers
- *
- * @param \Brevo\Client\Model\GetExternalFeedByUUIDHeaders[] $headers Custom headers for the feed
- *
- * @return $this
- */
- public function setHeaders($headers)
- {
- $this->container['headers'] = $headers;
-
- return $this;
- }
-
- /**
- * Gets maxRetries
- *
- * @return int
- */
- public function getMaxRetries()
- {
- return $this->container['maxRetries'];
- }
-
- /**
- * Sets maxRetries
- *
- * @param int $maxRetries Maximum number of retries on the feed url
- *
- * @return $this
- */
- public function setMaxRetries($maxRetries)
- {
-
- if (!is_null($maxRetries) && ($maxRetries > 5)) {
- throw new \InvalidArgumentException('invalid value for $maxRetries when calling UpdateExternalFeed., must be smaller than or equal to 5.');
- }
- if (!is_null($maxRetries) && ($maxRetries < 0)) {
- throw new \InvalidArgumentException('invalid value for $maxRetries when calling UpdateExternalFeed., must be bigger than or equal to 0.');
- }
-
- $this->container['maxRetries'] = $maxRetries;
-
- return $this;
- }
-
- /**
- * Gets cache
- *
- * @return bool
- */
- public function getCache()
- {
- return $this->container['cache'];
- }
-
- /**
- * Sets cache
- *
- * @param bool $cache Toggle caching of feed url response
- *
- * @return $this
- */
- public function setCache($cache)
- {
- $this->container['cache'] = $cache;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/UpdateList.php b/lib/Model/UpdateList.php
deleted file mode 100644
index 076cbe5..0000000
--- a/lib/Model/UpdateList.php
+++ /dev/null
@@ -1,335 +0,0 @@
- 'string',
- 'folderId' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'folderId' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'folderId' => 'folderId'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'folderId' => 'setFolderId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'folderId' => 'getFolderId'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['folderId'] = isset($data['folderId']) ? $data['folderId'] : null;
- }
-
- /**
- * 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the list. Either of the two parameters (name, folderId) can be updated at a time.
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets folderId
- *
- * @return int
- */
- public function getFolderId()
- {
- return $this->container['folderId'];
- }
-
- /**
- * Sets folderId
- *
- * @param int $folderId Id of the folder in which the list is to be moved. Either of the two parameters (name, folderId) can be updated at a time.
- *
- * @return $this
- */
- public function setFolderId($folderId)
- {
- $this->container['folderId'] = $folderId;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/UpdateSender.php b/lib/Model/UpdateSender.php
deleted file mode 100644
index 7f5548a..0000000
--- a/lib/Model/UpdateSender.php
+++ /dev/null
@@ -1,365 +0,0 @@
- 'string',
- 'email' => 'string',
- 'ips' => '\Brevo\Client\Model\CreateSenderIps[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'email' => 'email',
- 'ips' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'email' => 'email',
- 'ips' => 'ips'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'email' => 'setEmail',
- 'ips' => 'setIps'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'email' => 'getEmail',
- 'ips' => 'getIps'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['ips'] = isset($data['ips']) ? $data['ips'] : null;
- }
-
- /**
- * 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name From Name to update the sender
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email From Email to update the sender
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets ips
- *
- * @return \Brevo\Client\Model\CreateSenderIps[]
- */
- public function getIps()
- {
- return $this->container['ips'];
- }
-
- /**
- * Sets ips
- *
- * @param \Brevo\Client\Model\CreateSenderIps[] $ips Only in case of dedicated IP, IPs to associate to the sender. If passed, will replace all the existing IPs.
- *
- * @return $this
- */
- public function setIps($ips)
- {
- $this->container['ips'] = $ips;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/UpdateSmsCampaign.php b/lib/Model/UpdateSmsCampaign.php
deleted file mode 100644
index b7eea8a..0000000
--- a/lib/Model/UpdateSmsCampaign.php
+++ /dev/null
@@ -1,523 +0,0 @@
- 'string',
- 'sender' => 'string',
- 'content' => 'string',
- 'recipients' => '\Brevo\Client\Model\CreateSmsCampaignRecipients',
- 'scheduledAt' => 'string',
- 'unicodeEnabled' => 'bool',
- 'organisationPrefix' => 'string',
- 'unsubscribeInstruction' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'sender' => null,
- 'content' => null,
- 'recipients' => null,
- 'scheduledAt' => null,
- 'unicodeEnabled' => null,
- 'organisationPrefix' => null,
- 'unsubscribeInstruction' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'sender' => 'sender',
- 'content' => 'content',
- 'recipients' => 'recipients',
- 'scheduledAt' => 'scheduledAt',
- 'unicodeEnabled' => 'unicodeEnabled',
- 'organisationPrefix' => 'organisationPrefix',
- 'unsubscribeInstruction' => 'unsubscribeInstruction'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'sender' => 'setSender',
- 'content' => 'setContent',
- 'recipients' => 'setRecipients',
- 'scheduledAt' => 'setScheduledAt',
- 'unicodeEnabled' => 'setUnicodeEnabled',
- 'organisationPrefix' => 'setOrganisationPrefix',
- 'unsubscribeInstruction' => 'setUnsubscribeInstruction'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'sender' => 'getSender',
- 'content' => 'getContent',
- 'recipients' => 'getRecipients',
- 'scheduledAt' => 'getScheduledAt',
- 'unicodeEnabled' => 'getUnicodeEnabled',
- 'organisationPrefix' => 'getOrganisationPrefix',
- 'unsubscribeInstruction' => 'getUnsubscribeInstruction'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null;
- $this->container['content'] = isset($data['content']) ? $data['content'] : null;
- $this->container['recipients'] = isset($data['recipients']) ? $data['recipients'] : null;
- $this->container['scheduledAt'] = isset($data['scheduledAt']) ? $data['scheduledAt'] : null;
- $this->container['unicodeEnabled'] = isset($data['unicodeEnabled']) ? $data['unicodeEnabled'] : false;
- $this->container['organisationPrefix'] = isset($data['organisationPrefix']) ? $data['organisationPrefix'] : null;
- $this->container['unsubscribeInstruction'] = isset($data['unsubscribeInstruction']) ? $data['unsubscribeInstruction'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if (!is_null($this->container['sender']) && (mb_strlen($this->container['sender']) > 15)) {
- $invalidProperties[] = "invalid value for 'sender', the character length must be smaller than or equal to 15.";
- }
-
- 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the campaign
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets sender
- *
- * @return string
- */
- public function getSender()
- {
- return $this->container['sender'];
- }
-
- /**
- * Sets sender
- *
- * @param string $sender Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters**
- *
- * @return $this
- */
- public function setSender($sender)
- {
- if (!is_null($sender) && (mb_strlen($sender) > 15)) {
- throw new \InvalidArgumentException('invalid length for $sender when calling UpdateSmsCampaign., must be smaller than or equal to 15.');
- }
-
- $this->container['sender'] = $sender;
-
- return $this;
- }
-
- /**
- * Gets content
- *
- * @return string
- */
- public function getContent()
- {
- return $this->container['content'];
- }
-
- /**
- * Sets content
- *
- * @param string $content Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS
- *
- * @return $this
- */
- public function setContent($content)
- {
- $this->container['content'] = $content;
-
- return $this;
- }
-
- /**
- * Gets recipients
- *
- * @return \Brevo\Client\Model\CreateSmsCampaignRecipients
- */
- public function getRecipients()
- {
- return $this->container['recipients'];
- }
-
- /**
- * Sets recipients
- *
- * @param \Brevo\Client\Model\CreateSmsCampaignRecipients $recipients recipients
- *
- * @return $this
- */
- public function setRecipients($recipients)
- {
- $this->container['recipients'] = $recipients;
-
- return $this;
- }
-
- /**
- * Gets scheduledAt
- *
- * @return string
- */
- public function getScheduledAt()
- {
- return $this->container['scheduledAt'];
- }
-
- /**
- * Sets scheduledAt
- *
- * @param string $scheduledAt UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.
- *
- * @return $this
- */
- public function setScheduledAt($scheduledAt)
- {
- $this->container['scheduledAt'] = $scheduledAt;
-
- return $this;
- }
-
- /**
- * Gets unicodeEnabled
- *
- * @return bool
- */
- public function getUnicodeEnabled()
- {
- return $this->container['unicodeEnabled'];
- }
-
- /**
- * Sets unicodeEnabled
- *
- * @param bool $unicodeEnabled Format of the message. It indicates whether the content should be treated as unicode or not.
- *
- * @return $this
- */
- public function setUnicodeEnabled($unicodeEnabled)
- {
- $this->container['unicodeEnabled'] = $unicodeEnabled;
-
- return $this;
- }
-
- /**
- * Gets organisationPrefix
- *
- * @return string
- */
- public function getOrganisationPrefix()
- {
- return $this->container['organisationPrefix'];
- }
-
- /**
- * Sets organisationPrefix
- *
- * @param string $organisationPrefix A recognizable prefix will ensure your audience knows who you are. Recommended by U.S. carriers. This will be added as your Brand Name before the message content. **Prefer verifying maximum length of 160 characters including this prefix in message content to avoid multiple sending of same sms.**
- *
- * @return $this
- */
- public function setOrganisationPrefix($organisationPrefix)
- {
- $this->container['organisationPrefix'] = $organisationPrefix;
-
- return $this;
- }
-
- /**
- * Gets unsubscribeInstruction
- *
- * @return string
- */
- public function getUnsubscribeInstruction()
- {
- return $this->container['unsubscribeInstruction'];
- }
-
- /**
- * Sets unsubscribeInstruction
- *
- * @param string $unsubscribeInstruction Instructions to unsubscribe from future communications. Recommended by U.S. carriers. Must include **STOP** keyword. This will be added as instructions after the end of message content. **Prefer verifying maximum length of 160 characters including this instructions in message content to avoid multiple sending of same sms.**
- *
- * @return $this
- */
- public function setUnsubscribeInstruction($unsubscribeInstruction)
- {
- $this->container['unsubscribeInstruction'] = $unsubscribeInstruction;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/UpdateSmtpTemplate.php b/lib/Model/UpdateSmtpTemplate.php
deleted file mode 100644
index a9d6dba..0000000
--- a/lib/Model/UpdateSmtpTemplate.php
+++ /dev/null
@@ -1,575 +0,0 @@
- 'string',
- 'sender' => '\Brevo\Client\Model\UpdateSmtpTemplateSender',
- 'templateName' => 'string',
- 'htmlContent' => 'string',
- 'htmlUrl' => 'string',
- 'subject' => 'string',
- 'replyTo' => 'string',
- 'toField' => 'string',
- 'attachmentUrl' => 'string',
- 'isActive' => 'bool'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'tag' => null,
- 'sender' => null,
- 'templateName' => null,
- 'htmlContent' => null,
- 'htmlUrl' => 'url',
- 'subject' => null,
- 'replyTo' => 'email',
- 'toField' => null,
- 'attachmentUrl' => 'url',
- 'isActive' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'tag' => 'tag',
- 'sender' => 'sender',
- 'templateName' => 'templateName',
- 'htmlContent' => 'htmlContent',
- 'htmlUrl' => 'htmlUrl',
- 'subject' => 'subject',
- 'replyTo' => 'replyTo',
- 'toField' => 'toField',
- 'attachmentUrl' => 'attachmentUrl',
- 'isActive' => 'isActive'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'tag' => 'setTag',
- 'sender' => 'setSender',
- 'templateName' => 'setTemplateName',
- 'htmlContent' => 'setHtmlContent',
- 'htmlUrl' => 'setHtmlUrl',
- 'subject' => 'setSubject',
- 'replyTo' => 'setReplyTo',
- 'toField' => 'setToField',
- 'attachmentUrl' => 'setAttachmentUrl',
- 'isActive' => 'setIsActive'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'tag' => 'getTag',
- 'sender' => 'getSender',
- 'templateName' => 'getTemplateName',
- 'htmlContent' => 'getHtmlContent',
- 'htmlUrl' => 'getHtmlUrl',
- 'subject' => 'getSubject',
- 'replyTo' => 'getReplyTo',
- 'toField' => 'getToField',
- 'attachmentUrl' => 'getAttachmentUrl',
- 'isActive' => 'getIsActive'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null;
- $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null;
- $this->container['templateName'] = isset($data['templateName']) ? $data['templateName'] : null;
- $this->container['htmlContent'] = isset($data['htmlContent']) ? $data['htmlContent'] : null;
- $this->container['htmlUrl'] = isset($data['htmlUrl']) ? $data['htmlUrl'] : null;
- $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null;
- $this->container['replyTo'] = isset($data['replyTo']) ? $data['replyTo'] : null;
- $this->container['toField'] = isset($data['toField']) ? $data['toField'] : null;
- $this->container['attachmentUrl'] = isset($data['attachmentUrl']) ? $data['attachmentUrl'] : null;
- $this->container['isActive'] = isset($data['isActive']) ? $data['isActive'] : null;
- }
-
- /**
- * 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 tag
- *
- * @return string
- */
- public function getTag()
- {
- return $this->container['tag'];
- }
-
- /**
- * Sets tag
- *
- * @param string $tag Tag of the template
- *
- * @return $this
- */
- public function setTag($tag)
- {
- $this->container['tag'] = $tag;
-
- return $this;
- }
-
- /**
- * Gets sender
- *
- * @return \Brevo\Client\Model\UpdateSmtpTemplateSender
- */
- public function getSender()
- {
- return $this->container['sender'];
- }
-
- /**
- * Sets sender
- *
- * @param \Brevo\Client\Model\UpdateSmtpTemplateSender $sender sender
- *
- * @return $this
- */
- public function setSender($sender)
- {
- $this->container['sender'] = $sender;
-
- return $this;
- }
-
- /**
- * Gets templateName
- *
- * @return string
- */
- public function getTemplateName()
- {
- return $this->container['templateName'];
- }
-
- /**
- * Sets templateName
- *
- * @param string $templateName Name of the template
- *
- * @return $this
- */
- public function setTemplateName($templateName)
- {
- $this->container['templateName'] = $templateName;
-
- return $this;
- }
-
- /**
- * Gets htmlContent
- *
- * @return string
- */
- public function getHtmlContent()
- {
- return $this->container['htmlContent'];
- }
-
- /**
- * Sets htmlContent
- *
- * @param string $htmlContent Required if htmlUrl is empty. If the template is designed using Drag & Drop editor via HTML content, then the design page will not have Drag & Drop editor access for that template. Body of the message (HTML must have more than 10 characters)
- *
- * @return $this
- */
- public function setHtmlContent($htmlContent)
- {
- $this->container['htmlContent'] = $htmlContent;
-
- return $this;
- }
-
- /**
- * Gets htmlUrl
- *
- * @return string
- */
- public function getHtmlUrl()
- {
- return $this->container['htmlUrl'];
- }
-
- /**
- * Sets htmlUrl
- *
- * @param string $htmlUrl Required if htmlContent is empty. URL to the body of the email (HTML)
- *
- * @return $this
- */
- public function setHtmlUrl($htmlUrl)
- {
- $this->container['htmlUrl'] = $htmlUrl;
-
- return $this;
- }
-
- /**
- * Gets subject
- *
- * @return string
- */
- public function getSubject()
- {
- return $this->container['subject'];
- }
-
- /**
- * Sets subject
- *
- * @param string $subject Subject of the email
- *
- * @return $this
- */
- public function setSubject($subject)
- {
- $this->container['subject'] = $subject;
-
- return $this;
- }
-
- /**
- * Gets replyTo
- *
- * @return string
- */
- public function getReplyTo()
- {
- return $this->container['replyTo'];
- }
-
- /**
- * Sets replyTo
- *
- * @param string $replyTo Email on which campaign recipients will be able to reply to
- *
- * @return $this
- */
- public function setReplyTo($replyTo)
- {
- $this->container['replyTo'] = $replyTo;
-
- return $this;
- }
-
- /**
- * Gets toField
- *
- * @return string
- */
- public function getToField()
- {
- return $this->container['toField'];
- }
-
- /**
- * Sets toField
- *
- * @param string $toField To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your Brevo account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization
- *
- * @return $this
- */
- public function setToField($toField)
- {
- $this->container['toField'] = $toField;
-
- return $this;
- }
-
- /**
- * Gets attachmentUrl
- *
- * @return string
- */
- public function getAttachmentUrl()
- {
- return $this->container['attachmentUrl'];
- }
-
- /**
- * Sets attachmentUrl
- *
- * @param string $attachmentUrl Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps
- *
- * @return $this
- */
- public function setAttachmentUrl($attachmentUrl)
- {
- $this->container['attachmentUrl'] = $attachmentUrl;
-
- return $this;
- }
-
- /**
- * Gets isActive
- *
- * @return bool
- */
- public function getIsActive()
- {
- return $this->container['isActive'];
- }
-
- /**
- * Sets isActive
- *
- * @param bool $isActive Status of the template. isActive = false means template is inactive, isActive = true means template is active
- *
- * @return $this
- */
- public function setIsActive($isActive)
- {
- $this->container['isActive'] = $isActive;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/UpdateSmtpTemplateSender.php b/lib/Model/UpdateSmtpTemplateSender.php
deleted file mode 100644
index 6997349..0000000
--- a/lib/Model/UpdateSmtpTemplateSender.php
+++ /dev/null
@@ -1,366 +0,0 @@
- 'string',
- 'email' => 'string',
- 'id' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'email' => 'email',
- 'id' => 'int64'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'email' => 'email',
- 'id' => 'id'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'email' => 'setEmail',
- 'id' => 'setId'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'email' => 'getEmail',
- '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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['email'] = isset($data['email']) ? $data['email'] : null;
- $this->container['id'] = isset($data['id']) ? $data['id'] : null;
- }
-
- /**
- * 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the sender
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->container['email'];
- }
-
- /**
- * Sets email
- *
- * @param string $email Email of the sender
- *
- * @return $this
- */
- public function setEmail($email)
- {
- $this->container['email'] = $email;
-
- return $this;
- }
-
- /**
- * Gets id
- *
- * @return int
- */
- public function getId()
- {
- return $this->container['id'];
- }
-
- /**
- * Sets id
- *
- * @param int $id Select the sender for the template on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email).
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->container['id'] = $id;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/UpdateWebhook.php b/lib/Model/UpdateWebhook.php
deleted file mode 100644
index 6b8d016..0000000
--- a/lib/Model/UpdateWebhook.php
+++ /dev/null
@@ -1,539 +0,0 @@
- 'string',
- 'description' => 'string',
- 'events' => 'string[]',
- 'domain' => 'string',
- 'batched' => 'bool',
- 'auth' => '\Brevo\Client\Model\GetWebhookAuth',
- 'headers' => '\Brevo\Client\Model\GetWebhookHeaders[]'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'url' => 'url',
- 'description' => null,
- 'events' => null,
- 'domain' => null,
- 'batched' => null,
- 'auth' => null,
- 'headers' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'url' => 'url',
- 'description' => 'description',
- 'events' => 'events',
- 'domain' => 'domain',
- 'batched' => 'batched',
- 'auth' => 'auth',
- 'headers' => 'headers'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'url' => 'setUrl',
- 'description' => 'setDescription',
- 'events' => 'setEvents',
- 'domain' => 'setDomain',
- 'batched' => 'setBatched',
- 'auth' => 'setAuth',
- 'headers' => 'setHeaders'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'url' => 'getUrl',
- 'description' => 'getDescription',
- 'events' => 'getEvents',
- 'domain' => 'getDomain',
- 'batched' => 'getBatched',
- 'auth' => 'getAuth',
- 'headers' => 'getHeaders'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const EVENTS_SENT = 'sent';
- const EVENTS_HARD_BOUNCE = 'hardBounce';
- const EVENTS_SOFT_BOUNCE = 'softBounce';
- const EVENTS_BLOCKED = 'blocked';
- const EVENTS_SPAM = 'spam';
- const EVENTS_DELIVERED = 'delivered';
- const EVENTS_REQUEST = 'request';
- const EVENTS_CLICK = 'click';
- const EVENTS_INVALID = 'invalid';
- const EVENTS_DEFERRED = 'deferred';
- const EVENTS_OPENED = 'opened';
- const EVENTS_UNIQUE_OPENED = 'uniqueOpened';
- const EVENTS_UNSUBSCRIBED = 'unsubscribed';
- const EVENTS_LIST_ADDITION = 'listAddition';
- const EVENTS_CONTACT_UPDATED = 'contactUpdated';
- const EVENTS_CONTACT_DELETED = 'contactDeleted';
- const EVENTS_INBOUND_EMAIL_PROCESSED = 'inboundEmailProcessed';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getEventsAllowableValues()
- {
- return [
- self::EVENTS_SENT,
- self::EVENTS_HARD_BOUNCE,
- self::EVENTS_SOFT_BOUNCE,
- self::EVENTS_BLOCKED,
- self::EVENTS_SPAM,
- self::EVENTS_DELIVERED,
- self::EVENTS_REQUEST,
- self::EVENTS_CLICK,
- self::EVENTS_INVALID,
- self::EVENTS_DEFERRED,
- self::EVENTS_OPENED,
- self::EVENTS_UNIQUE_OPENED,
- self::EVENTS_UNSUBSCRIBED,
- self::EVENTS_LIST_ADDITION,
- self::EVENTS_CONTACT_UPDATED,
- self::EVENTS_CONTACT_DELETED,
- self::EVENTS_INBOUND_EMAIL_PROCESSED,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['url'] = isset($data['url']) ? $data['url'] : null;
- $this->container['description'] = isset($data['description']) ? $data['description'] : null;
- $this->container['events'] = isset($data['events']) ? $data['events'] : null;
- $this->container['domain'] = isset($data['domain']) ? $data['domain'] : null;
- $this->container['batched'] = isset($data['batched']) ? $data['batched'] : null;
- $this->container['auth'] = isset($data['auth']) ? $data['auth'] : null;
- $this->container['headers'] = isset($data['headers']) ? $data['headers'] : null;
- }
-
- /**
- * 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 url
- *
- * @return string
- */
- public function getUrl()
- {
- return $this->container['url'];
- }
-
- /**
- * Sets url
- *
- * @param string $url URL of the webhook
- *
- * @return $this
- */
- public function setUrl($url)
- {
- $this->container['url'] = $url;
-
- return $this;
- }
-
- /**
- * Gets description
- *
- * @return string
- */
- public function getDescription()
- {
- return $this->container['description'];
- }
-
- /**
- * Sets description
- *
- * @param string $description Description of the webhook
- *
- * @return $this
- */
- public function setDescription($description)
- {
- $this->container['description'] = $description;
-
- return $this;
- }
-
- /**
- * Gets events
- *
- * @return string[]
- */
- public function getEvents()
- {
- return $this->container['events'];
- }
-
- /**
- * Sets events
- *
- * @param string[] $events - Events triggering the webhook. Possible values for **Transactional** type webhook: #### `sent` OR `request`, `delivered`, `hardBounce`, `softBounce`, `blocked`, `spam`, `invalid`, `deferred`, `click`, `opened`, `uniqueOpened` and `unsubscribed` - Possible values for **Marketing** type webhook: #### `spam`, `opened`, `click`, `hardBounce`, `softBounce`, `unsubscribed`, `listAddition` & `delivered` - Possible values for **Inbound** type webhook: #### `inboundEmailProcessed`
- *
- * @return $this
- */
- public function setEvents($events)
- {
- $allowedValues = $this->getEventsAllowableValues();
- if (!is_null($events) && array_diff($events, $allowedValues)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'events', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['events'] = $events;
-
- return $this;
- }
-
- /**
- * Gets domain
- *
- * @return string
- */
- public function getDomain()
- {
- return $this->container['domain'];
- }
-
- /**
- * Sets domain
- *
- * @param string $domain Inbound domain of webhook, used in case of event type `inbound`
- *
- * @return $this
- */
- public function setDomain($domain)
- {
- $this->container['domain'] = $domain;
-
- return $this;
- }
-
- /**
- * Gets batched
- *
- * @return bool
- */
- public function getBatched()
- {
- return $this->container['batched'];
- }
-
- /**
- * Sets batched
- *
- * @param bool $batched To send batched webhooks
- *
- * @return $this
- */
- public function setBatched($batched)
- {
- $this->container['batched'] = $batched;
-
- return $this;
- }
-
- /**
- * Gets auth
- *
- * @return \Brevo\Client\Model\GetWebhookAuth
- */
- public function getAuth()
- {
- return $this->container['auth'];
- }
-
- /**
- * Sets auth
- *
- * @param \Brevo\Client\Model\GetWebhookAuth $auth auth
- *
- * @return $this
- */
- public function setAuth($auth)
- {
- $this->container['auth'] = $auth;
-
- return $this;
- }
-
- /**
- * Gets headers
- *
- * @return \Brevo\Client\Model\GetWebhookHeaders[]
- */
- public function getHeaders()
- {
- return $this->container['headers'];
- }
-
- /**
- * Sets headers
- *
- * @param \Brevo\Client\Model\GetWebhookHeaders[] $headers Custom headers to be send with webhooks
- *
- * @return $this
- */
- public function setHeaders($headers)
- {
- $this->container['headers'] = $headers;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/UpdateWhatsAppCampaign.php b/lib/Model/UpdateWhatsAppCampaign.php
deleted file mode 100644
index 20a4879..0000000
--- a/lib/Model/UpdateWhatsAppCampaign.php
+++ /dev/null
@@ -1,427 +0,0 @@
- 'string',
- 'campaignStatus' => 'string',
- 'rescheduleFor' => 'string',
- 'recipients' => '\Brevo\Client\Model\CreateWhatsAppCampaignRecipients'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'campaignName' => null,
- 'campaignStatus' => null,
- 'rescheduleFor' => null,
- 'recipients' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'campaignName' => 'campaignName',
- 'campaignStatus' => 'campaignStatus',
- 'rescheduleFor' => 'rescheduleFor',
- 'recipients' => 'recipients'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'campaignName' => 'setCampaignName',
- 'campaignStatus' => 'setCampaignStatus',
- 'rescheduleFor' => 'setRescheduleFor',
- 'recipients' => 'setRecipients'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'campaignName' => 'getCampaignName',
- 'campaignStatus' => 'getCampaignStatus',
- 'rescheduleFor' => 'getRescheduleFor',
- 'recipients' => 'getRecipients'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
- const CAMPAIGN_STATUS_SCHEDULED = 'scheduled';
- const CAMPAIGN_STATUS_SUSPENDED = 'suspended';
-
-
-
- /**
- * Gets allowable values of the enum
- *
- * @return string[]
- */
- public function getCampaignStatusAllowableValues()
- {
- return [
- self::CAMPAIGN_STATUS_SCHEDULED,
- self::CAMPAIGN_STATUS_SUSPENDED,
- ];
- }
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['campaignName'] = isset($data['campaignName']) ? $data['campaignName'] : null;
- $this->container['campaignStatus'] = isset($data['campaignStatus']) ? $data['campaignStatus'] : 'scheduled';
- $this->container['rescheduleFor'] = isset($data['rescheduleFor']) ? $data['rescheduleFor'] : null;
- $this->container['recipients'] = isset($data['recipients']) ? $data['recipients'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- $allowedValues = $this->getCampaignStatusAllowableValues();
- if (!is_null($this->container['campaignStatus']) && !in_array($this->container['campaignStatus'], $allowedValues, true)) {
- $invalidProperties[] = sprintf(
- "invalid value for 'campaignStatus', must be one of '%s'",
- 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 campaignName
- *
- * @return string
- */
- public function getCampaignName()
- {
- return $this->container['campaignName'];
- }
-
- /**
- * Sets campaignName
- *
- * @param string $campaignName Name of the campaign
- *
- * @return $this
- */
- public function setCampaignName($campaignName)
- {
- $this->container['campaignName'] = $campaignName;
-
- return $this;
- }
-
- /**
- * Gets campaignStatus
- *
- * @return string
- */
- public function getCampaignStatus()
- {
- return $this->container['campaignStatus'];
- }
-
- /**
- * Sets campaignStatus
- *
- * @param string $campaignStatus Status of the campaign
- *
- * @return $this
- */
- public function setCampaignStatus($campaignStatus)
- {
- $allowedValues = $this->getCampaignStatusAllowableValues();
- if (!is_null($campaignStatus) && !in_array($campaignStatus, $allowedValues, true)) {
- throw new \InvalidArgumentException(
- sprintf(
- "Invalid value for 'campaignStatus', must be one of '%s'",
- implode("', '", $allowedValues)
- )
- );
- }
- $this->container['campaignStatus'] = $campaignStatus;
-
- return $this;
- }
-
- /**
- * Gets rescheduleFor
- *
- * @return string
- */
- public function getRescheduleFor()
- {
- return $this->container['rescheduleFor'];
- }
-
- /**
- * Sets rescheduleFor
- *
- * @param string $rescheduleFor Reschedule the sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of campaign. **Prefer to pass your timezone in date-time format for accurate result.For example: **2017-06-01T12:30:00+02:00** Use this field to update the scheduledAt of any existing draft or scheduled WhatsApp campaign.
- *
- * @return $this
- */
- public function setRescheduleFor($rescheduleFor)
- {
- $this->container['rescheduleFor'] = $rescheduleFor;
-
- return $this;
- }
-
- /**
- * Gets recipients
- *
- * @return \Brevo\Client\Model\CreateWhatsAppCampaignRecipients
- */
- public function getRecipients()
- {
- return $this->container['recipients'];
- }
-
- /**
- * Sets recipients
- *
- * @param \Brevo\Client\Model\CreateWhatsAppCampaignRecipients $recipients recipients
- *
- * @return $this
- */
- public function setRecipients($recipients)
- {
- $this->container['recipients'] = $recipients;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/UploadImageModel.php b/lib/Model/UploadImageModel.php
deleted file mode 100644
index 7285b8f..0000000
--- a/lib/Model/UploadImageModel.php
+++ /dev/null
@@ -1,308 +0,0 @@
- 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'url' => 'string'
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'url' => 'url'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'url' => 'setUrl'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'url' => 'getUrl'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['url'] = isset($data['url']) ? $data['url'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['url'] === null) {
- $invalidProperties[] = "'url' 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
- *
- * @return string
- */
- public function getUrl()
- {
- return $this->container['url'];
- }
-
- /**
- * Sets url
- *
- * @param string $url URL of the image uploaded
- *
- * @return $this
- */
- public function setUrl($url)
- {
- $this->container['url'] = $url;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/UploadImageToGallery.php b/lib/Model/UploadImageToGallery.php
deleted file mode 100644
index 7510add..0000000
--- a/lib/Model/UploadImageToGallery.php
+++ /dev/null
@@ -1,338 +0,0 @@
- 'string',
- 'name' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'imageUrl' => null,
- 'name' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'imageUrl' => 'imageUrl',
- 'name' => 'name'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'imageUrl' => 'setImageUrl',
- 'name' => 'setName'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'imageUrl' => 'getImageUrl',
- 'name' => 'getName'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['imageUrl'] = isset($data['imageUrl']) ? $data['imageUrl'] : null;
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['imageUrl'] === null) {
- $invalidProperties[] = "'imageUrl' 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 imageUrl
- *
- * @return string
- */
- public function getImageUrl()
- {
- return $this->container['imageUrl'];
- }
-
- /**
- * Sets imageUrl
- *
- * @param string $imageUrl The absolute url of the image (no local file). Maximum allowed size for image is 2MB. Allowed extensions for images are - jpeg, jpg, png, bmp, gif.
- *
- * @return $this
- */
- public function setImageUrl($imageUrl)
- {
- $this->container['imageUrl'] = $imageUrl;
-
- return $this;
- }
-
- /**
- * Gets name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name Name of the image.
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/VariablesItems.php b/lib/Model/VariablesItems.php
deleted file mode 100644
index e6c6864..0000000
--- a/lib/Model/VariablesItems.php
+++ /dev/null
@@ -1,365 +0,0 @@
- 'string',
- 'default' => 'string',
- 'datatype' => 'string'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'default' => null,
- 'datatype' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'default' => 'default',
- 'datatype' => 'datatype'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'default' => 'setDefault',
- 'datatype' => 'setDatatype'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'default' => 'getDefault',
- 'datatype' => 'getDatatype'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['default'] = isset($data['default']) ? $data['default'] : null;
- $this->container['datatype'] = isset($data['datatype']) ? $data['datatype'] : null;
- }
-
- /**
- * 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name name
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets default
- *
- * @return string
- */
- public function getDefault()
- {
- return $this->container['default'];
- }
-
- /**
- * Sets default
- *
- * @param string $default default
- *
- * @return $this
- */
- public function setDefault($default)
- {
- $this->container['default'] = $default;
-
- return $this;
- }
-
- /**
- * Gets datatype
- *
- * @return string
- */
- public function getDatatype()
- {
- return $this->container['datatype'];
- }
-
- /**
- * Sets datatype
- *
- * @param string $datatype datatype
- *
- * @return $this
- */
- public function setDatatype($datatype)
- {
- $this->container['datatype'] = $datatype;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/WhatsappCampStats.php b/lib/Model/WhatsappCampStats.php
deleted file mode 100644
index 8aacad6..0000000
--- a/lib/Model/WhatsappCampStats.php
+++ /dev/null
@@ -1,440 +0,0 @@
- 'int',
- 'delivered' => 'int',
- 'read' => 'int',
- 'unsubscribe' => 'int',
- 'notSent' => 'int'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'sent' => null,
- 'delivered' => null,
- 'read' => null,
- 'unsubscribe' => null,
- 'notSent' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'sent' => 'sent',
- 'delivered' => 'delivered',
- 'read' => 'read',
- 'unsubscribe' => 'unsubscribe',
- 'notSent' => 'not_sent'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'sent' => 'setSent',
- 'delivered' => 'setDelivered',
- 'read' => 'setRead',
- 'unsubscribe' => 'setUnsubscribe',
- 'notSent' => 'setNotSent'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'sent' => 'getSent',
- 'delivered' => 'getDelivered',
- 'read' => 'getRead',
- 'unsubscribe' => 'getUnsubscribe',
- 'notSent' => 'getNotSent'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['sent'] = isset($data['sent']) ? $data['sent'] : null;
- $this->container['delivered'] = isset($data['delivered']) ? $data['delivered'] : null;
- $this->container['read'] = isset($data['read']) ? $data['read'] : null;
- $this->container['unsubscribe'] = isset($data['unsubscribe']) ? $data['unsubscribe'] : null;
- $this->container['notSent'] = isset($data['notSent']) ? $data['notSent'] : null;
- }
-
- /**
- * Show all the invalid properties with reasons.
- *
- * @return array invalid properties with reasons
- */
- public function listInvalidProperties()
- {
- $invalidProperties = [];
-
- if ($this->container['sent'] === null) {
- $invalidProperties[] = "'sent' can't be null";
- }
- if ($this->container['delivered'] === null) {
- $invalidProperties[] = "'delivered' can't be null";
- }
- if ($this->container['read'] === null) {
- $invalidProperties[] = "'read' can't be null";
- }
- if ($this->container['unsubscribe'] === null) {
- $invalidProperties[] = "'unsubscribe' can't be null";
- }
- if ($this->container['notSent'] === null) {
- $invalidProperties[] = "'notSent' 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 sent
- *
- * @return int
- */
- public function getSent()
- {
- return $this->container['sent'];
- }
-
- /**
- * Sets sent
- *
- * @param int $sent sent
- *
- * @return $this
- */
- public function setSent($sent)
- {
- $this->container['sent'] = $sent;
-
- return $this;
- }
-
- /**
- * Gets delivered
- *
- * @return int
- */
- public function getDelivered()
- {
- return $this->container['delivered'];
- }
-
- /**
- * Sets delivered
- *
- * @param int $delivered delivered
- *
- * @return $this
- */
- public function setDelivered($delivered)
- {
- $this->container['delivered'] = $delivered;
-
- return $this;
- }
-
- /**
- * Gets read
- *
- * @return int
- */
- public function getRead()
- {
- return $this->container['read'];
- }
-
- /**
- * Sets read
- *
- * @param int $read read
- *
- * @return $this
- */
- public function setRead($read)
- {
- $this->container['read'] = $read;
-
- return $this;
- }
-
- /**
- * Gets unsubscribe
- *
- * @return int
- */
- public function getUnsubscribe()
- {
- return $this->container['unsubscribe'];
- }
-
- /**
- * Sets unsubscribe
- *
- * @param int $unsubscribe unsubscribe
- *
- * @return $this
- */
- public function setUnsubscribe($unsubscribe)
- {
- $this->container['unsubscribe'] = $unsubscribe;
-
- return $this;
- }
-
- /**
- * Gets notSent
- *
- * @return int
- */
- public function getNotSent()
- {
- return $this->container['notSent'];
- }
-
- /**
- * Sets notSent
- *
- * @param int $notSent notSent
- *
- * @return $this
- */
- public function setNotSent($notSent)
- {
- $this->container['notSent'] = $notSent;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Model/WhatsappCampTemplate.php b/lib/Model/WhatsappCampTemplate.php
deleted file mode 100644
index 21e1005..0000000
--- a/lib/Model/WhatsappCampTemplate.php
+++ /dev/null
@@ -1,605 +0,0 @@
- 'string',
- 'category' => 'string',
- 'language' => 'string',
- 'containsButton' => 'bool',
- 'displayHeader' => 'bool',
- 'headerType' => 'string',
- 'components' => '\Brevo\Client\Model\ComponentItems[]',
- 'headerVariables' => '\Brevo\Client\Model\VariablesItems[]',
- 'bodyVariables' => '\Brevo\Client\Model\VariablesItems[]',
- 'buttonType' => 'string',
- 'hideFooter' => 'bool'
- ];
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @var string[]
- */
- protected static $swaggerFormats = [
- 'name' => null,
- 'category' => null,
- 'language' => null,
- 'containsButton' => null,
- 'displayHeader' => null,
- 'headerType' => null,
- 'components' => null,
- 'headerVariables' => null,
- 'bodyVariables' => null,
- 'buttonType' => null,
- 'hideFooter' => null
- ];
-
- /**
- * Array of property to type mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerTypes()
- {
- return self::$swaggerTypes;
- }
-
- /**
- * Array of property to format mappings. Used for (de)serialization
- *
- * @return array
- */
- public static function swaggerFormats()
- {
- return self::$swaggerFormats;
- }
-
- /**
- * Array of attributes where the key is the local name,
- * and the value is the original name
- *
- * @var string[]
- */
- protected static $attributeMap = [
- 'name' => 'name',
- 'category' => 'category',
- 'language' => 'language',
- 'containsButton' => 'contains_button',
- 'displayHeader' => 'display_header',
- 'headerType' => 'header_type',
- 'components' => 'components',
- 'headerVariables' => 'header_variables',
- 'bodyVariables' => 'body_variables',
- 'buttonType' => 'button_type',
- 'hideFooter' => 'hide_footer'
- ];
-
- /**
- * Array of attributes to setter functions (for deserialization of responses)
- *
- * @var string[]
- */
- protected static $setters = [
- 'name' => 'setName',
- 'category' => 'setCategory',
- 'language' => 'setLanguage',
- 'containsButton' => 'setContainsButton',
- 'displayHeader' => 'setDisplayHeader',
- 'headerType' => 'setHeaderType',
- 'components' => 'setComponents',
- 'headerVariables' => 'setHeaderVariables',
- 'bodyVariables' => 'setBodyVariables',
- 'buttonType' => 'setButtonType',
- 'hideFooter' => 'setHideFooter'
- ];
-
- /**
- * Array of attributes to getter functions (for serialization of requests)
- *
- * @var string[]
- */
- protected static $getters = [
- 'name' => 'getName',
- 'category' => 'getCategory',
- 'language' => 'getLanguage',
- 'containsButton' => 'getContainsButton',
- 'displayHeader' => 'getDisplayHeader',
- 'headerType' => 'getHeaderType',
- 'components' => 'getComponents',
- 'headerVariables' => 'getHeaderVariables',
- 'bodyVariables' => 'getBodyVariables',
- 'buttonType' => 'getButtonType',
- 'hideFooter' => 'getHideFooter'
- ];
-
- /**
- * 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::$swaggerModelName;
- }
-
-
-
-
-
- /**
- * Associative array for storing property values
- *
- * @var mixed[]
- */
- protected $container = [];
-
- /**
- * Constructor
- *
- * @param mixed[] $data Associated array of property values
- * initializing the model
- */
- public function __construct(array $data = null)
- {
- $this->container['name'] = isset($data['name']) ? $data['name'] : null;
- $this->container['category'] = isset($data['category']) ? $data['category'] : null;
- $this->container['language'] = isset($data['language']) ? $data['language'] : null;
- $this->container['containsButton'] = isset($data['containsButton']) ? $data['containsButton'] : null;
- $this->container['displayHeader'] = isset($data['displayHeader']) ? $data['displayHeader'] : null;
- $this->container['headerType'] = isset($data['headerType']) ? $data['headerType'] : null;
- $this->container['components'] = isset($data['components']) ? $data['components'] : null;
- $this->container['headerVariables'] = isset($data['headerVariables']) ? $data['headerVariables'] : null;
- $this->container['bodyVariables'] = isset($data['bodyVariables']) ? $data['bodyVariables'] : null;
- $this->container['buttonType'] = isset($data['buttonType']) ? $data['buttonType'] : null;
- $this->container['hideFooter'] = isset($data['hideFooter']) ? $data['hideFooter'] : null;
- }
-
- /**
- * 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 name
- *
- * @return string
- */
- public function getName()
- {
- return $this->container['name'];
- }
-
- /**
- * Sets name
- *
- * @param string $name name of the template
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->container['name'] = $name;
-
- return $this;
- }
-
- /**
- * Gets category
- *
- * @return string
- */
- public function getCategory()
- {
- return $this->container['category'];
- }
-
- /**
- * Sets category
- *
- * @param string $category description of the template
- *
- * @return $this
- */
- public function setCategory($category)
- {
- $this->container['category'] = $category;
-
- return $this;
- }
-
- /**
- * Gets language
- *
- * @return string
- */
- public function getLanguage()
- {
- return $this->container['language'];
- }
-
- /**
- * Sets language
- *
- * @param string $language language of the template
- *
- * @return $this
- */
- public function setLanguage($language)
- {
- $this->container['language'] = $language;
-
- return $this;
- }
-
- /**
- * Gets containsButton
- *
- * @return bool
- */
- public function getContainsButton()
- {
- return $this->container['containsButton'];
- }
-
- /**
- * Sets containsButton
- *
- * @param bool $containsButton containsButton
- *
- * @return $this
- */
- public function setContainsButton($containsButton)
- {
- $this->container['containsButton'] = $containsButton;
-
- return $this;
- }
-
- /**
- * Gets displayHeader
- *
- * @return bool
- */
- public function getDisplayHeader()
- {
- return $this->container['displayHeader'];
- }
-
- /**
- * Sets displayHeader
- *
- * @param bool $displayHeader displayHeader
- *
- * @return $this
- */
- public function setDisplayHeader($displayHeader)
- {
- $this->container['displayHeader'] = $displayHeader;
-
- return $this;
- }
-
- /**
- * Gets headerType
- *
- * @return string
- */
- public function getHeaderType()
- {
- return $this->container['headerType'];
- }
-
- /**
- * Sets headerType
- *
- * @param string $headerType type of header
- *
- * @return $this
- */
- public function setHeaderType($headerType)
- {
- $this->container['headerType'] = $headerType;
-
- return $this;
- }
-
- /**
- * Gets components
- *
- * @return \Brevo\Client\Model\ComponentItems[]
- */
- public function getComponents()
- {
- return $this->container['components'];
- }
-
- /**
- * Sets components
- *
- * @param \Brevo\Client\Model\ComponentItems[] $components array of component item objects
- *
- * @return $this
- */
- public function setComponents($components)
- {
- $this->container['components'] = $components;
-
- return $this;
- }
-
- /**
- * Gets headerVariables
- *
- * @return \Brevo\Client\Model\VariablesItems[]
- */
- public function getHeaderVariables()
- {
- return $this->container['headerVariables'];
- }
-
- /**
- * Sets headerVariables
- *
- * @param \Brevo\Client\Model\VariablesItems[] $headerVariables array of variables item object
- *
- * @return $this
- */
- public function setHeaderVariables($headerVariables)
- {
- $this->container['headerVariables'] = $headerVariables;
-
- return $this;
- }
-
- /**
- * Gets bodyVariables
- *
- * @return \Brevo\Client\Model\VariablesItems[]
- */
- public function getBodyVariables()
- {
- return $this->container['bodyVariables'];
- }
-
- /**
- * Sets bodyVariables
- *
- * @param \Brevo\Client\Model\VariablesItems[] $bodyVariables array of variables item variables
- *
- * @return $this
- */
- public function setBodyVariables($bodyVariables)
- {
- $this->container['bodyVariables'] = $bodyVariables;
-
- return $this;
- }
-
- /**
- * Gets buttonType
- *
- * @return string
- */
- public function getButtonType()
- {
- return $this->container['buttonType'];
- }
-
- /**
- * Sets buttonType
- *
- * @param string $buttonType buttonType
- *
- * @return $this
- */
- public function setButtonType($buttonType)
- {
- $this->container['buttonType'] = $buttonType;
-
- return $this;
- }
-
- /**
- * Gets hideFooter
- *
- * @return bool
- */
- public function getHideFooter()
- {
- return $this->container['hideFooter'];
- }
-
- /**
- * Sets hideFooter
- *
- * @param bool $hideFooter hideFooter
- *
- * @return $this
- */
- public function setHideFooter($hideFooter)
- {
- $this->container['hideFooter'] = $hideFooter;
-
- return $this;
- }
- /**
- * Returns true if offset exists. False otherwise.
- *
- * @param integer $offset Offset
- *
- * @return boolean
- */
- #[\ReturnTypeWillChange]
- public function offsetExists($offset)
- {
- return isset($this->container[$offset]);
- }
-
- /**
- * Gets offset.
- *
- * @param integer $offset Offset
- *
- * @return mixed
- */
- #[\ReturnTypeWillChange]
- public function offsetGet($offset)
- {
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
- }
-
- /**
- * Sets value based on offset.
- *
- * @param integer $offset Offset
- * @param mixed $value Value to be set
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetSet($offset, $value)
- {
- if (is_null($offset)) {
- $this->container[] = $value;
- } else {
- $this->container[$offset] = $value;
- }
- }
-
- /**
- * Unsets offset.
- *
- * @param integer $offset Offset
- *
- * @return void
- */
- #[\ReturnTypeWillChange]
- public function offsetUnset($offset)
- {
- unset($this->container[$offset]);
- }
-
- /**
- * Gets the string presentation of the object
- *
- * @return string
- */
- public function __toString()
- {
- if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
- return json_encode(
- ObjectSerializer::sanitizeForSerialization($this),
- JSON_PRETTY_PRINT
- );
- }
-
- return json_encode(ObjectSerializer::sanitizeForSerialization($this));
- }
-}
-
-
diff --git a/lib/Models/AbTestCampaignResult.php b/lib/Models/AbTestCampaignResult.php
new file mode 100644
index 0000000..89f4355
--- /dev/null
+++ b/lib/Models/AbTestCampaignResult.php
@@ -0,0 +1,519 @@
+
+ */
+class AbTestCampaignResult extends AbstractModel
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static string $openAPIModelName = 'abTestCampaignResult';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPITypes = [
+ 'winningVersion' => 'string',
+ 'winningCriteria' => 'string',
+ 'winningSubjectLine' => 'string',
+ 'openRate' => 'string',
+ 'clickRate' => 'string',
+ 'winningVersionRate' => 'string',
+ 'statistics' => '\Brevo\Client\Models\AbTestCampaignResultStatistics',
+ 'clickedLinks' => '\Brevo\Client\Models\AbTestCampaignResultClickedLinks'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPIFormats = [
+ 'winningVersion' => null,
+ 'winningCriteria' => null,
+ 'winningSubjectLine' => null,
+ 'openRate' => null,
+ 'clickRate' => null,
+ 'winningVersionRate' => null,
+ 'statistics' => null,
+ 'clickedLinks' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPINullables = [
+ 'winningVersion' => false,
+ 'winningCriteria' => false,
+ 'winningSubjectLine' => false,
+ 'openRate' => false,
+ 'clickRate' => false,
+ 'winningVersionRate' => false,
+ 'statistics' => false,
+ 'clickedLinks' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var array
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var array
+ */
+ protected static array $attributeMap = [
+ 'winningVersion' => 'winningVersion',
+ 'winningCriteria' => 'winningCriteria',
+ 'winningSubjectLine' => 'winningSubjectLine',
+ 'openRate' => 'openRate',
+ 'clickRate' => 'clickRate',
+ 'winningVersionRate' => 'winningVersionRate',
+ 'statistics' => 'statistics',
+ 'clickedLinks' => 'clickedLinks'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var array
+ */
+ protected static array $setters = [
+ 'winningVersion' => 'setWinningVersion',
+ 'winningCriteria' => 'setWinningCriteria',
+ 'winningSubjectLine' => 'setWinningSubjectLine',
+ 'openRate' => 'setOpenRate',
+ 'clickRate' => 'setClickRate',
+ 'winningVersionRate' => 'setWinningVersionRate',
+ 'statistics' => 'setStatistics',
+ 'clickedLinks' => 'setClickedLinks'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var array
+ */
+ protected static array $getters = [
+ 'winningVersion' => 'getWinningVersion',
+ 'winningCriteria' => 'getWinningCriteria',
+ 'winningSubjectLine' => 'getWinningSubjectLine',
+ 'openRate' => 'getOpenRate',
+ 'clickRate' => 'getClickRate',
+ 'winningVersionRate' => 'getWinningVersionRate',
+ 'statistics' => 'getStatistics',
+ 'clickedLinks' => 'getClickedLinks'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap(): array
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters(): array
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters(): array
+ {
+ return self::$getters;
+ }
+
+ public const WINNING_VERSION_NOT_AVAILABLE = 'notAvailable';
+ public const WINNING_VERSION_PENDING = 'pending';
+ public const WINNING_VERSION_TIE = 'tie';
+ public const WINNING_VERSION_A = 'A';
+ public const WINNING_VERSION_B = 'B';
+ public const WINNING_CRITERIA_OPEN = 'Open';
+ public const WINNING_CRITERIA_CLICK = 'Click';
+
+ /**
+ * Gets allowable values of the enum
+ *
+ * @return string[]
+ */
+ public function getWinningVersionAllowableValues()
+ {
+ return [
+ self::WINNING_VERSION_NOT_AVAILABLE,
+ self::WINNING_VERSION_PENDING,
+ self::WINNING_VERSION_TIE,
+ self::WINNING_VERSION_A,
+ self::WINNING_VERSION_B,
+ ];
+ }
+
+ /**
+ * Gets allowable values of the enum
+ *
+ * @return string[]
+ */
+ public function getWinningCriteriaAllowableValues()
+ {
+ return [
+ self::WINNING_CRITERIA_OPEN,
+ self::WINNING_CRITERIA_CLICK,
+ ];
+ }
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var array
+ */
+ protected array $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param array $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('winningVersion', $data ?? [], null);
+ $this->setIfExists('winningCriteria', $data ?? [], null);
+ $this->setIfExists('winningSubjectLine', $data ?? [], null);
+ $this->setIfExists('openRate', $data ?? [], null);
+ $this->setIfExists('clickRate', $data ?? [], null);
+ $this->setIfExists('winningVersionRate', $data ?? [], null);
+ $this->setIfExists('statistics', $data ?? [], null);
+ $this->setIfExists('clickedLinks', $data ?? [], null);
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return string[] invalid properties with reasons
+ */
+ public function listInvalidProperties(): array
+ {
+ $invalidProperties = [];
+
+ $allowedValues = $this->getWinningVersionAllowableValues();
+ if (!is_null($this->container['winningVersion']) && !in_array($this->container['winningVersion'], $allowedValues, true)) {
+ $invalidProperties[] = sprintf(
+ "invalid value '%s' for 'winningVersion', must be one of '%s'",
+ $this->container['winningVersion'],
+ implode("', '", $allowedValues)
+ );
+ }
+
+ $allowedValues = $this->getWinningCriteriaAllowableValues();
+ if (!is_null($this->container['winningCriteria']) && !in_array($this->container['winningCriteria'], $allowedValues, true)) {
+ $invalidProperties[] = sprintf(
+ "invalid value '%s' for 'winningCriteria', must be one of '%s'",
+ $this->container['winningCriteria'],
+ implode("', '", $allowedValues)
+ );
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Gets winningVersion
+ *
+ * @return string|null
+ */
+ public function getWinningVersion(): ?string
+ {
+ return $this->container['winningVersion'];
+ }
+
+ /**
+ * Sets winningVersion
+ *
+ * @param string|null $winningVersion Winning Campaign Info. pending = Campaign has been picked for sending and winning version is yet to be decided, tie = A tie happened between both the versions, notAvailable = Campaign has not yet been picked for sending.
+ *
+ * @return $this
+ */
+ public function setWinningVersion(?string $winningVersion): static
+ {
+ if (is_null($winningVersion)) {
+ throw new InvalidArgumentException('non-nullable winningVersion cannot be null');
+ }
+ $allowedValues = $this->getWinningVersionAllowableValues();
+ if (!in_array($winningVersion, $allowedValues, true)) {
+ throw new InvalidArgumentException(
+ sprintf(
+ "Invalid value '%s' for 'winningVersion', must be one of '%s'",
+ $winningVersion,
+ implode("', '", $allowedValues)
+ )
+ );
+ }
+ $this->container['winningVersion'] = $winningVersion;
+
+ return $this;
+ }
+
+ /**
+ * Gets winningCriteria
+ *
+ * @return string|null
+ */
+ public function getWinningCriteria(): ?string
+ {
+ return $this->container['winningCriteria'];
+ }
+
+ /**
+ * Sets winningCriteria
+ *
+ * @param string|null $winningCriteria Criteria choosen for winning version (Open/Click)
+ *
+ * @return $this
+ */
+ public function setWinningCriteria(?string $winningCriteria): static
+ {
+ if (is_null($winningCriteria)) {
+ throw new InvalidArgumentException('non-nullable winningCriteria cannot be null');
+ }
+ $allowedValues = $this->getWinningCriteriaAllowableValues();
+ if (!in_array($winningCriteria, $allowedValues, true)) {
+ throw new InvalidArgumentException(
+ sprintf(
+ "Invalid value '%s' for 'winningCriteria', must be one of '%s'",
+ $winningCriteria,
+ implode("', '", $allowedValues)
+ )
+ );
+ }
+ $this->container['winningCriteria'] = $winningCriteria;
+
+ return $this;
+ }
+
+ /**
+ * Gets winningSubjectLine
+ *
+ * @return string|null
+ */
+ public function getWinningSubjectLine(): ?string
+ {
+ return $this->container['winningSubjectLine'];
+ }
+
+ /**
+ * Sets winningSubjectLine
+ *
+ * @param string|null $winningSubjectLine Subject Line of current winning version
+ *
+ * @return $this
+ */
+ public function setWinningSubjectLine(?string $winningSubjectLine): static
+ {
+ if (is_null($winningSubjectLine)) {
+ throw new InvalidArgumentException('non-nullable winningSubjectLine cannot be null');
+ }
+ $this->container['winningSubjectLine'] = $winningSubjectLine;
+
+ return $this;
+ }
+
+ /**
+ * Gets openRate
+ *
+ * @return string|null
+ */
+ public function getOpenRate(): ?string
+ {
+ return $this->container['openRate'];
+ }
+
+ /**
+ * Sets openRate
+ *
+ * @param string|null $openRate Open rate for current winning version
+ *
+ * @return $this
+ */
+ public function setOpenRate(?string $openRate): static
+ {
+ if (is_null($openRate)) {
+ throw new InvalidArgumentException('non-nullable openRate cannot be null');
+ }
+ $this->container['openRate'] = $openRate;
+
+ return $this;
+ }
+
+ /**
+ * Gets clickRate
+ *
+ * @return string|null
+ */
+ public function getClickRate(): ?string
+ {
+ return $this->container['clickRate'];
+ }
+
+ /**
+ * Sets clickRate
+ *
+ * @param string|null $clickRate Click rate for current winning version
+ *
+ * @return $this
+ */
+ public function setClickRate(?string $clickRate): static
+ {
+ if (is_null($clickRate)) {
+ throw new InvalidArgumentException('non-nullable clickRate cannot be null');
+ }
+ $this->container['clickRate'] = $clickRate;
+
+ return $this;
+ }
+
+ /**
+ * Gets winningVersionRate
+ *
+ * @return string|null
+ */
+ public function getWinningVersionRate(): ?string
+ {
+ return $this->container['winningVersionRate'];
+ }
+
+ /**
+ * Sets winningVersionRate
+ *
+ * @param string|null $winningVersionRate Open/Click rate for the winner version
+ *
+ * @return $this
+ */
+ public function setWinningVersionRate(?string $winningVersionRate): static
+ {
+ if (is_null($winningVersionRate)) {
+ throw new InvalidArgumentException('non-nullable winningVersionRate cannot be null');
+ }
+ $this->container['winningVersionRate'] = $winningVersionRate;
+
+ return $this;
+ }
+
+ /**
+ * Gets statistics
+ *
+ * @return \Brevo\Client\Models\AbTestCampaignResultStatistics|null
+ */
+ public function getStatistics(): ?\Brevo\Client\Models\AbTestCampaignResultStatistics
+ {
+ return $this->container['statistics'];
+ }
+
+ /**
+ * Sets statistics
+ *
+ * @param \Brevo\Client\Models\AbTestCampaignResultStatistics|null $statistics statistics
+ *
+ * @return $this
+ */
+ public function setStatistics(?\Brevo\Client\Models\AbTestCampaignResultStatistics $statistics): static
+ {
+ if (is_null($statistics)) {
+ throw new InvalidArgumentException('non-nullable statistics cannot be null');
+ }
+ $this->container['statistics'] = $statistics;
+
+ return $this;
+ }
+
+ /**
+ * Gets clickedLinks
+ *
+ * @return \Brevo\Client\Models\AbTestCampaignResultClickedLinks|null
+ */
+ public function getClickedLinks(): ?\Brevo\Client\Models\AbTestCampaignResultClickedLinks
+ {
+ return $this->container['clickedLinks'];
+ }
+
+ /**
+ * Sets clickedLinks
+ *
+ * @param \Brevo\Client\Models\AbTestCampaignResultClickedLinks|null $clickedLinks clickedLinks
+ *
+ * @return $this
+ */
+ public function setClickedLinks(?\Brevo\Client\Models\AbTestCampaignResultClickedLinks $clickedLinks): static
+ {
+ if (is_null($clickedLinks)) {
+ throw new InvalidArgumentException('non-nullable clickedLinks cannot be null');
+ }
+ $this->container['clickedLinks'] = $clickedLinks;
+
+ return $this;
+ }
+}
+
+
diff --git a/lib/Models/AbTestCampaignResultClickedLinks.php b/lib/Models/AbTestCampaignResultClickedLinks.php
new file mode 100644
index 0000000..ca8bc17
--- /dev/null
+++ b/lib/Models/AbTestCampaignResultClickedLinks.php
@@ -0,0 +1,247 @@
+
+ */
+class AbTestCampaignResultClickedLinks extends AbstractModel
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static string $openAPIModelName = 'abTestCampaignResult_clickedLinks';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPITypes = [
+ 'versionA' => '\Brevo\Client\Models\AbTestVersionClicksInner[]',
+ 'versionB' => '\Brevo\Client\Models\AbTestVersionClicksInner[]'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPIFormats = [
+ 'versionA' => null,
+ 'versionB' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPINullables = [
+ 'versionA' => false,
+ 'versionB' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var array
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var array
+ */
+ protected static array $attributeMap = [
+ 'versionA' => 'Version A',
+ 'versionB' => 'Version B'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var array
+ */
+ protected static array $setters = [
+ 'versionA' => 'setVersionA',
+ 'versionB' => 'setVersionB'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var array
+ */
+ protected static array $getters = [
+ 'versionA' => 'getVersionA',
+ 'versionB' => 'getVersionB'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap(): array
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters(): array
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters(): array
+ {
+ return self::$getters;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var array
+ */
+ protected array $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param array $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('versionA', $data ?? [], null);
+ $this->setIfExists('versionB', $data ?? [], null);
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return string[] invalid properties with reasons
+ */
+ public function listInvalidProperties(): array
+ {
+ $invalidProperties = [];
+
+ if ($this->container['versionA'] === null) {
+ $invalidProperties[] = "'versionA' can't be null";
+ }
+ if ($this->container['versionB'] === null) {
+ $invalidProperties[] = "'versionB' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Gets versionA
+ *
+ * @return \Brevo\Client\Models\AbTestVersionClicksInner[]
+ */
+ public function getVersionA(): array
+ {
+ return $this->container['versionA'];
+ }
+
+ /**
+ * Sets versionA
+ *
+ * @param \Brevo\Client\Models\AbTestVersionClicksInner[] $versionA Information on clicked links for a particular version
+ *
+ * @return $this
+ */
+ public function setVersionA(array $versionA): static
+ {
+ if (is_null($versionA)) {
+ throw new InvalidArgumentException('non-nullable versionA cannot be null');
+ }
+ $this->container['versionA'] = $versionA;
+
+ return $this;
+ }
+
+ /**
+ * Gets versionB
+ *
+ * @return \Brevo\Client\Models\AbTestVersionClicksInner[]
+ */
+ public function getVersionB(): array
+ {
+ return $this->container['versionB'];
+ }
+
+ /**
+ * Sets versionB
+ *
+ * @param \Brevo\Client\Models\AbTestVersionClicksInner[] $versionB Information on clicked links for a particular version
+ *
+ * @return $this
+ */
+ public function setVersionB(array $versionB): static
+ {
+ if (is_null($versionB)) {
+ throw new InvalidArgumentException('non-nullable versionB cannot be null');
+ }
+ $this->container['versionB'] = $versionB;
+
+ return $this;
+ }
+}
+
+
diff --git a/lib/Models/AbTestCampaignResultStatistics.php b/lib/Models/AbTestCampaignResultStatistics.php
new file mode 100644
index 0000000..48efca7
--- /dev/null
+++ b/lib/Models/AbTestCampaignResultStatistics.php
@@ -0,0 +1,395 @@
+
+ */
+class AbTestCampaignResultStatistics extends AbstractModel
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static string $openAPIModelName = 'abTestCampaignResult_statistics';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPITypes = [
+ 'openers' => '\Brevo\Client\Models\AbTestVersionStats',
+ 'clicks' => '\Brevo\Client\Models\AbTestVersionStats',
+ 'unsubscribed' => '\Brevo\Client\Models\AbTestVersionStats',
+ 'hardBounces' => '\Brevo\Client\Models\AbTestVersionStats',
+ 'softBounces' => '\Brevo\Client\Models\AbTestVersionStats',
+ 'complaints' => '\Brevo\Client\Models\AbTestVersionStats'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPIFormats = [
+ 'openers' => null,
+ 'clicks' => null,
+ 'unsubscribed' => null,
+ 'hardBounces' => null,
+ 'softBounces' => null,
+ 'complaints' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPINullables = [
+ 'openers' => false,
+ 'clicks' => false,
+ 'unsubscribed' => false,
+ 'hardBounces' => false,
+ 'softBounces' => false,
+ 'complaints' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var array
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var array
+ */
+ protected static array $attributeMap = [
+ 'openers' => 'openers',
+ 'clicks' => 'clicks',
+ 'unsubscribed' => 'unsubscribed',
+ 'hardBounces' => 'hardBounces',
+ 'softBounces' => 'softBounces',
+ 'complaints' => 'complaints'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var array
+ */
+ protected static array $setters = [
+ 'openers' => 'setOpeners',
+ 'clicks' => 'setClicks',
+ 'unsubscribed' => 'setUnsubscribed',
+ 'hardBounces' => 'setHardBounces',
+ 'softBounces' => 'setSoftBounces',
+ 'complaints' => 'setComplaints'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var array
+ */
+ protected static array $getters = [
+ 'openers' => 'getOpeners',
+ 'clicks' => 'getClicks',
+ 'unsubscribed' => 'getUnsubscribed',
+ 'hardBounces' => 'getHardBounces',
+ 'softBounces' => 'getSoftBounces',
+ 'complaints' => 'getComplaints'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap(): array
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters(): array
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters(): array
+ {
+ return self::$getters;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var array
+ */
+ protected array $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param array $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('openers', $data ?? [], null);
+ $this->setIfExists('clicks', $data ?? [], null);
+ $this->setIfExists('unsubscribed', $data ?? [], null);
+ $this->setIfExists('hardBounces', $data ?? [], null);
+ $this->setIfExists('softBounces', $data ?? [], null);
+ $this->setIfExists('complaints', $data ?? [], null);
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return string[] invalid properties with reasons
+ */
+ public function listInvalidProperties(): array
+ {
+ $invalidProperties = [];
+
+ if ($this->container['openers'] === null) {
+ $invalidProperties[] = "'openers' can't be null";
+ }
+ if ($this->container['clicks'] === null) {
+ $invalidProperties[] = "'clicks' can't be null";
+ }
+ if ($this->container['unsubscribed'] === null) {
+ $invalidProperties[] = "'unsubscribed' can't be null";
+ }
+ if ($this->container['hardBounces'] === null) {
+ $invalidProperties[] = "'hardBounces' can't be null";
+ }
+ if ($this->container['softBounces'] === null) {
+ $invalidProperties[] = "'softBounces' can't be null";
+ }
+ if ($this->container['complaints'] === null) {
+ $invalidProperties[] = "'complaints' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Gets openers
+ *
+ * @return \Brevo\Client\Models\AbTestVersionStats
+ */
+ public function getOpeners(): \Brevo\Client\Models\AbTestVersionStats
+ {
+ return $this->container['openers'];
+ }
+
+ /**
+ * Sets openers
+ *
+ * @param \Brevo\Client\Models\AbTestVersionStats $openers openers
+ *
+ * @return $this
+ */
+ public function setOpeners(\Brevo\Client\Models\AbTestVersionStats $openers): static
+ {
+ if (is_null($openers)) {
+ throw new InvalidArgumentException('non-nullable openers cannot be null');
+ }
+ $this->container['openers'] = $openers;
+
+ return $this;
+ }
+
+ /**
+ * Gets clicks
+ *
+ * @return \Brevo\Client\Models\AbTestVersionStats
+ */
+ public function getClicks(): \Brevo\Client\Models\AbTestVersionStats
+ {
+ return $this->container['clicks'];
+ }
+
+ /**
+ * Sets clicks
+ *
+ * @param \Brevo\Client\Models\AbTestVersionStats $clicks clicks
+ *
+ * @return $this
+ */
+ public function setClicks(\Brevo\Client\Models\AbTestVersionStats $clicks): static
+ {
+ if (is_null($clicks)) {
+ throw new InvalidArgumentException('non-nullable clicks cannot be null');
+ }
+ $this->container['clicks'] = $clicks;
+
+ return $this;
+ }
+
+ /**
+ * Gets unsubscribed
+ *
+ * @return \Brevo\Client\Models\AbTestVersionStats
+ */
+ public function getUnsubscribed(): \Brevo\Client\Models\AbTestVersionStats
+ {
+ return $this->container['unsubscribed'];
+ }
+
+ /**
+ * Sets unsubscribed
+ *
+ * @param \Brevo\Client\Models\AbTestVersionStats $unsubscribed unsubscribed
+ *
+ * @return $this
+ */
+ public function setUnsubscribed(\Brevo\Client\Models\AbTestVersionStats $unsubscribed): static
+ {
+ if (is_null($unsubscribed)) {
+ throw new InvalidArgumentException('non-nullable unsubscribed cannot be null');
+ }
+ $this->container['unsubscribed'] = $unsubscribed;
+
+ return $this;
+ }
+
+ /**
+ * Gets hardBounces
+ *
+ * @return \Brevo\Client\Models\AbTestVersionStats
+ */
+ public function getHardBounces(): \Brevo\Client\Models\AbTestVersionStats
+ {
+ return $this->container['hardBounces'];
+ }
+
+ /**
+ * Sets hardBounces
+ *
+ * @param \Brevo\Client\Models\AbTestVersionStats $hardBounces hardBounces
+ *
+ * @return $this
+ */
+ public function setHardBounces(\Brevo\Client\Models\AbTestVersionStats $hardBounces): static
+ {
+ if (is_null($hardBounces)) {
+ throw new InvalidArgumentException('non-nullable hardBounces cannot be null');
+ }
+ $this->container['hardBounces'] = $hardBounces;
+
+ return $this;
+ }
+
+ /**
+ * Gets softBounces
+ *
+ * @return \Brevo\Client\Models\AbTestVersionStats
+ */
+ public function getSoftBounces(): \Brevo\Client\Models\AbTestVersionStats
+ {
+ return $this->container['softBounces'];
+ }
+
+ /**
+ * Sets softBounces
+ *
+ * @param \Brevo\Client\Models\AbTestVersionStats $softBounces softBounces
+ *
+ * @return $this
+ */
+ public function setSoftBounces(\Brevo\Client\Models\AbTestVersionStats $softBounces): static
+ {
+ if (is_null($softBounces)) {
+ throw new InvalidArgumentException('non-nullable softBounces cannot be null');
+ }
+ $this->container['softBounces'] = $softBounces;
+
+ return $this;
+ }
+
+ /**
+ * Gets complaints
+ *
+ * @return \Brevo\Client\Models\AbTestVersionStats
+ */
+ public function getComplaints(): \Brevo\Client\Models\AbTestVersionStats
+ {
+ return $this->container['complaints'];
+ }
+
+ /**
+ * Sets complaints
+ *
+ * @param \Brevo\Client\Models\AbTestVersionStats $complaints complaints
+ *
+ * @return $this
+ */
+ public function setComplaints(\Brevo\Client\Models\AbTestVersionStats $complaints): static
+ {
+ if (is_null($complaints)) {
+ throw new InvalidArgumentException('non-nullable complaints cannot be null');
+ }
+ $this->container['complaints'] = $complaints;
+
+ return $this;
+ }
+}
+
+
diff --git a/lib/Models/AbTestVersionClicksInner.php b/lib/Models/AbTestVersionClicksInner.php
new file mode 100644
index 0000000..02a440f
--- /dev/null
+++ b/lib/Models/AbTestVersionClicksInner.php
@@ -0,0 +1,284 @@
+
+ */
+class AbTestVersionClicksInner extends AbstractModel
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static string $openAPIModelName = 'abTestVersionClicks_inner';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPITypes = [
+ 'link' => 'string',
+ 'clicksCount' => 'int',
+ 'clickRate' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPIFormats = [
+ 'link' => null,
+ 'clicksCount' => 'int64',
+ 'clickRate' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPINullables = [
+ 'link' => false,
+ 'clicksCount' => false,
+ 'clickRate' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var array
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var array
+ */
+ protected static array $attributeMap = [
+ 'link' => 'link',
+ 'clicksCount' => 'clicksCount',
+ 'clickRate' => 'clickRate'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var array
+ */
+ protected static array $setters = [
+ 'link' => 'setLink',
+ 'clicksCount' => 'setClicksCount',
+ 'clickRate' => 'setClickRate'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var array
+ */
+ protected static array $getters = [
+ 'link' => 'getLink',
+ 'clicksCount' => 'getClicksCount',
+ 'clickRate' => 'getClickRate'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap(): array
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters(): array
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters(): array
+ {
+ return self::$getters;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var array
+ */
+ protected array $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param array $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('link', $data ?? [], null);
+ $this->setIfExists('clicksCount', $data ?? [], null);
+ $this->setIfExists('clickRate', $data ?? [], null);
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return string[] invalid properties with reasons
+ */
+ public function listInvalidProperties(): array
+ {
+ $invalidProperties = [];
+
+ if ($this->container['link'] === null) {
+ $invalidProperties[] = "'link' can't be null";
+ }
+ if ($this->container['clicksCount'] === null) {
+ $invalidProperties[] = "'clicksCount' can't be null";
+ }
+ if ($this->container['clickRate'] === null) {
+ $invalidProperties[] = "'clickRate' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Gets link
+ *
+ * @return string
+ */
+ public function getLink(): string
+ {
+ return $this->container['link'];
+ }
+
+ /**
+ * Sets link
+ *
+ * @param string $link URL of the link
+ *
+ * @return $this
+ */
+ public function setLink(string $link): static
+ {
+ if (is_null($link)) {
+ throw new InvalidArgumentException('non-nullable link cannot be null');
+ }
+ $this->container['link'] = $link;
+
+ return $this;
+ }
+
+ /**
+ * Gets clicksCount
+ *
+ * @return int
+ */
+ public function getClicksCount(): int
+ {
+ return $this->container['clicksCount'];
+ }
+
+ /**
+ * Sets clicksCount
+ *
+ * @param int $clicksCount Number of times a link is clicked
+ *
+ * @return $this
+ */
+ public function setClicksCount(int $clicksCount): static
+ {
+ if (is_null($clicksCount)) {
+ throw new InvalidArgumentException('non-nullable clicksCount cannot be null');
+ }
+ $this->container['clicksCount'] = $clicksCount;
+
+ return $this;
+ }
+
+ /**
+ * Gets clickRate
+ *
+ * @return string
+ */
+ public function getClickRate(): string
+ {
+ return $this->container['clickRate'];
+ }
+
+ /**
+ * Sets clickRate
+ *
+ * @param string $clickRate Percentage of clicks of link with respect to total clicks
+ *
+ * @return $this
+ */
+ public function setClickRate(string $clickRate): static
+ {
+ if (is_null($clickRate)) {
+ throw new InvalidArgumentException('non-nullable clickRate cannot be null');
+ }
+ $this->container['clickRate'] = $clickRate;
+
+ return $this;
+ }
+}
+
+
diff --git a/lib/Models/AbTestVersionStats.php b/lib/Models/AbTestVersionStats.php
new file mode 100644
index 0000000..0711e4d
--- /dev/null
+++ b/lib/Models/AbTestVersionStats.php
@@ -0,0 +1,248 @@
+
+ */
+class AbTestVersionStats extends AbstractModel
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static string $openAPIModelName = 'abTestVersionStats';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPITypes = [
+ 'versionA' => 'string',
+ 'versionB' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPIFormats = [
+ 'versionA' => null,
+ 'versionB' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPINullables = [
+ 'versionA' => false,
+ 'versionB' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var array
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var array
+ */
+ protected static array $attributeMap = [
+ 'versionA' => 'Version A',
+ 'versionB' => 'Version B'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var array
+ */
+ protected static array $setters = [
+ 'versionA' => 'setVersionA',
+ 'versionB' => 'setVersionB'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var array
+ */
+ protected static array $getters = [
+ 'versionA' => 'getVersionA',
+ 'versionB' => 'getVersionB'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap(): array
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters(): array
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters(): array
+ {
+ return self::$getters;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var array
+ */
+ protected array $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param array $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('versionA', $data ?? [], null);
+ $this->setIfExists('versionB', $data ?? [], null);
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return string[] invalid properties with reasons
+ */
+ public function listInvalidProperties(): array
+ {
+ $invalidProperties = [];
+
+ if ($this->container['versionA'] === null) {
+ $invalidProperties[] = "'versionA' can't be null";
+ }
+ if ($this->container['versionB'] === null) {
+ $invalidProperties[] = "'versionB' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Gets versionA
+ *
+ * @return string
+ */
+ public function getVersionA(): string
+ {
+ return $this->container['versionA'];
+ }
+
+ /**
+ * Sets versionA
+ *
+ * @param string $versionA percentage of an event for version A
+ *
+ * @return $this
+ */
+ public function setVersionA(string $versionA): static
+ {
+ if (is_null($versionA)) {
+ throw new InvalidArgumentException('non-nullable versionA cannot be null');
+ }
+ $this->container['versionA'] = $versionA;
+
+ return $this;
+ }
+
+ /**
+ * Gets versionB
+ *
+ * @return string
+ */
+ public function getVersionB(): string
+ {
+ return $this->container['versionB'];
+ }
+
+ /**
+ * Sets versionB
+ *
+ * @param string $versionB percentage of an event for version B
+ *
+ * @return $this
+ */
+ public function setVersionB(string $versionB): static
+ {
+ if (is_null($versionB)) {
+ throw new InvalidArgumentException('non-nullable versionB cannot be null');
+ }
+ $this->container['versionB'] = $versionB;
+
+ return $this;
+ }
+}
+
+
diff --git a/lib/Models/AbstractModel.php b/lib/Models/AbstractModel.php
new file mode 100644
index 0000000..e78f067
--- /dev/null
+++ b/lib/Models/AbstractModel.php
@@ -0,0 +1,255 @@
+
+ */
+ protected static array $openAPINullables = [];
+
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var array
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPIFormats = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPITypes = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes(): array
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats(): array
+ {
+ 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 array
+ */
+ protected function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param array $openAPINullablesSetToNull
+ */
+ protected 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);
+ }
+
+ /**
+ * 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
+ */
+ protected function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid(): bool
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists(mixed $offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[ReturnTypeWillChange]
+ public function offsetGet(mixed $offset): mixed
+ {
+ 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(mixed $offset, mixed $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(mixed $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(): mixed
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString(): string
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue(): string
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName(): string
+ {
+ return self::$openAPIModelName;
+ }
+
+}
diff --git a/lib/Models/AddContactToListByEmails.php b/lib/Models/AddContactToListByEmails.php
new file mode 100644
index 0000000..71c4208
--- /dev/null
+++ b/lib/Models/AddContactToListByEmails.php
@@ -0,0 +1,222 @@
+
+ */
+class AddContactToListByEmails extends AbstractModel
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static string $openAPIModelName = 'addContactToListByEmails';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPITypes = [
+ 'emails' => 'string[]'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPIFormats = [
+ 'emails' => 'email'
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPINullables = [
+ 'emails' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var array
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var array
+ */
+ protected static array $attributeMap = [
+ 'emails' => 'emails'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var array
+ */
+ protected static array $setters = [
+ 'emails' => 'setEmails'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var array
+ */
+ protected static array $getters = [
+ 'emails' => 'getEmails'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap(): array
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters(): array
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters(): array
+ {
+ return self::$getters;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var array
+ */
+ protected array $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param array $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('emails', $data ?? [], null);
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return string[] invalid properties with reasons
+ */
+ public function listInvalidProperties(): array
+ {
+ $invalidProperties = [];
+
+ if (!is_null($this->container['emails']) && (count($this->container['emails']) > 150)) {
+ $invalidProperties[] = "invalid value for 'emails', number of items must be less than or equal to 150.";
+ }
+
+ if (!is_null($this->container['emails']) && (count($this->container['emails']) < 1)) {
+ $invalidProperties[] = "invalid value for 'emails', number of items must be greater than or equal to 1.";
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Gets emails
+ *
+ * @return string[]|null
+ */
+ public function getEmails(): ?array
+ {
+ return $this->container['emails'];
+ }
+
+ /**
+ * Sets emails
+ *
+ * @param string[]|null $emails Emails to add to a list. You can pass a **maximum of 150 emails** for addition in one request. **_If you need to add the emails in bulk, please prefer /contacts/import api._**
+ *
+ * @return $this
+ */
+ public function setEmails(?array $emails): static
+ {
+ if (is_null($emails)) {
+ throw new InvalidArgumentException('non-nullable emails cannot be null');
+ }
+
+ if ((count($emails) > 150)) {
+ throw new InvalidArgumentException('invalid value for $emails when calling AddContactToListByEmails., number of items must be less than or equal to 150.');
+ }
+ if ((count($emails) < 1)) {
+ throw new InvalidArgumentException('invalid length for $emails when calling AddContactToListByEmails., number of items must be greater than or equal to 1.');
+ }
+ $this->container['emails'] = $emails;
+
+ return $this;
+ }
+}
+
+
diff --git a/lib/Models/AddContactToListByExtIDs.php b/lib/Models/AddContactToListByExtIDs.php
new file mode 100644
index 0000000..2d1f8b2
--- /dev/null
+++ b/lib/Models/AddContactToListByExtIDs.php
@@ -0,0 +1,222 @@
+
+ */
+class AddContactToListByExtIDs extends AbstractModel
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static string $openAPIModelName = 'addContactToListByExtIDs';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPITypes = [
+ 'extIds' => 'string[]'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPIFormats = [
+ 'extIds' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPINullables = [
+ 'extIds' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var array
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var array
+ */
+ protected static array $attributeMap = [
+ 'extIds' => 'extIds'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var array
+ */
+ protected static array $setters = [
+ 'extIds' => 'setExtIds'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var array
+ */
+ protected static array $getters = [
+ 'extIds' => 'getExtIds'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap(): array
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters(): array
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters(): array
+ {
+ return self::$getters;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var array
+ */
+ protected array $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param array $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('extIds', $data ?? [], null);
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return string[] invalid properties with reasons
+ */
+ public function listInvalidProperties(): array
+ {
+ $invalidProperties = [];
+
+ if (!is_null($this->container['extIds']) && (count($this->container['extIds']) > 150)) {
+ $invalidProperties[] = "invalid value for 'extIds', number of items must be less than or equal to 150.";
+ }
+
+ if (!is_null($this->container['extIds']) && (count($this->container['extIds']) < 1)) {
+ $invalidProperties[] = "invalid value for 'extIds', number of items must be greater than or equal to 1.";
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Gets extIds
+ *
+ * @return string[]|null
+ */
+ public function getExtIds(): ?array
+ {
+ return $this->container['extIds'];
+ }
+
+ /**
+ * Sets extIds
+ *
+ * @param string[]|null $extIds EXT_ID attributes to add to a list. You can pass a **maximum of 150 EXT_ID attributes** for addition in one request. **_If you need to add the emails in bulk, please prefer /contacts/import api._**
+ *
+ * @return $this
+ */
+ public function setExtIds(?array $extIds): static
+ {
+ if (is_null($extIds)) {
+ throw new InvalidArgumentException('non-nullable extIds cannot be null');
+ }
+
+ if ((count($extIds) > 150)) {
+ throw new InvalidArgumentException('invalid value for $extIds when calling AddContactToListByExtIDs., number of items must be less than or equal to 150.');
+ }
+ if ((count($extIds) < 1)) {
+ throw new InvalidArgumentException('invalid length for $extIds when calling AddContactToListByExtIDs., number of items must be greater than or equal to 1.');
+ }
+ $this->container['extIds'] = $extIds;
+
+ return $this;
+ }
+}
+
+
diff --git a/lib/Models/AddContactToListByIDs.php b/lib/Models/AddContactToListByIDs.php
new file mode 100644
index 0000000..deaff7f
--- /dev/null
+++ b/lib/Models/AddContactToListByIDs.php
@@ -0,0 +1,222 @@
+
+ */
+class AddContactToListByIDs extends AbstractModel
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static string $openAPIModelName = 'addContactToListByIDs';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPITypes = [
+ 'ids' => 'int[]'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPIFormats = [
+ 'ids' => 'int64'
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPINullables = [
+ 'ids' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var array
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var array
+ */
+ protected static array $attributeMap = [
+ 'ids' => 'ids'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var array
+ */
+ protected static array $setters = [
+ 'ids' => 'setIds'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var array
+ */
+ protected static array $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(): array
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters(): array
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters(): array
+ {
+ return self::$getters;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var array
+ */
+ protected array $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param array $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('ids', $data ?? [], null);
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return string[] invalid properties with reasons
+ */
+ public function listInvalidProperties(): array
+ {
+ $invalidProperties = [];
+
+ if (!is_null($this->container['ids']) && (count($this->container['ids']) > 150)) {
+ $invalidProperties[] = "invalid value for 'ids', number of items must be less than or equal to 150.";
+ }
+
+ if (!is_null($this->container['ids']) && (count($this->container['ids']) < 1)) {
+ $invalidProperties[] = "invalid value for 'ids', number of items must be greater than or equal to 1.";
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Gets ids
+ *
+ * @return int[]|null
+ */
+ public function getIds(): ?array
+ {
+ return $this->container['ids'];
+ }
+
+ /**
+ * Sets ids
+ *
+ * @param int[]|null $ids IDs to add to a list. You can pass a **maximum of 150 IDs** for addition in one request. **_If you need to add the emails in bulk, please prefer /contacts/import api._**
+ *
+ * @return $this
+ */
+ public function setIds(?array $ids): static
+ {
+ if (is_null($ids)) {
+ throw new InvalidArgumentException('non-nullable ids cannot be null');
+ }
+
+ if ((count($ids) > 150)) {
+ throw new InvalidArgumentException('invalid value for $ids when calling AddContactToListByIDs., number of items must be less than or equal to 150.');
+ }
+ if ((count($ids) < 1)) {
+ throw new InvalidArgumentException('invalid length for $ids when calling AddContactToListByIDs., number of items must be greater than or equal to 1.');
+ }
+ $this->container['ids'] = $ids;
+
+ return $this;
+ }
+}
+
+
diff --git a/lib/Models/AddContactToListRequest.php b/lib/Models/AddContactToListRequest.php
new file mode 100644
index 0000000..3aaf142
--- /dev/null
+++ b/lib/Models/AddContactToListRequest.php
@@ -0,0 +1,320 @@
+
+ */
+class AddContactToListRequest extends AbstractModel
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static string $openAPIModelName = 'addContactToList_request';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPITypes = [
+ 'emails' => 'string[]',
+ 'ids' => 'int[]',
+ 'extIds' => 'string[]'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPIFormats = [
+ 'emails' => 'email',
+ 'ids' => 'int64',
+ 'extIds' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPINullables = [
+ 'emails' => false,
+ 'ids' => false,
+ 'extIds' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var array
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var array
+ */
+ protected static array $attributeMap = [
+ 'emails' => 'emails',
+ 'ids' => 'ids',
+ 'extIds' => 'extIds'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var array
+ */
+ protected static array $setters = [
+ 'emails' => 'setEmails',
+ 'ids' => 'setIds',
+ 'extIds' => 'setExtIds'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var array
+ */
+ protected static array $getters = [
+ 'emails' => 'getEmails',
+ 'ids' => 'getIds',
+ 'extIds' => 'getExtIds'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap(): array
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters(): array
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters(): array
+ {
+ return self::$getters;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var array
+ */
+ protected array $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param array $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('emails', $data ?? [], null);
+ $this->setIfExists('ids', $data ?? [], null);
+ $this->setIfExists('extIds', $data ?? [], null);
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return string[] invalid properties with reasons
+ */
+ public function listInvalidProperties(): array
+ {
+ $invalidProperties = [];
+
+ if (!is_null($this->container['emails']) && (count($this->container['emails']) > 150)) {
+ $invalidProperties[] = "invalid value for 'emails', number of items must be less than or equal to 150.";
+ }
+
+ if (!is_null($this->container['emails']) && (count($this->container['emails']) < 1)) {
+ $invalidProperties[] = "invalid value for 'emails', number of items must be greater than or equal to 1.";
+ }
+
+ if (!is_null($this->container['ids']) && (count($this->container['ids']) > 150)) {
+ $invalidProperties[] = "invalid value for 'ids', number of items must be less than or equal to 150.";
+ }
+
+ if (!is_null($this->container['ids']) && (count($this->container['ids']) < 1)) {
+ $invalidProperties[] = "invalid value for 'ids', number of items must be greater than or equal to 1.";
+ }
+
+ if (!is_null($this->container['extIds']) && (count($this->container['extIds']) > 150)) {
+ $invalidProperties[] = "invalid value for 'extIds', number of items must be less than or equal to 150.";
+ }
+
+ if (!is_null($this->container['extIds']) && (count($this->container['extIds']) < 1)) {
+ $invalidProperties[] = "invalid value for 'extIds', number of items must be greater than or equal to 1.";
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Gets emails
+ *
+ * @return string[]|null
+ */
+ public function getEmails(): ?array
+ {
+ return $this->container['emails'];
+ }
+
+ /**
+ * Sets emails
+ *
+ * @param string[]|null $emails Emails to add to a list. You can pass a **maximum of 150 emails** for addition in one request. **_If you need to add the emails in bulk, please prefer /contacts/import api._**
+ *
+ * @return $this
+ */
+ public function setEmails(?array $emails): static
+ {
+ if (is_null($emails)) {
+ throw new InvalidArgumentException('non-nullable emails cannot be null');
+ }
+
+ if ((count($emails) > 150)) {
+ throw new InvalidArgumentException('invalid value for $emails when calling AddContactToListRequest., number of items must be less than or equal to 150.');
+ }
+ if ((count($emails) < 1)) {
+ throw new InvalidArgumentException('invalid length for $emails when calling AddContactToListRequest., number of items must be greater than or equal to 1.');
+ }
+ $this->container['emails'] = $emails;
+
+ return $this;
+ }
+
+ /**
+ * Gets ids
+ *
+ * @return int[]|null
+ */
+ public function getIds(): ?array
+ {
+ return $this->container['ids'];
+ }
+
+ /**
+ * Sets ids
+ *
+ * @param int[]|null $ids IDs to add to a list. You can pass a **maximum of 150 IDs** for addition in one request. **_If you need to add the emails in bulk, please prefer /contacts/import api._**
+ *
+ * @return $this
+ */
+ public function setIds(?array $ids): static
+ {
+ if (is_null($ids)) {
+ throw new InvalidArgumentException('non-nullable ids cannot be null');
+ }
+
+ if ((count($ids) > 150)) {
+ throw new InvalidArgumentException('invalid value for $ids when calling AddContactToListRequest., number of items must be less than or equal to 150.');
+ }
+ if ((count($ids) < 1)) {
+ throw new InvalidArgumentException('invalid length for $ids when calling AddContactToListRequest., number of items must be greater than or equal to 1.');
+ }
+ $this->container['ids'] = $ids;
+
+ return $this;
+ }
+
+ /**
+ * Gets extIds
+ *
+ * @return string[]|null
+ */
+ public function getExtIds(): ?array
+ {
+ return $this->container['extIds'];
+ }
+
+ /**
+ * Sets extIds
+ *
+ * @param string[]|null $extIds EXT_ID attributes to add to a list. You can pass a **maximum of 150 EXT_ID attributes** for addition in one request. **_If you need to add the emails in bulk, please prefer /contacts/import api._**
+ *
+ * @return $this
+ */
+ public function setExtIds(?array $extIds): static
+ {
+ if (is_null($extIds)) {
+ throw new InvalidArgumentException('non-nullable extIds cannot be null');
+ }
+
+ if ((count($extIds) > 150)) {
+ throw new InvalidArgumentException('invalid value for $extIds when calling AddContactToListRequest., number of items must be less than or equal to 150.');
+ }
+ if ((count($extIds) < 1)) {
+ throw new InvalidArgumentException('invalid length for $extIds when calling AddContactToListRequest., number of items must be greater than or equal to 1.');
+ }
+ $this->container['extIds'] = $extIds;
+
+ return $this;
+ }
+}
+
+
diff --git a/lib/Models/AttributeRewardPayload.php b/lib/Models/AttributeRewardPayload.php
new file mode 100644
index 0000000..382b99b
--- /dev/null
+++ b/lib/Models/AttributeRewardPayload.php
@@ -0,0 +1,278 @@
+
+ */
+class AttributeRewardPayload extends AbstractModel
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static string $openAPIModelName = 'attributeRewardPayload';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPITypes = [
+ 'rewardId' => 'string',
+ 'contactId' => 'float',
+ 'loyaltySubscriptionId' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPIFormats = [
+ 'rewardId' => 'uuid',
+ 'contactId' => null,
+ 'loyaltySubscriptionId' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPINullables = [
+ 'rewardId' => false,
+ 'contactId' => false,
+ 'loyaltySubscriptionId' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var array
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var array
+ */
+ protected static array $attributeMap = [
+ 'rewardId' => 'rewardId',
+ 'contactId' => 'contactId',
+ 'loyaltySubscriptionId' => 'loyaltySubscriptionId'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var array
+ */
+ protected static array $setters = [
+ 'rewardId' => 'setRewardId',
+ 'contactId' => 'setContactId',
+ 'loyaltySubscriptionId' => 'setLoyaltySubscriptionId'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var array
+ */
+ protected static array $getters = [
+ 'rewardId' => 'getRewardId',
+ 'contactId' => 'getContactId',
+ 'loyaltySubscriptionId' => 'getLoyaltySubscriptionId'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap(): array
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters(): array
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters(): array
+ {
+ return self::$getters;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var array
+ */
+ protected array $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param array $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('rewardId', $data ?? [], null);
+ $this->setIfExists('contactId', $data ?? [], null);
+ $this->setIfExists('loyaltySubscriptionId', $data ?? [], null);
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return string[] invalid properties with reasons
+ */
+ public function listInvalidProperties(): array
+ {
+ $invalidProperties = [];
+
+ if ($this->container['rewardId'] === null) {
+ $invalidProperties[] = "'rewardId' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Gets rewardId
+ *
+ * @return string
+ */
+ public function getRewardId(): string
+ {
+ return $this->container['rewardId'];
+ }
+
+ /**
+ * Sets rewardId
+ *
+ * @param string $rewardId Reward id
+ *
+ * @return $this
+ */
+ public function setRewardId(string $rewardId): static
+ {
+ if (is_null($rewardId)) {
+ throw new InvalidArgumentException('non-nullable rewardId cannot be null');
+ }
+ $this->container['rewardId'] = $rewardId;
+
+ return $this;
+ }
+
+ /**
+ * Gets contactId
+ *
+ * @return float|null
+ */
+ public function getContactId(): ?float
+ {
+ return $this->container['contactId'];
+ }
+
+ /**
+ * Sets contactId
+ *
+ * @param float|null $contactId Contact to attribute the reward
+ *
+ * @return $this
+ */
+ public function setContactId(?float $contactId): static
+ {
+ if (is_null($contactId)) {
+ throw new InvalidArgumentException('non-nullable contactId cannot be null');
+ }
+ $this->container['contactId'] = $contactId;
+
+ return $this;
+ }
+
+ /**
+ * Gets loyaltySubscriptionId
+ *
+ * @return string|null
+ */
+ public function getLoyaltySubscriptionId(): ?string
+ {
+ return $this->container['loyaltySubscriptionId'];
+ }
+
+ /**
+ * Sets loyaltySubscriptionId
+ *
+ * @param string|null $loyaltySubscriptionId One of contactId or loyaltySubscriptionId is required
+ *
+ * @return $this
+ */
+ public function setLoyaltySubscriptionId(?string $loyaltySubscriptionId): static
+ {
+ if (is_null($loyaltySubscriptionId)) {
+ throw new InvalidArgumentException('non-nullable loyaltySubscriptionId cannot be null');
+ }
+ $this->container['loyaltySubscriptionId'] = $loyaltySubscriptionId;
+
+ return $this;
+ }
+}
+
+
diff --git a/lib/Models/AttributedRewardFailedConditionErrorResponse.php b/lib/Models/AttributedRewardFailedConditionErrorResponse.php
new file mode 100644
index 0000000..3eb7093
--- /dev/null
+++ b/lib/Models/AttributedRewardFailedConditionErrorResponse.php
@@ -0,0 +1,207 @@
+
+ */
+class AttributedRewardFailedConditionErrorResponse extends AbstractModel
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static string $openAPIModelName = 'attributedRewardFailedConditionErrorResponse';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPITypes = [
+ 'error' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPIFormats = [
+ 'error' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPINullables = [
+ 'error' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var array
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var array
+ */
+ protected static array $attributeMap = [
+ 'error' => 'error'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var array
+ */
+ protected static array $setters = [
+ 'error' => 'setError'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var array
+ */
+ protected static array $getters = [
+ 'error' => 'getError'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap(): array
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters(): array
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters(): array
+ {
+ return self::$getters;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var array
+ */
+ protected array $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param array $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('error', $data ?? [], null);
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return string[] invalid properties with reasons
+ */
+ public function listInvalidProperties(): array
+ {
+ $invalidProperties = [];
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Gets error
+ *
+ * @return string|null
+ */
+ public function getError(): ?string
+ {
+ return $this->container['error'];
+ }
+
+ /**
+ * Sets error
+ *
+ * @param string|null $error error
+ *
+ * @return $this
+ */
+ public function setError(?string $error): static
+ {
+ if (is_null($error)) {
+ throw new InvalidArgumentException('non-nullable error cannot be null');
+ }
+ $this->container['error'] = $error;
+
+ return $this;
+ }
+}
+
+
diff --git a/lib/Models/AuthenticateDomainModel.php b/lib/Models/AuthenticateDomainModel.php
new file mode 100644
index 0000000..b94716a
--- /dev/null
+++ b/lib/Models/AuthenticateDomainModel.php
@@ -0,0 +1,247 @@
+
+ */
+class AuthenticateDomainModel extends AbstractModel
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static string $openAPIModelName = 'authenticateDomainModel';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPITypes = [
+ 'domainName' => 'string',
+ 'message' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPIFormats = [
+ 'domainName' => null,
+ 'message' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPINullables = [
+ 'domainName' => false,
+ 'message' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var array
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var array
+ */
+ protected static array $attributeMap = [
+ 'domainName' => 'domain_name',
+ 'message' => 'message'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var array
+ */
+ protected static array $setters = [
+ 'domainName' => 'setDomainName',
+ 'message' => 'setMessage'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var array
+ */
+ protected static array $getters = [
+ 'domainName' => 'getDomainName',
+ 'message' => 'getMessage'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap(): array
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters(): array
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters(): array
+ {
+ return self::$getters;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var array
+ */
+ protected array $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param array $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('domainName', $data ?? [], null);
+ $this->setIfExists('message', $data ?? [], null);
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return string[] invalid properties with reasons
+ */
+ public function listInvalidProperties(): array
+ {
+ $invalidProperties = [];
+
+ if ($this->container['domainName'] === null) {
+ $invalidProperties[] = "'domainName' can't be null";
+ }
+ if ($this->container['message'] === null) {
+ $invalidProperties[] = "'message' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Gets domainName
+ *
+ * @return string
+ */
+ public function getDomainName(): string
+ {
+ return $this->container['domainName'];
+ }
+
+ /**
+ * Sets domainName
+ *
+ * @param string $domainName Domain
+ *
+ * @return $this
+ */
+ public function setDomainName(string $domainName): static
+ {
+ if (is_null($domainName)) {
+ throw new InvalidArgumentException('non-nullable domainName cannot be null');
+ }
+ $this->container['domainName'] = $domainName;
+
+ return $this;
+ }
+
+ /**
+ * Gets message
+ *
+ * @return string
+ */
+ public function getMessage(): string
+ {
+ return $this->container['message'];
+ }
+
+ /**
+ * Sets message
+ *
+ * @param string $message Success message
+ *
+ * @return $this
+ */
+ public function setMessage(string $message): static
+ {
+ if (is_null($message)) {
+ throw new InvalidArgumentException('non-nullable message cannot be null');
+ }
+ $this->container['message'] = $message;
+
+ return $this;
+ }
+}
+
+
diff --git a/lib/Models/BadRequestPayload.php b/lib/Models/BadRequestPayload.php
new file mode 100644
index 0000000..90f6f61
--- /dev/null
+++ b/lib/Models/BadRequestPayload.php
@@ -0,0 +1,207 @@
+
+ */
+class BadRequestPayload extends AbstractModel
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static string $openAPIModelName = 'badRequestPayload';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPITypes = [
+ 'error' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPIFormats = [
+ 'error' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPINullables = [
+ 'error' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var array
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var array
+ */
+ protected static array $attributeMap = [
+ 'error' => 'error'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var array
+ */
+ protected static array $setters = [
+ 'error' => 'setError'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var array
+ */
+ protected static array $getters = [
+ 'error' => 'getError'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap(): array
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters(): array
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters(): array
+ {
+ return self::$getters;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var array
+ */
+ protected array $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param array $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('error', $data ?? [], null);
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return string[] invalid properties with reasons
+ */
+ public function listInvalidProperties(): array
+ {
+ $invalidProperties = [];
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Gets error
+ *
+ * @return string|null
+ */
+ public function getError(): ?string
+ {
+ return $this->container['error'];
+ }
+
+ /**
+ * Sets error
+ *
+ * @param string|null $error Readable message associated to the failure
+ *
+ * @return $this
+ */
+ public function setError(?string $error): static
+ {
+ if (is_null($error)) {
+ throw new InvalidArgumentException('non-nullable error cannot be null');
+ }
+ $this->container['error'] = $error;
+
+ return $this;
+ }
+}
+
+
diff --git a/lib/Models/Balance.php b/lib/Models/Balance.php
new file mode 100644
index 0000000..7e9a658
--- /dev/null
+++ b/lib/Models/Balance.php
@@ -0,0 +1,275 @@
+
+ */
+class Balance extends AbstractModel
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static string $openAPIModelName = 'balance';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPITypes = [
+ 'loyaltyProgramId' => 'string',
+ 'contactId' => 'int',
+ 'balances' => '\Brevo\Client\Models\BalanceBalancesInner[]'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPIFormats = [
+ 'loyaltyProgramId' => 'uuid',
+ 'contactId' => null,
+ 'balances' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPINullables = [
+ 'loyaltyProgramId' => false,
+ 'contactId' => false,
+ 'balances' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var array
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var array
+ */
+ protected static array $attributeMap = [
+ 'loyaltyProgramId' => 'loyaltyProgramId',
+ 'contactId' => 'contactId',
+ 'balances' => 'balances'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var array
+ */
+ protected static array $setters = [
+ 'loyaltyProgramId' => 'setLoyaltyProgramId',
+ 'contactId' => 'setContactId',
+ 'balances' => 'setBalances'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var array
+ */
+ protected static array $getters = [
+ 'loyaltyProgramId' => 'getLoyaltyProgramId',
+ 'contactId' => 'getContactId',
+ 'balances' => 'getBalances'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap(): array
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters(): array
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters(): array
+ {
+ return self::$getters;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var array
+ */
+ protected array $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param array $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('loyaltyProgramId', $data ?? [], null);
+ $this->setIfExists('contactId', $data ?? [], null);
+ $this->setIfExists('balances', $data ?? [], null);
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return string[] invalid properties with reasons
+ */
+ public function listInvalidProperties(): array
+ {
+ $invalidProperties = [];
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Gets loyaltyProgramId
+ *
+ * @return string|null
+ */
+ public function getLoyaltyProgramId(): ?string
+ {
+ return $this->container['loyaltyProgramId'];
+ }
+
+ /**
+ * Sets loyaltyProgramId
+ *
+ * @param string|null $loyaltyProgramId Loyalty program Id
+ *
+ * @return $this
+ */
+ public function setLoyaltyProgramId(?string $loyaltyProgramId): static
+ {
+ if (is_null($loyaltyProgramId)) {
+ throw new InvalidArgumentException('non-nullable loyaltyProgramId cannot be null');
+ }
+ $this->container['loyaltyProgramId'] = $loyaltyProgramId;
+
+ return $this;
+ }
+
+ /**
+ * Gets contactId
+ *
+ * @return int|null
+ */
+ public function getContactId(): ?int
+ {
+ return $this->container['contactId'];
+ }
+
+ /**
+ * Sets contactId
+ *
+ * @param int|null $contactId Contact Id associated with the balance
+ *
+ * @return $this
+ */
+ public function setContactId(?int $contactId): static
+ {
+ if (is_null($contactId)) {
+ throw new InvalidArgumentException('non-nullable contactId cannot be null');
+ }
+ $this->container['contactId'] = $contactId;
+
+ return $this;
+ }
+
+ /**
+ * Gets balances
+ *
+ * @return \Brevo\Client\Models\BalanceBalancesInner[]|null
+ */
+ public function getBalances(): ?array
+ {
+ return $this->container['balances'];
+ }
+
+ /**
+ * Sets balances
+ *
+ * @param \Brevo\Client\Models\BalanceBalancesInner[]|null $balances List of balances
+ *
+ * @return $this
+ */
+ public function setBalances(?array $balances): static
+ {
+ if (is_null($balances)) {
+ throw new InvalidArgumentException('non-nullable balances cannot be null');
+ }
+ $this->container['balances'] = $balances;
+
+ return $this;
+ }
+}
+
+
diff --git a/lib/Models/BalanceBalancesInner.php b/lib/Models/BalanceBalancesInner.php
new file mode 100644
index 0000000..8e29d0c
--- /dev/null
+++ b/lib/Models/BalanceBalancesInner.php
@@ -0,0 +1,241 @@
+
+ */
+class BalanceBalancesInner extends AbstractModel
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static string $openAPIModelName = 'balance_balances_inner';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPITypes = [
+ 'balanceDefinitionId' => 'string',
+ 'value' => 'float'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPIFormats = [
+ 'balanceDefinitionId' => 'uuid',
+ 'value' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPINullables = [
+ 'balanceDefinitionId' => false,
+ 'value' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var array
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var array
+ */
+ protected static array $attributeMap = [
+ 'balanceDefinitionId' => 'balanceDefinitionId',
+ 'value' => 'value'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var array
+ */
+ protected static array $setters = [
+ 'balanceDefinitionId' => 'setBalanceDefinitionId',
+ 'value' => 'setValue'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var array
+ */
+ protected static array $getters = [
+ 'balanceDefinitionId' => 'getBalanceDefinitionId',
+ 'value' => 'getValue'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap(): array
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters(): array
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters(): array
+ {
+ return self::$getters;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var array
+ */
+ protected array $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param array $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('balanceDefinitionId', $data ?? [], null);
+ $this->setIfExists('value', $data ?? [], null);
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return string[] invalid properties with reasons
+ */
+ public function listInvalidProperties(): array
+ {
+ $invalidProperties = [];
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Gets balanceDefinitionId
+ *
+ * @return string|null
+ */
+ public function getBalanceDefinitionId(): ?string
+ {
+ return $this->container['balanceDefinitionId'];
+ }
+
+ /**
+ * Sets balanceDefinitionId
+ *
+ * @param string|null $balanceDefinitionId Balance definition Id
+ *
+ * @return $this
+ */
+ public function setBalanceDefinitionId(?string $balanceDefinitionId): static
+ {
+ if (is_null($balanceDefinitionId)) {
+ throw new InvalidArgumentException('non-nullable balanceDefinitionId cannot be null');
+ }
+ $this->container['balanceDefinitionId'] = $balanceDefinitionId;
+
+ return $this;
+ }
+
+ /**
+ * Gets value
+ *
+ * @return float|null
+ */
+ public function getValue(): ?float
+ {
+ return $this->container['value'];
+ }
+
+ /**
+ * Sets value
+ *
+ * @param float|null $value The monetary value corresponding to the current balance
+ *
+ * @return $this
+ */
+ public function setValue(?float $value): static
+ {
+ if (is_null($value)) {
+ throw new InvalidArgumentException('non-nullable value cannot be null');
+ }
+ $this->container['value'] = $value;
+
+ return $this;
+ }
+}
+
+
diff --git a/lib/Models/BalanceDefinition.php b/lib/Models/BalanceDefinition.php
new file mode 100644
index 0000000..670f197
--- /dev/null
+++ b/lib/Models/BalanceDefinition.php
@@ -0,0 +1,821 @@
+
+ */
+class BalanceDefinition extends AbstractModel
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static string $openAPIModelName = 'balanceDefinition';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPITypes = [
+ 'id' => 'string',
+ 'name' => 'string',
+ 'description' => 'string',
+ 'meta' => 'object',
+ 'unit' => 'string',
+ 'minAmount' => 'float',
+ 'maxAmount' => 'float',
+ 'maximumCreditAmountLimit' => 'float',
+ 'maximumDebitAmountLimit' => 'float',
+ 'balanceOptionAmountOvertakingStrategy' => 'string',
+ 'balanceOptionCreditRounding' => 'string',
+ 'balanceOptionDebitRounding' => 'string',
+ 'balanceAvailabilityDurationValue' => 'float',
+ 'balanceAvailabilityDurationUnit' => 'string',
+ 'balanceAvailabilityDurationModifier' => 'string',
+ 'balanceExpirationDate' => '\DateTime',
+ 'createdAt' => '\DateTime',
+ 'updatedAt' => '\DateTime'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPIFormats = [
+ 'id' => 'uuid',
+ 'name' => null,
+ 'description' => null,
+ 'meta' => null,
+ 'unit' => null,
+ 'minAmount' => null,
+ 'maxAmount' => null,
+ 'maximumCreditAmountLimit' => null,
+ 'maximumDebitAmountLimit' => null,
+ 'balanceOptionAmountOvertakingStrategy' => null,
+ 'balanceOptionCreditRounding' => null,
+ 'balanceOptionDebitRounding' => null,
+ 'balanceAvailabilityDurationValue' => null,
+ 'balanceAvailabilityDurationUnit' => null,
+ 'balanceAvailabilityDurationModifier' => null,
+ 'balanceExpirationDate' => 'date-time',
+ 'createdAt' => 'date-time',
+ 'updatedAt' => 'date-time'
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPINullables = [
+ 'id' => false,
+ 'name' => false,
+ 'description' => false,
+ 'meta' => false,
+ 'unit' => false,
+ 'minAmount' => false,
+ 'maxAmount' => false,
+ 'maximumCreditAmountLimit' => false,
+ 'maximumDebitAmountLimit' => false,
+ 'balanceOptionAmountOvertakingStrategy' => false,
+ 'balanceOptionCreditRounding' => false,
+ 'balanceOptionDebitRounding' => false,
+ 'balanceAvailabilityDurationValue' => false,
+ 'balanceAvailabilityDurationUnit' => false,
+ 'balanceAvailabilityDurationModifier' => false,
+ 'balanceExpirationDate' => false,
+ 'createdAt' => false,
+ 'updatedAt' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var array
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var array
+ */
+ protected static array $attributeMap = [
+ 'id' => 'id',
+ 'name' => 'name',
+ 'description' => 'description',
+ 'meta' => 'meta',
+ 'unit' => 'unit',
+ 'minAmount' => 'minAmount',
+ 'maxAmount' => 'maxAmount',
+ 'maximumCreditAmountLimit' => 'maximumCreditAmountLimit',
+ 'maximumDebitAmountLimit' => 'maximumDebitAmountLimit',
+ 'balanceOptionAmountOvertakingStrategy' => 'balanceOptionAmountOvertakingStrategy',
+ 'balanceOptionCreditRounding' => 'balanceOptionCreditRounding',
+ 'balanceOptionDebitRounding' => 'balanceOptionDebitRounding',
+ 'balanceAvailabilityDurationValue' => 'balanceAvailabilityDurationValue',
+ 'balanceAvailabilityDurationUnit' => 'balanceAvailabilityDurationUnit',
+ 'balanceAvailabilityDurationModifier' => 'balanceAvailabilityDurationModifier',
+ 'balanceExpirationDate' => 'balanceExpirationDate',
+ 'createdAt' => 'createdAt',
+ 'updatedAt' => 'updatedAt'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var array
+ */
+ protected static array $setters = [
+ 'id' => 'setId',
+ 'name' => 'setName',
+ 'description' => 'setDescription',
+ 'meta' => 'setMeta',
+ 'unit' => 'setUnit',
+ 'minAmount' => 'setMinAmount',
+ 'maxAmount' => 'setMaxAmount',
+ 'maximumCreditAmountLimit' => 'setMaximumCreditAmountLimit',
+ 'maximumDebitAmountLimit' => 'setMaximumDebitAmountLimit',
+ 'balanceOptionAmountOvertakingStrategy' => 'setBalanceOptionAmountOvertakingStrategy',
+ 'balanceOptionCreditRounding' => 'setBalanceOptionCreditRounding',
+ 'balanceOptionDebitRounding' => 'setBalanceOptionDebitRounding',
+ 'balanceAvailabilityDurationValue' => 'setBalanceAvailabilityDurationValue',
+ 'balanceAvailabilityDurationUnit' => 'setBalanceAvailabilityDurationUnit',
+ 'balanceAvailabilityDurationModifier' => 'setBalanceAvailabilityDurationModifier',
+ 'balanceExpirationDate' => 'setBalanceExpirationDate',
+ 'createdAt' => 'setCreatedAt',
+ 'updatedAt' => 'setUpdatedAt'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var array
+ */
+ protected static array $getters = [
+ 'id' => 'getId',
+ 'name' => 'getName',
+ 'description' => 'getDescription',
+ 'meta' => 'getMeta',
+ 'unit' => 'getUnit',
+ 'minAmount' => 'getMinAmount',
+ 'maxAmount' => 'getMaxAmount',
+ 'maximumCreditAmountLimit' => 'getMaximumCreditAmountLimit',
+ 'maximumDebitAmountLimit' => 'getMaximumDebitAmountLimit',
+ 'balanceOptionAmountOvertakingStrategy' => 'getBalanceOptionAmountOvertakingStrategy',
+ 'balanceOptionCreditRounding' => 'getBalanceOptionCreditRounding',
+ 'balanceOptionDebitRounding' => 'getBalanceOptionDebitRounding',
+ 'balanceAvailabilityDurationValue' => 'getBalanceAvailabilityDurationValue',
+ 'balanceAvailabilityDurationUnit' => 'getBalanceAvailabilityDurationUnit',
+ 'balanceAvailabilityDurationModifier' => 'getBalanceAvailabilityDurationModifier',
+ 'balanceExpirationDate' => 'getBalanceExpirationDate',
+ 'createdAt' => 'getCreatedAt',
+ 'updatedAt' => 'getUpdatedAt'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap(): array
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters(): array
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters(): array
+ {
+ return self::$getters;
+ }
+
+ public const BALANCE_AVAILABILITY_DURATION_MODIFIER_START_OF_PERIOD = 'startOfPeriod';
+ public const BALANCE_AVAILABILITY_DURATION_MODIFIER_END_OF_PERIOD = 'endOfPeriod';
+ public const BALANCE_AVAILABILITY_DURATION_MODIFIER_NO_MODIFICATION = 'noModification';
+
+ /**
+ * Gets allowable values of the enum
+ *
+ * @return string[]
+ */
+ public function getBalanceAvailabilityDurationModifierAllowableValues()
+ {
+ return [
+ self::BALANCE_AVAILABILITY_DURATION_MODIFIER_START_OF_PERIOD,
+ self::BALANCE_AVAILABILITY_DURATION_MODIFIER_END_OF_PERIOD,
+ self::BALANCE_AVAILABILITY_DURATION_MODIFIER_NO_MODIFICATION,
+ ];
+ }
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var array
+ */
+ protected array $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param array $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('id', $data ?? [], null);
+ $this->setIfExists('name', $data ?? [], null);
+ $this->setIfExists('description', $data ?? [], null);
+ $this->setIfExists('meta', $data ?? [], null);
+ $this->setIfExists('unit', $data ?? [], null);
+ $this->setIfExists('minAmount', $data ?? [], null);
+ $this->setIfExists('maxAmount', $data ?? [], null);
+ $this->setIfExists('maximumCreditAmountLimit', $data ?? [], null);
+ $this->setIfExists('maximumDebitAmountLimit', $data ?? [], null);
+ $this->setIfExists('balanceOptionAmountOvertakingStrategy', $data ?? [], null);
+ $this->setIfExists('balanceOptionCreditRounding', $data ?? [], null);
+ $this->setIfExists('balanceOptionDebitRounding', $data ?? [], null);
+ $this->setIfExists('balanceAvailabilityDurationValue', $data ?? [], null);
+ $this->setIfExists('balanceAvailabilityDurationUnit', $data ?? [], null);
+ $this->setIfExists('balanceAvailabilityDurationModifier', $data ?? [], null);
+ $this->setIfExists('balanceExpirationDate', $data ?? [], null);
+ $this->setIfExists('createdAt', $data ?? [], null);
+ $this->setIfExists('updatedAt', $data ?? [], null);
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return string[] invalid properties with reasons
+ */
+ public function listInvalidProperties(): array
+ {
+ $invalidProperties = [];
+
+ $allowedValues = $this->getBalanceAvailabilityDurationModifierAllowableValues();
+ if (!is_null($this->container['balanceAvailabilityDurationModifier']) && !in_array($this->container['balanceAvailabilityDurationModifier'], $allowedValues, true)) {
+ $invalidProperties[] = sprintf(
+ "invalid value '%s' for 'balanceAvailabilityDurationModifier', must be one of '%s'",
+ $this->container['balanceAvailabilityDurationModifier'],
+ implode("', '", $allowedValues)
+ );
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Gets id
+ *
+ * @return string|null
+ */
+ public function getId(): ?string
+ {
+ return $this->container['id'];
+ }
+
+ /**
+ * Sets id
+ *
+ * @param string|null $id Unique identifier for the balance definition.
+ *
+ * @return $this
+ */
+ public function setId(?string $id): static
+ {
+ if (is_null($id)) {
+ throw new InvalidArgumentException('non-nullable id cannot be null');
+ }
+ $this->container['id'] = $id;
+
+ return $this;
+ }
+
+ /**
+ * Gets name
+ *
+ * @return string|null
+ */
+ public function getName(): ?string
+ {
+ return $this->container['name'];
+ }
+
+ /**
+ * Sets name
+ *
+ * @param string|null $name Name for the balance definition
+ *
+ * @return $this
+ */
+ public function setName(?string $name): static
+ {
+ if (is_null($name)) {
+ throw new InvalidArgumentException('non-nullable name cannot be null');
+ }
+ $this->container['name'] = $name;
+
+ return $this;
+ }
+
+ /**
+ * Gets description
+ *
+ * @return string|null
+ */
+ public function getDescription(): ?string
+ {
+ return $this->container['description'];
+ }
+
+ /**
+ * Sets description
+ *
+ * @param string|null $description Description for the balance definition
+ *
+ * @return $this
+ */
+ public function setDescription(?string $description): static
+ {
+ if (is_null($description)) {
+ throw new InvalidArgumentException('non-nullable description cannot be null');
+ }
+ $this->container['description'] = $description;
+
+ return $this;
+ }
+
+ /**
+ * Gets meta
+ *
+ * @return object|null
+ */
+ public function getMeta(): ?object
+ {
+ return $this->container['meta'];
+ }
+
+ /**
+ * Sets meta
+ *
+ * @param object|null $meta Additional metadata related to the balance definition.
+ *
+ * @return $this
+ */
+ public function setMeta(?object $meta): static
+ {
+ if (is_null($meta)) {
+ throw new InvalidArgumentException('non-nullable meta cannot be null');
+ }
+ $this->container['meta'] = $meta;
+
+ return $this;
+ }
+
+ /**
+ * Gets unit
+ *
+ * @return string|null
+ */
+ public function getUnit(): ?string
+ {
+ return $this->container['unit'];
+ }
+
+ /**
+ * Sets unit
+ *
+ * @param string|null $unit The unit for this balance definition
+ *
+ * @return $this
+ */
+ public function setUnit(?string $unit): static
+ {
+ if (is_null($unit)) {
+ throw new InvalidArgumentException('non-nullable unit cannot be null');
+ }
+ $this->container['unit'] = $unit;
+
+ return $this;
+ }
+
+ /**
+ * Gets minAmount
+ *
+ * @return float|null
+ */
+ public function getMinAmount(): ?float
+ {
+ return $this->container['minAmount'];
+ }
+
+ /**
+ * Sets minAmount
+ *
+ * @param float|null $minAmount Minimum possible amount for balance
+ *
+ * @return $this
+ */
+ public function setMinAmount(?float $minAmount): static
+ {
+ if (is_null($minAmount)) {
+ throw new InvalidArgumentException('non-nullable minAmount cannot be null');
+ }
+ $this->container['minAmount'] = $minAmount;
+
+ return $this;
+ }
+
+ /**
+ * Gets maxAmount
+ *
+ * @return float|null
+ */
+ public function getMaxAmount(): ?float
+ {
+ return $this->container['maxAmount'];
+ }
+
+ /**
+ * Sets maxAmount
+ *
+ * @param float|null $maxAmount Maximum possible amount for balance
+ *
+ * @return $this
+ */
+ public function setMaxAmount(?float $maxAmount): static
+ {
+ if (is_null($maxAmount)) {
+ throw new InvalidArgumentException('non-nullable maxAmount cannot be null');
+ }
+ $this->container['maxAmount'] = $maxAmount;
+
+ return $this;
+ }
+
+ /**
+ * Gets maximumCreditAmountLimit
+ *
+ * @return float|null
+ */
+ public function getMaximumCreditAmountLimit(): ?float
+ {
+ return $this->container['maximumCreditAmountLimit'];
+ }
+
+ /**
+ * Sets maximumCreditAmountLimit
+ *
+ * @param float|null $maximumCreditAmountLimit Maximum credit amount limit per operation
+ *
+ * @return $this
+ */
+ public function setMaximumCreditAmountLimit(?float $maximumCreditAmountLimit): static
+ {
+ if (is_null($maximumCreditAmountLimit)) {
+ throw new InvalidArgumentException('non-nullable maximumCreditAmountLimit cannot be null');
+ }
+ $this->container['maximumCreditAmountLimit'] = $maximumCreditAmountLimit;
+
+ return $this;
+ }
+
+ /**
+ * Gets maximumDebitAmountLimit
+ *
+ * @return float|null
+ */
+ public function getMaximumDebitAmountLimit(): ?float
+ {
+ return $this->container['maximumDebitAmountLimit'];
+ }
+
+ /**
+ * Sets maximumDebitAmountLimit
+ *
+ * @param float|null $maximumDebitAmountLimit Maximum debit amount limit per operation
+ *
+ * @return $this
+ */
+ public function setMaximumDebitAmountLimit(?float $maximumDebitAmountLimit): static
+ {
+ if (is_null($maximumDebitAmountLimit)) {
+ throw new InvalidArgumentException('non-nullable maximumDebitAmountLimit cannot be null');
+ }
+ $this->container['maximumDebitAmountLimit'] = $maximumDebitAmountLimit;
+
+ return $this;
+ }
+
+ /**
+ * Gets balanceOptionAmountOvertakingStrategy
+ *
+ * @return string|null
+ */
+ public function getBalanceOptionAmountOvertakingStrategy(): ?string
+ {
+ return $this->container['balanceOptionAmountOvertakingStrategy'];
+ }
+
+ /**
+ * Sets balanceOptionAmountOvertakingStrategy
+ *
+ * @param string|null $balanceOptionAmountOvertakingStrategy Partial enables partial credit of balance if maximum balance limit is reaching. Strict enables rejection of transaction if it will breach the max credit amount limit.
+ *
+ * @return $this
+ */
+ public function setBalanceOptionAmountOvertakingStrategy(?string $balanceOptionAmountOvertakingStrategy): static
+ {
+ if (is_null($balanceOptionAmountOvertakingStrategy)) {
+ throw new InvalidArgumentException('non-nullable balanceOptionAmountOvertakingStrategy cannot be null');
+ }
+ $this->container['balanceOptionAmountOvertakingStrategy'] = $balanceOptionAmountOvertakingStrategy;
+
+ return $this;
+ }
+
+ /**
+ * Gets balanceOptionCreditRounding
+ *
+ * @return string|null
+ */
+ public function getBalanceOptionCreditRounding(): ?string
+ {
+ return $this->container['balanceOptionCreditRounding'];
+ }
+
+ /**
+ * Sets balanceOptionCreditRounding
+ *
+ * @param string|null $balanceOptionCreditRounding balanceOptionCreditRounding
+ *
+ * @return $this
+ */
+ public function setBalanceOptionCreditRounding(?string $balanceOptionCreditRounding): static
+ {
+ if (is_null($balanceOptionCreditRounding)) {
+ throw new InvalidArgumentException('non-nullable balanceOptionCreditRounding cannot be null');
+ }
+ $this->container['balanceOptionCreditRounding'] = $balanceOptionCreditRounding;
+
+ return $this;
+ }
+
+ /**
+ * Gets balanceOptionDebitRounding
+ *
+ * @return string|null
+ */
+ public function getBalanceOptionDebitRounding(): ?string
+ {
+ return $this->container['balanceOptionDebitRounding'];
+ }
+
+ /**
+ * Sets balanceOptionDebitRounding
+ *
+ * @param string|null $balanceOptionDebitRounding balanceOptionDebitRounding
+ *
+ * @return $this
+ */
+ public function setBalanceOptionDebitRounding(?string $balanceOptionDebitRounding): static
+ {
+ if (is_null($balanceOptionDebitRounding)) {
+ throw new InvalidArgumentException('non-nullable balanceOptionDebitRounding cannot be null');
+ }
+ $this->container['balanceOptionDebitRounding'] = $balanceOptionDebitRounding;
+
+ return $this;
+ }
+
+ /**
+ * Gets balanceAvailabilityDurationValue
+ *
+ * @return float|null
+ */
+ public function getBalanceAvailabilityDurationValue(): ?float
+ {
+ return $this->container['balanceAvailabilityDurationValue'];
+ }
+
+ /**
+ * Sets balanceAvailabilityDurationValue
+ *
+ * @param float|null $balanceAvailabilityDurationValue Number of days/weeks/month/year for balance expiry
+ *
+ * @return $this
+ */
+ public function setBalanceAvailabilityDurationValue(?float $balanceAvailabilityDurationValue): static
+ {
+ if (is_null($balanceAvailabilityDurationValue)) {
+ throw new InvalidArgumentException('non-nullable balanceAvailabilityDurationValue cannot be null');
+ }
+ $this->container['balanceAvailabilityDurationValue'] = $balanceAvailabilityDurationValue;
+
+ return $this;
+ }
+
+ /**
+ * Gets balanceAvailabilityDurationUnit
+ *
+ * @return string|null
+ */
+ public function getBalanceAvailabilityDurationUnit(): ?string
+ {
+ return $this->container['balanceAvailabilityDurationUnit'];
+ }
+
+ /**
+ * Sets balanceAvailabilityDurationUnit
+ *
+ * @param string|null $balanceAvailabilityDurationUnit Unit of time for the balance's availability (e.g., day/week/month/year).
+ *
+ * @return $this
+ */
+ public function setBalanceAvailabilityDurationUnit(?string $balanceAvailabilityDurationUnit): static
+ {
+ if (is_null($balanceAvailabilityDurationUnit)) {
+ throw new InvalidArgumentException('non-nullable balanceAvailabilityDurationUnit cannot be null');
+ }
+ $this->container['balanceAvailabilityDurationUnit'] = $balanceAvailabilityDurationUnit;
+
+ return $this;
+ }
+
+ /**
+ * Gets balanceAvailabilityDurationModifier
+ *
+ * @return string|null
+ */
+ public function getBalanceAvailabilityDurationModifier(): ?string
+ {
+ return $this->container['balanceAvailabilityDurationModifier'];
+ }
+
+ /**
+ * Sets balanceAvailabilityDurationModifier
+ *
+ * @param string|null $balanceAvailabilityDurationModifier startOfPeriod depicts the balancy expiry on start of day/week/month/year. endOfPeriod depicts the balancy expiry on end of day/week/month/year
+ *
+ * @return $this
+ */
+ public function setBalanceAvailabilityDurationModifier(?string $balanceAvailabilityDurationModifier): static
+ {
+ if (is_null($balanceAvailabilityDurationModifier)) {
+ throw new InvalidArgumentException('non-nullable balanceAvailabilityDurationModifier cannot be null');
+ }
+ $allowedValues = $this->getBalanceAvailabilityDurationModifierAllowableValues();
+ if (!in_array($balanceAvailabilityDurationModifier, $allowedValues, true)) {
+ throw new InvalidArgumentException(
+ sprintf(
+ "Invalid value '%s' for 'balanceAvailabilityDurationModifier', must be one of '%s'",
+ $balanceAvailabilityDurationModifier,
+ implode("', '", $allowedValues)
+ )
+ );
+ }
+ $this->container['balanceAvailabilityDurationModifier'] = $balanceAvailabilityDurationModifier;
+
+ return $this;
+ }
+
+ /**
+ * Gets balanceExpirationDate
+ *
+ * @return \DateTime|null
+ */
+ public function getBalanceExpirationDate(): ?\DateTime
+ {
+ return $this->container['balanceExpirationDate'];
+ }
+
+ /**
+ * Sets balanceExpirationDate
+ *
+ * @param \DateTime|null $balanceExpirationDate Date when the balance expires and can no longer be used, in dd/mm format. The balance will be expired when this date appears next in the calendar and only one of balanceExpirationDate or balance availability fields can be used.
+ *
+ * @return $this
+ */
+ public function setBalanceExpirationDate(?\DateTime $balanceExpirationDate): static
+ {
+ if (is_null($balanceExpirationDate)) {
+ throw new InvalidArgumentException('non-nullable balanceExpirationDate cannot be null');
+ }
+ $this->container['balanceExpirationDate'] = $balanceExpirationDate;
+
+ return $this;
+ }
+
+ /**
+ * Gets createdAt
+ *
+ * @return \DateTime|null
+ */
+ public function getCreatedAt(): ?\DateTime
+ {
+ return $this->container['createdAt'];
+ }
+
+ /**
+ * Sets createdAt
+ *
+ * @param \DateTime|null $createdAt createdAt
+ *
+ * @return $this
+ */
+ public function setCreatedAt(?\DateTime $createdAt): static
+ {
+ if (is_null($createdAt)) {
+ throw new InvalidArgumentException('non-nullable createdAt cannot be null');
+ }
+ $this->container['createdAt'] = $createdAt;
+
+ return $this;
+ }
+
+ /**
+ * Gets updatedAt
+ *
+ * @return \DateTime|null
+ */
+ public function getUpdatedAt(): ?\DateTime
+ {
+ return $this->container['updatedAt'];
+ }
+
+ /**
+ * Sets updatedAt
+ *
+ * @param \DateTime|null $updatedAt updatedAt
+ *
+ * @return $this
+ */
+ public function setUpdatedAt(?\DateTime $updatedAt): static
+ {
+ if (is_null($updatedAt)) {
+ throw new InvalidArgumentException('non-nullable updatedAt cannot be null');
+ }
+ $this->container['updatedAt'] = $updatedAt;
+
+ return $this;
+ }
+}
+
+
diff --git a/lib/Models/BalanceDefinitionIdDoesNotExist.php b/lib/Models/BalanceDefinitionIdDoesNotExist.php
new file mode 100644
index 0000000..24ab052
--- /dev/null
+++ b/lib/Models/BalanceDefinitionIdDoesNotExist.php
@@ -0,0 +1,207 @@
+
+ */
+class BalanceDefinitionIdDoesNotExist extends AbstractModel
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static string $openAPIModelName = 'balanceDefinitionIdDoesNotExist';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPITypes = [
+ 'error' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPIFormats = [
+ 'error' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPINullables = [
+ 'error' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var array
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var array
+ */
+ protected static array $attributeMap = [
+ 'error' => 'error'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var array
+ */
+ protected static array $setters = [
+ 'error' => 'setError'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var array
+ */
+ protected static array $getters = [
+ 'error' => 'getError'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap(): array
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters(): array
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters(): array
+ {
+ return self::$getters;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var array
+ */
+ protected array $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param array $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('error', $data ?? [], null);
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return string[] invalid properties with reasons
+ */
+ public function listInvalidProperties(): array
+ {
+ $invalidProperties = [];
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Gets error
+ *
+ * @return string|null
+ */
+ public function getError(): ?string
+ {
+ return $this->container['error'];
+ }
+
+ /**
+ * Sets error
+ *
+ * @param string|null $error Provided balance definition id does not exist
+ *
+ * @return $this
+ */
+ public function setError(?string $error): static
+ {
+ if (is_null($error)) {
+ throw new InvalidArgumentException('non-nullable error cannot be null');
+ }
+ $this->container['error'] = $error;
+
+ return $this;
+ }
+}
+
+
diff --git a/lib/Models/BalanceDefinitionPage.php b/lib/Models/BalanceDefinitionPage.php
new file mode 100644
index 0000000..e0ae186
--- /dev/null
+++ b/lib/Models/BalanceDefinitionPage.php
@@ -0,0 +1,207 @@
+
+ */
+class BalanceDefinitionPage extends AbstractModel
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static string $openAPIModelName = 'balanceDefinitionPage';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPITypes = [
+ 'items' => '\Brevo\Client\Models\BalanceDefinition[]'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPIFormats = [
+ 'items' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPINullables = [
+ 'items' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var array
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var array
+ */
+ protected static array $attributeMap = [
+ 'items' => 'items'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var array
+ */
+ protected static array $setters = [
+ 'items' => 'setItems'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var array
+ */
+ protected static array $getters = [
+ 'items' => 'getItems'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap(): array
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters(): array
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters(): array
+ {
+ return self::$getters;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var array
+ */
+ protected array $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param array $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('items', $data ?? [], null);
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return string[] invalid properties with reasons
+ */
+ public function listInvalidProperties(): array
+ {
+ $invalidProperties = [];
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Gets items
+ *
+ * @return \Brevo\Client\Models\BalanceDefinition[]|null
+ */
+ public function getItems(): ?array
+ {
+ return $this->container['items'];
+ }
+
+ /**
+ * Sets items
+ *
+ * @param \Brevo\Client\Models\BalanceDefinition[]|null $items Balance definition list
+ *
+ * @return $this
+ */
+ public function setItems(?array $items): static
+ {
+ if (is_null($items)) {
+ throw new InvalidArgumentException('non-nullable items cannot be null');
+ }
+ $this->container['items'] = $items;
+
+ return $this;
+ }
+}
+
+
diff --git a/lib/Models/BalanceLimit.php b/lib/Models/BalanceLimit.php
new file mode 100644
index 0000000..3629448
--- /dev/null
+++ b/lib/Models/BalanceLimit.php
@@ -0,0 +1,450 @@
+
+ */
+class BalanceLimit extends AbstractModel
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static string $openAPIModelName = 'balanceLimit';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPITypes = [
+ 'constraintType' => 'string',
+ 'transactionType' => 'string',
+ 'durationValue' => 'int',
+ 'durationUnit' => 'string',
+ 'value' => 'float'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPIFormats = [
+ 'constraintType' => null,
+ 'transactionType' => null,
+ 'durationValue' => null,
+ 'durationUnit' => null,
+ 'value' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPINullables = [
+ 'constraintType' => false,
+ 'transactionType' => false,
+ 'durationValue' => false,
+ 'durationUnit' => false,
+ 'value' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var array
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var array
+ */
+ protected static array $attributeMap = [
+ 'constraintType' => 'constraintType',
+ 'transactionType' => 'transactionType',
+ 'durationValue' => 'durationValue',
+ 'durationUnit' => 'durationUnit',
+ 'value' => 'value'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var array
+ */
+ protected static array $setters = [
+ 'constraintType' => 'setConstraintType',
+ 'transactionType' => 'setTransactionType',
+ 'durationValue' => 'setDurationValue',
+ 'durationUnit' => 'setDurationUnit',
+ 'value' => 'setValue'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var array
+ */
+ protected static array $getters = [
+ 'constraintType' => 'getConstraintType',
+ 'transactionType' => 'getTransactionType',
+ 'durationValue' => 'getDurationValue',
+ 'durationUnit' => 'getDurationUnit',
+ 'value' => 'getValue'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap(): array
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters(): array
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters(): array
+ {
+ return self::$getters;
+ }
+
+ public const CONSTRAINT_TYPE_AMOUNT = 'amount';
+ public const CONSTRAINT_TYPE_TRANSACTION = 'transaction';
+ public const TRANSACTION_TYPE_DEBIT = 'debit';
+ public const TRANSACTION_TYPE_CREDIT = 'credit';
+ public const DURATION_UNIT_DAY = 'day';
+ public const DURATION_UNIT_WEEK = 'week';
+ public const DURATION_UNIT_MONTH = 'month';
+ public const DURATION_UNIT_YEAR = 'year';
+
+ /**
+ * Gets allowable values of the enum
+ *
+ * @return string[]
+ */
+ public function getConstraintTypeAllowableValues()
+ {
+ return [
+ self::CONSTRAINT_TYPE_AMOUNT,
+ self::CONSTRAINT_TYPE_TRANSACTION,
+ ];
+ }
+
+ /**
+ * Gets allowable values of the enum
+ *
+ * @return string[]
+ */
+ public function getTransactionTypeAllowableValues()
+ {
+ return [
+ self::TRANSACTION_TYPE_DEBIT,
+ self::TRANSACTION_TYPE_CREDIT,
+ ];
+ }
+
+ /**
+ * Gets allowable values of the enum
+ *
+ * @return string[]
+ */
+ public function getDurationUnitAllowableValues()
+ {
+ return [
+ self::DURATION_UNIT_DAY,
+ self::DURATION_UNIT_WEEK,
+ self::DURATION_UNIT_MONTH,
+ self::DURATION_UNIT_YEAR,
+ ];
+ }
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var array
+ */
+ protected array $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param array $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('constraintType', $data ?? [], 'amount');
+ $this->setIfExists('transactionType', $data ?? [], 'debit');
+ $this->setIfExists('durationValue', $data ?? [], null);
+ $this->setIfExists('durationUnit', $data ?? [], 'day');
+ $this->setIfExists('value', $data ?? [], null);
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return string[] invalid properties with reasons
+ */
+ public function listInvalidProperties(): array
+ {
+ $invalidProperties = [];
+
+ $allowedValues = $this->getConstraintTypeAllowableValues();
+ if (!is_null($this->container['constraintType']) && !in_array($this->container['constraintType'], $allowedValues, true)) {
+ $invalidProperties[] = sprintf(
+ "invalid value '%s' for 'constraintType', must be one of '%s'",
+ $this->container['constraintType'],
+ implode("', '", $allowedValues)
+ );
+ }
+
+ $allowedValues = $this->getTransactionTypeAllowableValues();
+ if (!is_null($this->container['transactionType']) && !in_array($this->container['transactionType'], $allowedValues, true)) {
+ $invalidProperties[] = sprintf(
+ "invalid value '%s' for 'transactionType', must be one of '%s'",
+ $this->container['transactionType'],
+ implode("', '", $allowedValues)
+ );
+ }
+
+ $allowedValues = $this->getDurationUnitAllowableValues();
+ if (!is_null($this->container['durationUnit']) && !in_array($this->container['durationUnit'], $allowedValues, true)) {
+ $invalidProperties[] = sprintf(
+ "invalid value '%s' for 'durationUnit', must be one of '%s'",
+ $this->container['durationUnit'],
+ implode("', '", $allowedValues)
+ );
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Gets constraintType
+ *
+ * @return string|null
+ */
+ public function getConstraintType(): ?string
+ {
+ return $this->container['constraintType'];
+ }
+
+ /**
+ * Sets constraintType
+ *
+ * @param string|null $constraintType Select amount to define constraints on amount and transaction to define constraints on transaction
+ *
+ * @return $this
+ */
+ public function setConstraintType(?string $constraintType): static
+ {
+ if (is_null($constraintType)) {
+ throw new InvalidArgumentException('non-nullable constraintType cannot be null');
+ }
+ $allowedValues = $this->getConstraintTypeAllowableValues();
+ if (!in_array($constraintType, $allowedValues, true)) {
+ throw new InvalidArgumentException(
+ sprintf(
+ "Invalid value '%s' for 'constraintType', must be one of '%s'",
+ $constraintType,
+ implode("', '", $allowedValues)
+ )
+ );
+ }
+ $this->container['constraintType'] = $constraintType;
+
+ return $this;
+ }
+
+ /**
+ * Gets transactionType
+ *
+ * @return string|null
+ */
+ public function getTransactionType(): ?string
+ {
+ return $this->container['transactionType'];
+ }
+
+ /**
+ * Sets transactionType
+ *
+ * @param string|null $transactionType Select debit to configure limit for debit transaction type. Select credit to configure limit for credit transaction type
+ *
+ * @return $this
+ */
+ public function setTransactionType(?string $transactionType): static
+ {
+ if (is_null($transactionType)) {
+ throw new InvalidArgumentException('non-nullable transactionType cannot be null');
+ }
+ $allowedValues = $this->getTransactionTypeAllowableValues();
+ if (!in_array($transactionType, $allowedValues, true)) {
+ throw new InvalidArgumentException(
+ sprintf(
+ "Invalid value '%s' for 'transactionType', must be one of '%s'",
+ $transactionType,
+ implode("', '", $allowedValues)
+ )
+ );
+ }
+ $this->container['transactionType'] = $transactionType;
+
+ return $this;
+ }
+
+ /**
+ * Gets durationValue
+ *
+ * @return int|null
+ */
+ public function getDurationValue(): ?int
+ {
+ return $this->container['durationValue'];
+ }
+
+ /**
+ * Sets durationValue
+ *
+ * @param int|null $durationValue Number of days/weeks/month/year for balance limit
+ *
+ * @return $this
+ */
+ public function setDurationValue(?int $durationValue): static
+ {
+ if (is_null($durationValue)) {
+ throw new InvalidArgumentException('non-nullable durationValue cannot be null');
+ }
+ $this->container['durationValue'] = $durationValue;
+
+ return $this;
+ }
+
+ /**
+ * Gets durationUnit
+ *
+ * @return string|null
+ */
+ public function getDurationUnit(): ?string
+ {
+ return $this->container['durationUnit'];
+ }
+
+ /**
+ * Sets durationUnit
+ *
+ * @param string|null $durationUnit Unit for the balance's availability
+ *
+ * @return $this
+ */
+ public function setDurationUnit(?string $durationUnit): static
+ {
+ if (is_null($durationUnit)) {
+ throw new InvalidArgumentException('non-nullable durationUnit cannot be null');
+ }
+ $allowedValues = $this->getDurationUnitAllowableValues();
+ if (!in_array($durationUnit, $allowedValues, true)) {
+ throw new InvalidArgumentException(
+ sprintf(
+ "Invalid value '%s' for 'durationUnit', must be one of '%s'",
+ $durationUnit,
+ implode("', '", $allowedValues)
+ )
+ );
+ }
+ $this->container['durationUnit'] = $durationUnit;
+
+ return $this;
+ }
+
+ /**
+ * Gets value
+ *
+ * @return float|null
+ */
+ public function getValue(): ?float
+ {
+ return $this->container['value'];
+ }
+
+ /**
+ * Sets value
+ *
+ * @param float|null $value The value or amount associated with the balance limit.
+ *
+ * @return $this
+ */
+ public function setValue(?float $value): static
+ {
+ if (is_null($value)) {
+ throw new InvalidArgumentException('non-nullable value cannot be null');
+ }
+ $this->container['value'] = $value;
+
+ return $this;
+ }
+}
+
+
diff --git a/lib/Models/BalanceLimitPayload.php b/lib/Models/BalanceLimitPayload.php
new file mode 100644
index 0000000..d914f89
--- /dev/null
+++ b/lib/Models/BalanceLimitPayload.php
@@ -0,0 +1,484 @@
+
+ */
+class BalanceLimitPayload extends AbstractModel
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static string $openAPIModelName = 'balanceLimitPayload';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPITypes = [
+ 'id' => 'string',
+ 'transactionType' => 'string',
+ 'durationValue' => 'int',
+ 'durationUnit' => 'string',
+ 'value' => 'float',
+ 'constraintType' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPIFormats = [
+ 'id' => 'uuid',
+ 'transactionType' => null,
+ 'durationValue' => null,
+ 'durationUnit' => null,
+ 'value' => null,
+ 'constraintType' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPINullables = [
+ 'id' => false,
+ 'transactionType' => false,
+ 'durationValue' => false,
+ 'durationUnit' => false,
+ 'value' => false,
+ 'constraintType' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var array
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var array
+ */
+ protected static array $attributeMap = [
+ 'id' => 'id',
+ 'transactionType' => 'transactionType',
+ 'durationValue' => 'durationValue',
+ 'durationUnit' => 'durationUnit',
+ 'value' => 'value',
+ 'constraintType' => 'constraintType'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var array
+ */
+ protected static array $setters = [
+ 'id' => 'setId',
+ 'transactionType' => 'setTransactionType',
+ 'durationValue' => 'setDurationValue',
+ 'durationUnit' => 'setDurationUnit',
+ 'value' => 'setValue',
+ 'constraintType' => 'setConstraintType'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var array
+ */
+ protected static array $getters = [
+ 'id' => 'getId',
+ 'transactionType' => 'getTransactionType',
+ 'durationValue' => 'getDurationValue',
+ 'durationUnit' => 'getDurationUnit',
+ 'value' => 'getValue',
+ 'constraintType' => 'getConstraintType'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap(): array
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters(): array
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters(): array
+ {
+ return self::$getters;
+ }
+
+ public const TRANSACTION_TYPE_DEBIT = 'debit';
+ public const TRANSACTION_TYPE_CREDIT = 'credit';
+ public const DURATION_UNIT_DAY = 'day';
+ public const DURATION_UNIT_WEEK = 'week';
+ public const DURATION_UNIT_MONTH = 'month';
+ public const DURATION_UNIT_YEAR = 'year';
+ public const CONSTRAINT_TYPE_AMOUNT = 'amount';
+ public const CONSTRAINT_TYPE_TRANSACTION = 'transaction';
+
+ /**
+ * Gets allowable values of the enum
+ *
+ * @return string[]
+ */
+ public function getTransactionTypeAllowableValues()
+ {
+ return [
+ self::TRANSACTION_TYPE_DEBIT,
+ self::TRANSACTION_TYPE_CREDIT,
+ ];
+ }
+
+ /**
+ * Gets allowable values of the enum
+ *
+ * @return string[]
+ */
+ public function getDurationUnitAllowableValues()
+ {
+ return [
+ self::DURATION_UNIT_DAY,
+ self::DURATION_UNIT_WEEK,
+ self::DURATION_UNIT_MONTH,
+ self::DURATION_UNIT_YEAR,
+ ];
+ }
+
+ /**
+ * Gets allowable values of the enum
+ *
+ * @return string[]
+ */
+ public function getConstraintTypeAllowableValues()
+ {
+ return [
+ self::CONSTRAINT_TYPE_AMOUNT,
+ self::CONSTRAINT_TYPE_TRANSACTION,
+ ];
+ }
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var array
+ */
+ protected array $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param array $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('id', $data ?? [], null);
+ $this->setIfExists('transactionType', $data ?? [], null);
+ $this->setIfExists('durationValue', $data ?? [], null);
+ $this->setIfExists('durationUnit', $data ?? [], null);
+ $this->setIfExists('value', $data ?? [], null);
+ $this->setIfExists('constraintType', $data ?? [], null);
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return string[] invalid properties with reasons
+ */
+ public function listInvalidProperties(): array
+ {
+ $invalidProperties = [];
+
+ $allowedValues = $this->getTransactionTypeAllowableValues();
+ if (!is_null($this->container['transactionType']) && !in_array($this->container['transactionType'], $allowedValues, true)) {
+ $invalidProperties[] = sprintf(
+ "invalid value '%s' for 'transactionType', must be one of '%s'",
+ $this->container['transactionType'],
+ implode("', '", $allowedValues)
+ );
+ }
+
+ $allowedValues = $this->getDurationUnitAllowableValues();
+ if (!is_null($this->container['durationUnit']) && !in_array($this->container['durationUnit'], $allowedValues, true)) {
+ $invalidProperties[] = sprintf(
+ "invalid value '%s' for 'durationUnit', must be one of '%s'",
+ $this->container['durationUnit'],
+ implode("', '", $allowedValues)
+ );
+ }
+
+ $allowedValues = $this->getConstraintTypeAllowableValues();
+ if (!is_null($this->container['constraintType']) && !in_array($this->container['constraintType'], $allowedValues, true)) {
+ $invalidProperties[] = sprintf(
+ "invalid value '%s' for 'constraintType', must be one of '%s'",
+ $this->container['constraintType'],
+ implode("', '", $allowedValues)
+ );
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Gets id
+ *
+ * @return string|null
+ */
+ public function getId(): ?string
+ {
+ return $this->container['id'];
+ }
+
+ /**
+ * Sets id
+ *
+ * @param string|null $id Unique identifier for the balance limit in UUID format.
+ *
+ * @return $this
+ */
+ public function setId(?string $id): static
+ {
+ if (is_null($id)) {
+ throw new InvalidArgumentException('non-nullable id cannot be null');
+ }
+ $this->container['id'] = $id;
+
+ return $this;
+ }
+
+ /**
+ * Gets transactionType
+ *
+ * @return string|null
+ */
+ public function getTransactionType(): ?string
+ {
+ return $this->container['transactionType'];
+ }
+
+ /**
+ * Sets transactionType
+ *
+ * @param string|null $transactionType transactionType
+ *
+ * @return $this
+ */
+ public function setTransactionType(?string $transactionType): static
+ {
+ if (is_null($transactionType)) {
+ throw new InvalidArgumentException('non-nullable transactionType cannot be null');
+ }
+ $allowedValues = $this->getTransactionTypeAllowableValues();
+ if (!in_array($transactionType, $allowedValues, true)) {
+ throw new InvalidArgumentException(
+ sprintf(
+ "Invalid value '%s' for 'transactionType', must be one of '%s'",
+ $transactionType,
+ implode("', '", $allowedValues)
+ )
+ );
+ }
+ $this->container['transactionType'] = $transactionType;
+
+ return $this;
+ }
+
+ /**
+ * Gets durationValue
+ *
+ * @return int|null
+ */
+ public function getDurationValue(): ?int
+ {
+ return $this->container['durationValue'];
+ }
+
+ /**
+ * Sets durationValue
+ *
+ * @param int|null $durationValue Number of days/weeks/month/year for balance expiry
+ *
+ * @return $this
+ */
+ public function setDurationValue(?int $durationValue): static
+ {
+ if (is_null($durationValue)) {
+ throw new InvalidArgumentException('non-nullable durationValue cannot be null');
+ }
+ $this->container['durationValue'] = $durationValue;
+
+ return $this;
+ }
+
+ /**
+ * Gets durationUnit
+ *
+ * @return string|null
+ */
+ public function getDurationUnit(): ?string
+ {
+ return $this->container['durationUnit'];
+ }
+
+ /**
+ * Sets durationUnit
+ *
+ * @param string|null $durationUnit Unit of time for the balance's availability (e.g., day/week/month/year).
+ *
+ * @return $this
+ */
+ public function setDurationUnit(?string $durationUnit): static
+ {
+ if (is_null($durationUnit)) {
+ throw new InvalidArgumentException('non-nullable durationUnit cannot be null');
+ }
+ $allowedValues = $this->getDurationUnitAllowableValues();
+ if (!in_array($durationUnit, $allowedValues, true)) {
+ throw new InvalidArgumentException(
+ sprintf(
+ "Invalid value '%s' for 'durationUnit', must be one of '%s'",
+ $durationUnit,
+ implode("', '", $allowedValues)
+ )
+ );
+ }
+ $this->container['durationUnit'] = $durationUnit;
+
+ return $this;
+ }
+
+ /**
+ * Gets value
+ *
+ * @return float|null
+ */
+ public function getValue(): ?float
+ {
+ return $this->container['value'];
+ }
+
+ /**
+ * Sets value
+ *
+ * @param float|null $value The value or amount associated with the balance limit.
+ *
+ * @return $this
+ */
+ public function setValue(?float $value): static
+ {
+ if (is_null($value)) {
+ throw new InvalidArgumentException('non-nullable value cannot be null');
+ }
+ $this->container['value'] = $value;
+
+ return $this;
+ }
+
+ /**
+ * Gets constraintType
+ *
+ * @return string|null
+ */
+ public function getConstraintType(): ?string
+ {
+ return $this->container['constraintType'];
+ }
+
+ /**
+ * Sets constraintType
+ *
+ * @param string|null $constraintType Defines the type of constraint imposed by the balance limit.
+ *
+ * @return $this
+ */
+ public function setConstraintType(?string $constraintType): static
+ {
+ if (is_null($constraintType)) {
+ throw new InvalidArgumentException('non-nullable constraintType cannot be null');
+ }
+ $allowedValues = $this->getConstraintTypeAllowableValues();
+ if (!in_array($constraintType, $allowedValues, true)) {
+ throw new InvalidArgumentException(
+ sprintf(
+ "Invalid value '%s' for 'constraintType', must be one of '%s'",
+ $constraintType,
+ implode("', '", $allowedValues)
+ )
+ );
+ }
+ $this->container['constraintType'] = $constraintType;
+
+ return $this;
+ }
+}
+
+
diff --git a/lib/Models/BalancePage.php b/lib/Models/BalancePage.php
new file mode 100644
index 0000000..c688c38
--- /dev/null
+++ b/lib/Models/BalancePage.php
@@ -0,0 +1,207 @@
+
+ */
+class BalancePage extends AbstractModel
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static string $openAPIModelName = 'balancePage';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPITypes = [
+ 'balance' => '\Brevo\Client\Models\Balance'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPIFormats = [
+ 'balance' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPINullables = [
+ 'balance' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var array
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var array
+ */
+ protected static array $attributeMap = [
+ 'balance' => 'balance'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var array
+ */
+ protected static array $setters = [
+ 'balance' => 'setBalance'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var array
+ */
+ protected static array $getters = [
+ 'balance' => 'getBalance'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap(): array
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters(): array
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters(): array
+ {
+ return self::$getters;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var array
+ */
+ protected array $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param array $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('balance', $data ?? [], null);
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return string[] invalid properties with reasons
+ */
+ public function listInvalidProperties(): array
+ {
+ $invalidProperties = [];
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Gets balance
+ *
+ * @return \Brevo\Client\Models\Balance|null
+ */
+ public function getBalance(): ?\Brevo\Client\Models\Balance
+ {
+ return $this->container['balance'];
+ }
+
+ /**
+ * Sets balance
+ *
+ * @param \Brevo\Client\Models\Balance|null $balance balance
+ *
+ * @return $this
+ */
+ public function setBalance(?\Brevo\Client\Models\Balance $balance): static
+ {
+ if (is_null($balance)) {
+ throw new InvalidArgumentException('non-nullable balance cannot be null');
+ }
+ $this->container['balance'] = $balance;
+
+ return $this;
+ }
+}
+
+
diff --git a/lib/Models/BlockDomain.php b/lib/Models/BlockDomain.php
new file mode 100644
index 0000000..eb96fe1
--- /dev/null
+++ b/lib/Models/BlockDomain.php
@@ -0,0 +1,210 @@
+
+ */
+class BlockDomain extends AbstractModel
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static string $openAPIModelName = 'blockDomain';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPITypes = [
+ 'domain' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPIFormats = [
+ 'domain' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPINullables = [
+ 'domain' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var array
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var array
+ */
+ protected static array $attributeMap = [
+ 'domain' => 'domain'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var array
+ */
+ protected static array $setters = [
+ 'domain' => 'setDomain'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var array
+ */
+ protected static array $getters = [
+ 'domain' => 'getDomain'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap(): array
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters(): array
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters(): array
+ {
+ return self::$getters;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var array
+ */
+ protected array $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param array $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('domain', $data ?? [], null);
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return string[] invalid properties with reasons
+ */
+ public function listInvalidProperties(): array
+ {
+ $invalidProperties = [];
+
+ if ($this->container['domain'] === null) {
+ $invalidProperties[] = "'domain' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Gets domain
+ *
+ * @return string
+ */
+ public function getDomain(): string
+ {
+ return $this->container['domain'];
+ }
+
+ /**
+ * Sets domain
+ *
+ * @param string $domain name of the domain to be blocked
+ *
+ * @return $this
+ */
+ public function setDomain(string $domain): static
+ {
+ if (is_null($domain)) {
+ throw new InvalidArgumentException('non-nullable domain cannot be null');
+ }
+ $this->container['domain'] = $domain;
+
+ return $this;
+ }
+}
+
+
diff --git a/lib/Models/CancelledTransaction.php b/lib/Models/CancelledTransaction.php
new file mode 100644
index 0000000..da51b50
--- /dev/null
+++ b/lib/Models/CancelledTransaction.php
@@ -0,0 +1,587 @@
+
+ */
+class CancelledTransaction extends AbstractModel
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static string $openAPIModelName = 'cancelledTransaction';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPITypes = [
+ 'id' => 'string',
+ 'status' => 'string',
+ 'amount' => 'float',
+ 'meta' => 'object',
+ 'rejectedAt' => '\DateTime',
+ 'rejectReason' => 'string',
+ 'expirationDate' => '\DateTime',
+ 'completedAt' => '\DateTime',
+ 'cancelledAt' => '\DateTime',
+ 'createdAt' => '\DateTime',
+ 'updatedAt' => '\DateTime'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPIFormats = [
+ 'id' => 'uuid',
+ 'status' => null,
+ 'amount' => null,
+ 'meta' => null,
+ 'rejectedAt' => 'date-time',
+ 'rejectReason' => null,
+ 'expirationDate' => 'date-time',
+ 'completedAt' => 'date-time',
+ 'cancelledAt' => 'date-time',
+ 'createdAt' => 'date-time',
+ 'updatedAt' => 'date-time'
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var array
+ */
+ protected static array $openAPINullables = [
+ 'id' => false,
+ 'status' => false,
+ 'amount' => false,
+ 'meta' => false,
+ 'rejectedAt' => false,
+ 'rejectReason' => false,
+ 'expirationDate' => false,
+ 'completedAt' => false,
+ 'cancelledAt' => false,
+ 'createdAt' => false,
+ 'updatedAt' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var array
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var array
+ */
+ protected static array $attributeMap = [
+ 'id' => 'id',
+ 'status' => 'status',
+ 'amount' => 'amount',
+ 'meta' => 'meta',
+ 'rejectedAt' => 'rejectedAt',
+ 'rejectReason' => 'rejectReason',
+ 'expirationDate' => 'expirationDate',
+ 'completedAt' => 'completedAt',
+ 'cancelledAt' => 'cancelledAt',
+ 'createdAt' => 'createdAt',
+ 'updatedAt' => 'updatedAt'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var array
+ */
+ protected static array $setters = [
+ 'id' => 'setId',
+ 'status' => 'setStatus',
+ 'amount' => 'setAmount',
+ 'meta' => 'setMeta',
+ 'rejectedAt' => 'setRejectedAt',
+ 'rejectReason' => 'setRejectReason',
+ 'expirationDate' => 'setExpirationDate',
+ 'completedAt' => 'setCompletedAt',
+ 'cancelledAt' => 'setCancelledAt',
+ 'createdAt' => 'setCreatedAt',
+ 'updatedAt' => 'setUpdatedAt'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var array